From 9af2c59b129a8c2dbcf9b578c6aabecbacbc634b Mon Sep 17 00:00:00 2001
From: lm <lm@student.ethz.ch>
Date: Thu, 10 Feb 2011 14:18:12 +0100
Subject: [PATCH] Made param7 accessible as well

---
 src/uas/UASWaypointManager.cc             |  4 ++--
 src/ui/WaypointView.cc                    |  9 ++++++---
 src/ui/mission/QGCCustomWaypointAction.ui | 15 ++++++++++++++-
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/src/uas/UASWaypointManager.cc b/src/uas/UASWaypointManager.cc
index 8d0db507d6..f399286e76 100644
--- a/src/uas/UASWaypointManager.cc
+++ b/src/uas/UASWaypointManager.cc
@@ -394,7 +394,7 @@ void UASWaypointManager::saveWaypoints(const QString &saveFile)
     QTextStream out(&file);
 
     //write the waypoint list version to the first line for compatibility check
-    out << "QGC WPL 100\r\n";
+    out << "QGC WPL 110\r\n";
 
     for (int i = 0; i < waypoints.size(); i++)
     {
@@ -420,7 +420,7 @@ void UASWaypointManager::loadWaypoints(const QString &loadFile)
 
     const QStringList &version = in.readLine().split(" ");
 
-    if (!(version.size() == 3 && version[0] == "QGC" && version[1] == "WPL" && version[2] == "100"))
+    if (!(version.size() == 3 && version[0] == "QGC" && version[1] == "WPL" && version[2] == "110"))
     {
         emit updateStatusString(tr("The waypoint file is not compatible with the current version of QGroundControl."));
         //MainWindow::instance()->showCriticalMessage(tr("Error loading waypoint file"),tr("The waypoint file is not compatible with the current version of QGroundControl."));
diff --git a/src/ui/WaypointView.cc b/src/ui/WaypointView.cc
index fbb3ff1cdf..718c7f2d96 100644
--- a/src/ui/WaypointView.cc
+++ b/src/ui/WaypointView.cc
@@ -105,9 +105,7 @@ WaypointView::WaypointView(Waypoint* wp, QWidget* parent) :
     connect(customCommand->param4SpinBox, SIGNAL(valueChanged(double)), wp, SLOT(setParam4(double)));
     connect(customCommand->param5SpinBox, SIGNAL(valueChanged(double)), wp, SLOT(setParam5(double)));
     connect(customCommand->param6SpinBox, SIGNAL(valueChanged(double)), wp, SLOT(setParam6(double)));
-
-    // MISSION ELEMENT WIDGET
-    // TODO
+    connect(customCommand->param7SpinBox, SIGNAL(valueChanged(double)), wp, SLOT(setParam7(double)));
 }
 
 void WaypointView::setYaw(int yawDegree)
@@ -507,6 +505,11 @@ void WaypointView::updateValues()
     {
         customCommand->param6SpinBox->setValue(wp->getParam6());
     }
+    // Param 7
+    if (customCommand->param7SpinBox->value() != wp->getParam7())
+    {
+        customCommand->param7SpinBox->setValue(wp->getParam7());
+    }
 
     wp->blockSignals(false);
 }
diff --git a/src/ui/mission/QGCCustomWaypointAction.ui b/src/ui/mission/QGCCustomWaypointAction.ui
index 0b7c930894..5c98f8980a 100644
--- a/src/ui/mission/QGCCustomWaypointAction.ui
+++ b/src/ui/mission/QGCCustomWaypointAction.ui
@@ -13,7 +13,7 @@
   <property name="windowTitle">
    <string>Form</string>
   </property>
-  <layout class="QHBoxLayout" name="horizontalLayout" stretch="10,10,10,10,10,10,0">
+  <layout class="QHBoxLayout" name="horizontalLayout" stretch="10,10,10,10,10,10,0,0">
    <property name="spacing">
     <number>5</number>
    </property>
@@ -114,6 +114,19 @@
      </property>
     </widget>
    </item>
+   <item>
+    <widget class="QDoubleSpinBox" name="param7SpinBox">
+     <property name="prefix">
+      <string>P7 </string>
+     </property>
+     <property name="minimum">
+      <double>-2147483647.000000000000000</double>
+     </property>
+     <property name="maximum">
+      <double>2147483647.000000000000000</double>
+     </property>
+    </widget>
+   </item>
   </layout>
  </widget>
  <resources/>
-- 
GitLab