Commit 576441b5 authored by pixhawk's avatar pixhawk

Preparation for offline WaypointList. Does not compile!!!

parent 3805b4cc
This diff is collapsed.
......@@ -10,6 +10,13 @@ QGCWaypointListMulti::QGCWaypointListMulti(QWidget *parent) :
setMinimumSize(600, 80);
connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)), this, SLOT(systemCreated(UASInterface*)));
connect(UASManager::instance(), SIGNAL(activeUASSet(int)), this, SLOT(systemSetActive(int)));
WaypointList* list = new WaypointList(ui->stackedWidget, uas);
lists.insert(uas->getUASID(), list);
ui->stackedWidget->addWidget(list);
// Ensure widget is deleted when system is deleted
connect(uas, SIGNAL(destroyed(QObject*)), this, SLOT(systemDeleted(QObject*)));
}
void QGCWaypointListMulti::systemDeleted(QObject* uas)
......
......@@ -364,13 +364,13 @@ void WaypointEditableView::changedCurrent(int state)
{
if (wp->getCurrent() == true) //User clicked on the waypoint, that is already current
{
qDebug() << "Editable " << wp->getId() << " changedCurrent: State 0, current true" ;
//qDebug() << "Editable " << wp->getId() << " changedCurrent: State 0, current true" ;
m_ui->selectedBox->setChecked(true);
m_ui->selectedBox->setCheckState(Qt::Checked);
}
else
{
qDebug() << "Editable " << wp->getId() << " changedCurrent: State 0, current false";
//qDebug() << "Editable " << wp->getId() << " changedCurrent: State 0, current false";
m_ui->selectedBox->setChecked(false);
m_ui->selectedBox->setCheckState(Qt::Unchecked);
//wp->setCurrent(false);
......@@ -378,7 +378,7 @@ void WaypointEditableView::changedCurrent(int state)
}
else
{
qDebug() << "Editable " << wp->getId() << " changedCurrent: State 2";
//qDebug() << "Editable " << wp->getId() << " changedCurrent: State 2";
wp->setCurrent(true);
emit changeCurrentWaypoint(wp->getId()); //the slot changeCurrentWaypoint() in WaypointList sets all other current flags to false
}
......
......@@ -93,7 +93,10 @@ WaypointList::WaypointList(QWidget *parent, UASInterface* uas) :
// SET UAS AFTER ALL SIGNALS/SLOTS ARE CONNECTED
setUAS(uas);
if (uas)
{
setUAS(uas);
}
// STATUS LABEL
updateStatusLabel("");
......@@ -295,6 +298,7 @@ void WaypointList::updateStatusLabel(const QString &string)
m_ui->viewStatusLabel->setText(string);
}
// Request UASWaypointManager to send the SET_CURRENT message to UAV
void WaypointList::changeCurrentWaypoint(quint16 seq)
{
if (uas)
......@@ -303,11 +307,9 @@ void WaypointList::changeCurrentWaypoint(quint16 seq)
}
}
// Request UASWaypointManager to set the new "current" and make sure all other waypoints are not "current"
void WaypointList::currentWaypointEditableChanged(quint16 seq)
{
qDebug() << "WaypointList::currentWaypointEditableChanged";
if (uas)
{
uas->getWaypointManager()->setCurrentEditable(seq);
......@@ -335,6 +337,7 @@ void WaypointList::currentWaypointEditableChanged(quint16 seq)
}
// Update waypointViews to correctly indicate the new current waypoint
void WaypointList::currentWaypointViewOnlyChanged(quint16 seq)
{
if (uas)
......
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