Commit fbedfdc4 authored by lm's avatar lm

Fixed compile error on Linux

parent 779a2015
......@@ -38,18 +38,9 @@
<x>0</x>
<y>0</y>
<width>1000</width>
<height>22</height>
<height>25</height>
</rect>
</property>
<widget class="QMenu" name="menuMGround">
<property name="title">
<string>File</string>
</property>
<addaction name="actionJoystickSettings"/>
<addaction name="actionSimulate"/>
<addaction name="separator"/>
<addaction name="actionExit"/>
</widget>
<widget class="QMenu" name="menuUnmanned_System">
<property name="title">
<string>Unmanned System</string>
......@@ -99,6 +90,15 @@
<string>Select System</string>
</property>
</widget>
<widget class="QMenu" name="menuMGround">
<property name="title">
<string>File</string>
</property>
<addaction name="actionJoystickSettings"/>
<addaction name="actionSimulate"/>
<addaction name="separator"/>
<addaction name="actionExit"/>
</widget>
<addaction name="menuMGround"/>
<addaction name="menuNetwork"/>
<addaction name="menuConnected_Systems"/>
......
......@@ -118,50 +118,51 @@ void QGCGoogleEarthView::updateState()
#ifdef Q_OS_MAC
if (isVisible())
{
if (webViewMac->page()->currentFrame()->evaluateJavaScript("isInitialized();").toBool())
{
static bool initialized = false;
if (!initialized)
{
webViewMac->page()->currentFrame()->evaluateJavaScript("setGCSHome(22.679833,8.549444, 470);");
initialized = true;
}
int uasId = 0;
double lat = 22.679833;
double lon = 8.549444;
double alt = 470.0;
float roll = 0.0f;
float pitch = 0.0f;
float yaw = 0.0f;
if (mav)
if (webViewMac->page()->currentFrame()->evaluateJavaScript("isInitialized();").toBool())
{
uasId = mav->getUASID();
lat = mav->getLatitude();
lon = mav->getLongitude();
alt = mav->getAltitude();
roll = mav->getRoll();
pitch = mav->getPitch();
yaw = mav->getYaw();
}
webViewMac->page()->currentFrame()->evaluateJavaScript(QString("setAircraftPositionAttitude(%1, %2, %3, %4, %6, %7, %8);")
.arg(uasId)
.arg(lat)
.arg(lon)
.arg(alt+500)
.arg(roll)
.arg(pitch)
.arg(yaw));
if (followCamera)
{
webViewMac->page()->currentFrame()->evaluateJavaScript(QString("updateFollowAircraft()"));
static bool initialized = false;
if (!initialized)
{
webViewMac->page()->currentFrame()->evaluateJavaScript("setGCSHome(22.679833,8.549444, 470);");
initialized = true;
}
int uasId = 0;
double lat = 22.679833;
double lon = 8.549444;
double alt = 470.0;
float roll = 0.0f;
float pitch = 0.0f;
float yaw = 0.0f;
if (mav)
{
uasId = mav->getUASID();
lat = mav->getLatitude();
lon = mav->getLongitude();
alt = mav->getAltitude();
roll = mav->getRoll();
pitch = mav->getPitch();
yaw = mav->getYaw();
}
webViewMac->page()->currentFrame()->evaluateJavaScript(QString("setAircraftPositionAttitude(%1, %2, %3, %4, %6, %7, %8);")
.arg(uasId)
.arg(lat)
.arg(lon)
.arg(alt+500)
.arg(roll)
.arg(pitch)
.arg(yaw));
if (followCamera)
{
webViewMac->page()->currentFrame()->evaluateJavaScript(QString("updateFollowAircraft()"));
}
}
}
#endif
}
}
void QGCGoogleEarthView::changeEvent(QEvent *e)
{
......
......@@ -50,7 +50,7 @@ This file is part of the PIXHAWK project
#define CONTROL_MODE_TEST2 "MODE TEST2"
#define CONTROL_MODE_TEST3 "MODE TEST3"
#define CONTROL_MODE_READY "MODE TEST3"
#define CONTROL_MODE_RC_TRAINING "MODE RC TRAINING"
#define CONTROL_MODE_RC_TRAINING "RC SIMULATION"
#define CONTROL_MODE_LOCKED_INDEX 1
#define CONTROL_MODE_MANUAL_INDEX 2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment