Commit 70b09fc5 authored by pixhawk's avatar pixhawk

Cleaning up WP interface

parent c9a7fdde
This diff is collapsed.
......@@ -87,8 +87,8 @@ public slots:
/** @brief The waypoint manager informs that the waypoint list was changed */
void waypointListChanged(void);
/** @brief The MapWidget informs that a waypoint global was changed on the map */
void waypointGlobalChanged(const QPointF coordinate, const int indexWP);
// /** @brief The MapWidget informs that a waypoint global was changed on the map */
// void waypointGlobalChanged(const QPointF coordinate, const int indexWP);
void clearWPWidget();
......@@ -99,8 +99,8 @@ public slots:
void moveDown(Waypoint* wp);
void removeWaypoint(Waypoint* wp);
void setIsLoadFileWP();
void setIsReadGlobalWP(bool value);
// void setIsLoadFileWP();
// void setIsReadGlobalWP(bool value);
......
......@@ -29,6 +29,7 @@ WaypointView::WaypointView(Waypoint* wp, QWidget* parent) :
m_ui->setupUi(this);
this->wp = wp;
connect(wp, SIGNAL(destroyed(QObject*)), this, SLOT(deleted(QObject*)));
// CUSTOM COMMAND WIDGET
customCommand->setupUi(m_ui->customActionWidget);
......@@ -320,6 +321,14 @@ void WaypointView::updateFrameView(int frame)
}
}
void WaypointView::deleted(QObject* waypoint)
{
if (waypoint == this->wp)
{
deleteLater();
}
}
void WaypointView::changedFrame(int index)
{
// set waypoint action
......@@ -346,6 +355,13 @@ void WaypointView::changedCurrent(int state)
void WaypointView::updateValues()
{
// Check if we just lost the wp, delete the widget
// accordingly
if (!wp)
{
deleteLater();
return;
}
// Deactivate signals from the WP
wp->blockSignals(true);
// update frame
......
/*=====================================================================
/*===================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
......@@ -10,15 +9,15 @@ This file is part of the QGROUNDCONTROL project
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
......@@ -46,17 +45,19 @@ class Ui_QGCCustomWaypointAction;
class WaypointView : public QWidget {
Q_OBJECT
Q_DISABLE_COPY(WaypointView)
public:
explicit WaypointView(Waypoint* wp, QWidget* parent);
public:
explicit WaypointView(Waypoint* wp, QWidget* parent);
virtual ~WaypointView();
public:
void setCurrent(bool state);
public slots:
void moveUp();
void moveDown();
void remove();
/** @brief Waypoint matching this widget has been deleted */
void deleted(QObject* waypoint);
void changedAutoContinue(int);
void updateFrameView(int frame);
void changedFrame(int state);
......@@ -64,19 +65,19 @@ public slots:
void changedAction(int state);
void changedCurrent(int);
void updateValues(void);
void setYaw(int); //hidden degree to radian conversion
protected:
virtual void changeEvent(QEvent *e);
Waypoint* wp;
// Special widgets extendending the
// waypoint view to mission capabilities
Ui_QGCCustomWaypointAction* customCommand;
private:
Ui::WaypointView *m_ui;
signals:
void moveUpWaypoint(Waypoint*);
void moveDownWaypoint(Waypoint*);
......
......@@ -13,7 +13,7 @@
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="10,10,10,10,10,10,0">
<property name="spacing">
<number>5</number>
</property>
......@@ -23,7 +23,7 @@
<item>
<widget class="QSpinBox" name="commandSpinBox">
<property name="prefix">
<string>CMD </string>
<string>CMD/ACT </string>
</property>
<property name="minimum">
<number>0</number>
......@@ -65,7 +65,7 @@
<item>
<widget class="QDoubleSpinBox" name="param3SpinBox">
<property name="prefix">
<string>P3 </string>
<string>Orbit/P3 </string>
</property>
<property name="minimum">
<double>-2147483647.000000000000000</double>
......@@ -78,7 +78,33 @@
<item>
<widget class="QDoubleSpinBox" name="param4SpinBox">
<property name="prefix">
<string>P4 </string>
<string>X/P4 </string>
</property>
<property name="minimum">
<double>-2147483647.000000000000000</double>
</property>
<property name="maximum">
<double>2147483647.000000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="param5SpinBox">
<property name="prefix">
<string>Y/P5 </string>
</property>
<property name="minimum">
<double>-2147483647.000000000000000</double>
</property>
<property name="maximum">
<double>2147483647.000000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="doubleSpinBox">
<property name="prefix">
<string>Z/P6 </string>
</property>
<property name="minimum">
<double>-2147483647.000000000000000</double>
......
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