From 247294a83776cbf833041a268eafff2dbec354d8 Mon Sep 17 00:00:00 2001 From: Bryant Date: Mon, 27 May 2013 20:05:16 -0700 Subject: [PATCH] The mission listing now has its UI disabled when not usable due to the lack of a connected UAS. --- src/ui/WaypointList.cc | 17 ++-- src/ui/WaypointList.ui | 181 ++++++++++++++++++++++------------------- 2 files changed, 110 insertions(+), 88 deletions(-) diff --git a/src/ui/WaypointList.cc b/src/ui/WaypointList.cc index faffdfae0..2286104c1 100644 --- a/src/ui/WaypointList.cc +++ b/src/ui/WaypointList.cc @@ -103,11 +103,12 @@ WaypointList::WaypointList(QWidget *parent, UASWaypointManager* wpm) : // SET UAS AFTER ALL SIGNALS/SLOTS ARE CONNECTED if (!WPM->getUAS()) { - // Hide buttons, which don't make sense without valid UAS - m_ui->positionAddButton->hide(); - m_ui->transmitButton->hide(); - m_ui->readButton->hide(); - m_ui->refreshButton->hide(); + // Disable buttons which don't make sense without valid UAS. + m_ui->positionAddButton->setEnabled(false); + m_ui->transmitButton->setEnabled(false); + m_ui->readButton->setEnabled(false); + m_ui->refreshButton->setEnabled(false); + //FIXME: The whole "Onboard Waypoints"-tab should be hidden, instead of "refresh" button // Insert a "NO UAV" info into the Onboard Tab QLabel* noUas = new QLabel(this); @@ -185,6 +186,12 @@ void WaypointList::setUAS(UASInterface* uas) disconnect(this->uas, SIGNAL(attitudeChanged(UASInterface*,double,double,double,quint64)), this, SLOT(updateAttitude(UASInterface*,double,double,double,quint64))); } + // Now that there's a valid UAS, enable the UI. + m_ui->positionAddButton->setEnabled(true); + m_ui->transmitButton->setEnabled(true); + m_ui->readButton->setEnabled(true); + m_ui->refreshButton->setEnabled(true); + WPM = uas->getWaypointManager(); this->uas = uas; diff --git a/src/ui/WaypointList.ui b/src/ui/WaypointList.ui index b4a5fb11b..e89079886 100644 --- a/src/ui/WaypointList.ui +++ b/src/ui/WaypointList.ui @@ -37,6 +37,9 @@ + + true + 0 @@ -60,51 +63,23 @@ 6 - - - - true - - - - - 0 - 0 - 836 - 316 - - - - - - - Waypoint list. The list is empty until you issue a read command or add waypoints. - - - Waypoint list. The list is empty until you issue a read command or add waypoints. - - - Waypoint list. The list is empty until you issue a read command or add waypoints. - - - - - - - - - + + - Save waypoints to a file on the local harddisk. Does not save them on the MAV. + Add a new waypoint to this list. Transmit via write to the MAV. - Save waypoints to a file on the local harddisk. Does not save them on the MAV. + Add a new waypoint to this list. Transmit via write to the MAV. - Save waypoints to a file on the local harddisk. Does not save them on the MAV. + Add a new waypoint to this list. Transmit via write to the MAV. - Save WPs + ... + + + + :/files/images/actions/list-add.svg:/files/images/actions/list-add.svg @@ -137,68 +112,75 @@ - - + + - Set the current vehicle position as new waypoint + Save waypoints to a file on the local harddisk. Does not save them on the MAV. - Set the current vehicle position as new waypoint + Save waypoints to a file on the local harddisk. Does not save them on the MAV. - Set the current vehicle position as new waypoint + Save waypoints to a file on the local harddisk. Does not save them on the MAV. - ... - - - - :/files/images/actions/go-bottom.svg:/files/images/actions/go-bottom.svg + Save WPs - - + + - Add a new waypoint to this list. Transmit via write to the MAV. + The current waypoint transmission status - Add a new waypoint to this list. Transmit via write to the MAV. + The current waypoint transmission status - Add a new waypoint to this list. Transmit via write to the MAV. + The current waypoint transmission status - ... - - - - :/files/images/actions/list-add.svg:/files/images/actions/list-add.svg + Please add first waypoint. - - - - Delete all waypoints from this list. You have to click write to clear the list on the MAV as well. - - - Delete all waypoints from this list. You have to click write to clear the list on the MAV as well. - - - Delete all waypoints from this list. You have to click write to clear the list on the MAV as well. - - - ... - - - - :/files/images/actions/process-stop.svg:/files/images/actions/process-stop.svg + + + + true + + + + 0 + 0 + 836 + 316 + + + + + + + Waypoint list. The list is empty until you issue a read command or add waypoints. + + + Waypoint list. The list is empty until you issue a read command or add waypoints. + + + Waypoint list. The list is empty until you issue a read command or add waypoints. + + + + + - + + + false + Read all waypoints from the MAV. Clears the list on this computer. @@ -217,8 +199,11 @@ - + + + false + Transmit all waypoints on this list to the MAV. @@ -237,19 +222,46 @@ - - + + - The current waypoint transmission status + Delete all waypoints from this list. You have to click write to clear the list on the MAV as well. - The current waypoint transmission status + Delete all waypoints from this list. You have to click write to clear the list on the MAV as well. - The current waypoint transmission status + Delete all waypoints from this list. You have to click write to clear the list on the MAV as well. - Please add first waypoint. + ... + + + + :/files/images/actions/process-stop.svg:/files/images/actions/process-stop.svg + + + + + + + false + + + Set the current vehicle position as new waypoint + + + Set the current vehicle position as new waypoint + + + Set the current vehicle position as new waypoint + + + ... + + + + :/files/images/actions/go-bottom.svg:/files/images/actions/go-bottom.svg @@ -329,6 +341,9 @@ + + false + Read all waypoints from the MAV and display in View tab.. -- 2.22.0