From fbedfdc44ff32bfb8e37016e688cb989d024921d Mon Sep 17 00:00:00 2001 From: lm Date: Tue, 14 Dec 2010 09:39:10 +0100 Subject: [PATCH] Fixed compile error on Linux --- src/ui/MainWindow.ui | 20 ++++---- src/ui/map3D/QGCGoogleEarthView.cc | 79 +++++++++++++++--------------- src/ui/uas/UASControlWidget.cc | 2 +- 3 files changed, 51 insertions(+), 50 deletions(-) diff --git a/src/ui/MainWindow.ui b/src/ui/MainWindow.ui index 323c51a5c..9a912e058 100644 --- a/src/ui/MainWindow.ui +++ b/src/ui/MainWindow.ui @@ -38,18 +38,9 @@ 0 0 1000 - 22 + 25 - - - File - - - - - - Unmanned System @@ -99,6 +90,15 @@ Select System + + + File + + + + + + diff --git a/src/ui/map3D/QGCGoogleEarthView.cc b/src/ui/map3D/QGCGoogleEarthView.cc index ecd7e52e2..5762082ea 100644 --- a/src/ui/map3D/QGCGoogleEarthView.cc +++ b/src/ui/map3D/QGCGoogleEarthView.cc @@ -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) { diff --git a/src/ui/uas/UASControlWidget.cc b/src/ui/uas/UASControlWidget.cc index d638e1cc3..a007e7c96 100644 --- a/src/ui/uas/UASControlWidget.cc +++ b/src/ui/uas/UASControlWidget.cc @@ -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 -- 2.22.0