Commit 80f8aac3 authored by Lorenz Meier's avatar Lorenz Meier

Only loading port names which still are available, fixed more compile errors

parent b94f906c
......@@ -218,6 +218,9 @@ void SerialConfigurationWindow::setupPortList()
// Get the ports available on this system
QVector<QString>* ports = link->getCurrentPorts();
QString storedName = this->link->getPortName();
bool storedFound = false;
// Add the ports in reverse order, because we prepend them to the list
for (int i = ports->size() - 1; i >= 0; --i)
{
......@@ -227,9 +230,14 @@ void SerialConfigurationWindow::setupPortList()
ui.portName->insertItem(0, ports->at(i));
if (!userConfigured) ui.portName->setEditText(ports->at(i));
}
// Check if the stored link name is still present
if (ports->at(i).contains(storedName) || storedName.contains(ports->at(i)))
storedFound = true;
}
ui.portName->setEditText(this->link->getPortName());
if (storedFound)
ui.portName->setEditText(storedName);
}
void SerialConfigurationWindow::enableFlowControl(bool flow)
......
......@@ -265,7 +265,7 @@ void QGCGoogleEarthView::updateWaypointList(int uas)
if (uasInstance)
{
// Get all waypoints, including non-global waypoints
QVector<Waypoint*> wpList = uasInstance->getWaypointManager()->getGlobalFrameAndNavTypeWaypointList();
QList<Waypoint*> wpList = uasInstance->getWaypointManager()->getGlobalFrameAndNavTypeWaypointList();
// Trim internal list to number of global waypoints in the waypoint manager list
javaScript(QString("updateWaypointListLength(%1,%2);").arg(uas).arg(wpList.count()));
......@@ -712,7 +712,7 @@ void QGCGoogleEarthView::updateState()
// Update waypoint or symbol
if (mav)
{
QVector<Waypoint*> wps = mav->getWaypointManager()->getGlobalFrameAndNavTypeWaypointList();
QList<Waypoint*> wps = mav->getWaypointManager()->getGlobalFrameAndNavTypeWaypointList();
bool ok;
int index = idText.toInt(&ok);
......
......@@ -36,6 +36,7 @@ This file is part of the QGROUNDCONTROL project
#include <osg/ShapeDrawable>
#include "Imagery.h"
#include "UASManager.h"
WaypointGroupNode::WaypointGroupNode(const QColor& color)
: mColor(color)
......@@ -70,6 +71,16 @@ WaypointGroupNode::update(UASInterface* uas, MAV_FRAME frame)
Imagery::LLtoUTM(latitude, longitude, robotX, robotY, utmZone);
robotZ = -altitude;
}
else if (frame == MAV_FRAME_GLOBAL_RELATIVE_ALT)
{
double latitude = uas->getLatitude();
double longitude = uas->getLongitude();
double altitude = uas->getAltitude() + UASManager::instance()->getHomeAltitude();
QString utmZone;
Imagery::LLtoUTM(latitude, longitude, robotX, robotY, utmZone);
robotZ = -altitude;
}
else if (frame == MAV_FRAME_LOCAL_NED)
{
robotX = uas->getLocalX();
......@@ -82,7 +93,7 @@ WaypointGroupNode::update(UASInterface* uas, MAV_FRAME frame)
removeChild(0, getNumChildren());
}
const QVector<Waypoint *>& list = uas->getWaypointManager()->getWaypointEditableList();
const QList<Waypoint *>& list = uas->getWaypointManager()->getWaypointEditableList();
for (int i = 0; i < list.size(); i++)
{
......
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