Commit eb2a01d9 authored by pixhawk's avatar pixhawk

Fixed google earth runtime issues

parent 6540c223
...@@ -142,8 +142,7 @@ function createAircraft(id, type, color) ...@@ -142,8 +142,7 @@ function createAircraft(id, type, color)
aircraft[id] = planePlacemark; aircraft[id] = planePlacemark;
attitudes[id] = planeOrient; attitudes[id] = planeOrient;
aircraftLocations[id] = planeLoc; aircraftLocations[id] = planeLoc;
aircraftLastLocations[id] = ge.createLocation(''); aircraftLastLocations[id] = ge.createLocation('');
aircraftColors[id] = color;
//planeColor = color; //planeColor = color;
createTrail(id, color); createTrail(id, color);
...@@ -190,12 +189,6 @@ function showTrail(id) ...@@ -190,12 +189,6 @@ function showTrail(id)
trailsVisible[id] = true; trailsVisible[id] = true;
} }
function startTrail(id)
{
createTrail(id, trailColors[id]);
trailsVisible[id] = true;
}
function setViewRange(dist) function setViewRange(dist)
{ {
currViewRange = dist; currViewRange = dist;
......
...@@ -151,20 +151,6 @@ void QGCGoogleEarthView::updateGlobalPosition(UASInterface* uas, double lon, dou ...@@ -151,20 +151,6 @@ void QGCGoogleEarthView::updateGlobalPosition(UASInterface* uas, double lon, dou
//qDebug() << QString("addTrailPosition(%1, %2, %3, %4);").arg(uas->getUASID()).arg(lat, 0, 'f', 15).arg(lon, 0, 'f', 15).arg(alt, 0, 'f', 15); //qDebug() << QString("addTrailPosition(%1, %2, %3, %4);").arg(uas->getUASID()).arg(lat, 0, 'f', 15).arg(lon, 0, 'f', 15).arg(alt, 0, 'f', 15);
} }
void QGCGoogleEarthView::clearTrail()
{
// Check if the current trail has to be hidden
if (trailEnabled && !state)
{
QList<UASInterface*> mavs = UASManager::instance()->getUASList();
foreach (UASInterface* currMav, mavs)
{
javaScript(QString("clearTrail(%1);").arg(currMav->getUASID()));
javaScript(QString("startTrail(%1);").arg(currMav->getUASID()));
}
}
}
void QGCGoogleEarthView::showTrail(bool state) void QGCGoogleEarthView::showTrail(bool state)
{ {
// Check if the current trail has to be hidden // Check if the current trail has to be hidden
...@@ -173,7 +159,7 @@ void QGCGoogleEarthView::showTrail(bool state) ...@@ -173,7 +159,7 @@ void QGCGoogleEarthView::showTrail(bool state)
QList<UASInterface*> mavs = UASManager::instance()->getUASList(); QList<UASInterface*> mavs = UASManager::instance()->getUASList();
foreach (UASInterface* currMav, mavs) foreach (UASInterface* currMav, mavs)
{ {
javaScript(QString("clearTrail(%1);").arg(currMav->getUASID())); javaScript(QString("hideTrail(%1);").arg(currMav->getUASID()));
} }
} }
...@@ -358,9 +344,6 @@ void QGCGoogleEarthView::initializeGoogleEarth() ...@@ -358,9 +344,6 @@ void QGCGoogleEarthView::initializeGoogleEarth()
ui->trailCheckbox->setChecked(trailEnabled); ui->trailCheckbox->setChecked(trailEnabled);
connect(ui->trailCheckbox, SIGNAL(toggled(bool)), this, SLOT(showTrail(bool))); connect(ui->trailCheckbox, SIGNAL(toggled(bool)), this, SLOT(showTrail(bool)));
// Clear trail button
connect(ui->clearTrailButton, SIGNAL(clicked()), this, SLOT(clearTrail()));
// Go home // Go home
connect(ui->goHomeButton, SIGNAL(clicked()), this, SLOT(goHome())); connect(ui->goHomeButton, SIGNAL(clicked()), this, SLOT(goHome()));
......
...@@ -82,8 +82,6 @@ public slots: ...@@ -82,8 +82,6 @@ public slots:
void setActiveUAS(UASInterface* uas); void setActiveUAS(UASInterface* uas);
/** @brief Update the global position */ /** @brief Update the global position */
void updateGlobalPosition(UASInterface* uas, double lon, double lat, double alt, quint64 usec); void updateGlobalPosition(UASInterface* uas, double lon, double lat, double alt, quint64 usec);
/** @brief Clear the existing vehicle trails */
void clearTrail();
/** @brief Show the vehicle trail */ /** @brief Show the vehicle trail */
void showTrail(bool state); void showTrail(bool state);
/** @brief Show the waypoints */ /** @brief Show the waypoints */
......
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