From d8e1d849f5d285cba3516c54b19376b2c49b306b Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Tue, 21 Jan 2014 23:08:13 +0100 Subject: [PATCH 01/28] OP-1183 UAVObjectBrowser now displays and allows editing of integers in hex format (when unit is set to hex) +review OPReview --- .../plugins/uavobjectbrowser/fieldtreeitem.h | 137 +++++++++++++++++- .../uavobjectbrowser/uavobjecttreemodel.cpp | 9 +- 2 files changed, 136 insertions(+), 10 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/uavobjectbrowser/fieldtreeitem.h b/ground/openpilotgcs/src/plugins/uavobjectbrowser/fieldtreeitem.h index 31cf9ecb3..64e639eea 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectbrowser/fieldtreeitem.h +++ b/ground/openpilotgcs/src/plugins/uavobjectbrowser/fieldtreeitem.h @@ -51,18 +51,23 @@ class FieldTreeItem : public TreeItem { Q_OBJECT public: + FieldTreeItem(int index, const QList &data, TreeItem *parent = 0) : TreeItem(data, parent), m_index(index) {} + FieldTreeItem(int index, const QVariant &data, TreeItem *parent = 0) : TreeItem(data, parent), m_index(index) {} + bool isEditable() { return true; } + virtual QWidget *createEditor(QWidget *parent) = 0; virtual QVariant getEditorValue(QWidget *editor) = 0; virtual void setEditorValue(QWidget *editor, QVariant value) = 0; virtual void apply() {} + protected: int m_index; }; @@ -70,12 +75,12 @@ protected: class EnumFieldTreeItem : public FieldTreeItem { Q_OBJECT public: - EnumFieldTreeItem(UAVObjectField *field, int index, const QList &data, - TreeItem *parent = 0) : + EnumFieldTreeItem(UAVObjectField *field, int index, const QList &data, TreeItem *parent = 0) : FieldTreeItem(index, data, parent), m_enumOptions(field->getOptions()), m_field(field) {} - EnumFieldTreeItem(UAVObjectField *field, int index, const QVariant &data, - TreeItem *parent = 0) : + + EnumFieldTreeItem(UAVObjectField *field, int index, const QVariant &data, TreeItem *parent = 0) : FieldTreeItem(index, data, parent), m_enumOptions(field->getOptions()), m_field(field) {} + void setData(QVariant value, int column) { QStringList options = m_field->getOptions(); @@ -85,6 +90,7 @@ public: setChanged(tmpValIndex != value); TreeItem::setData(value, column); } + QString enumOptions(int index) { if ((index < 0) || (index >= m_enumOptions.length())) { @@ -92,6 +98,7 @@ public: } return m_enumOptions.at(index); } + void apply() { int value = data(dataColumn).toInt(); @@ -100,6 +107,7 @@ public: m_field->setValue(options[value], m_index); setChanged(false); } + void update() { QStringList options = m_field->getOptions(); @@ -111,14 +119,16 @@ public: setHighlight(true); } } + QWidget *createEditor(QWidget *parent) { QComboBox *editor = new QComboBox(parent); // Setting ClickFocus lets the ComboBox stay open on Mac OSX. editor->setFocusPolicy(Qt::ClickFocus); - foreach(QString option, m_enumOptions) - editor->addItem(option); + foreach(QString option, m_enumOptions) { + editor->addItem(option); + } return editor; } @@ -135,6 +145,7 @@ public: comboBox->setCurrentIndex(value.toInt()); } + private: QStringList m_enumOptions; UAVObjectField *m_field; @@ -148,6 +159,7 @@ public: { setMinMaxValues(); } + IntFieldTreeItem(UAVObjectField *field, int index, const QVariant &data, TreeItem *parent = 0) : FieldTreeItem(index, data, parent), m_field(field) { @@ -210,16 +222,19 @@ public: spinBox->setValue(value.toInt()); } + void setData(QVariant value, int column) { setChanged(m_field->getValue(m_index) != value); TreeItem::setData(value, column); } + void apply() { m_field->setValue(data(dataColumn).toInt(), m_index); setChanged(false); } + void update() { int value = m_field->getValue(m_index).toInt(); @@ -241,18 +256,22 @@ class FloatFieldTreeItem : public FieldTreeItem { public: FloatFieldTreeItem(UAVObjectField *field, int index, const QList &data, bool scientific = false, TreeItem *parent = 0) : FieldTreeItem(index, data, parent), m_field(field), m_useScientificNotation(scientific) {} + FloatFieldTreeItem(UAVObjectField *field, int index, const QVariant &data, bool scientific = false, TreeItem *parent = 0) : FieldTreeItem(index, data, parent), m_field(field), m_useScientificNotation(scientific) {} + void setData(QVariant value, int column) { setChanged(m_field->getValue(m_index) != value); TreeItem::setData(value, column); } + void apply() { m_field->setValue(data(dataColumn).toDouble(), m_index); setChanged(false); } + void update() { double value = m_field->getValue(m_index).toDouble(); @@ -303,9 +322,115 @@ public: spinBox->setValue(value.toDouble()); } } + private: UAVObjectField *m_field; bool m_useScientificNotation; }; +class HexFieldTreeItem : public FieldTreeItem { + Q_OBJECT +public: + HexFieldTreeItem(UAVObjectField *field, int index, const QList &data, TreeItem *parent = 0) : + FieldTreeItem(index, data, parent), m_field(field) + {} + + HexFieldTreeItem(UAVObjectField *field, int index, const QVariant &data, TreeItem *parent = 0) : + FieldTreeItem(index, data, parent), m_field(field) + {} + + QWidget *createEditor(QWidget *parent) + { + QLineEdit *lineEdit = new QLineEdit(parent); + + lineEdit->setInputMask(QString(maxLength(), 'H')); + + return lineEdit; + } + + QVariant getEditorValue(QWidget *editor) + { + QLineEdit *lineEdit = static_cast(editor); + + return lineEdit->text(); + } + + void setEditorValue(QWidget *editor, QVariant value) + { + QLineEdit *lineEdit = static_cast(editor); + + lineEdit->setText(value.toString()); + } + + void setData(QVariant value, int column) + { + setChanged(m_field->getValue(m_index) != value); + TreeItem::setData(value, column); + } + + void apply() + { + m_field->setValue(toUInt(data(dataColumn)), m_index); + setChanged(false); + } + + void update() + { + QVariant value = toHexString(m_field->getValue(m_index)); + + if (data() != value || changed()) { + TreeItem::setData(value); + setHighlight(true); + } + } + +private: + UAVObjectField *m_field; + + QVariant toHexString(QVariant value) + { + QString str; + bool ok; + + return str.setNum(value.toUInt(&ok), 16).toUpper(); + } + + QVariant toUInt(QVariant str) + { + bool ok; + + return str.toString().toUInt(&ok, 16); + } + + int maxLength() + { + int maxLength = 0; + + switch (m_field->getType()) { + case UAVObjectField::INT8: + maxLength = 2; + break; + case UAVObjectField::INT16: + maxLength = 4; + break; + case UAVObjectField::INT32: + maxLength = 8; + break; + case UAVObjectField::UINT8: + maxLength = 2; + break; + case UAVObjectField::UINT16: + maxLength = 4; + break; + case UAVObjectField::UINT32: + maxLength = 8; + break; + default: + Q_ASSERT(false); + break; + } + return maxLength; + } +}; + #endif // FIELDTREEITEM_H diff --git a/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.cpp b/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.cpp index 1845f2c35..f1665bd59 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjectbrowser/uavobjecttreemodel.cpp @@ -228,7 +228,11 @@ void UAVObjectTreeModel::addSingleField(int index, UAVObjectField *field, TreeIt case UAVObjectField::UINT32: data.append(field->getValue(index)); data.append(field->getUnits()); - item = new IntFieldTreeItem(field, index, data); + if (field->getUnits().toLower() == "hex") { + item = new HexFieldTreeItem(field, index, data); + } else { + item = new IntFieldTreeItem(field, index, data); + } break; case UAVObjectField::FLOAT32: data.append(field->getValue(index)); @@ -351,9 +355,6 @@ QVariant UAVObjectTreeModel::data(const QModelIndex &index, int role) const return item->data(index.column()); } -// if (role == Qt::DecorationRole) -// return QIcon(":/core/images/openpilot_logo_128.png"); - if (role == Qt::ToolTipRole) { TreeItem *item = static_cast(index.internalPointer()); return item->description(); From ae3d2f41b8816b468f4f903f0f1e861b92856797 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Wed, 22 Jan 2014 21:35:06 +0100 Subject: [PATCH 02/28] OP-1183 UAVObjectBrowser - fixed issue in newly added hex string editor --- .../src/plugins/uavobjectbrowser/fieldtreeitem.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/uavobjectbrowser/fieldtreeitem.h b/ground/openpilotgcs/src/plugins/uavobjectbrowser/fieldtreeitem.h index 64e639eea..6f150e96a 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectbrowser/fieldtreeitem.h +++ b/ground/openpilotgcs/src/plugins/uavobjectbrowser/fieldtreeitem.h @@ -101,7 +101,7 @@ public: void apply() { - int value = data(dataColumn).toInt(); + int value = data().toInt(); QStringList options = m_field->getOptions(); m_field->setValue(options[value], m_index); @@ -231,7 +231,7 @@ public: void apply() { - m_field->setValue(data(dataColumn).toInt(), m_index); + m_field->setValue(data().toInt(), m_index); setChanged(false); } @@ -268,7 +268,7 @@ public: void apply() { - m_field->setValue(data(dataColumn).toDouble(), m_index); + m_field->setValue(data().toDouble(), m_index); setChanged(false); } @@ -364,13 +364,13 @@ public: void setData(QVariant value, int column) { - setChanged(m_field->getValue(m_index) != value); + setChanged(m_field->getValue(m_index) != toUInt(value)); TreeItem::setData(value, column); } void apply() { - m_field->setValue(toUInt(data(dataColumn)), m_index); + m_field->setValue(toUInt(data()), m_index); setChanged(false); } From b58620c9815bba46bbab1ee6482e081630df7f35 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Fri, 24 Jan 2014 00:17:47 +0100 Subject: [PATCH 03/28] OP-1184 removed obsolete plots from the stack scope monitor gadget did same in TaskInfo uav object --- .../default_configurations/OpenPilotGCS.xml | 84 ++++++---- shared/uavobjectdefinition/taskinfo.xml | 155 +++++++++--------- 2 files changed, 124 insertions(+), 115 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml index 827ea2a1c..2ed464a0d 100644 --- a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml +++ b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml @@ -2285,7 +2285,8 @@ 1000 240 - 4294945280 + 4294901760 + true None StackRemaining-System TaskInfo @@ -2296,38 +2297,20 @@ 4294945280 + true None - StackRemaining-Actuator + StackRemaining-CallbackScheduler0 TaskInfo 0 1 0 0 - - 4294945280 - None - StackRemaining-Guidance - TaskInfo - 0 - 1 - 0 - 0 - - - 4294945280 - None - StackRemaining-Watchdog - TaskInfo - 0 - 1 - 0 - 0 - - 4294945280 + 4278190335 + true None - StackRemaining-TelemetryTx + StackRemaining-CallbackScheduler1 TaskInfo 0 1 @@ -2335,9 +2318,10 @@ 0 - 4294945280 + 4294967040 + true None - StackRemaining-TelemetryTxPri + StackRemaining-ManualControl TaskInfo 0 1 @@ -2345,9 +2329,10 @@ 0 - 4294945280 + 4278255615 + true None - StackRemaining-TelemetryRx + StackRemaining-Stabilization TaskInfo 0 1 @@ -2355,9 +2340,10 @@ 0 - 4294945280 + 4294923775 + true None - StackRemaining-GPS + StackRemaining-Actuator TaskInfo 0 1 @@ -2365,9 +2351,10 @@ 0 - 4294945280 + 4289331327 + true None - StackRemaining-ManualControl + StackRemaining-Sensors TaskInfo 0 1 @@ -2376,6 +2363,7 @@ 4294945280 + true None StackRemaining-Altitude TaskInfo @@ -2385,9 +2373,10 @@ 0 - 4294945280 + 4283760767 + true None - StackRemaining-AHRSComms + StackRemaining-TelemetryTx TaskInfo 0 1 @@ -2395,15 +2384,38 @@ 0 - 4294945280 + 4289331327 + true None - StackRemaining-Stabilization + StackRemaining-TelemetryTxPri TaskInfo 0 1 0 0 + + 4294901760 + true + None + StackRemaining-TelemetryRx + TaskInfo + 0 + 1 + 0 + 0 + + + 4283782527 + true + None + StackRemaining-RadioRx + TaskInfo + 0 + 1 + 0 + 0 + 12 1 1000 diff --git a/shared/uavobjectdefinition/taskinfo.xml b/shared/uavobjectdefinition/taskinfo.xml index 7dc843c0a..c5ddc5058 100644 --- a/shared/uavobjectdefinition/taskinfo.xml +++ b/shared/uavobjectdefinition/taskinfo.xml @@ -3,72 +3,70 @@ Task information + System - Actuator - Attitude - Sensors - TelemetryTx - TelemetryTxPri - TelemetryRx - RadioRx - GPS - ManualControl - Altitude - Airspeed - Stabilization - AltitudeHold - PathPlanner - PathFollower - FlightPlan - Com2UsbBridge - Usb2ComBridge - OveroSync - ModemRx - ModemTx - ModemStat - Autotune - EventDispatcher - MagBaro - OSDGen CallbackScheduler0 CallbackScheduler1 CallbackScheduler2 CallbackScheduler3 + + ManualControl + Stabilization + Actuator + Sensors + Attitude + Altitude + Airspeed + MagBaro + + PathFollower + FlightPlan + + TelemetryTx + TelemetryTxPri + TelemetryRx + + RadioRx + Com2UsbBridge + Usb2ComBridge + + GPS + OSDGen + Autotune + System - Actuator - Attitude - Sensors - TelemetryTx - TelemetryTxPri - TelemetryRx - RadioRx - GPS - ManualControl - Altitude - Airspeed - Stabilization - AltitudeHold - PathPlanner - PathFollower - FlightPlan - Com2UsbBridge - Usb2ComBridge - OveroSync - ModemRx - ModemTx - ModemStat - Autotune - EventDispatcher - MagBaro - OSDGen CallbackScheduler0 CallbackScheduler1 CallbackScheduler2 CallbackScheduler3 + + ManualControl + Stabilization + Actuator + Sensors + Attitude + Altitude + Airspeed + MagBaro + + PathFollower + FlightPlan + + TelemetryTx + TelemetryTxPri + TelemetryRx + + RadioRx + Com2UsbBridge + Usb2ComBridge + + GPS + OSDGen + Autotune @@ -77,40 +75,39 @@ + System - Actuator - Attitude - Sensors - TelemetryTx - TelemetryTxPri - TelemetryRx - RadioRx - GPS - ManualControl - Altitude - Airspeed - Stabilization - AltitudeHold - PathPlanner - PathFollower - FlightPlan - Com2UsbBridge - Usb2ComBridge - OveroSync - ModemRx - ModemTx - ModemStat - Autotune - EventDispatcher - MagBaro - OSDGen CallbackScheduler0 CallbackScheduler1 CallbackScheduler2 CallbackScheduler3 + + ManualControl + Stabilization + Actuator + Sensors + Attitude + Altitude + Airspeed + MagBaro + + PathFollower + FlightPlan + + TelemetryTx + TelemetryTxPri + TelemetryRx + + RadioRx + Com2UsbBridge + Usb2ComBridge + + GPS + OSDGen + Autotune - + From 16ff328bfb67e83fa521a97b1eeda68f3eca8f75 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Fri, 24 Jan 2014 19:53:13 +0100 Subject: [PATCH 04/28] OP-1184 removed spurious drawAntialiased setting from stack scope config +review OPReview-632 --- .../default_configurations/OpenPilotGCS.xml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml index 2ed464a0d..decf3135b 100644 --- a/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml +++ b/ground/openpilotgcs/share/openpilotgcs/default_configurations/OpenPilotGCS.xml @@ -2286,7 +2286,6 @@ 240 4294901760 - true None StackRemaining-System TaskInfo @@ -2297,7 +2296,6 @@ 4294945280 - true None StackRemaining-CallbackScheduler0 TaskInfo @@ -2308,7 +2306,6 @@ 4278190335 - true None StackRemaining-CallbackScheduler1 TaskInfo @@ -2319,7 +2316,6 @@ 4294967040 - true None StackRemaining-ManualControl TaskInfo @@ -2330,7 +2326,6 @@ 4278255615 - true None StackRemaining-Stabilization TaskInfo @@ -2341,7 +2336,6 @@ 4294923775 - true None StackRemaining-Actuator TaskInfo @@ -2352,7 +2346,6 @@ 4289331327 - true None StackRemaining-Sensors TaskInfo @@ -2363,7 +2356,6 @@ 4294945280 - true None StackRemaining-Altitude TaskInfo @@ -2374,7 +2366,6 @@ 4283760767 - true None StackRemaining-TelemetryTx TaskInfo @@ -2385,7 +2376,6 @@ 4289331327 - true None StackRemaining-TelemetryTxPri TaskInfo @@ -2396,7 +2386,6 @@ 4294901760 - true None StackRemaining-TelemetryRx TaskInfo @@ -2407,7 +2396,6 @@ 4283782527 - true None StackRemaining-RadioRx TaskInfo From e28e6a76faf617f96dad5ab89b61f58232680571 Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Fri, 24 Jan 2014 20:19:13 +0100 Subject: [PATCH 05/28] OP-1176 : fix Cruise Control checkboxes use wrong Default button --- ground/openpilotgcs/src/plugins/config/input.ui | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/input.ui b/ground/openpilotgcs/src/plugins/config/input.ui index 5e867e15a..32a553d7c 100644 --- a/ground/openpilotgcs/src/plugins/config/input.ui +++ b/ground/openpilotgcs/src/plugins/config/input.ui @@ -1313,7 +1313,6 @@ margin:1px; index:0 haslimits:no scale:1 - buttongroup:16 @@ -1354,7 +1353,6 @@ margin:1px; index:1 haslimits:no scale:1 - buttongroup:16 @@ -1395,7 +1393,6 @@ margin:1px; index:2 haslimits:no scale:1 - buttongroup:16 @@ -1439,7 +1436,6 @@ margin:1px; index:3 haslimits:no scale:1 - buttongroup:16 @@ -1483,7 +1479,6 @@ margin:1px; index:4 haslimits:no scale:1 - buttongroup:16 @@ -1527,7 +1522,6 @@ margin:1px; index:5 haslimits:no scale:1 - buttongroup:16 From a234f52b6d5db59c0b70c4395479ab7a153c04ad Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Fri, 24 Jan 2014 20:50:13 +0100 Subject: [PATCH 06/28] OP-1182 minor tweak of telemetry monitor widget margin for better centering --- .../openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp b/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp index e83891d06..d19ad9e2c 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp @@ -60,8 +60,7 @@ ConnectionManager::ConnectionManager(Internal::MainWindow *mainWindow) : // put everything together QHBoxLayout *layout = new QHBoxLayout; layout->setSpacing(6); - // cheat a bit with the margin to "nicely" center things vertically - layout->setContentsMargins(6, 0, 4, 2); + layout->setContentsMargins(5, 2, 5, 2); setLayout(layout); layout->addWidget(new QLabel(tr("Connections:")), 0, Qt::AlignVCenter); From 0e163b7d977ec52187f795c7635def98d1a291bc Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Sat, 25 Jan 2014 15:22:12 +0100 Subject: [PATCH 07/28] Fix WHATSNEW for release --- WHATSNEW.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/WHATSNEW.txt b/WHATSNEW.txt index ad205cb35..fb184e8b4 100644 --- a/WHATSNEW.txt +++ b/WHATSNEW.txt @@ -1,5 +1,6 @@ ---- RELEASE-14.01-RC1 --- Cruising Ratt --- -This is the RC1 for the first 2014 software release. + +--- RELEASE-14.01-RC2 --- Cruising Ratt --- +This is the RC2 for the first 2014 software release. This version still supports the CopterControl and CC3D. It includes some major "under the hood" changes like migration to Qt5.1 and QtQuick2 widgets, an overhaul of UAVTalk to improve @@ -15,6 +16,11 @@ in this release is accessible here: http://progress.openpilot.org/browse/OP/fixforversion/10220 +Issues fixes since RC1 release +http://progress.openpilot.org/issues/?jql=labels%20%3D%20%2214.01-rc1%22 +OP-1166 OP-1168 OP-1169 OP-1176 OP-1177 OP-1178 OP-1179 OP-1180 +OP-1182 OP-1183 OP-1184 OP-1187 OP-1188 OP-1192 + --- RELEASE-13.06.04 --- This maintenance release includes the following fixes missing in (previously not released to public) RELEASE-13.06.03. - Fixed issues with Google Maps; From 597ac4db2a3d77c964e4e608d1e13ed67f5a6d25 Mon Sep 17 00:00:00 2001 From: Corvus Corax Date: Sun, 2 Feb 2014 14:09:50 +0100 Subject: [PATCH 08/28] OP-1195 increase priority for pios radio link driver task --- flight/pios/common/pios_rfm22b.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flight/pios/common/pios_rfm22b.c b/flight/pios/common/pios_rfm22b.c index c9ea2bd35..93bef7c5c 100644 --- a/flight/pios/common/pios_rfm22b.c +++ b/flight/pios/common/pios_rfm22b.c @@ -64,7 +64,7 @@ /* Local Defines */ #define STACK_SIZE_BYTES 200 -#define TASK_PRIORITY (tskIDLE_PRIORITY + 2) +#define TASK_PRIORITY (tskIDLE_PRIORITY + 4) // flight control relevant device driver (ppm link) #define ISR_TIMEOUT 1 // ms #define EVENT_QUEUE_SIZE 5 #define RFM22B_DEFAULT_RX_DATARATE RFM22_datarate_9600 From 8b25ac189405265904294b8037201e135450c15f Mon Sep 17 00:00:00 2001 From: Corvus Corax Date: Sun, 2 Feb 2014 14:13:25 +0100 Subject: [PATCH 09/28] OP-1195 adapted task priorities for manualcontrol and stabilization --- flight/modules/Actuator/actuator.c | 2 +- flight/modules/ManualControl/manualcontrol.c | 2 +- flight/modules/Stabilization/stabilization.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flight/modules/Actuator/actuator.c b/flight/modules/Actuator/actuator.c index 7d92efdf2..782cc8ed1 100644 --- a/flight/modules/Actuator/actuator.c +++ b/flight/modules/Actuator/actuator.c @@ -55,7 +55,7 @@ #define STACK_SIZE_BYTES 1312 #endif -#define TASK_PRIORITY (tskIDLE_PRIORITY + 4) +#define TASK_PRIORITY (tskIDLE_PRIORITY + 4) // device driver #define FAILSAFE_TIMEOUT_MS 100 #define MAX_MIX_ACTUATORS ACTUATORCOMMAND_CHANNEL_NUMELEM diff --git a/flight/modules/ManualControl/manualcontrol.c b/flight/modules/ManualControl/manualcontrol.c index 4ed56a1ad..ea1c41ff6 100644 --- a/flight/modules/ManualControl/manualcontrol.c +++ b/flight/modules/ManualControl/manualcontrol.c @@ -64,7 +64,7 @@ #define STACK_SIZE_BYTES 1152 #endif -#define TASK_PRIORITY (tskIDLE_PRIORITY + 4) +#define TASK_PRIORITY (tskIDLE_PRIORITY + 3) // 3 = flight control #define UPDATE_PERIOD_MS 20 #define THROTTLE_FAILSAFE -0.1f #define ARMED_THRESHOLD 0.50f diff --git a/flight/modules/Stabilization/stabilization.c b/flight/modules/Stabilization/stabilization.c index 65462ae0c..fa03330bb 100644 --- a/flight/modules/Stabilization/stabilization.c +++ b/flight/modules/Stabilization/stabilization.c @@ -73,7 +73,7 @@ #define STACK_SIZE_BYTES 840 #endif -#define TASK_PRIORITY (tskIDLE_PRIORITY + 4) +#define TASK_PRIORITY (tskIDLE_PRIORITY + 3) // FLIGHT CONTROL priority #define FAILSAFE_TIMEOUT_MS 30 // number of flight mode switch positions From 723e22aa1a7ce2cadcfcc301da83c88fe896339c Mon Sep 17 00:00:00 2001 From: Corvus Corax Date: Tue, 4 Feb 2014 19:05:17 +0100 Subject: [PATCH 10/28] OP-1211 time_measurement_helper --- flight/modules/Stabilization/stabilization.c | 12 +++- flight/pios/common/pios_deltatime.c | 68 +++++++++++++++++++ flight/pios/inc/pios_deltatime.h | 53 +++++++++++++++ flight/pios/pios.h | 4 ++ flight/pios/pios_sim_posix.h | 1 + .../coptercontrol/firmware/inc/pios_config.h | 1 + .../firmware/inc/pios_config_posix.h | 1 + .../revolution/firmware/inc/pios_config.h | 1 + .../revolution/firmware/inc/pios_config_sim.h | 1 + .../revoproto/firmware/inc/pios_config.h | 1 + .../revoproto/firmware/inc/pios_config_sim.h | 2 + .../targets/boards/simposix/firmware/Makefile | 1 + .../simposix/firmware/inc/pios_config.h | 1 + make/apps-defs.mk | 1 + 14 files changed, 145 insertions(+), 3 deletions(-) create mode 100644 flight/pios/common/pios_deltatime.c create mode 100644 flight/pios/inc/pios_deltatime.h diff --git a/flight/modules/Stabilization/stabilization.c b/flight/modules/Stabilization/stabilization.c index 65462ae0c..dc86fc104 100644 --- a/flight/modules/Stabilization/stabilization.c +++ b/flight/modules/Stabilization/stabilization.c @@ -65,6 +65,11 @@ #include "relay_tuning.h" // Private constants +#define UPDATE_EXPECTED (1.0f / 666.0f) +#define UPDATE_MIN 1.0e-6f +#define UPDATE_MAX 1.0f +#define UPDATE_ALPHA 1.0e-3f + #define MAX_QUEUE_SIZE 1 #if defined(PIOS_STABILIZATION_STACK_SIZE) @@ -194,7 +199,9 @@ MODULE_INITCALL(StabilizationInitialize, StabilizationStart); static void stabilizationTask(__attribute__((unused)) void *parameters) { UAVObjEvent ev; - uint32_t timeval = PIOS_DELAY_GetRaw(); + PiOSDeltatimeConfig timeval; + + PIOS_DELTATIME_Init(&timeval, UPDATE_EXPECTED, UPDATE_MIN, UPDATE_MAX, UPDATE_ALPHA); ActuatorDesiredData actuatorDesired; StabilizationDesiredData stabDesired; @@ -226,8 +233,7 @@ static void stabilizationTask(__attribute__((unused)) void *parameters) continue; } - dT = PIOS_DELAY_DiffuS(timeval) * 1.0e-6f; - timeval = PIOS_DELAY_GetRaw(); + dT = PIOS_DELTATIME_GetAverageSeconds(&timeval); FlightStatusGet(&flightStatus); StabilizationDesiredGet(&stabDesired); diff --git a/flight/pios/common/pios_deltatime.c b/flight/pios/common/pios_deltatime.c new file mode 100644 index 000000000..5a2b56f02 --- /dev/null +++ b/flight/pios/common/pios_deltatime.c @@ -0,0 +1,68 @@ +/** + ****************************************************************************** + * @addtogroup PIOS PIOS Core hardware abstraction layer + * @{ + * @addtogroup PIOS_DELTATIME time measurement Functions + * @brief PiOS Delay functionality + * @{ + * + * @file pios_deltatime.c + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. + * @brief Settings functions header + * @see The GNU Public License (GPL) Version 3 + * + *****************************************************************************/ +/* + * This program is free software; you can redistribute it and/or modify + * 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. + * + * This program 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 this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include + +#ifdef PIOS_INCLUDE_DELTATIME + +void PIOS_DELTATIME_Init(PiOSDeltatimeConfig *config, float average, float min, float max, float alpha) +{ + PIOS_Assert(config); + config->average = average; + config->min = min; + config->max = max; + config->alpha = alpha; + config->last = PIOS_DELAY_GetRaw(); +}; + + +float PIOS_DELTATIME_GetAverageSeconds(PiOSDeltatimeConfig *config) +{ + PIOS_Assert(config); + float dT = PIOS_DELAY_DiffuS(config->last) * 1.0e-6f; + config->last = PIOS_DELAY_GetRaw(); + if (dT < config->min) { + dT = config->min; + } + if (dT > config->max) { + dT = config->max; + } + config->average = config->average * (1.0f - config->alpha) + dT * config->alpha; + return config->average; +} + + +#endif // PIOS_INCLUDE_DELTATIME + + +/** + * @} + * @} + */ diff --git a/flight/pios/inc/pios_deltatime.h b/flight/pios/inc/pios_deltatime.h new file mode 100644 index 000000000..968acff40 --- /dev/null +++ b/flight/pios/inc/pios_deltatime.h @@ -0,0 +1,53 @@ +/** + ****************************************************************************** + * @addtogroup PIOS PIOS Core hardware abstraction layer + * @{ + * @addtogroup PIOS_DELTATIME time measurement Functions + * @brief PiOS Delay functionality + * @{ + * + * @file pios_deltatime.h + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. + * @brief Settings functions header + * @see The GNU Public License (GPL) Version 3 + * + *****************************************************************************/ +/* + * This program is free software; you can redistribute it and/or modify + * 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. + * + * This program 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 this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef PIOS_DELTATIME_H +#define PIOS_DELTATIME_H + +struct PiOSDeltatimeConfigStruct { + uint32_t last; + float average; + float min; + float max; + float alpha; +}; +typedef struct PiOSDeltatimeConfigStruct PiOSDeltatimeConfig; + +/* Public Functions */ +void PIOS_DELTATIME_Init(PiOSDeltatimeConfig *config, float average, float min, float max, float alpha); + +float PIOS_DELTATIME_GetAverageSeconds(PiOSDeltatimeConfig *config); + +#endif /* PIOS_DELTATIME_H */ + +/** + * @} + * @} + */ diff --git a/flight/pios/pios.h b/flight/pios/pios.h index 6ba15b104..95ee81d47 100644 --- a/flight/pios/pios.h +++ b/flight/pios/pios.h @@ -104,6 +104,10 @@ #include #endif +#ifdef PIOS_INCLUDE_DELTATIME +#include +#endif + #ifdef PIOS_INCLUDE_INITCALL #include "pios_initcall.h" #endif diff --git a/flight/pios/pios_sim_posix.h b/flight/pios/pios_sim_posix.h index 84fd5440a..5b378eb46 100644 --- a/flight/pios/pios_sim_posix.h +++ b/flight/pios/pios_sim_posix.h @@ -79,6 +79,7 @@ extern void PIOS_LED_Init(void); #include #include #include +#include #include #include #include diff --git a/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h b/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h index ea94abb02..e0498e3e1 100644 --- a/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h +++ b/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h @@ -49,6 +49,7 @@ /* PIOS system functions */ #define PIOS_INCLUDE_DELAY +#define PIOS_INCLUDE_DELTATIME #define PIOS_INCLUDE_INITCALL #define PIOS_INCLUDE_SYS #define PIOS_INCLUDE_TASK_MONITOR diff --git a/flight/targets/boards/coptercontrol/firmware/inc/pios_config_posix.h b/flight/targets/boards/coptercontrol/firmware/inc/pios_config_posix.h index eda0a2511..4dc76d13d 100644 --- a/flight/targets/boards/coptercontrol/firmware/inc/pios_config_posix.h +++ b/flight/targets/boards/coptercontrol/firmware/inc/pios_config_posix.h @@ -32,6 +32,7 @@ /* Enable/Disable PiOS Modules */ #define PIOS_INCLUDE_SYS #define PIOS_INCLUDE_DELAY +#define PIOS_INCLUDE_DELTATIME #define PIOS_INCLUDE_LED #define PIOS_INCLUDE_FREERTOS #define PIOS_INCLUDE_TASK_MONITOR diff --git a/flight/targets/boards/revolution/firmware/inc/pios_config.h b/flight/targets/boards/revolution/firmware/inc/pios_config.h index fbaff9438..c2d7673a8 100644 --- a/flight/targets/boards/revolution/firmware/inc/pios_config.h +++ b/flight/targets/boards/revolution/firmware/inc/pios_config.h @@ -49,6 +49,7 @@ /* PIOS system functions */ #define PIOS_INCLUDE_DELAY +#define PIOS_INCLUDE_DELTATIME #define PIOS_INCLUDE_INITCALL #define PIOS_INCLUDE_SYS #define PIOS_INCLUDE_TASK_MONITOR diff --git a/flight/targets/boards/revolution/firmware/inc/pios_config_sim.h b/flight/targets/boards/revolution/firmware/inc/pios_config_sim.h index 293516522..9402af396 100644 --- a/flight/targets/boards/revolution/firmware/inc/pios_config_sim.h +++ b/flight/targets/boards/revolution/firmware/inc/pios_config_sim.h @@ -32,6 +32,7 @@ /* Enable/Disable PiOS Modules */ #define PIOS_INCLUDE_SYS #define PIOS_INCLUDE_DELAY +#define PIOS_INCLUDE_DELTATIME #define PIOS_INCLUDE_LED #define PIOS_INCLUDE_SDCARD #define PIOS_INCLUDE_FREERTOS diff --git a/flight/targets/boards/revoproto/firmware/inc/pios_config.h b/flight/targets/boards/revoproto/firmware/inc/pios_config.h index c8e3d340c..afd32c159 100644 --- a/flight/targets/boards/revoproto/firmware/inc/pios_config.h +++ b/flight/targets/boards/revoproto/firmware/inc/pios_config.h @@ -49,6 +49,7 @@ /* PIOS system functions */ #define PIOS_INCLUDE_DELAY +#define PIOS_INCLUDE_DELTATIME #define PIOS_INCLUDE_INITCALL #define PIOS_INCLUDE_SYS #define PIOS_INCLUDE_TASK_MONITOR diff --git a/flight/targets/boards/revoproto/firmware/inc/pios_config_sim.h b/flight/targets/boards/revoproto/firmware/inc/pios_config_sim.h index 56470b59b..0d6dd38a3 100644 --- a/flight/targets/boards/revoproto/firmware/inc/pios_config_sim.h +++ b/flight/targets/boards/revoproto/firmware/inc/pios_config_sim.h @@ -1,4 +1,5 @@ /** + #define PIOS_INCLUDE_DELTATIME ****************************************************************************** * * @file pios_config.h @@ -32,6 +33,7 @@ /* Enable/Disable PiOS Modules */ #define PIOS_INCLUDE_SYS #define PIOS_INCLUDE_DELAY +#define PIOS_INCLUDE_DELTATIME #define PIOS_INCLUDE_LED #define PIOS_INCLUDE_SDCARD #define PIOS_INCLUDE_FREERTOS diff --git a/flight/targets/boards/simposix/firmware/Makefile b/flight/targets/boards/simposix/firmware/Makefile index 000539682..221580e7f 100644 --- a/flight/targets/boards/simposix/firmware/Makefile +++ b/flight/targets/boards/simposix/firmware/Makefile @@ -101,6 +101,7 @@ SRC += $(MATHLIB)/pid.c SRC += $(PIOSCORECOMMON)/pios_task_monitor.c SRC += $(PIOSCORECOMMON)/pios_dosfs_logfs.c SRC += $(PIOSCORECOMMON)/pios_debuglog.c +SRC += $(PIOSCORECOMMON)/pios_deltatime.c ## PIOS Hardware include $(PIOS)/posix/library.mk diff --git a/flight/targets/boards/simposix/firmware/inc/pios_config.h b/flight/targets/boards/simposix/firmware/inc/pios_config.h index f3b494e91..0738b6e44 100644 --- a/flight/targets/boards/simposix/firmware/inc/pios_config.h +++ b/flight/targets/boards/simposix/firmware/inc/pios_config.h @@ -41,6 +41,7 @@ /* Enable/Disable PiOS Modules */ // #define PIOS_INCLUDE_ADC #define PIOS_INCLUDE_DELAY +#define PIOS_INCLUDE_DELTATIME // #define PIOS_INCLUDE_I2C #define PIOS_INCLUDE_IRQ #define PIOS_INCLUDE_LED diff --git a/make/apps-defs.mk b/make/apps-defs.mk index b326b218d..fe268f73a 100644 --- a/make/apps-defs.mk +++ b/make/apps-defs.mk @@ -82,6 +82,7 @@ SRC += $(PIOSCOMMON)/pios_crc.c SRC += $(PIOSCOMMON)/pios_flashfs_logfs.c SRC += $(PIOSCOMMON)/pios_flash_jedec.c SRC += $(PIOSCOMMON)/pios_debuglog.c +SRC += $(PIOSCOMMON)/pios_deltatime.c SRC += $(PIOSCOMMON)/pios_rcvr.c SRC += $(PIOSCOMMON)/pios_rfm22b.c SRC += $(PIOSCOMMON)/pios_rfm22b_com.c From a3bb523bf3945ae56e5487f7cebd5575e99a866f Mon Sep 17 00:00:00 2001 From: Corvus Corax Date: Tue, 4 Feb 2014 19:21:33 +0100 Subject: [PATCH 11/28] OP-1211 adjusted alpha value to more sensible default --- flight/modules/Stabilization/stabilization.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flight/modules/Stabilization/stabilization.c b/flight/modules/Stabilization/stabilization.c index dc86fc104..c8da3c487 100644 --- a/flight/modules/Stabilization/stabilization.c +++ b/flight/modules/Stabilization/stabilization.c @@ -68,7 +68,7 @@ #define UPDATE_EXPECTED (1.0f / 666.0f) #define UPDATE_MIN 1.0e-6f #define UPDATE_MAX 1.0f -#define UPDATE_ALPHA 1.0e-3f +#define UPDATE_ALPHA 1.0e-2f #define MAX_QUEUE_SIZE 1 @@ -234,7 +234,7 @@ static void stabilizationTask(__attribute__((unused)) void *parameters) } dT = PIOS_DELTATIME_GetAverageSeconds(&timeval); - + fprintf(stderr, "dt is %f\n", dT); FlightStatusGet(&flightStatus); StabilizationDesiredGet(&stabDesired); AttitudeStateGet(&attitudeState); From 28be9cc8ce177572889b2bae00a5868b181a1abb Mon Sep 17 00:00:00 2001 From: Corvus Corax Date: Tue, 4 Feb 2014 19:48:33 +0100 Subject: [PATCH 12/28] OP-1211 adapted existing code to use new pios functionality instead of separate error prone implementations --- flight/modules/Attitude/attitude.c | 15 +++-- flight/modules/Stabilization/stabilization.c | 1 - .../modules/StateEstimation/filteraltitude.c | 63 +++++++------------ flight/modules/StateEstimation/filterekf.c | 34 ++++------ 4 files changed, 43 insertions(+), 70 deletions(-) diff --git a/flight/modules/Attitude/attitude.c b/flight/modules/Attitude/attitude.c index 84ee51bb3..6a2bb4ce7 100644 --- a/flight/modules/Attitude/attitude.c +++ b/flight/modules/Attitude/attitude.c @@ -72,10 +72,16 @@ #define UPDATE_RATE 25.0f #define GYRO_NEUTRAL 1665 +#define UPDATE_EXPECTED (1.0f / 666.0f) +#define UPDATE_MIN 1.0e-6f +#define UPDATE_MAX 1.0f +#define UPDATE_ALPHA 1.0e-2f + // Private types // Private variables static xTaskHandle taskHandle; +static PiOSDeltatimeConfig dtconfig; // Private functions static void AttitudeTask(void *parameters); @@ -214,6 +220,8 @@ static void AttitudeTask(__attribute__((unused)) void *parameters) // Force settings update to make sure rotation loaded settingsUpdatedCb(AttitudeSettingsHandle()); + PIOS_DELTATIME_Init(&dtconfig, UPDATE_EXPECTED, UPDATE_MIN, UPDATE_MAX, UPDATE_ALPHA); + // Main task loop while (1) { FlightStatusData flightStatus; @@ -473,12 +481,7 @@ static inline void apply_accel_filter(const float *raw, float *filtered) static void updateAttitude(AccelStateData *accelStateData, GyroStateData *gyrosData) { - float dT; - portTickType thisSysTime = xTaskGetTickCount(); - static portTickType lastSysTime = 0; - - dT = (thisSysTime == lastSysTime) ? 0.001f : (thisSysTime - lastSysTime) * portTICK_RATE_MS * 0.001f; - lastSysTime = thisSysTime; + float dT = PIOS_DELTATIME_GetAverageSeconds(&dtconfig); // Bad practice to assume structure order, but saves memory float *gyros = &gyrosData->x; diff --git a/flight/modules/Stabilization/stabilization.c b/flight/modules/Stabilization/stabilization.c index c8da3c487..ab5c7ab61 100644 --- a/flight/modules/Stabilization/stabilization.c +++ b/flight/modules/Stabilization/stabilization.c @@ -234,7 +234,6 @@ static void stabilizationTask(__attribute__((unused)) void *parameters) } dT = PIOS_DELTATIME_GetAverageSeconds(&timeval); - fprintf(stderr, "dt is %f\n", dT); FlightStatusGet(&flightStatus); StabilizationDesiredGet(&stabDesired); AttitudeStateGet(&attitudeState); diff --git a/flight/modules/StateEstimation/filteraltitude.c b/flight/modules/StateEstimation/filteraltitude.c index 01d38a1b8..2b46b35af 100644 --- a/flight/modules/StateEstimation/filteraltitude.c +++ b/flight/modules/StateEstimation/filteraltitude.c @@ -40,20 +40,22 @@ #define STACK_REQUIRED 128 -#define DT_ALPHA 1e-3f +#define DT_ALPHA 1e-2f +#define DT_MIN 1e-6f +#define DT_MAX 1.0f +#define DT_AVERAGE 1e-3f // Private types struct data { - float state[4]; // state = altitude,velocity,accel_offset,accel - float pos[3]; // position updates from other filters - float vel[3]; // position updates from other filters - float dTA; - float dTA2; - int32_t lastTime; - float accelLast; - float baroLast; - int32_t baroLastTime; - bool first_run; + float state[4]; // state = altitude,velocity,accel_offset,accel + float pos[3]; // position updates from other filters + float vel[3]; // position updates from other filters + + PiOSDeltatimeConfig dt1config; + PiOSDeltatimeConfig dt2config; + float accelLast; + float baroLast; + bool first_run; AltitudeFilterSettingsData settings; }; @@ -89,8 +91,8 @@ static int32_t init(stateFilter *self) this->vel[0] = 0.0f; this->vel[1] = 0.0f; this->vel[2] = 0.0f; - this->dTA = -1.0f; - this->dTA2 = -1.0f; + PIOS_DELTATIME_Init(&this->dt1config, DT_AVERAGE, DT_MIN, DT_MAX, DT_ALPHA); + PIOS_DELTATIME_Init(&this->dt2config, DT_AVERAGE, DT_MIN, DT_MAX, DT_ALPHA); this->baroLast = 0.0f; this->accelLast = 0.0f; this->first_run = 1; @@ -104,12 +106,8 @@ static int32_t filter(stateFilter *self, stateEstimation *state) if (this->first_run) { // Initialize to current altitude reading at initial location - if (IS_SET(state->updated, SENSORUPDATES_accel)) { - this->lastTime = PIOS_DELAY_GetRaw(); - } if (IS_SET(state->updated, SENSORUPDATES_baro)) { - this->first_run = 0; - this->baroLastTime = PIOS_DELAY_GetRaw(); + this->first_run = 0; } } else { // save existing position and velocity updates so GPS will still work @@ -141,22 +139,14 @@ static int32_t filter(stateFilter *self, stateEstimation *state) // correct velocity and position state (integration) // low pass for average dT, compensate timing jitter from scheduler - float dT = PIOS_DELAY_DiffuS(this->lastTime) / 1.0e6f; - this->lastTime = PIOS_DELAY_GetRaw(); - if (dT < 0.001f) { - dT = 0.001f; - } - if (this->dTA < 0) { - this->dTA = dT; - } else { - this->dTA = this->dTA * (1.0f - DT_ALPHA) + dT * DT_ALPHA; - } + // + float dT = PIOS_DELTATIME_GetAverageSeconds(&this->dt1config); float speedLast = this->state[1]; - this->state[1] += 0.5f * (this->accelLast + (this->state[3] - this->state[2])) * this->dTA; + this->state[1] += 0.5f * (this->accelLast + (this->state[3] - this->state[2])) * dT; this->accelLast = this->state[3] - this->state[2]; - this->state[0] += 0.5f * (speedLast + this->state[1]) * this->dTA; + this->state[0] += 0.5f * (speedLast + this->state[1]) * dT; state->pos[0] = this->pos[0]; @@ -175,17 +165,8 @@ static int32_t filter(stateFilter *self, stateEstimation *state) // correct the velocity state (low pass differentiation) // low pass for average dT, compensate timing jitter from scheduler - float dT = PIOS_DELAY_DiffuS(this->baroLastTime) / 1.0e6f; - this->baroLastTime = PIOS_DELAY_GetRaw(); - if (dT < 0.001f) { - dT = 0.001f; - } - if (this->dTA2 < 0) { - this->dTA2 = dT; - } else { - this->dTA2 = this->dTA2 * (1.0f - DT_ALPHA) + dT * DT_ALPHA; - } - this->state[1] = (1.0f - (this->settings.BaroKp * this->settings.BaroKp)) * this->state[1] + (this->settings.BaroKp * this->settings.BaroKp) * (state->baro[0] - this->baroLast) / this->dTA2; + float dT = PIOS_DELTATIME_GetAverageSeconds(&this->dt2config); + this->state[1] = (1.0f - (this->settings.BaroKp * this->settings.BaroKp)) * this->state[1] + (this->settings.BaroKp * this->settings.BaroKp) * (state->baro[0] - this->baroLast) / dT; this->baroLast = state->baro[0]; state->pos[0] = this->pos[0]; diff --git a/flight/modules/StateEstimation/filterekf.c b/flight/modules/StateEstimation/filterekf.c index a141e4d8f..0aa906dda 100644 --- a/flight/modules/StateEstimation/filterekf.c +++ b/flight/modules/StateEstimation/filterekf.c @@ -45,6 +45,8 @@ #define STACK_REQUIRED 2048 #define DT_ALPHA 1e-3f +#define DT_MIN 1e-6f +#define DT_MAX 1.0f #define DT_INIT (1.0f / 666.0f) // initialize with 666 Hz (default sensor update rate on revo) #define IMPORT_SENSOR_IF_UPDATED(shortname, num) \ @@ -66,10 +68,9 @@ struct data { stateEstimation work; - uint32_t ins_last_time; - bool inited; + bool inited; - float dTa; + PiOSDeltatimeConfig dtconfig; }; // Private variables @@ -154,11 +155,10 @@ static int32_t maininit(stateFilter *self) { struct data *this = (struct data *)self->localdata; - this->inited = false; - this->init_stage = 0; - this->work.updated = 0; - this->ins_last_time = PIOS_DELAY_GetRaw(); - this->dTa = DT_INIT; + this->inited = false; + this->init_stage = 0; + this->work.updated = 0; + PIOS_DELTATIME_Init(&this->dtconfig, DT_INIT, DT_MIN, DT_MAX, DT_ALPHA); EKFConfigurationGet(&this->ekfConfiguration); int t; @@ -224,17 +224,7 @@ static int32_t filter(stateFilter *self, stateEstimation *state) return 0; } - dT = PIOS_DELAY_DiffuS(this->ins_last_time) / 1.0e6f; - this->ins_last_time = PIOS_DELAY_GetRaw(); - - // This should only happen at start up or at mode switches - if (dT > 0.01f) { - dT = 0.01f; - } else if (dT <= 0.001f) { - dT = 0.001f; - } - - this->dTa = this->dTa * (1.0f - DT_ALPHA) + dT * DT_ALPHA; // low pass for average dT, compensate timing jitter from scheduler + dT = PIOS_DELTATIME_GetAverageSeconds(&this->dtconfig); if (!this->inited && IS_SET(this->work.updated, SENSORUPDATES_mag) && IS_SET(this->work.updated, SENSORUPDATES_baro) && IS_SET(this->work.updated, SENSORUPDATES_pos)) { // Don't initialize until all sensors are read @@ -300,7 +290,7 @@ static int32_t filter(stateFilter *self, stateEstimation *state) // Run prediction a bit before any corrections float gyros[3] = { DEG2RAD(this->work.gyro[0]), DEG2RAD(this->work.gyro[1]), DEG2RAD(this->work.gyro[2]) }; - INSStatePrediction(gyros, this->work.accel, this->dTa); + INSStatePrediction(gyros, this->work.accel, dT); // Copy the attitude into the state // NOTE: updating gyr correctly is valid, because this code is reached only when SENSORUPDATES_gyro is already true @@ -335,7 +325,7 @@ static int32_t filter(stateFilter *self, stateEstimation *state) float gyros[3] = { DEG2RAD(this->work.gyro[0]), DEG2RAD(this->work.gyro[1]), DEG2RAD(this->work.gyro[2]) }; // Advance the state estimate - INSStatePrediction(gyros, this->work.accel, this->dTa); + INSStatePrediction(gyros, this->work.accel, dT); // Copy the attitude into the state // NOTE: updating gyr correctly is valid, because this code is reached only when SENSORUPDATES_gyro is already true @@ -355,7 +345,7 @@ static int32_t filter(stateFilter *self, stateEstimation *state) state->updated |= SENSORUPDATES_attitude | SENSORUPDATES_pos | SENSORUPDATES_vel; // Advance the covariance estimate - INSCovariancePrediction(this->dTa); + INSCovariancePrediction(dT); if (IS_SET(this->work.updated, SENSORUPDATES_mag)) { sensors |= MAG_SENSORS; From 517123d5216e911f7845b933fa261cbad3a4d5c8 Mon Sep 17 00:00:00 2001 From: m_thread Date: Thu, 6 Feb 2014 16:27:58 +0100 Subject: [PATCH 13/28] OP-1191 OPLink Configuration cleanup --- .../plugins/config/configpipxtremewidget.cpp | 369 +- .../plugins/config/configpipxtremewidget.h | 11 +- .../src/plugins/config/pipxtreme.ui | 3526 +++++++++-------- 3 files changed, 1979 insertions(+), 1927 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp b/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp index 494cce35b..ca49af80a 100644 --- a/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp @@ -40,19 +40,14 @@ ConfigPipXtremeWidget::ConfigPipXtremeWidget(QWidget *parent) : ConfigTaskWidget ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); UAVObjectManager *objManager = pm->getObject(); oplinkStatusObj = dynamic_cast(objManager->getObject("OPLinkStatus")); - if (oplinkStatusObj != NULL) { - connect(oplinkStatusObj, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateStatus(UAVObject *))); - } else { - qDebug() << "Error: Object is unknown (OPLinkStatus)."; - } + Q_ASSERT(oplinkStatusObj); + connect(oplinkStatusObj, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateStatus(UAVObject *))); // Connect to the OPLinkSettings object updates oplinkSettingsObj = dynamic_cast(objManager->getObject("OPLinkSettings")); - if (oplinkSettingsObj != NULL) { - connect(oplinkSettingsObj, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateSettings(UAVObject *))); - } else { - qDebug() << "Error: Object is unknown (OPLinkSettings)."; - } + Q_ASSERT(oplinkSettingsObj); + connect(oplinkSettingsObj, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateSettings(UAVObject *))); + Core::Internal::GeneralSettings *settings = pm->getObject(); if (!settings->useExpertMode()) { m_oplink->Apply->setVisible(false); @@ -62,7 +57,6 @@ ConfigPipXtremeWidget::ConfigPipXtremeWidget(QWidget *parent) : ConfigTaskWidget addWidgetBinding("OPLinkSettings", "MainPort", m_oplink->MainPort); addWidgetBinding("OPLinkSettings", "FlexiPort", m_oplink->FlexiPort); addWidgetBinding("OPLinkSettings", "VCPPort", m_oplink->VCPPort); - addWidgetBinding("OPLinkSettings", "ComSpeed", m_oplink->ComSpeed); addWidgetBinding("OPLinkSettings", "MaxRFPower", m_oplink->MaxRFTxPower); addWidgetBinding("OPLinkSettings", "MinChannel", m_oplink->MinimumChannel); addWidgetBinding("OPLinkSettings", "MaxChannel", m_oplink->MaximumChannel); @@ -72,6 +66,7 @@ ConfigPipXtremeWidget::ConfigPipXtremeWidget(QWidget *parent) : ConfigTaskWidget addWidgetBinding("OPLinkSettings", "OneWay", m_oplink->OneWayLink); addWidgetBinding("OPLinkSettings", "PPMOnly", m_oplink->PPMOnly); addWidgetBinding("OPLinkSettings", "PPM", m_oplink->PPM); + addWidgetBinding("OPLinkSettings", "ComSpeed", m_oplink->ComSpeed); addWidgetBinding("OPLinkStatus", "DeviceID", m_oplink->DeviceID); addWidgetBinding("OPLinkStatus", "RxGood", m_oplink->Good); @@ -94,27 +89,19 @@ ConfigPipXtremeWidget::ConfigPipXtremeWidget(QWidget *parent) : ConfigTaskWidget addWidgetBinding("OPLinkStatus", "TXRate", m_oplink->TXRate); // Connect the bind buttons - connect(m_oplink->Bind1, SIGNAL(clicked()), this, SLOT(bind1())); - connect(m_oplink->Bind2, SIGNAL(clicked()), this, SLOT(bind2())); - connect(m_oplink->Bind3, SIGNAL(clicked()), this, SLOT(bind3())); - connect(m_oplink->Bind4, SIGNAL(clicked()), this, SLOT(bind3())); + connect(m_oplink->Bind1, SIGNAL(clicked()), this, SLOT(bind())); + connect(m_oplink->Bind2, SIGNAL(clicked()), this, SLOT(bind())); + connect(m_oplink->Bind3, SIGNAL(clicked()), this, SLOT(bind())); + connect(m_oplink->Bind4, SIGNAL(clicked()), this, SLOT(bind())); // Connect the selection changed signals. - connect(m_oplink->PPMOnly, SIGNAL(toggled(bool)), this, SLOT(ppmOnlyToggled(bool))); - connect(m_oplink->ComSpeed, SIGNAL(currentIndexChanged(int)), this, SLOT(comSpeedChanged(int))); - - ppmOnlyToggled(m_oplink->PPMOnly->isChecked()); - - // Add scroll bar when necessary - QScrollArea *scroll = new QScrollArea; - scroll->setWidget(m_oplink->frame_3); - scroll->setWidgetResizable(true); - m_oplink->verticalLayout_3->addWidget(scroll); + connect(m_oplink->PPMOnly, SIGNAL(toggled(bool)), this, SLOT(ppmOnlyChanged())); // Request and update of the setting object. settingsUpdated = false; autoLoadWidgets(); disableMouseWheelEvents(); + updateEnableControls(); } ConfigPipXtremeWidget::~ConfigPipXtremeWidget() @@ -130,101 +117,102 @@ void ConfigPipXtremeWidget::updateStatus(UAVObject *object) oplinkSettingsObj->requestUpdate(); } + // Update the link state + UAVObjectField *linkField = object->getField("LinkState"); + m_oplink->LinkState->setText(linkField->getValue().toString()); + bool linkConnected = (linkField->getValue() == linkField->getOptions().at(OPLinkStatus::LINKSTATE_CONNECTED)); + bool modemEnabled = linkConnected || (linkField->getValue() == linkField->getOptions().at(OPLinkStatus::LINKSTATE_DISCONNECTED)) || + (linkField->getValue() == linkField->getOptions().at(OPLinkStatus::LINKSTATE_ENABLED)); + + UAVObjectField *pairRssiField = object->getField("PairSignalStrengths"); + + bool bound; + bool ok; + quint32 boundPairId = m_oplink->CoordID->text().toUInt(&ok, 16); + // Update the detected devices. UAVObjectField *pairIdField = object->getField("PairIDs"); - if (pairIdField) { - quint32 pairid1 = pairIdField->getValue(0).toUInt(); - m_oplink->PairID1->setText(QString::number(pairid1, 16).toUpper()); - m_oplink->PairID1->setEnabled(false); - m_oplink->Bind1->setEnabled(pairid1); - quint32 pairid2 = pairIdField->getValue(1).toUInt(); - m_oplink->PairID2->setText(QString::number(pairIdField->getValue(1).toUInt(), 16).toUpper()); - m_oplink->PairID2->setEnabled(false); - m_oplink->Bind2->setEnabled(pairid2); - quint32 pairid3 = pairIdField->getValue(2).toUInt(); - m_oplink->PairID3->setText(QString::number(pairIdField->getValue(2).toUInt(), 16).toUpper()); - m_oplink->PairID3->setEnabled(false); - m_oplink->Bind3->setEnabled(pairid3); - quint32 pairid4 = pairIdField->getValue(3).toUInt(); - m_oplink->PairID4->setText(QString::number(pairIdField->getValue(3).toUInt(), 16).toUpper()); - m_oplink->PairID4->setEnabled(false); - m_oplink->Bind4->setEnabled(pairid4); - } else { - qDebug() << "ConfigPipXtremeWidget: Count not read PairID field."; - } - UAVObjectField *pairRssiField = object->getField("PairSignalStrengths"); - if (pairRssiField) { - m_oplink->PairSignalStrengthBar1->setValue(pairRssiField->getValue(0).toInt()); - m_oplink->PairSignalStrengthBar2->setValue(pairRssiField->getValue(1).toInt()); - m_oplink->PairSignalStrengthBar3->setValue(pairRssiField->getValue(2).toInt()); - m_oplink->PairSignalStrengthBar4->setValue(pairRssiField->getValue(3).toInt()); - m_oplink->PairSignalStrengthLabel1->setText(QString("%1dB").arg(pairRssiField->getValue(0).toInt())); - m_oplink->PairSignalStrengthLabel2->setText(QString("%1dB").arg(pairRssiField->getValue(1).toInt())); - m_oplink->PairSignalStrengthLabel3->setText(QString("%1dB").arg(pairRssiField->getValue(2).toInt())); - m_oplink->PairSignalStrengthLabel4->setText(QString("%1dB").arg(pairRssiField->getValue(3).toInt())); - } else { - qDebug() << "ConfigPipXtremeWidget: Count not read PairID field."; - } + quint32 pairid = pairIdField->getValue(0).toUInt(); + bound = (pairid == boundPairId); + m_oplink->PairID1->setText(QString::number(pairid, 16).toUpper()); + m_oplink->PairID1->setEnabled(false); + m_oplink->Bind1->setText(bound ? tr("Unbind") : tr("Bind")); + m_oplink->Bind1->setEnabled(pairid && modemEnabled); + m_oplink->PairSignalStrengthBar1->setValue(((bound && !linkConnected) || !modemEnabled) ? -127 : pairRssiField->getValue(0).toInt()); + m_oplink->PairSignalStrengthLabel1->setText(QString("%1dB").arg(m_oplink->PairSignalStrengthBar1->value())); + + pairid = pairIdField->getValue(1).toUInt(); + bound = (pairid == boundPairId); + m_oplink->PairID2->setText(QString::number(pairid, 16).toUpper()); + m_oplink->PairID2->setEnabled(false); + m_oplink->Bind2->setText(bound ? tr("Unbind") : tr("Bind")); + m_oplink->Bind2->setEnabled(pairid && modemEnabled); + m_oplink->PairSignalStrengthBar2->setValue(((bound && !linkConnected) || !modemEnabled) ? -127 : pairRssiField->getValue(1).toInt()); + m_oplink->PairSignalStrengthLabel2->setText(QString("%1dB").arg(m_oplink->PairSignalStrengthBar2->value())); + + pairid = pairIdField->getValue(2).toUInt(); + bound = (pairid == boundPairId); + m_oplink->PairID3->setText(QString::number(pairid, 16).toUpper()); + m_oplink->PairID3->setEnabled(false); + m_oplink->Bind3->setText(bound ? tr("Unbind") : tr("Bind")); + m_oplink->Bind3->setEnabled(pairid && modemEnabled); + m_oplink->PairSignalStrengthBar3->setValue(((bound && !linkConnected) || !modemEnabled) ? -127 : pairRssiField->getValue(2).toInt()); + m_oplink->PairSignalStrengthLabel3->setText(QString("%1dB").arg(m_oplink->PairSignalStrengthBar3->value())); + + pairid = pairIdField->getValue(3).toUInt(); + bound = (pairid == boundPairId); + m_oplink->PairID4->setText(QString::number(pairid, 16).toUpper()); + m_oplink->PairID4->setEnabled(false); + m_oplink->Bind4->setText(bound ? tr("Unbind") : tr("Bind")); + m_oplink->Bind4->setEnabled(pairid && modemEnabled); + m_oplink->PairSignalStrengthBar4->setValue(((bound && !linkConnected) || !modemEnabled) ? -127 : pairRssiField->getValue(3).toInt()); + m_oplink->PairSignalStrengthLabel4->setText(QString("%1dB").arg(m_oplink->PairSignalStrengthBar4->value())); // Update the Description field // TODO use UAVObjectUtilManager::descriptionToStructure() UAVObjectField *descField = object->getField("Description"); - if (descField) { - if (descField->getValue(0) != QChar(255)) { - /* - * This looks like a binary with a description at the end: - * 4 bytes: header: "OpFw". - * 4 bytes: GIT commit tag (short version of SHA1). - * 4 bytes: Unix timestamp of compile time. - * 2 bytes: target platform. Should follow same rule as BOARD_TYPE and BOARD_REVISION in board define files. - * 26 bytes: commit tag if it is there, otherwise branch name. '-dirty' may be added if needed. Zero-padded. - * 20 bytes: SHA1 sum of the firmware. - * 20 bytes: SHA1 sum of the uavo definitions. - * 20 bytes: free for now. - */ - char buf[OPLinkStatus::DESCRIPTION_NUMELEM]; - for (unsigned int i = 0; i < 26; ++i) { - buf[i] = descField->getValue(i + 14).toChar().toLatin1(); - } - buf[26] = '\0'; - QString descstr(buf); - quint32 gitDate = descField->getValue(11).toChar().toLatin1() & 0xFF; - for (int i = 1; i < 4; i++) { - gitDate = gitDate << 8; - gitDate += descField->getValue(11 - i).toChar().toLatin1() & 0xFF; - } - QString date = QDateTime::fromTime_t(gitDate).toUTC().toString("yyyy-MM-dd HH:mm"); - m_oplink->FirmwareVersion->setText(descstr + " " + date); - } else { - m_oplink->FirmwareVersion->setText(tr("Unknown")); + if (descField->getValue(0) != QChar(255)) { + /* + * This looks like a binary with a description at the end: + * 4 bytes: header: "OpFw". + * 4 bytes: GIT commit tag (short version of SHA1). + * 4 bytes: Unix timestamp of compile time. + * 2 bytes: target platform. Should follow same rule as BOARD_TYPE and BOARD_REVISION in board define files. + * 26 bytes: commit tag if it is there, otherwise branch name. '-dirty' may be added if needed. Zero-padded. + * 20 bytes: SHA1 sum of the firmware. + * 20 bytes: SHA1 sum of the uavo definitions. + * 20 bytes: free for now. + */ + char buf[OPLinkStatus::DESCRIPTION_NUMELEM]; + for (unsigned int i = 0; i < 26; ++i) { + buf[i] = descField->getValue(i + 14).toChar().toLatin1(); } + buf[26] = '\0'; + QString descstr(buf); + quint32 gitDate = descField->getValue(11).toChar().toLatin1() & 0xFF; + for (int i = 1; i < 4; i++) { + gitDate = gitDate << 8; + gitDate += descField->getValue(11 - i).toChar().toLatin1() & 0xFF; + } + QString date = QDateTime::fromTime_t(gitDate).toUTC().toString("yyyy-MM-dd HH:mm"); + m_oplink->FirmwareVersion->setText(descstr + " " + date); } else { - qDebug() << "ConfigPipXtremeWidget: Failed to read Description field."; + m_oplink->FirmwareVersion->setText(tr("Unknown")); } // Update the serial number field UAVObjectField *serialField = object->getField("CPUSerial"); - if (serialField) { - char buf[OPLinkStatus::CPUSERIAL_NUMELEM * 2 + 1]; - for (unsigned int i = 0; i < OPLinkStatus::CPUSERIAL_NUMELEM; ++i) { - unsigned char val = serialField->getValue(i).toUInt() >> 4; - buf[i * 2] = ((val < 10) ? '0' : '7') + val; - val = serialField->getValue(i).toUInt() & 0xf; - buf[i * 2 + 1] = ((val < 10) ? '0' : '7') + val; - } - buf[OPLinkStatus::CPUSERIAL_NUMELEM * 2] = '\0'; - m_oplink->SerialNumber->setText(buf); - } else { - qDebug() << "ConfigPipXtremeWidget: Failed to read CPUSerial field."; + char buf[OPLinkStatus::CPUSERIAL_NUMELEM * 2 + 1]; + for (unsigned int i = 0; i < OPLinkStatus::CPUSERIAL_NUMELEM; ++i) { + unsigned char val = serialField->getValue(i).toUInt() >> 4; + buf[i * 2] = ((val < 10) ? '0' : '7') + val; + val = serialField->getValue(i).toUInt() & 0xf; + buf[i * 2 + 1] = ((val < 10) ? '0' : '7') + val; } + buf[OPLinkStatus::CPUSERIAL_NUMELEM * 2] = '\0'; + m_oplink->SerialNumber->setText(buf); - // Update the link state - UAVObjectField *linkField = object->getField("LinkState"); - if (linkField) { - m_oplink->LinkState->setText(linkField->getValue().toString()); - } else { - qDebug() << "ConfigPipXtremeWidget: Failed to read LinkState field."; - } + updateEnableControls(); } /*! @@ -239,124 +227,93 @@ void ConfigPipXtremeWidget::updateSettings(UAVObject *object) // Enable components based on the board type connected. UAVObjectField *board_type_field = oplinkStatusObj->getField("BoardType"); - if (board_type_field) { - switch (board_type_field->getValue().toInt()) { - case 0x09: // Revolution - m_oplink->MainPort->setVisible(false); - m_oplink->MainPortLabel->setVisible(false); - m_oplink->FlexiPort->setVisible(false); - m_oplink->FlexiPortLabel->setVisible(false); - m_oplink->VCPPort->setVisible(false); - m_oplink->VCPPortLabel->setVisible(false); - m_oplink->FlexiIOPort->setVisible(false); - m_oplink->FlexiIOPortLabel->setVisible(false); - m_oplink->PPM->setVisible(true); - break; - case 0x03: // OPLinkMini - m_oplink->MainPort->setVisible(true); - m_oplink->MainPortLabel->setVisible(true); - m_oplink->FlexiPort->setVisible(true); - m_oplink->FlexiPortLabel->setVisible(true); - m_oplink->VCPPort->setVisible(true); - m_oplink->VCPPortLabel->setVisible(true); - m_oplink->FlexiIOPort->setVisible(false); - m_oplink->FlexiIOPortLabel->setVisible(false); - m_oplink->PPM->setVisible(false); - break; - case 0x0A: - m_oplink->MainPort->setVisible(true); - m_oplink->MainPortLabel->setVisible(true); - m_oplink->FlexiPort->setVisible(true); - m_oplink->FlexiPortLabel->setVisible(true); - m_oplink->VCPPort->setVisible(true); - m_oplink->VCPPortLabel->setVisible(true); - m_oplink->FlexiIOPort->setVisible(true); - m_oplink->FlexiIOPortLabel->setVisible(true); - m_oplink->PPM->setVisible(false); - break; - default: - // This shouldn't happen. - break; - } - } else { - qDebug() << "BoardType not found."; + switch (board_type_field->getValue().toInt()) { + case 0x09: // Revolution + m_oplink->MainPort->setVisible(false); + m_oplink->MainPortLabel->setVisible(false); + m_oplink->FlexiPort->setVisible(false); + m_oplink->FlexiPortLabel->setVisible(false); + m_oplink->VCPPort->setVisible(false); + m_oplink->VCPPortLabel->setVisible(false); + m_oplink->FlexiIOPort->setVisible(false); + m_oplink->FlexiIOPortLabel->setVisible(false); + m_oplink->PPM->setVisible(true); + break; + case 0x03: // OPLinkMini + m_oplink->MainPort->setVisible(true); + m_oplink->MainPortLabel->setVisible(true); + m_oplink->FlexiPort->setVisible(true); + m_oplink->FlexiPortLabel->setVisible(true); + m_oplink->VCPPort->setVisible(true); + m_oplink->VCPPortLabel->setVisible(true); + m_oplink->FlexiIOPort->setVisible(false); + m_oplink->FlexiIOPortLabel->setVisible(false); + m_oplink->PPM->setVisible(false); + break; + case 0x0A: // OPLink? + m_oplink->MainPort->setVisible(true); + m_oplink->MainPortLabel->setVisible(true); + m_oplink->FlexiPort->setVisible(true); + m_oplink->FlexiPortLabel->setVisible(true); + m_oplink->VCPPort->setVisible(true); + m_oplink->VCPPortLabel->setVisible(true); + m_oplink->FlexiIOPort->setVisible(true); + m_oplink->FlexiIOPortLabel->setVisible(true); + m_oplink->PPM->setVisible(false); + break; + default: + // This shouldn't happen. + break; } - - // Enable the push buttons. - enableControls(true); + updateEnableControls(); } } +void ConfigPipXtremeWidget::updateEnableControls() +{ + enableControls(true); + ppmOnlyChanged(); +} + void ConfigPipXtremeWidget::disconnected() { if (settingsUpdated) { settingsUpdated = false; - - // Enable the push buttons. - enableControls(false); } } -void ConfigPipXtremeWidget::SetPairID(QLineEdit *pairIdWidget) +void ConfigPipXtremeWidget::bind() { - // Get the pair ID out of the selection widget - quint32 pairID = 0; - bool okay; + QPushButton *bindButton = qobject_cast(sender()); - pairID = pairIdWidget->text().toUInt(&okay, 16); - - // Store the ID in the coord ID field. - m_oplink->CoordID->setText(QString::number(pairID, 16).toUpper()); -} - -void ConfigPipXtremeWidget::bind1() -{ - SetPairID(m_oplink->PairID1); -} - -void ConfigPipXtremeWidget::bind2() -{ - SetPairID(m_oplink->PairID1); -} - -void ConfigPipXtremeWidget::bind3() -{ - SetPairID(m_oplink->PairID1); -} - -void ConfigPipXtremeWidget::bind4() -{ - SetPairID(m_oplink->PairID1); -} - -void ConfigPipXtremeWidget::ppmOnlyToggled(bool on) -{ - if (on) { - m_oplink->PPM->setEnabled(false); - m_oplink->OneWayLink->setEnabled(false); - m_oplink->ComSpeed->setEnabled(false); - } else { - m_oplink->PPM->setEnabled(true); - m_oplink->OneWayLink->setEnabled(true); - m_oplink->ComSpeed->setEnabled(true); - // Change the comspeed from 4800 of PPM only is turned off. - if (m_oplink->ComSpeed->currentIndex() == OPLinkSettings::COMSPEED_4800) { - m_oplink->ComSpeed->setCurrentIndex(OPLinkSettings::COMSPEED_9600); + if (bindButton) { + QLineEdit *editField = NULL; + if (bindButton == m_oplink->Bind1) { + editField = m_oplink->PairID1; + } else if (bindButton == m_oplink->Bind2) { + editField = m_oplink->PairID2; + } else if (bindButton == m_oplink->Bind3) { + editField = m_oplink->PairID3; + } else if (bindButton == m_oplink->Bind4) { + editField = m_oplink->PairID4; + } + Q_ASSERT(editField); + bool ok; + quint32 pairid = editField->text().toUInt(&ok, 16); + if (ok) { + quint32 boundPairId = m_oplink->CoordID->text().toUInt(&ok, 16); + (pairid != boundPairId) ? m_oplink->CoordID->setText(QString::number(pairid, 16).toUpper()) : m_oplink->CoordID->setText("0"); } } } -void ConfigPipXtremeWidget::comSpeedChanged(int index) +void ConfigPipXtremeWidget::ppmOnlyChanged() { - qDebug() << "comSpeedChanged: " << index; - switch (index) { - case OPLinkSettings::COMSPEED_4800: - m_oplink->PPMOnly->setChecked(true); - break; - default: - m_oplink->PPMOnly->setChecked(false); - break; - } + bool is_ppm_only = m_oplink->PPMOnly->isChecked(); + + m_oplink->PPM->setEnabled(!is_ppm_only); + m_oplink->OneWayLink->setEnabled(!is_ppm_only); + m_oplink->ComSpeed->setEnabled(!is_ppm_only); } /** diff --git a/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.h b/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.h index 4b5493103..986f7c7bd 100644 --- a/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.h +++ b/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.h @@ -55,16 +55,13 @@ private: // Are the settings current? bool settingsUpdated; - void SetPairID(QLineEdit *pairIdWidget); +protected: + void updateEnableControls(); private slots: void disconnected(); - void bind1(); - void bind2(); - void bind3(); - void bind4(); - void ppmOnlyToggled(bool toggled); - void comSpeedChanged(int index); + void bind(); + void ppmOnlyChanged(); }; #endif // CONFIGTXPIDWIDGET_H diff --git a/ground/openpilotgcs/src/plugins/config/pipxtreme.ui b/ground/openpilotgcs/src/plugins/config/pipxtreme.ui index 5730bb139..513aec847 100644 --- a/ground/openpilotgcs/src/plugins/config/pipxtreme.ui +++ b/ground/openpilotgcs/src/plugins/config/pipxtreme.ui @@ -15,1724 +15,1822 @@ - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - - + + + + OPLink configuration + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QFrame::NoFrame + + + true + + + + + 0 + 0 + 812 + 692 + + + + + + + 0 + 0 + + + + + 50 + false + + + + Configuration + + + + + + Com speed in bps. + + + + + + + + 50 + false + + + + Com Speed + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 50 + false + + + + VCP Port + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 16777215 + 16777215 + + + + Choose the function for the flexi port + + + + + + + + 50 + false + + + + Main Port + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 16777215 + 16777215 + + + + Choose the function for the main port + + + + + + + + 16777215 + 16777215 + + + + Set the maximum TX output power the modem will use (mW) + + + Qt::LeftToRight + + + 0 + + + + + + + + 50 + false + + + + Max Power + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 16777215 + 16777215 + + + + Choose the function for the USB virtual com port + + + + + + + + 50 + false + + + + FlexiIO Port + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + 50 + false + + + + Flexi Port + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 50 + false + + + + Max Chan + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 50 + false + + + + Channel 0 is 430 MHz, channel 249 is 440 MHz, and the channel spacing is 40 KHz. + + + 249 + + + + + + + + 50 + false + + + + Min Chan + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 50 + false + + + + Channel 0 is 430 MHz, channel 249 is 440 MHz, and the channel spacing is 40 KHz. + + + 249 + + + + + + + + 50 + false + + + + Channel Set + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 50 + false + + + + Sets the random sequence of channels to use for frequency hopping. + + + 249 + + + + + + + + 50 + false + + + + Only PPM packets will be transmitted. + + + PPM Only + + + + + + + + 50 + false + + + + If selected, data will only be transmitted from the coordinator to the Rx modem. + + + One-Way + + + + + + + + 50 + false + + + + PPM packets will be received by this modem. Must be selected if Coordinator modem is configured for PPM. + + + PPM + + + + + + + + 50 + false + + + + This modem will be a coordinator and other modems will bind to it. + + + Coordinator + + + + + + + + + + Remote modems + + + + + + + 50 + false + + + + -100dB + + + + + + + -127 + + + 0 + + + 0 + + + false + + + %v dBm + + + + + + + + 50 + false + + + + -100dB + + + + + + + + 100 + 16777215 + + + + + 50 + false + + + + + + + + -127 + + + 0 + + + 0 + + + false + + + %v dBm + + + + + + + + 100 + 16777215 + + + + + 50 + false + + + + + + + + -127 + + + 0 + + + -127 + + + false + + + %v dBm + + + + + + + + 50 + false + + + + -100dB + + + + + + + -127 + + + 0 + + + 0 + + + false + + + %v dBm + + + + + + + + 50 + false + + + + -100dB + + + + + + + + 100 + 16777215 + + + + + 50 + false + + + + + + + + + 100 + 16777215 + + + + + 50 + false + + + + 12345678 + + + + + + + + 50 + false + + + + Bind + + + + + + + + 50 + false + + + + Bind + + + + + + + + 50 + false + + + + Bind + + + + + + + + 50 + false + + + + Bind + + + + + + + + 50 + false + + + + Qt::LeftToRight + + + Coordinator ID + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 100 + 16777215 + + + + + 50 + false + + + + This is the coordinator id currently bound to. + + + 8 + + + + + + + + + + + 430 + 0 + + + + + 50 + false + + + + Qt::LeftToRight + + + QLineEdit { + border: none; + border-radius: 1px; + padding: 0 4px; + background: rgba(0, 0, 0, 16); + /* background: transparent; */ + /* selection-background-color: darkgray;*/ + } + + + Status + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + 0 + 0 + + + + + 101 + 16777215 + + + + + 50 + false + + + + false + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + 12345678 + + + + + + + + 50 + false + + + + Link State + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 101 + 16777215 + + + + + 50 + false + + + + The modems current state + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + Disconnected + + + + + + + + 50 + false + + + + Firmware Ver. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + + 50 + false + + + + false + + + true + + + + + + + + 0 + 0 + + + + + 101 + 16777215 + + + + + 50 + false + + + + true + + + + + + + + 50 + false + + + + Serial Number + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + + 50 + false + false + + + + false + + + The modems serial number + + + true + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + + + + + + 50 + false + + + + Device ID + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 50 + false + + + + Link Quality + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 101 + 16777215 + + + + + 50 + false + + + + false + + + true + + + + + + + + 50 + false + + + + RSSI + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 101 + 16777215 + + + + + 50 + false + + + + The number of packets that were unable to be transmitted + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + + + + + + 50 + false + + + + TX Seq. No. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 101 + 16777215 + + + + + 50 + false + + + + false + + + true + + + + + + + + 50 + false + + + + TX Rate (B/s) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 101 + 16777215 + + + + + 50 + false + + + + false + + + true + + + + + + + + 50 + false + + + + RX Seq. No. + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 101 + 16777215 + + + + + 50 + false + + + + false + + + true + + + + + + + + 50 + false + + + + RX Rate (B/s) + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 101 + 16777215 + + + + + 50 + false + + + + false + + + true + + + + + + + + 50 + false + + + + RX Good + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 101 + 16777215 + + + + + 50 + false + + + + The percentage of packets that were corrected with error correction + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + + + + + + 50 + false + + + + RX Corrected + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 101 + 16777215 + + + + + 50 + false + + + + The percentage of packets that were corrected with error correction + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + + + + + + 50 + false + + + + RX Errors + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 101 + 16777215 + + + + + 50 + false + + + + The percentage of packets that could not be corrected with error correction + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + + + + + + 50 + false + + + + RX Missed + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 101 + 16777215 + + + + + 50 + false + + + + The percentage of packets that were not received at all + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + + + + + + 50 + false + + + + TX Dropped + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 101 + 16777215 + + + + + 50 + false + + + + The number of packets that were unable to be transmitted + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + + + + + + 50 + false + + + + TX Resent + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 50 + false + + + + Tx Failure + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 101 + 16777215 + + + + + 50 + false + + + + false + + + true + + + + + + + + 50 + false + + + + Free Heap + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 101 + 16777215 + + + + + 50 + false + + + + true + + + + + + + + 50 + false + + + + UAVTalk Errors + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 101 + 16777215 + + + + + 50 + false + + + + false + + + true + + + + + + + + 0 + 0 + + + + + 101 + 16777215 + + + + + 50 + false + + + + false + + + true + + + + + + + + 50 + false + + + + Resets + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 101 + 16777215 + + + + + 50 + false + + + + false + + + true + + + + + + + + 50 + false + + + + Timeouts + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 50 + false + + + + RX Failure + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 101 + 16777215 + + + + + 50 + false + + + + The percentage of packets that were not received at all + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - Qt::Horizontal - - - - 40 - 5 - - - - - - - - - - - - :/core/images/helpicon.svg:/core/images/helpicon.svg - - - - 32 - 32 - - - - true - - - - button:help - url:http://wiki.openpilot.org/x/dACrAQ - - - - - - - - Send settings to the board but do not save to the non-volatile memory - - - Apply - - - - - - - Send settings to the board and save to the non-volatile memory - - - Save - - - false - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - 430 - 0 - - - - - 75 - true - - - - Qt::LeftToRight - - - Status - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - 0 - 0 - - - - - 101 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - false - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - 12345678 - - - - - - - Link State - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 101 - 16777215 - - - - - 75 - true - - - - The modems current state - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 3px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - Disconnected - - - - - - - Firmware Ver. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - false - - - true - - - - - - - - 0 - 0 - - - - - 101 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - true - - - - - - - Serial Number - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - - 75 - false - true - - - - false - - - The modems serial number - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - true - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - - - - - Device ID - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Link Quality - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 101 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - false - - - true - - - - - - - RSSI - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 101 - 16777215 - - - - - 75 - true - - - - The number of packets that were unable to be transmitted - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - - - - - TX Seq. No. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 101 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - false - - - true - - - - - - - TX Rate (B/s) - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 101 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - false - - - true - - - - - - - RX Seq. No. - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 101 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - false - - - true - - - - - - - RX Rate (B/s) - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 101 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - false - - - true - - - - - - - RX Good - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 101 - 16777215 - - - - - 75 - true - - - - The percentage of packets that were corrected with error correction - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - - - - - RX Corrected - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 101 - 16777215 - - - - - 75 - true - - - - The percentage of packets that were corrected with error correction - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - - - - - RX Errors - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 101 - 16777215 - - - - - 75 - true - - - - The percentage of packets that could not be corrected with error correction - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - - - - - RX Missed - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 101 - 16777215 - - - - - 75 - true - - - - The percentage of packets that were not received at all - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - - - - - TX Dropped - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 101 - 16777215 - - - - - 75 - true - - - - The number of packets that were unable to be transmitted - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - - - - - TX Resent - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Tx Failure - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 101 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - false - - - true - - - - - - - Free Heap - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 101 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - true - - - - - - - UAVTalk Errors - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 101 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - false - - - true - - - - - - - - 0 - 0 - - - - - 101 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - false - - - true - - - - - - - Resets - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 101 - 16777215 - - - - - 75 - true - - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - false - - - true - - - - - - - Timeouts - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - RX Failure - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 101 - 16777215 - - - - - 75 - true - - - - The percentage of packets that were not received at all - - - QLineEdit { - border: none; - border-radius: 1px; - padding: 0 4px; - background: rgba(0, 0, 0, 16); - /* background: transparent; */ - /* selection-background-color: darkgray;*/ - } - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - - - - - - - - - - - - 75 - true - - - - Remote Modems - - - - - - - - - -100dB - - - - - - - -127 - - - 0 - - - 0 - - - false - - - %v dBm - - - - - - - -100dB - - - - - - - - 100 - 16777215 - - - - - - - - -127 - - - 0 - - - 0 - - - false - - - %v dBm - - - - - - - - 100 - 16777215 - - - - - - - - -127 - - - 0 - - - -127 - - - false - - - %v dBm - - - - - - - -100dB - - - - - - - -127 - - - 0 - - - 0 - - - false - - - %v dBm - - - - - - - -100dB - - - - - - - - 100 - 16777215 - - - - - - - - - 100 - 16777215 - - - - 12345678 - - - - - - - Bind - - - - - - - Bind - - - - - - - Bind - - - - - - - Bind - - - - - - - Qt::LeftToRight - - - Coord ID - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 100 - 16777215 - - - - 8 - - - - - - - This modem will be a coordinator and other modems will bind to it. - - - Coordinator - - - - - - - - - - - - - - 0 - 0 - - - - - 75 - true - - - - Configuration - - - - - - Com speed in bps. - - - - - - - Com Speed - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - VCP Port - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 16777215 - 16777215 - - - - Choose the function for the flexi port - - - - - - - Main Port - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 16777215 - 16777215 - - - - Choose the function for the main port - - - - - - - - 16777215 - 16777215 - - - - Set the maximum TX output power the modem will use (mW) - - - Qt::LeftToRight - - - 0 - - - - - - - Max Power - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 16777215 - 16777215 - - - - Choose the function for the USB virtual com port - - - - - - - FlexiIO Port - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - Flexi Port - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - If selected, data will only be transmitted from the coordinator to the Rx modem. - - - One-Way Link - - - - - - - Only PPM packets will be transmitted. - - - PPM Only - - - - - - - Max Chan - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Channel 0 is 430 MHz, channel 249 is 440 MHz, and the channel spacing is 40 KHz. - - - 249 - - - - - - - Min Chan - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Channel 0 is 430 MHz, channel 249 is 440 MHz, and the channel spacing is 40 KHz. - - - 249 - - - - - - - Channel Set - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Sets the random sequence of channels to use for frequency hopping. - - - 249 - - - - - - - PPM packets will be received by this modem. Must be selected if Coordinator modem is configured for PPM. - - - PPM - - - - - - - + + + + + + + + + + Qt::Horizontal + + + + 40 + 5 + + + + + + + + + 25 + 25 + + + + + + + + :/core/images/helpicon.svg:/core/images/helpicon.svg + + + + 25 + 25 + + + + true + + + + button:help + url:http://wiki.openpilot.org/x/dACrAQ + + + + + + + + Send settings to the board but do not save to the non-volatile memory + + + Apply + + + + + + + Send settings to the board and save to the non-volatile memory + + + Save + + + false + + + + + From e6a8d8f02c07034e162469a7477fb60e79996a34 Mon Sep 17 00:00:00 2001 From: m_thread Date: Thu, 6 Feb 2014 16:28:26 +0100 Subject: [PATCH 14/28] OP-1191 General Configuration cleanup --- .../src/plugins/config/airframe.ui | 92 +++- .../src/plugins/config/cc_hw_settings.ui | 30 +- .../src/plugins/config/ccattitude.ui | 29 +- .../openpilotgcs/src/plugins/config/input.ui | 24 +- .../openpilotgcs/src/plugins/config/output.ui | 73 ++- .../src/plugins/config/revosensors.ui | 50 +- .../src/plugins/config/stabilization.ui | 435 +----------------- .../openpilotgcs/src/plugins/config/txpid.ui | 16 +- 8 files changed, 243 insertions(+), 506 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/airframe.ui b/ground/openpilotgcs/src/plugins/config/airframe.ui index da2f1898c..a31886748 100644 --- a/ground/openpilotgcs/src/plugins/config/airframe.ui +++ b/ground/openpilotgcs/src/plugins/config/airframe.ui @@ -14,9 +14,6 @@ Form - - 12 - @@ -29,7 +26,16 @@ - + + 9 + + + 9 + + + 9 + + 9 @@ -102,7 +108,16 @@ Mixer Settings - + + 9 + + + 9 + + + 9 + + 9 @@ -197,12 +212,21 @@ 0 0 - 832 - 461 + 840 + 439 - + + 0 + + + 0 + + + 0 + + 0 @@ -244,7 +268,16 @@ 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -327,12 +360,21 @@ 0 0 - 223 - 269 + 275 + 309 - + + 12 + + + 12 + + + 12 + + 12 @@ -341,7 +383,16 @@ Feed Forward Configuration - + + 12 + + + 12 + + + 12 + + 12 @@ -607,7 +658,16 @@ In 'units per second', a sound default is 1000. - + + 0 + + + 0 + + + 0 + + 0 @@ -711,12 +771,12 @@ p, li { white-space: pre-wrap; } <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> <table border="0" style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;"> <tr> <td style="border: none;"> <p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:14pt; font-weight:600; color:#ff0000;">SETTING UP FEED FORWARD REQUIRES CAUTION</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt;"></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Ubuntu'; font-size:11pt;"><br /></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;"><br /></span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;"><br /></span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Lucida Grande'; font-size:13pt;">Beware: Feed Forward Tuning will launch all engines around mid-throttle, you have been warned!</span></p> diff --git a/ground/openpilotgcs/src/plugins/config/cc_hw_settings.ui b/ground/openpilotgcs/src/plugins/config/cc_hw_settings.ui index 1f01e9625..a5d9d9a83 100644 --- a/ground/openpilotgcs/src/plugins/config/cc_hw_settings.ui +++ b/ground/openpilotgcs/src/plugins/config/cc_hw_settings.ui @@ -14,9 +14,6 @@ Form - - 12 - @@ -27,7 +24,16 @@ HW settings - + + 0 + + + 0 + + + 0 + + 0 @@ -110,12 +116,21 @@ 0 0 - 616 - 513 + 624 + 516 - + + 12 + + + 12 + + + 12 + + 12 @@ -627,7 +642,6 @@ Beware of not locking yourself out! - diff --git a/ground/openpilotgcs/src/plugins/config/ccattitude.ui b/ground/openpilotgcs/src/plugins/config/ccattitude.ui index f515dfaa0..4a8bc7535 100644 --- a/ground/openpilotgcs/src/plugins/config/ccattitude.ui +++ b/ground/openpilotgcs/src/plugins/config/ccattitude.ui @@ -14,9 +14,6 @@ Form - - 12 - @@ -27,7 +24,16 @@ Attitude - + + 0 + + + 0 + + + 0 + + 0 @@ -110,12 +116,21 @@ 0 0 - 750 - 483 + 758 + 486 - + + 12 + + + 12 + + + 12 + + 12 diff --git a/ground/openpilotgcs/src/plugins/config/input.ui b/ground/openpilotgcs/src/plugins/config/input.ui index 32a553d7c..aa3d1a7f4 100644 --- a/ground/openpilotgcs/src/plugins/config/input.ui +++ b/ground/openpilotgcs/src/plugins/config/input.ui @@ -14,18 +14,6 @@ Form - - 12 - - - 12 - - - 12 - - - 12 - @@ -128,8 +116,8 @@ 0 0 - 766 - 745 + 774 + 748 @@ -558,8 +546,8 @@ 0 0 - 766 - 745 + 768 + 742 @@ -2176,8 +2164,8 @@ Setup the flight mode channel on the RC Input tab if you have not done so alread 0 0 - 766 - 745 + 768 + 742 diff --git a/ground/openpilotgcs/src/plugins/config/output.ui b/ground/openpilotgcs/src/plugins/config/output.ui index fbe9e0e0a..11a3fb900 100644 --- a/ground/openpilotgcs/src/plugins/config/output.ui +++ b/ground/openpilotgcs/src/plugins/config/output.ui @@ -14,9 +14,6 @@ Form - - 12 - @@ -36,7 +33,16 @@ 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -116,15 +122,24 @@ 0 0 - 668 - 671 + 676 + 674 6 - + + 12 + + + 12 + + + 12 + + 12 @@ -145,7 +160,16 @@ Output Update Speed - + + 12 + + + 12 + + + 12 + + 12 @@ -656,7 +680,16 @@ Leave at 50Hz for fixed wing. - + + 12 + + + 12 + + + 12 + + 12 @@ -668,7 +701,16 @@ Leave at 50Hz for fixed wing. - + + 12 + + + 12 + + + 12 + + 12 @@ -727,7 +769,16 @@ Leave at 50Hz for fixed wing. - + + 12 + + + 12 + + + 12 + + 12 diff --git a/ground/openpilotgcs/src/plugins/config/revosensors.ui b/ground/openpilotgcs/src/plugins/config/revosensors.ui index 390f7acea..90baa76aa 100644 --- a/ground/openpilotgcs/src/plugins/config/revosensors.ui +++ b/ground/openpilotgcs/src/plugins/config/revosensors.ui @@ -6,7 +6,7 @@ 0 0 - 649 + 808 510 @@ -20,7 +20,7 @@ true - 1 + 0 @@ -41,7 +41,16 @@ QFrame::Sunken - + + 3 + + + 3 + + + 3 + + 3 @@ -127,7 +136,16 @@ QFrame::Sunken - + + 3 + + + 3 + + + 3 + + 3 @@ -230,7 +248,16 @@ Hint: run this with engines at cruising speed. QFrame::Raised - + + 3 + + + 3 + + + 3 + + 3 @@ -308,7 +335,7 @@ Hint: run this with engines at cruising speed. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> <table border="0" style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;"> <tr> <td style="border: none;"> @@ -338,7 +365,16 @@ p, li { white-space: pre-wrap; } - + + 6 + + + 6 + + + 6 + + 6 diff --git a/ground/openpilotgcs/src/plugins/config/stabilization.ui b/ground/openpilotgcs/src/plugins/config/stabilization.ui index 7eabe0723..a21cc236d 100644 --- a/ground/openpilotgcs/src/plugins/config/stabilization.ui +++ b/ground/openpilotgcs/src/plugins/config/stabilization.ui @@ -22,421 +22,6 @@ 0 - - - - - - - 0 - 0 - 0 - - - - - - - 240 - 240 - 240 - - - - - - - 255 - 255 - 255 - - - - - - - 247 - 247 - 247 - - - - - - - 120 - 120 - 120 - - - - - - - 160 - 160 - 160 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 240 - 240 - 240 - - - - - - - 0 - 0 - 0 - - - - - - - 247 - 247 - 247 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - 240 - 240 - 240 - - - - - - - 255 - 255 - 255 - - - - - - - 247 - 247 - 247 - - - - - - - 120 - 120 - 120 - - - - - - - 160 - 160 - 160 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 240 - 240 - 240 - - - - - - - 0 - 0 - 0 - - - - - - - 247 - 247 - 247 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 120 - 120 - 120 - - - - - - - 240 - 240 - 240 - - - - - - - 255 - 255 - 255 - - - - - - - 247 - 247 - 247 - - - - - - - 120 - 120 - 120 - - - - - - - 160 - 160 - 160 - - - - - - - 120 - 120 - 120 - - - - - - - 255 - 255 - 255 - - - - - - - 120 - 120 - 120 - - - - - - - 240 - 240 - 240 - - - - - - - 240 - 240 - 240 - - - - - - - 0 - 0 - 0 - - - - - - - 240 - 240 - 240 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - Stabilization @@ -551,8 +136,8 @@ 0 0 - 796 - 708 + 798 + 705 @@ -8759,8 +8344,8 @@ border-radius: 5; 0 0 - 796 - 708 + 553 + 733 @@ -18750,8 +18335,8 @@ border-radius: 5; 0 0 - 796 - 708 + 756 + 562 @@ -26881,8 +26466,8 @@ border-radius: 5; 0 0 - 796 - 708 + 731 + 435 @@ -27727,8 +27312,8 @@ border-radius: 5; 0 0 - 796 - 708 + 391 + 518 diff --git a/ground/openpilotgcs/src/plugins/config/txpid.ui b/ground/openpilotgcs/src/plugins/config/txpid.ui index 550102209..496ffe032 100644 --- a/ground/openpilotgcs/src/plugins/config/txpid.ui +++ b/ground/openpilotgcs/src/plugins/config/txpid.ui @@ -17,18 +17,6 @@ 6 - - 12 - - - 12 - - - 12 - - - 12 - @@ -131,8 +119,8 @@ 0 0 - 742 - 450 + 753 + 475 From 9b50c26e8fdfaff7784ccea3e19a83f5f3725207 Mon Sep 17 00:00:00 2001 From: Fredrik Arvidsson Date: Tue, 28 Jan 2014 19:42:20 +0100 Subject: [PATCH 15/28] OP-1088 Switched to use 'Fusion' style on the application --- .../src/plugins/coreplugin/mainwindow.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp b/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp index f2886eebf..197058f29 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp @@ -50,7 +50,9 @@ #include "ioutputpane.h" #include "icorelistener.h" #include "iconfigurableplugin.h" -#include "manhattanstyle.h" + +#include + #include "rightpane.h" #include "settingsdialog.h" #include "threadmanager.h" @@ -140,20 +142,7 @@ MainWindow::MainWindow() : QCoreApplication::setOrganizationName(QLatin1String("OpenPilot")); QCoreApplication::setOrganizationDomain(QLatin1String("openpilot.org")); QSettings::setDefaultFormat(XmlConfig::XmlSettingsFormat); - QString baseName = qApp->style()->objectName(); -#ifdef Q_WS_X11 - if (baseName == QLatin1String("windows")) { - // Sometimes we get the standard windows 95 style as a fallback - // e.g. if we are running on a KDE4 desktop - QByteArray desktopEnvironment = qgetenv("DESKTOP_SESSION"); - if (desktopEnvironment == "kde") { - baseName = QLatin1String("plastique"); - } else { - baseName = QLatin1String("cleanlooks"); - } - } -#endif - qApp->setStyle(new ManhattanStyle(baseName)); + qApp->setStyle(QStyleFactory::create("Fusion")); setDockNestingEnabled(true); From 6bfbe8881336c9015371fabd636580a290efc496 Mon Sep 17 00:00:00 2001 From: m_thread Date: Thu, 6 Feb 2014 17:51:13 +0100 Subject: [PATCH 17/28] OP-1191 Added message box stating that board reboot is needed after bind/unbind --- .../openpilotgcs/src/plugins/config/configpipxtremewidget.cpp | 2 ++ ground/openpilotgcs/src/plugins/config/pipxtreme.ui | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp b/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp index ca49af80a..c806ec30e 100644 --- a/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp @@ -30,6 +30,7 @@ #include #include #include +#include ConfigPipXtremeWidget::ConfigPipXtremeWidget(QWidget *parent) : ConfigTaskWidget(parent) { @@ -304,6 +305,7 @@ void ConfigPipXtremeWidget::bind() quint32 boundPairId = m_oplink->CoordID->text().toUInt(&ok, 16); (pairid != boundPairId) ? m_oplink->CoordID->setText(QString::number(pairid, 16).toUpper()) : m_oplink->CoordID->setText("0"); } + QMessageBox::information(this, tr("Information", "To apply the changes when binding/unbinding the board must be rebooted or power cycled."), QMessageBox::Ok); } } diff --git a/ground/openpilotgcs/src/plugins/config/pipxtreme.ui b/ground/openpilotgcs/src/plugins/config/pipxtreme.ui index 513aec847..7d75bea2d 100644 --- a/ground/openpilotgcs/src/plugins/config/pipxtreme.ui +++ b/ground/openpilotgcs/src/plugins/config/pipxtreme.ui @@ -16,7 +16,7 @@ - + OPLink configuration @@ -686,7 +686,7 @@ - This is the coordinator id currently bound to. + <html><head/><body><p>This is the coordinator id we currently are bound to.</p><p>To manually bind to a specific coordinator, just type</p><p>or paste its device id in this box and save.</p><p>The device must be rebooted for the binding to take place.</p></body></html> 8 From 986f2e3e8ef81adf284c9e98e393ea5531af0e8b Mon Sep 17 00:00:00 2001 From: m_thread Date: Thu, 6 Feb 2014 18:30:01 +0100 Subject: [PATCH 18/28] OP-1191 Fixed a typo. --- .../openpilotgcs/src/plugins/config/configpipxtremewidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp b/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp index c806ec30e..ce0616102 100644 --- a/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp @@ -305,7 +305,7 @@ void ConfigPipXtremeWidget::bind() quint32 boundPairId = m_oplink->CoordID->text().toUInt(&ok, 16); (pairid != boundPairId) ? m_oplink->CoordID->setText(QString::number(pairid, 16).toUpper()) : m_oplink->CoordID->setText("0"); } - QMessageBox::information(this, tr("Information", "To apply the changes when binding/unbinding the board must be rebooted or power cycled."), QMessageBox::Ok); + QMessageBox::information(this, tr("Information"), tr("To apply the changes when binding/unbinding the board must be rebooted or power cycled."), QMessageBox::Ok); } } From 216ec095e45035a6b556363223ec1698ea47d643 Mon Sep 17 00:00:00 2001 From: Corvus Corax Date: Thu, 6 Feb 2014 19:34:34 +0100 Subject: [PATCH 19/28] OP-1211 removed unneeded define --- flight/pios/common/pios_deltatime.c | 4 ---- flight/pios/pios.h | 3 --- .../targets/boards/coptercontrol/firmware/inc/pios_config.h | 1 - .../boards/coptercontrol/firmware/inc/pios_config_posix.h | 1 - flight/targets/boards/revolution/firmware/inc/pios_config.h | 1 - .../targets/boards/revolution/firmware/inc/pios_config_sim.h | 1 - flight/targets/boards/revoproto/firmware/inc/pios_config.h | 1 - .../targets/boards/revoproto/firmware/inc/pios_config_sim.h | 2 -- flight/targets/boards/simposix/firmware/inc/pios_config.h | 1 - 9 files changed, 15 deletions(-) diff --git a/flight/pios/common/pios_deltatime.c b/flight/pios/common/pios_deltatime.c index 5a2b56f02..ec5ee8eb9 100644 --- a/flight/pios/common/pios_deltatime.c +++ b/flight/pios/common/pios_deltatime.c @@ -30,7 +30,6 @@ #include -#ifdef PIOS_INCLUDE_DELTATIME void PIOS_DELTATIME_Init(PiOSDeltatimeConfig *config, float average, float min, float max, float alpha) { @@ -59,9 +58,6 @@ float PIOS_DELTATIME_GetAverageSeconds(PiOSDeltatimeConfig *config) } -#endif // PIOS_INCLUDE_DELTATIME - - /** * @} * @} diff --git a/flight/pios/pios.h b/flight/pios/pios.h index 95ee81d47..c1371d866 100644 --- a/flight/pios/pios.h +++ b/flight/pios/pios.h @@ -102,9 +102,6 @@ /* PIOS system functions */ #ifdef PIOS_INCLUDE_DELAY #include -#endif - -#ifdef PIOS_INCLUDE_DELTATIME #include #endif diff --git a/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h b/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h index e0498e3e1..ea94abb02 100644 --- a/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h +++ b/flight/targets/boards/coptercontrol/firmware/inc/pios_config.h @@ -49,7 +49,6 @@ /* PIOS system functions */ #define PIOS_INCLUDE_DELAY -#define PIOS_INCLUDE_DELTATIME #define PIOS_INCLUDE_INITCALL #define PIOS_INCLUDE_SYS #define PIOS_INCLUDE_TASK_MONITOR diff --git a/flight/targets/boards/coptercontrol/firmware/inc/pios_config_posix.h b/flight/targets/boards/coptercontrol/firmware/inc/pios_config_posix.h index 4dc76d13d..eda0a2511 100644 --- a/flight/targets/boards/coptercontrol/firmware/inc/pios_config_posix.h +++ b/flight/targets/boards/coptercontrol/firmware/inc/pios_config_posix.h @@ -32,7 +32,6 @@ /* Enable/Disable PiOS Modules */ #define PIOS_INCLUDE_SYS #define PIOS_INCLUDE_DELAY -#define PIOS_INCLUDE_DELTATIME #define PIOS_INCLUDE_LED #define PIOS_INCLUDE_FREERTOS #define PIOS_INCLUDE_TASK_MONITOR diff --git a/flight/targets/boards/revolution/firmware/inc/pios_config.h b/flight/targets/boards/revolution/firmware/inc/pios_config.h index c2d7673a8..fbaff9438 100644 --- a/flight/targets/boards/revolution/firmware/inc/pios_config.h +++ b/flight/targets/boards/revolution/firmware/inc/pios_config.h @@ -49,7 +49,6 @@ /* PIOS system functions */ #define PIOS_INCLUDE_DELAY -#define PIOS_INCLUDE_DELTATIME #define PIOS_INCLUDE_INITCALL #define PIOS_INCLUDE_SYS #define PIOS_INCLUDE_TASK_MONITOR diff --git a/flight/targets/boards/revolution/firmware/inc/pios_config_sim.h b/flight/targets/boards/revolution/firmware/inc/pios_config_sim.h index 9402af396..293516522 100644 --- a/flight/targets/boards/revolution/firmware/inc/pios_config_sim.h +++ b/flight/targets/boards/revolution/firmware/inc/pios_config_sim.h @@ -32,7 +32,6 @@ /* Enable/Disable PiOS Modules */ #define PIOS_INCLUDE_SYS #define PIOS_INCLUDE_DELAY -#define PIOS_INCLUDE_DELTATIME #define PIOS_INCLUDE_LED #define PIOS_INCLUDE_SDCARD #define PIOS_INCLUDE_FREERTOS diff --git a/flight/targets/boards/revoproto/firmware/inc/pios_config.h b/flight/targets/boards/revoproto/firmware/inc/pios_config.h index afd32c159..c8e3d340c 100644 --- a/flight/targets/boards/revoproto/firmware/inc/pios_config.h +++ b/flight/targets/boards/revoproto/firmware/inc/pios_config.h @@ -49,7 +49,6 @@ /* PIOS system functions */ #define PIOS_INCLUDE_DELAY -#define PIOS_INCLUDE_DELTATIME #define PIOS_INCLUDE_INITCALL #define PIOS_INCLUDE_SYS #define PIOS_INCLUDE_TASK_MONITOR diff --git a/flight/targets/boards/revoproto/firmware/inc/pios_config_sim.h b/flight/targets/boards/revoproto/firmware/inc/pios_config_sim.h index 0d6dd38a3..56470b59b 100644 --- a/flight/targets/boards/revoproto/firmware/inc/pios_config_sim.h +++ b/flight/targets/boards/revoproto/firmware/inc/pios_config_sim.h @@ -1,5 +1,4 @@ /** - #define PIOS_INCLUDE_DELTATIME ****************************************************************************** * * @file pios_config.h @@ -33,7 +32,6 @@ /* Enable/Disable PiOS Modules */ #define PIOS_INCLUDE_SYS #define PIOS_INCLUDE_DELAY -#define PIOS_INCLUDE_DELTATIME #define PIOS_INCLUDE_LED #define PIOS_INCLUDE_SDCARD #define PIOS_INCLUDE_FREERTOS diff --git a/flight/targets/boards/simposix/firmware/inc/pios_config.h b/flight/targets/boards/simposix/firmware/inc/pios_config.h index 0738b6e44..f3b494e91 100644 --- a/flight/targets/boards/simposix/firmware/inc/pios_config.h +++ b/flight/targets/boards/simposix/firmware/inc/pios_config.h @@ -41,7 +41,6 @@ /* Enable/Disable PiOS Modules */ // #define PIOS_INCLUDE_ADC #define PIOS_INCLUDE_DELAY -#define PIOS_INCLUDE_DELTATIME // #define PIOS_INCLUDE_I2C #define PIOS_INCLUDE_IRQ #define PIOS_INCLUDE_LED From 7d44e38daf598b3e4dd4e28dbe261421ac0b54e8 Mon Sep 17 00:00:00 2001 From: m_thread Date: Tue, 28 Jan 2014 22:13:41 +0100 Subject: [PATCH 20/28] OP-1088 Changes to the Vehicle configuration page. Changed combo box for tab bar and made the tab text translate-able. --- .../src/plugins/config/airframe.ui | 1403 ++++++++--------- .../src/plugins/config/configgadgetwidget.cpp | 2 +- .../config/configvehicletypewidget.cpp | 99 +- .../plugins/config/configvehicletypewidget.h | 18 +- 4 files changed, 737 insertions(+), 785 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/airframe.ui b/ground/openpilotgcs/src/plugins/config/airframe.ui index a31886748..100a9f50a 100644 --- a/ground/openpilotgcs/src/plugins/config/airframe.ui +++ b/ground/openpilotgcs/src/plugins/config/airframe.ui @@ -14,375 +14,303 @@ Form + + 0 + - - - - 0 - 0 - - - - - - - - 9 - - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 75 - true - - - - Vehicle type: - - - - - - - - 0 - 0 - - - - - 50 - false - - - - Select aircraft type here - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 2 - 20 - - - - - - + - - - 0 + + + Qt::LeftToRight - - - true - - - Mixer Settings - - - - 9 - - - 9 - - - 9 - - - 9 - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - 255 - 255 - 255 - - - - - - - 232 - 232 - 232 - - - - - - - - - 255 - 255 - 255 - - - - - - - 232 - 232 - 232 - - - - - - - - - 232 - 232 - 232 - - - - - - - 232 - 232 - 232 - - - - - - - - QFrame::NoFrame - - - QFrame::Plain - - + + true + + + #vehicleTypeFrame{ + color: rgb(180, 180, 180); + margin-top: -1px; +} + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + 0 + + + true - - - - 0 - 0 - 840 - 439 - + + Mixer Settings + + + + 9 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - QFrame::NoFrame - - - -1 + + 9 + + + 9 + + + 9 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + + + 255 + 255 + 255 + + + + + + + 232 + 232 + 232 + + + + + + + + + 255 + 255 + 255 + + + + + + + 232 + 232 + 232 + + + + + + + + + 232 + 232 + 232 + + + + + + + 232 + 232 + 232 + + + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + true + + + + + 0 + 0 + 820 + 478 + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + QFrame::NoFrame + + + -1 + + + + - - - + + + - - - - - - true - - - Feed Forward - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - - - - 255 - 255 - 255 - - - - - - - 232 - 232 - 232 - - - - - - - - - 255 - 255 - 255 - - - - - - - 232 - 232 - 232 - - - - - - - - - 232 - 232 - 232 - - - - - - - 232 - 232 - 232 - - - - - - - - QFrame::NoFrame - - - QFrame::Plain - - + + true - - - - 0 - 0 - 275 - 309 - + + Feed Forward + + + + 0 - - - 12 - - - 12 - - - 12 - - - 12 - - - - - Feed Forward Configuration + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + 255 + 255 + 255 + + + + + + + 232 + 232 + 232 + + + + + + + + + 255 + 255 + 255 + + + + + + + 232 + 232 + 232 + + + + + + + + + 232 + 232 + 232 + + + + + + + 232 + 232 + 232 + + + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + true + + + + + 0 + 0 + 271 + 307 + - + 12 @@ -395,191 +323,386 @@ 12 - - - - - - Decel Time Constant - - - - - - - true - - - Qt::StrongFocus - - - When tuning: Slowly raise decel time from zero to just + + + + Feed Forward Configuration + + + + 12 + + + 12 + + + 12 + + + 12 + + + + + + + Decel Time Constant + + + + + + + true + + + Qt::StrongFocus + + + When tuning: Slowly raise decel time from zero to just under the level where the motor starts to undershoot its target speed when decelerating. Do it after accel time is setup. - - - 3 - - - 100.000000000000000 - - - 0.010000000000000 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Accel Time Constant - - - - - - - true - - - Qt::StrongFocus - - - In miliseconds. + + + 3 + + + 100.000000000000000 + + + 0.010000000000000 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Accel Time Constant + + + + + + + true + + + Qt::StrongFocus + + + In miliseconds. When tuning: Slowly raise accel time from zero to just under the level where the motor starts to overshoot its target speed. - - - 3 - - - 100.000000000000000 - - - 0.010000000000000 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 16777215 - 16 - - - - 1000 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - true - - - - 0 - 32 - - - - Qt::StrongFocus - - - Overall level of feed forward (in percentage). - - - 100 - - - 1 - - - Qt::Horizontal - - - QSlider::NoTicks - - - - - - - - 0 - 32 - - - - Qt::StrongFocus - - - Limits how much the engines can accelerate or decelerate. + + + 3 + + + 100.000000000000000 + + + 0.010000000000000 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 16777215 + 16 + + + + 1000 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + + 0 + 32 + + + + Qt::StrongFocus + + + Overall level of feed forward (in percentage). + + + 100 + + + 1 + + + Qt::Horizontal + + + QSlider::NoTicks + + + + + + + + 0 + 32 + + + + Qt::StrongFocus + + + Limits how much the engines can accelerate or decelerate. In 'units per second', a sound default is 1000. - - - 500 - - - 2000 - - - 1000 - - - Qt::Horizontal - - - false - - - false - + + + 500 + + + 2000 + + + 1000 + + + Qt::Horizontal + + + false + + + false + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16 + + + + MaxAccel + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 30 + 0 + + + + 000 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + FeedForward + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + - - + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 267 + 20 + + + + + + + + Qt::StrongFocus + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;">Beware! Check </span><span style=" font-family:'Sans'; font-size:10pt; font-weight:600;">all three</span><span style=" font-family:'Sans'; font-size:10pt;"> checkboxes to test Feed Forward.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;">It will run only if your airframe armed.</span></p></body></html> + + + + + + + + + + Qt::StrongFocus + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;">Beware! Check </span><span style=" font-family:'Sans'; font-size:10pt; font-weight:600;">all three</span><span style=" font-family:'Sans'; font-size:10pt;"> checkboxes to test Feed Forward.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;">It will run only if your airframe armed.</span></p></body></html> + + + + + + + + + + Qt::StrongFocus + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;">Beware! Check </span><span style=" font-family:'Sans'; font-size:10pt; font-weight:600;">all three</span><span style=" font-family:'Sans'; font-size:10pt;"> checkboxes to test Feed Forward.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;">It will run only if your airframe armed.</span></p></body></html> + + + Enable FF tuning + + + + + + + Qt::Horizontal + + + + 267 + 20 + + + + + + + + + - + 0 0 @@ -587,190 +710,13 @@ In 'units per second', a sound default is 1000. 0 - 0 + 40 - - - 16777215 - 16 - - - - MaxAccel - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 30 - 0 - - - - 000 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - FeedForward - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Qt::Horizontal - - - - 267 - 20 - - - - - - - - Qt::StrongFocus - - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;">Beware! Check </span><span style=" font-family:'Sans'; font-size:10pt; font-weight:600;">all three</span><span style=" font-family:'Sans'; font-size:10pt;"> checkboxes to test Feed Forward.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;">It will run only if your airframe armed.</span></p></body></html> - - - - - - - - - - Qt::StrongFocus - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;">Beware! Check </span><span style=" font-family:'Sans'; font-size:10pt; font-weight:600;">all three</span><span style=" font-family:'Sans'; font-size:10pt;"> checkboxes to test Feed Forward.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;">It will run only if your airframe armed.</span></p></body></html> - - - - - - - - - - Qt::StrongFocus - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;">Beware! Check </span><span style=" font-family:'Sans'; font-size:10pt; font-weight:600;">all three</span><span style=" font-family:'Sans'; font-size:10pt;"> checkboxes to test Feed Forward.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;">It will run only if your airframe armed.</span></p></body></html> - - - Enable FF tuning - - - - - - - Qt::Horizontal - - - - 267 - 20 - - - - - - - - - - - - 0 - 0 - - - - - 0 - 40 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> <table border="0" style="-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;"> <tr> @@ -781,17 +727,36 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt;"><br /></span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Lucida Grande'; font-size:13pt;">Beware: Feed Forward Tuning will launch all engines around mid-throttle, you have been warned!</span></p> <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Lucida Grande'; font-size:13pt;">Remove your props initially, and for fine-tuning, make sure your airframe is safely held in place. Wear glasses and protect your face and body.</span></p></td></tr></table></body></html> - + + + + - - - + + + - - - + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 9 + + + + @@ -869,6 +834,14 @@ p, li { white-space: pre-wrap; } + + + QTabBar + QWidget +
qtabbar.h
+ 1 +
+
diff --git a/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp index 6e932e870..4ae81eb08 100644 --- a/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp @@ -250,7 +250,7 @@ void ConfigGadgetWidget::tabAboutToChange(int i, bool *proceed) } if (wid->isDirty()) { int ans = QMessageBox::warning(this, tr("Unsaved changes"), tr("The tab you are leaving has unsaved changes," - "if you proceed they will be lost." + "if you proceed they will be lost.\n" "Do you still want to proceed?"), QMessageBox::Yes, QMessageBox::No); if (ans == QMessageBox::No) { *proceed = false; diff --git a/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp b/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp index 0d6d4ee05..4bfda4563 100644 --- a/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp @@ -122,18 +122,18 @@ ConfigVehicleTypeWidget::ConfigVehicleTypeWidget(QWidget *parent) : ConfigTaskWi addUAVObject("MixerSettings"); addUAVObject("ActuatorSettings"); - ffTuningInProgress = false; - ffTuningPhase = false; + m_ffTuningInProgress = false; + m_ffTuningPhase = false; - QStringList airframeTypes; - airframeTypes << "Fixed Wing" << "Multirotor" << "Helicopter" << "Ground" << "Custom"; - m_aircraft->aircraftType->addItems(airframeTypes); - - // Set default vehicle to MultiRotor - // m_aircraft->aircraftType->setCurrentIndex(3); + // The order of the tabs is important since they correspond with the AirframCategory enum + m_aircraft->aircraftType->addTab(tr("Multirotor")); + m_aircraft->aircraftType->addTab(tr("Fixed Wing")); + m_aircraft->aircraftType->addTab(tr("Helicopter")); + m_aircraft->aircraftType->addTab(tr("Ground")); + m_aircraft->aircraftType->addTab(tr("Custom")); // Connect aircraft type selection dropbox to callback function - connect(m_aircraft->aircraftType, SIGNAL(currentIndexChanged(int)), this, SLOT(switchAirframeType(int))); + connect(m_aircraft->aircraftType, SIGNAL(currentChanged(int)), this, SLOT(switchAirframeType(int))); // Connect the three feed forward test checkboxes connect(m_aircraft->ffTestBox1, SIGNAL(clicked(bool)), this, SLOT(enableFFTest())); @@ -145,9 +145,6 @@ ConfigVehicleTypeWidget::ConfigVehicleTypeWidget(QWidget *parent) : ConfigTaskWi refreshWidgetsValues(); - // register widgets for dirty state management - addWidget(m_aircraft->aircraftType); - // register FF widgets for dirty state management addWidget(m_aircraft->feedForwardSlider); addWidget(m_aircraft->accelTime); @@ -171,10 +168,7 @@ ConfigVehicleTypeWidget::~ConfigVehicleTypeWidget() void ConfigVehicleTypeWidget::switchAirframeType(int index) { - // TODO not safe w/r to translation!!! - QString frameCategory = m_aircraft->aircraftType->currentText(); - - m_aircraft->airframesWidget->setCurrentWidget(getVehicleConfigWidget(frameCategory)); + m_aircraft->airframesWidget->setCurrentWidget(getVehicleConfigWidget(index)); } /** @@ -202,10 +196,9 @@ void ConfigVehicleTypeWidget::refreshWidgetsValues(UAVObject *o) // At this stage, we will need to have some hardcoded settings in this code, this // is not ideal, but there you go. QString frameType = field->getValue().toString(); - qDebug() << "ConfigVehicleTypeWidget::refreshWidgetsValues - frame type:" << frameType; - QString category = frameCategory(frameType); - setComboCurrentIndex(m_aircraft->aircraftType, m_aircraft->aircraftType->findText(category)); + int category = frameCategory(frameType); + m_aircraft->aircraftType->setCurrentIndex(category); VehicleConfig *vehicleConfig = getVehicleConfigWidget(category); if (vehicleConfig) { @@ -215,8 +208,6 @@ void ConfigVehicleTypeWidget::refreshWidgetsValues(UAVObject *o) updateFeedForwardUI(); setDirty(dirty); - - qDebug() << "ConfigVehicleTypeWidget::refreshWidgetsValues - end"; } /** @@ -264,63 +255,61 @@ void ConfigVehicleTypeWidget::updateObjectsFromWidgets() updateFeedForwardUI(); } -QString ConfigVehicleTypeWidget::frameCategory(QString frameType) +int ConfigVehicleTypeWidget::frameCategory(QString frameType) { - QString category; - if (frameType == "FixedWing" || frameType == "Elevator aileron rudder" || frameType == "FixedWingElevon" || frameType == "Elevon" || frameType == "FixedWingVtail" || frameType == "Vtail") { - category = "Fixed Wing"; + return ConfigVehicleTypeWidget::FIXED_WING; } else if (frameType == "Tri" || frameType == "Tricopter Y" || frameType == "QuadX" || frameType == "Quad X" || frameType == "QuadP" || frameType == "Quad +" || frameType == "Hexa" || frameType == "Hexacopter" || frameType == "HexaX" || frameType == "Hexacopter X" || frameType == "HexaCoax" || frameType == "Hexacopter Y6" || frameType == "Octo" || frameType == "Octocopter" || frameType == "OctoV" || frameType == "Octocopter V" || frameType == "OctoCoaxP" || frameType == "Octo Coax +" || frameType == "OctoCoaxX" || frameType == "Octo Coax X") { - category = "Multirotor"; + return ConfigVehicleTypeWidget::MULTIROTOR; } else if (frameType == "HeliCP") { - category = "Helicopter"; + return ConfigVehicleTypeWidget::HELICOPTER; } else if (frameType == "GroundVehicleCar" || frameType == "Turnable (car)" || frameType == "GroundVehicleDifferential" || frameType == "Differential (tank)" || frameType == "GroundVehicleMotorcyle" || frameType == "Motorcycle") { - category = "Ground"; + return ConfigVehicleTypeWidget::GROUND; } else { - category = "Custom"; + return ConfigVehicleTypeWidget::CUSTOM; } - return category; } -VehicleConfig *ConfigVehicleTypeWidget::getVehicleConfigWidget(QString frameCategory) +VehicleConfig *ConfigVehicleTypeWidget::getVehicleConfigWidget(int frameCategory) { VehicleConfig *vehiculeConfig; - if (!vehicleIndexMap.contains(frameCategory)) { + if (!m_vehicleIndexMap.contains(frameCategory)) { // create config widget vehiculeConfig = createVehicleConfigWidget(frameCategory); // bind config widget "field" to this ConfigTaskWodget // this is necessary to get "dirty" state management vehiculeConfig->registerWidgets(*this); + // add config widget to UI int index = m_aircraft->airframesWidget->insertWidget(m_aircraft->airframesWidget->count(), vehiculeConfig); - vehicleIndexMap[frameCategory] = index; + m_vehicleIndexMap[frameCategory] = index; + updateEnableControls(); } - int index = vehicleIndexMap.value(frameCategory); + int index = m_vehicleIndexMap.value(frameCategory); vehiculeConfig = (VehicleConfig *)m_aircraft->airframesWidget->widget(index); return vehiculeConfig; } -VehicleConfig *ConfigVehicleTypeWidget::createVehicleConfigWidget(QString frameCategory) +VehicleConfig *ConfigVehicleTypeWidget::createVehicleConfigWidget(int frameCategory) { - qDebug() << "ConfigVehicleTypeWidget::createVehicleConfigWidget - creating" << frameCategory; - if (frameCategory == "Fixed Wing") { + if (frameCategory == ConfigVehicleTypeWidget::FIXED_WING) { return new ConfigFixedWingWidget(); - } else if (frameCategory == "Multirotor") { + } else if (frameCategory == ConfigVehicleTypeWidget::MULTIROTOR){ return new ConfigMultiRotorWidget(); - } else if (frameCategory == "Helicopter") { + } else if (frameCategory == ConfigVehicleTypeWidget::HELICOPTER) { return new ConfigCcpmWidget(); - } else if (frameCategory == "Ground") { + } else if (frameCategory == ConfigVehicleTypeWidget::GROUND) { return new ConfigGroundVehicleWidget(); - } else if (frameCategory == "Custom") { + } else if (frameCategory ==ConfigVehicleTypeWidget::CUSTOM) { return new ConfigCustomWidget(); } return NULL; @@ -337,17 +326,17 @@ void ConfigVehicleTypeWidget::enableFFTest() // - Every other time event: send FF settings to flight FW if (m_aircraft->ffTestBox1->isChecked() && m_aircraft->ffTestBox2->isChecked() && m_aircraft->ffTestBox3->isChecked()) { - if (!ffTuningInProgress) { + if (!m_ffTuningInProgress) { // Initiate tuning: UAVDataObject *obj = dynamic_cast(getObjectManager()->getObject( QString("ManualControlCommand"))); UAVObject::Metadata mdata = obj->getMetadata(); - accInitialData = mdata; + m_accInitialData = mdata; UAVObject::SetFlightAccess(mdata, UAVObject::ACCESS_READONLY); obj->setMetadata(mdata); } // Depending on phase, either move actuator or send FF settings: - if (ffTuningPhase) { + if (m_ffTuningPhase) { // Send FF settings to the board UAVDataObject *mixer = dynamic_cast(getObjectManager()->getObject(QString("MixerSettings"))); Q_ASSERT(mixer); @@ -369,18 +358,18 @@ void ConfigVehicleTypeWidget::enableFFTest() obj->getField("Throttle")->setValue(target); obj->updated(); } - ffTuningPhase = !ffTuningPhase; - ffTuningInProgress = true; + m_ffTuningPhase = !m_ffTuningPhase; + m_ffTuningInProgress = true; QTimer::singleShot(1000, this, SLOT(enableFFTest())); } else { // - If no: disarm timer, restore actuatorcommand metadata // Disarm! - if (ffTuningInProgress) { - ffTuningInProgress = false; + if (m_ffTuningInProgress) { + m_ffTuningInProgress = false; UAVDataObject *obj = dynamic_cast(getObjectManager()->getObject( QString("ManualControlCommand"))); UAVObject::Metadata mdata = obj->getMetadata(); - mdata = accInitialData; // Restore metadata + mdata = m_accInitialData; // Restore metadata obj->setMetadata(mdata); } } @@ -413,15 +402,3 @@ void ConfigVehicleTypeWidget::openHelp() { QDesktopServices::openUrl(QUrl("http://wiki.openpilot.org/x/44Cf", QUrl::StrictMode)); } - -/** - Helper function: - Sets the current index on supplied combobox to index - if it is within bounds 0 <= index < combobox.count() - */ -void ConfigVehicleTypeWidget::setComboCurrentIndex(QComboBox *box, int index) -{ - if (index >= 0 && index < box->count()) { - box->setCurrentIndex(index); - } -} diff --git a/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.h b/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.h index 5bee9696c..be40b4d48 100644 --- a/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.h +++ b/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.h @@ -64,7 +64,6 @@ class ConfigVehicleTypeWidget : public ConfigTaskWidget { public: static QStringList getChannelDescriptions(); - static void setComboCurrentIndex(QComboBox *box, int index); ConfigVehicleTypeWidget(QWidget *parent = 0); ~ConfigVehicleTypeWidget(); @@ -76,20 +75,23 @@ protected slots: private: Ui_AircraftWidget *m_aircraft; + static enum { MULTIROTOR = 0, FIXED_WING, HELICOPTER, GROUND, CUSTOM } AirframeCategory; + // Maps a frame category to its index in the m_aircraft->airframesWidget QStackedWidget - QMap vehicleIndexMap; + QMap m_vehicleIndexMap; - QString frameCategory(QString frameType); - VehicleConfig *getVehicleConfigWidget(QString frameCategory); - VehicleConfig *createVehicleConfigWidget(QString frameCategory); + int frameCategory(QString frameType); + + VehicleConfig *getVehicleConfigWidget(int frameCategory); + VehicleConfig *createVehicleConfigWidget(int frameCategory); // Feed Forward void updateFeedForwardUI(); - bool ffTuningInProgress; - bool ffTuningPhase; - UAVObject::Metadata accInitialData; + bool m_ffTuningInProgress; + bool m_ffTuningPhase; + UAVObject::Metadata m_accInitialData; private slots: void switchAirframeType(int index); From 0964031ae0cad869ae0db2310158ea24ae813700 Mon Sep 17 00:00:00 2001 From: m_thread Date: Sat, 8 Feb 2014 13:51:42 +0100 Subject: [PATCH 21/28] OP-1191 Minor gui fixes. Removed stuff from linux css file. No need to have minor tweaks to the fusion style. --- .../stylesheets/default_linux.qss | 18 ---- .../src/plugins/config/camerastabilization.ui | 88 +++++++++++-------- .../src/plugins/config/revosensors.ui | 4 +- 3 files changed, 55 insertions(+), 55 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/stylesheets/default_linux.qss b/ground/openpilotgcs/share/openpilotgcs/stylesheets/default_linux.qss index 64ac641ab..edc9dc8cd 100644 --- a/ground/openpilotgcs/share/openpilotgcs/stylesheets/default_linux.qss +++ b/ground/openpilotgcs/share/openpilotgcs/stylesheets/default_linux.qss @@ -1,19 +1 @@ /* Linux styles */ - -QGroupBox { - border: 1px solid gray; - border-radius: 5px; - margin-top: 1ex; - font-size: 11px; - font-weight: bold; -} - -QGroupBox::title { - subcontrol-origin: margin; - subcontrol-position: top left; - padding: 0 3px; -} - -MixerCurveWidget { - font-size: 12px; -} diff --git a/ground/openpilotgcs/src/plugins/config/camerastabilization.ui b/ground/openpilotgcs/src/plugins/config/camerastabilization.ui index 5b78247b4..c2b90e525 100644 --- a/ground/openpilotgcs/src/plugins/config/camerastabilization.ui +++ b/ground/openpilotgcs/src/plugins/config/camerastabilization.ui @@ -42,7 +42,16 @@ Camera Stabilization - + + 0 + + + 0 + + + 0 + + 0 @@ -64,15 +73,24 @@ 0 0 - 762 - 658 + 750 + 729 12 - + + 12 + + + 12 + + + 12 + + 12 @@ -1358,6 +1376,37 @@ The same value is used for all axes. + + + + + 0 + 50 + + + + + 16777215 + 16777215 + + + + Messages + + + + + + false + + + + + + + + + @@ -1379,37 +1428,6 @@ The same value is used for all axes. - - - - - 0 - 50 - - - - - 16777215 - 16777215 - - - - Messages - - - - - - false - - - - - - - - - diff --git a/ground/openpilotgcs/src/plugins/config/revosensors.ui b/ground/openpilotgcs/src/plugins/config/revosensors.ui index 90baa76aa..8c6e2de1e 100644 --- a/ground/openpilotgcs/src/plugins/config/revosensors.ui +++ b/ground/openpilotgcs/src/plugins/config/revosensors.ui @@ -874,8 +874,8 @@ A setting of 0.00 disables the filter. - 32 - 32 + 25 + 25 From da137e18e76bf4ee9666ab6cbc8380075f0f9e44 Mon Sep 17 00:00:00 2001 From: m_thread Date: Sat, 8 Feb 2014 13:55:32 +0100 Subject: [PATCH 22/28] OP-1191 Removed all special tweaks to the macosx css. No need to have this for fusion. --- .../stylesheets/default_macos.qss | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/ground/openpilotgcs/share/openpilotgcs/stylesheets/default_macos.qss b/ground/openpilotgcs/share/openpilotgcs/stylesheets/default_macos.qss index 55fa1b6c1..6a22ce96a 100644 --- a/ground/openpilotgcs/share/openpilotgcs/stylesheets/default_macos.qss +++ b/ground/openpilotgcs/share/openpilotgcs/stylesheets/default_macos.qss @@ -1,22 +1,2 @@ /* MacOS styles */ -QGroupBox { - border: 1px solid gray; - border-radius: 5px; - margin-top: 1ex; - font-size: 11px; - font-weight: bold; -} - -QGroupBox::title { - subcontrol-origin: margin; - subcontrol-position: top left; - padding: 0 3px; -} - -QTabWidget::pane { - margin: 1px, 1px, 1px, 1px; - border: 2px solid rgb(196, 196, 196); - border-radius: 5px; - padding: 0px; -} From 53c5b511afe63c26028d58a723bd44ae770d5094 Mon Sep 17 00:00:00 2001 From: m_thread Date: Sun, 9 Feb 2014 10:59:50 +0100 Subject: [PATCH 23/28] OP-1191 Fixed Stabilization gui issues. --- .../config/configstabilizationwidget.cpp | 22 +- .../src/plugins/config/stabilization.ui | 5652 +++-------------- 2 files changed, 1051 insertions(+), 4623 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp index 5fae05678..951f94550 100644 --- a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp @@ -117,9 +117,11 @@ ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTa addWidget(ui->pushButton_23); addWidget(ui->basicResponsivenessGroupBox); - connect(ui->basicResponsivenessGroupBox, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool))); + addWidget(ui->basicResponsivenessCheckBox); + connect(ui->basicResponsivenessCheckBox, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool))); addWidget(ui->advancedResponsivenessGroupBox); - connect(ui->advancedResponsivenessGroupBox, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool))); + addWidget(ui->advancedResponsivenessCheckBox); + connect(ui->advancedResponsivenessCheckBox, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool))); connect(this, SIGNAL(widgetContentsChanged(QWidget *)), this, SLOT(processLinkedWidgets(QWidget *))); @@ -138,7 +140,7 @@ void ConfigStabilizationWidget::refreshWidgetsValues(UAVObject *o) { ConfigTaskWidget::refreshWidgetsValues(o); - ui->basicResponsivenessGroupBox->setChecked(ui->rateRollKp_3->value() == ui->ratePitchKp_4->value() && + ui->basicResponsivenessCheckBox->setChecked(ui->rateRollKp_3->value() == ui->ratePitchKp_4->value() && ui->rateRollKi_3->value() == ui->ratePitchKi_4->value()); } @@ -169,14 +171,18 @@ void ConfigStabilizationWidget::linkCheckBoxes(bool value) ui->checkBox_2->setChecked(value); } else if (sender() == ui->checkBox_2) { ui->checkBox_8->setChecked(value); - } else if (sender() == ui->basicResponsivenessGroupBox) { - ui->advancedResponsivenessGroupBox->setChecked(!value); + } else if (sender() == ui->basicResponsivenessCheckBox) { + ui->advancedResponsivenessCheckBox->setChecked(!value); + ui->basicResponsivenessControls->setEnabled(value); + ui->advancedResponsivenessControls->setEnabled(!value); if (value) { processLinkedWidgets(ui->AttitudeResponsivenessSlider); processLinkedWidgets(ui->RateResponsivenessSlider); } - } else if (sender() == ui->advancedResponsivenessGroupBox) { - ui->basicResponsivenessGroupBox->setChecked(!value); + } else if (sender() == ui->advancedResponsivenessCheckBox) { + ui->basicResponsivenessCheckBox->setChecked(!value); + ui->basicResponsivenessControls->setEnabled(!value); + ui->advancedResponsivenessControls->setEnabled(value); } } @@ -218,7 +224,7 @@ void ConfigStabilizationWidget::processLinkedWidgets(QWidget *widget) } } - if (ui->basicResponsivenessGroupBox->isChecked()) { + if (ui->basicResponsivenessCheckBox->isChecked()) { if (widget == ui->AttitudeResponsivenessSlider) { ui->ratePitchKp_4->setValue(ui->AttitudeResponsivenessSlider->value()); } else if (widget == ui->RateResponsivenessSlider) { diff --git a/ground/openpilotgcs/src/plugins/config/stabilization.ui b/ground/openpilotgcs/src/plugins/config/stabilization.ui index a21cc236d..f33da0062 100644 --- a/ground/openpilotgcs/src/plugins/config/stabilization.ui +++ b/ground/openpilotgcs/src/plugins/config/stabilization.ui @@ -167,9 +167,6 @@ margin-top: -1px; - - - @@ -183,9 +180,9 @@ margin-top: -1px; false - true + false - + 9 @@ -198,7 +195,7 @@ margin-top: -1px; 9 - + @@ -221,21 +218,8 @@ margin-top: -1px; - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - + + QGroupBox{border: 0px;} @@ -2202,6 +2186,29 @@ border-radius: 5; + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Use Basic Configuration + + + true + + + @@ -2699,7 +2706,7 @@ border-radius: 5; true - + 0 @@ -2709,19 +2716,6 @@ border-radius: 5; 0 - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -2748,6 +2742,760 @@ border-radius: 5; + + + + + 50 + 22 + + + + + 50 + 22 + + + + Qt::StrongFocus + + + As a rule of thumb, you can set the Integral at roughly the same +value as the Kp. + + + 200 + + + 200 + + + + objname:StabilizationSettingsBankX + fieldname:YawRatePID + element:Ki + haslimits:yes + scale:0.0001 + buttongroup:1,10 + + + + + + + + + 0 + 0 + + + + + 0 + 25 + + + + Qt::StrongFocus + + + <html><head/><body><p>This adjusts how much stability your vehicle will have when flying tilted (ie forward flight) in Rate mode. A good starting point for Integral is the same as Proportional</p></body></html> + + + + + + 100 + + + 50 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 25 + + + + objname:StabilizationSettingsBankX + fieldname:YawRatePID + element:Ki + haslimits:yes + scale:0.0001 + buttongroup:1,10 + + + + + + + + + 0 + 0 + + + + + 0 + 25 + + + + Qt::StrongFocus + + + <html><head/><body><p>This adjusts how much stability your vehicle will have when flying tilted (ie forward flight) in Rate mode. A good starting point for Integral is the same as Proportional</p></body></html> + + + + + + 100 + + + 50 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 25 + + + + objname:StabilizationSettingsBankX + fieldname:PitchRatePID + element:Ki + haslimits:yes + scale:0.0001 + buttongroup:1,10 + + + + + + + + + 50 + 22 + + + + + 50 + 22 + + + + Qt::StrongFocus + + + As a rule of thumb, you can set the Integral at roughly the same +value as the Kp. + + + 200 + + + 200 + + + + objname:StabilizationSettingsBankX + fieldname:PitchRatePID + element:Ki + haslimits:yes + scale:0.0001 + buttongroup:1,10 + + + + + + + + + 0 + 0 + + + + + 0 + 16 + + + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 58 + 58 + 58 + + + + + + + 48 + 48 + 48 + + + + + + + 19 + 19 + 19 + + + + + + + 26 + 26 + 26 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 0 + 0 + 0 + + + + + + + 19 + 19 + 19 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 58 + 58 + 58 + + + + + + + 48 + 48 + 48 + + + + + + + 19 + 19 + 19 + + + + + + + 26 + 26 + 26 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 0 + 0 + 0 + + + + + + + 19 + 19 + 19 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 58 + 58 + 58 + + + + + + + 48 + 48 + 48 + + + + + + + 19 + 19 + 19 + + + + + + + 26 + 26 + 26 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 0 + 0 + 0 + + + + + + + 39 + 39 + 39 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 75 + true + + + + false + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; + + + Roll + + + Qt::AlignCenter + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -3901,170 +4649,6 @@ border-radius: 5; - - - - - 50 - 22 - - - - - 50 - 22 - - - - Qt::StrongFocus - - - Slowly raise Proportional until you start seeing clear oscillations when you fly. -Then lower the value by 5 or so. - - - 200 - - - 200 - - - - objname:StabilizationSettingsBankX - fieldname:RollRatePID - element:Kp - haslimits:yes - scale:0.0001 - buttongroup:1,10 - - - - - - - - - 0 - 0 - - - - - 78 - 16 - - - - - - - Proportional - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 0 - - - - - 0 - 25 - - - - Qt::StrongFocus - - - <html><head/><body><p>This adjusts how much leveling stability is set into Rate mode (inner loop). Too much will make your vehicle oscillate in Rate mode.</p></body></html> - - - - - - 100 - - - 50 - - - Qt::Horizontal - - - QSlider::TicksBelow - - - 25 - - - - objname:StabilizationSettingsBankX - fieldname:YawRatePID - element:Kp - haslimits:yes - scale:0.0001 - buttongroup:1,10 - - - - - - - - - 0 - 0 - - - - - 0 - 25 - - - - Qt::StrongFocus - - - <html><head/><body><p>This adjusts how much leveling stability is set into Rate mode (inner loop). Too much will make your vehicle oscillate in Rate mode.</p></body></html> - - - - - - 100 - - - 50 - - - Qt::Horizontal - - - QSlider::TicksBelow - - - 25 - - - - objname:StabilizationSettingsBankX - fieldname:PitchRatePID - element:Kp - haslimits:yes - scale:0.0001 - buttongroup:1,10 - - - - @@ -4251,8 +4835,8 @@ value as the Kp. - - + + 50 @@ -4269,8 +4853,8 @@ value as the Kp. Qt::StrongFocus - As a rule of thumb, you can set the Integral at roughly the same -value as the Kp. + Slowly raise Proportional until you start seeing clear oscillations when you fly. +Then lower the value by 5 or so. 200 @@ -4281,8 +4865,8 @@ value as the Kp. objname:StabilizationSettingsBankX - fieldname:YawRatePID - element:Ki + fieldname:RollRatePID + element:Kp haslimits:yes scale:0.0001 buttongroup:1,10 @@ -4290,707 +4874,130 @@ value as the Kp. - - + + - + 0 0 - 0 - 25 - - - - Qt::StrongFocus - - - <html><head/><body><p>This adjusts how much stability your vehicle will have when flying tilted (ie forward flight) in Rate mode. A good starting point for Integral is the same as Proportional</p></body></html> - - - - - - 100 - - - 50 - - - Qt::Horizontal - - - QSlider::TicksBelow - - - 25 - - - - objname:StabilizationSettingsBankX - fieldname:YawRatePID - element:Ki - haslimits:yes - scale:0.0001 - buttongroup:1,10 - - - - - - - - - 0 - 0 - - - - - 0 - 25 - - - - Qt::StrongFocus - - - <html><head/><body><p>This adjusts how much stability your vehicle will have when flying tilted (ie forward flight) in Rate mode. A good starting point for Integral is the same as Proportional</p></body></html> - - - - - - 100 - - - 50 - - - Qt::Horizontal - - - QSlider::TicksBelow - - - 25 - - - - objname:StabilizationSettingsBankX - fieldname:PitchRatePID - element:Ki - haslimits:yes - scale:0.0001 - buttongroup:1,10 - - - - - - - - - 50 - 22 - - - - - 50 - 22 - - - - Qt::StrongFocus - - - As a rule of thumb, you can set the Integral at roughly the same -value as the Kp. - - - 200 - - - 200 - - - - objname:StabilizationSettingsBankX - fieldname:PitchRatePID - element:Ki - haslimits:yes - scale:0.0001 - buttongroup:1,10 - - - - - - - - - 0 - 0 - - - - - 0 + 78 16 - - - - - - - 255 - 255 - 255 - - - - - - - - - 74 - 74 - 74 - - - - - 36 - 36 - 36 - - - - - - - - - 58 - 58 - 58 - - - - - - - 48 - 48 - 48 - - - - - - - 19 - 19 - 19 - - - - - - - 26 - 26 - 26 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 74 - 74 - 74 - - - - - 36 - 36 - 36 - - - - - - - - - - - 74 - 74 - 74 - - - - - 36 - 36 - 36 - - - - - - - - - 0 - 0 - 0 - - - - - - - 19 - 19 - 19 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 255 - 255 - 255 - - - - - - - - - 74 - 74 - 74 - - - - - 36 - 36 - 36 - - - - - - - - - 58 - 58 - 58 - - - - - - - 48 - 48 - 48 - - - - - - - 19 - 19 - 19 - - - - - - - 26 - 26 - 26 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 74 - 74 - 74 - - - - - 36 - 36 - 36 - - - - - - - - - - - 74 - 74 - 74 - - - - - 36 - 36 - 36 - - - - - - - - - 0 - 0 - 0 - - - - - - - 19 - 19 - 19 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 255 - 255 - 255 - - - - - - - - - 74 - 74 - 74 - - - - - 36 - 36 - 36 - - - - - - - - - 58 - 58 - 58 - - - - - - - 48 - 48 - 48 - - - - - - - 19 - 19 - 19 - - - - - - - 26 - 26 - 26 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - 255 - 255 - 255 - - - - - - - - - 74 - 74 - 74 - - - - - 36 - 36 - 36 - - - - - - - - - - - 74 - 74 - 74 - - - - - 36 - 36 - 36 - - - - - - - - - 0 - 0 - 0 - - - - - - - 39 - 39 - 39 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 75 - true - - - - false - - background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); -color: rgb(255, 255, 255); -border-radius: 5; + - Roll + Proportional - Qt::AlignCenter + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + + + 0 + 0 + + + + + 0 + 25 + + + + Qt::StrongFocus + + + <html><head/><body><p>This adjusts how much leveling stability is set into Rate mode (inner loop). Too much will make your vehicle oscillate in Rate mode.</p></body></html> + + + + + + 100 + + + 50 + Qt::Horizontal - + + QSlider::TicksBelow + + + 25 + + + + objname:StabilizationSettingsBankX + fieldname:YawRatePID + element:Kp + haslimits:yes + scale:0.0001 + buttongroup:1,10 + + + + + + + + + 0 + 0 + + + - 40 - 20 + 0 + 25 - + + Qt::StrongFocus + + + <html><head/><body><p>This adjusts how much leveling stability is set into Rate mode (inner loop). Too much will make your vehicle oscillate in Rate mode.</p></body></html> + + + + + + 100 + + + 50 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 25 + + + + objname:StabilizationSettingsBankX + fieldname:PitchRatePID + element:Kp + haslimits:yes + scale:0.0001 + buttongroup:1,10 + + + @@ -5096,520 +5103,6 @@ border-radius: 5; 195 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 251 - 251 - 251 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 251 - 251 - 251 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 124 - 124 - 124 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 124 - 124 - 124 - - - - - - - 255 - 255 - 255 - - - - - - - 124 - 124 - 124 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 248 - 248 - 248 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - false @@ -8344,7 +7837,7 @@ border-radius: 5; 0 0 - 553 + 784 733 @@ -8390,520 +7883,6 @@ border-radius: 5; 16777215 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 251 - 251 - 251 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 251 - 251 - 251 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 124 - 124 - 124 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 124 - 124 - 124 - - - - - - - 255 - 255 - 255 - - - - - - - 124 - 124 - 124 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 248 - 248 - 248 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - Responsiveness @@ -8911,7 +7890,7 @@ border-radius: 5; Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - true + false false @@ -8932,62 +7911,11 @@ border-radius: 5; 6 - - - - Qt::Horizontal + + + + false - - QSizePolicy::Expanding - - - - 632 - 20 - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Reset all values to GCS defaults - - - - - - Default - - - - objname:StabilizationSettings - button:default - buttongroup:6 - - - - - - 0 @@ -11728,596 +10656,21 @@ border-radius: 5; - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 251 - 251 - 251 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 251 - 251 - 251 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 124 - 124 - 124 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 124 - 124 - 124 - - - - - - - 255 - 255 - 255 - - - - - - - 124 - 124 - 124 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 248 - 248 - 248 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - Rate Stabilization (Inner Loop) - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - false - - - - 9 - - - 9 - - - 9 - - - 9 - - - 6 - - - - - Qt::Horizontal - - - - 497 - 20 - - - - - - - - <html><head/><body><p>Link roll &amp; pitch values together, thus giving the same value for each when setting up a symetrical vehicle that requires both to be the same.</p></body></html> - - - + + + + + 0 + 0 + - Link Roll and Pitch + Use Advanced Configuration - - + + 0 @@ -12349,11 +10702,72 @@ border-radius: 5; objname:StabilizationSettings button:default - buttongroup:4 + buttongroup:6 + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Rate Stabilization (Inner Loop) + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + false + + + + 9 + + + 9 + + + 9 + + + 9 + + + 6 + @@ -15061,6 +13475,70 @@ border-radius: 5; + + + + Qt::Horizontal + + + + 497 + 20 + + + + + + + + <html><head/><body><p>Link roll &amp; pitch values together, thus giving the same value for each when setting up a symetrical vehicle that requires both to be the same.</p></body></html> + + + + + + Link Roll and Pitch + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Reset all values to GCS defaults + + + + + + Default + + + + objname:StabilizationSettings + button:default + buttongroup:4 + + + + @@ -15084,520 +13562,6 @@ border-radius: 5; 16777215 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 251 - 251 - 251 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 251 - 251 - 251 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 124 - 124 - 124 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 124 - 124 - 124 - - - - - - - 255 - 255 - 255 - - - - - - - 124 - 124 - 124 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 248 - 248 - 248 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - false @@ -18335,8 +16299,8 @@ border-radius: 5; 0 0 - 756 - 562 + 798 + 705 @@ -23450,520 +21414,6 @@ border-radius: 5; - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 251 - 251 - 251 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 251 - 251 - 251 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 124 - 124 - 124 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 124 - 124 - 124 - - - - - - - 255 - 255 - 255 - - - - - - - 124 - 124 - 124 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 248 - 248 - 248 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - false @@ -26466,8 +23916,8 @@ border-radius: 5; 0 0 - 731 - 435 + 798 + 705 @@ -27312,8 +24762,8 @@ border-radius: 5; 0 0 - 391 - 518 + 798 + 705 @@ -27337,520 +24787,6 @@ border-radius: 5; 16777215 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 251 - 251 - 251 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 251 - 251 - 251 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 124 - 124 - 124 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 124 - 124 - 124 - - - - - - - 255 - 255 - 255 - - - - - - - 124 - 124 - 124 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 248 - 248 - 248 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - Tuning @@ -29264,520 +26200,6 @@ border-radius: 5; 16777215 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 251 - 251 - 251 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 0 - 0 - 0 - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 251 - 251 - 251 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - - - - 124 - 124 - 124 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 255 - 255 - 255 - - - - - - - 251 - 251 - 251 - - - - - - - 124 - 124 - 124 - - - - - - - 165 - 165 - 165 - - - - - - - 124 - 124 - 124 - - - - - - - 255 - 255 - 255 - - - - - - - 124 - 124 - 124 - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - - - 243 - 243 - 243 - - - - - 250 - 250 - 250 - - - - - - - - - 0 - 0 - 0 - - - - - - - 248 - 248 - 248 - - - - - - - 255 - 255 - 220 - - - - - - - 0 - 0 - 0 - - - - - - Vario Altitude From 277410061afe0c23d2435d3668494588fd4a4317 Mon Sep 17 00:00:00 2001 From: Fredrik Arvidsson Date: Tue, 28 Jan 2014 19:41:07 +0100 Subject: [PATCH 24/28] OP-1166 Channel number dropdowns not initialized properly. --- .../src/plugins/config/configinputwidget.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 002b81fff..c6f7313a6 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -82,12 +82,13 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : InputChannelForm *inpForm = new InputChannelForm(this, index == 0); ui->channelSettings->layout()->addWidget(inpForm); // Add the row to the UI inpForm->setName(name); - addWidgetBinding("ManualControlSettings", "ChannelGroups", inpForm->ui->channelGroup, index); - addWidgetBinding("ManualControlSettings", "ChannelNumber", inpForm->ui->channelNumber, index); - // The order of the following three binding calls is important. Since the values will be populated + // The order of the following binding calls is important. Since the values will be populated // in reverse order of the binding order otherwise the 'Reversed' logic will floor the neutral value - // to the max value ( which is smaller than the neutral value when reversed ) + // to the max value ( which is smaller than the neutral value when reversed ) and the channel number + // will not be set correctly. + addWidgetBinding("ManualControlSettings", "ChannelNumber", inpForm->ui->channelNumber, index); + addWidgetBinding("ManualControlSettings", "ChannelGroups", inpForm->ui->channelGroup, index); addWidgetBinding("ManualControlSettings", "ChannelNeutral", inpForm->ui->channelNeutral, index); addWidgetBinding("ManualControlSettings", "ChannelNeutral", inpForm->ui->neutralValue, index); addWidgetBinding("ManualControlSettings", "ChannelMin", inpForm->ui->channelMin, index); From 64d0f861b1238ebe2996a56939f9fb9d9ebd8ce0 Mon Sep 17 00:00:00 2001 From: m_thread Date: Sun, 9 Feb 2014 11:36:57 +0100 Subject: [PATCH 25/28] OP-1191 Gui fixes to Output configuration gui. --- .../openpilotgcs/src/plugins/config/output.ui | 73 +-- .../src/plugins/config/outputchannelform.ui | 443 ++++++++++-------- 2 files changed, 254 insertions(+), 262 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/output.ui b/ground/openpilotgcs/src/plugins/config/output.ui index 11a3fb900..aa2f892c7 100644 --- a/ground/openpilotgcs/src/plugins/config/output.ui +++ b/ground/openpilotgcs/src/plugins/config/output.ui @@ -160,21 +160,6 @@ Output Update Speed - - 12 - - - 12 - - - 12 - - - 12 - - - 6 - @@ -197,12 +182,6 @@ - - - 75 - true - - Channel: @@ -415,12 +394,6 @@ Leave at 50Hz for fixed wing. 20 - - - 75 - true - - Update rate: @@ -677,21 +650,9 @@ Leave at 50Hz for fixed wing. - + Output Channel Configuration - - 12 - - - 12 - - - 12 - - - 12 - @@ -701,24 +662,12 @@ Leave at 50Hz for fixed wing. - - 12 - - - 12 - - - 12 - - - 12 - 519 - 0 + 20 @@ -749,7 +698,7 @@ Leave at 50Hz for fixed wing. 20 - 542 + 0 @@ -766,21 +715,9 @@ Leave at 50Hz for fixed wing. - + Live Testing - - 12 - - - 12 - - - 12 - - - 12 - @@ -789,7 +726,7 @@ Leave at 50Hz for fixed wing. 105 - 0 + 20 diff --git a/ground/openpilotgcs/src/plugins/config/outputchannelform.ui b/ground/openpilotgcs/src/plugins/config/outputchannelform.ui index 3b4079ce7..84ee3a2be 100644 --- a/ground/openpilotgcs/src/plugins/config/outputchannelform.ui +++ b/ground/openpilotgcs/src/plugins/config/outputchannelform.ui @@ -23,29 +23,7 @@ 12 - - - - - 0 - 0 - - - - - 0 - 25 - - - - Current value of slider. - - - 0000 - - - - + @@ -55,7 +33,7 @@ - 0 + 45 20 @@ -81,22 +59,55 @@ margin:1px; - - + + + + + 0 + 25 + + + + Qt::StrongFocus + + + Maximum PWM value, beware of not overdriving your servo. + + + 9999 + + + + + - + 0 0 - 110 - 25 + 0 + 20 + + + 75 + false + true + + + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; +font:bold; +margin:1px; + - TextLabel + Neutral (slowest for motor) Qt::AlignCenter @@ -145,110 +156,21 @@ margin:1px; - - - - - 0 - 0 - + + + + Qt::Horizontal - + + QSizePolicy::Minimum + + - 20 - 25 - - - - Channel Number - - - Qt::LeftToRight - - - TextLabel - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 0 - 25 - - - - Qt::StrongFocus - - - Minimum PWM value, beware of not overdriving your servo. - - - 9999 - - - - - - - - 0 - 0 - - - - - 45 - 25 - - - - Qt::StrongFocus - - - Check to invert the channel. - - - - - - - - 0 - 0 - - - - - 0 + 5 20 - - - 75 - false - true - - - - background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); -color: rgb(255, 255, 255); -border-radius: 5; -font:bold; -margin:1px; - - - Neutral (slowest for motor) - - - Qt::AlignCenter - - + @@ -286,26 +208,29 @@ margin:1px; - - - - Qt::Horizontal - - - QSizePolicy::Minimum - - + + + - 5 - 20 + 0 + 25 - + + Qt::StrongFocus + + + Minimum PWM value, beware of not overdriving your servo. + + + 9999 + + - - + + - + 0 0 @@ -313,28 +238,17 @@ margin:1px; 0 - 20 + 25 - - - 75 - false - true - + + Qt::StrongFocus - - background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); -color: rgb(255, 255, 255); -border-radius: 5; -font:bold; -margin:1px; + + 9999 - - Min - - - Qt::AlignCenter + + Qt::Horizontal @@ -374,30 +288,33 @@ margin:1px; - - + + - + 0 0 - 45 + 20 25 - - Qt::StrongFocus - - Output mode + Channel Number + + + TextLabel + + + Qt::AlignCenter - - + + Qt::Horizontal @@ -412,6 +329,28 @@ margin:1px; + + + + + 0 + 0 + + + + + 110 + 25 + + + + TextLabel + + + Qt::AlignCenter + + + @@ -441,17 +380,17 @@ font:bold; margin:1px; - Rev + Reversed Qt::AlignCenter - - + + - + 0 0 @@ -462,34 +401,152 @@ margin:1px; 25 - - Qt::StrongFocus + + Current value of slider. - - 9999 - - - Qt::Horizontal + + 0000 - - + + + + + 0 + 0 + + 0 - 25 + 20 - - Qt::StrongFocus + + + 75 + false + true + - - Maximum PWM value, beware of not overdriving your servo. + + background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255)); +color: rgb(255, 255, 255); +border-radius: 5; +font:bold; +margin:1px; - - 9999 + + Min + + Qt::AlignCenter + + + + + + + + 75 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Qt::StrongFocus + + + Check to invert the channel. + + + + + + + + + + + 45 + 0 + + + + QFrame::NoFrame + + + QFrame::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Qt::StrongFocus + + + Output mode + + + + @@ -498,8 +555,6 @@ margin:1px; actuatorMin actuatorNeutral actuatorMax - actuatorRev - actuatorLink
From 9f02d3c17098a2bf00edfd51c92a675ea57d65e8 Mon Sep 17 00:00:00 2001 From: m_thread Date: Sun, 9 Feb 2014 14:08:07 +0100 Subject: [PATCH 26/28] OP-1191 Added some tooltips and fixed tooltip font color in css to make it work in Fusion style on Linux. --- .../share/openpilotgcs/stylesheets/default_linux.qss | 4 ++++ ground/openpilotgcs/src/plugins/config/stabilization.ui | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/ground/openpilotgcs/share/openpilotgcs/stylesheets/default_linux.qss b/ground/openpilotgcs/share/openpilotgcs/stylesheets/default_linux.qss index edc9dc8cd..863ad4f2f 100644 --- a/ground/openpilotgcs/share/openpilotgcs/stylesheets/default_linux.qss +++ b/ground/openpilotgcs/share/openpilotgcs/stylesheets/default_linux.qss @@ -1 +1,5 @@ /* Linux styles */ + +QToolTip { + color: black; + } diff --git a/ground/openpilotgcs/src/plugins/config/stabilization.ui b/ground/openpilotgcs/src/plugins/config/stabilization.ui index f33da0062..f89f15087 100644 --- a/ground/openpilotgcs/src/plugins/config/stabilization.ui +++ b/ground/openpilotgcs/src/plugins/config/stabilization.ui @@ -25391,6 +25391,9 @@ border-radius: 5; + + <html><head/><body><p>How fast the vehicle should climb or descent to compensate a certain altitude difference. higher values could result in more accurate altitude hold but also more violent control actions, lower values are safer and ensure smoother flight. The default value should be fine for the majority of crafts.</p></body></html> + 100 @@ -25417,6 +25420,9 @@ border-radius: 5; + + <html><head/><body><p>How much the vehicle should throttle up or down to compensate or achieve a certain vertical speed. Higher values lead to more aggressive throttle changes and could lead to oscillations. This is the most likely candidate to change depending on the crafts engine thrust. Heavy craft with weak engines might require higher values.</p></body></html> + 100 @@ -25443,6 +25449,9 @@ border-radius: 5; + + <html><head/><body><p>How fast the vehicle should adjust its neutral throttle estimation. Altitude assumes that when engaged the throttle is in the range required to hover. If the throttle is a lot higher or lower, it needs to adjust this &quot;throttle trim&quot; Higher values make it do this adjustment faster, but this could lead to ugly oscillations. Leave at default unless you know what you are doing.</p></body></html> + 1000 From 184b161d45b53432ea982be3fe72fbfbb52a4ee1 Mon Sep 17 00:00:00 2001 From: m_thread Date: Sun, 9 Feb 2014 17:39:16 +0100 Subject: [PATCH 27/28] OP-1191 Fixed weirdness showing in 'Edit Gadgets Mode' after switch to Fusion style. --- .../coreplugin/uavgadgetmanager/uavgadgetview.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetmanager/uavgadgetview.cpp b/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetmanager/uavgadgetview.cpp index 86ec14f21..96def978a 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetmanager/uavgadgetview.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/uavgadgetmanager/uavgadgetview.cpp @@ -104,7 +104,7 @@ UAVGadgetView::UAVGadgetView(Core::UAVGadgetManager *uavGadgetManager, IUAVGadge ++index; } - m_defaultToolBar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + m_defaultToolBar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); m_activeToolBar = m_defaultToolBar; QHBoxLayout *toolBarLayout = new QHBoxLayout(m_toolBar); @@ -115,7 +115,7 @@ UAVGadgetView::UAVGadgetView(Core::UAVGadgetManager *uavGadgetManager, IUAVGadge m_toolBar->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::MinimumExpanding); QWidget *spacerWidget = new QWidget(this); - spacerWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + spacerWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); m_activeLabel->setTextFormat(Qt::RichText); m_activeLabel->setText("" + tr("Active") + ""); @@ -124,9 +124,10 @@ UAVGadgetView::UAVGadgetView(Core::UAVGadgetManager *uavGadgetManager, IUAVGadge m_closeButton->setIcon(QIcon(":/core/images/closebutton.png")); m_top = new Utils::StyledBar(this); + m_top->setMaximumHeight(35); QHBoxLayout *toplayout = new QHBoxLayout(m_top); - toplayout->setSpacing(0); - toplayout->setMargin(0); + toplayout->setSpacing(4); + toplayout->setMargin(4); toplayout->addWidget(m_uavGadgetList); toplayout->addWidget(m_toolBar); // Custom toolbar stretches toplayout->addWidget(spacerWidget); From 3e6192f2d162cdbe31c073dcd8985c0f2d69b175 Mon Sep 17 00:00:00 2001 From: m_thread Date: Sun, 9 Feb 2014 19:12:45 +0100 Subject: [PATCH 28/28] OP-1191 Uncrustify. --- .../src/plugins/config/configpipxtremewidget.cpp | 10 +++++----- .../src/plugins/config/configvehicletypewidget.cpp | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp b/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp index ce0616102..6595b6366 100644 --- a/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configpipxtremewidget.cpp @@ -121,9 +121,9 @@ void ConfigPipXtremeWidget::updateStatus(UAVObject *object) // Update the link state UAVObjectField *linkField = object->getField("LinkState"); m_oplink->LinkState->setText(linkField->getValue().toString()); - bool linkConnected = (linkField->getValue() == linkField->getOptions().at(OPLinkStatus::LINKSTATE_CONNECTED)); + bool linkConnected = (linkField->getValue() == linkField->getOptions().at(OPLinkStatus::LINKSTATE_CONNECTED)); bool modemEnabled = linkConnected || (linkField->getValue() == linkField->getOptions().at(OPLinkStatus::LINKSTATE_DISCONNECTED)) || - (linkField->getValue() == linkField->getOptions().at(OPLinkStatus::LINKSTATE_ENABLED)); + (linkField->getValue() == linkField->getOptions().at(OPLinkStatus::LINKSTATE_ENABLED)); UAVObjectField *pairRssiField = object->getField("PairSignalStrengths"); @@ -143,7 +143,7 @@ void ConfigPipXtremeWidget::updateStatus(UAVObject *object) m_oplink->PairSignalStrengthLabel1->setText(QString("%1dB").arg(m_oplink->PairSignalStrengthBar1->value())); pairid = pairIdField->getValue(1).toUInt(); - bound = (pairid == boundPairId); + bound = (pairid == boundPairId); m_oplink->PairID2->setText(QString::number(pairid, 16).toUpper()); m_oplink->PairID2->setEnabled(false); m_oplink->Bind2->setText(bound ? tr("Unbind") : tr("Bind")); @@ -152,7 +152,7 @@ void ConfigPipXtremeWidget::updateStatus(UAVObject *object) m_oplink->PairSignalStrengthLabel2->setText(QString("%1dB").arg(m_oplink->PairSignalStrengthBar2->value())); pairid = pairIdField->getValue(2).toUInt(); - bound = (pairid == boundPairId); + bound = (pairid == boundPairId); m_oplink->PairID3->setText(QString::number(pairid, 16).toUpper()); m_oplink->PairID3->setEnabled(false); m_oplink->Bind3->setText(bound ? tr("Unbind") : tr("Bind")); @@ -161,7 +161,7 @@ void ConfigPipXtremeWidget::updateStatus(UAVObject *object) m_oplink->PairSignalStrengthLabel3->setText(QString("%1dB").arg(m_oplink->PairSignalStrengthBar3->value())); pairid = pairIdField->getValue(3).toUInt(); - bound = (pairid == boundPairId); + bound = (pairid == boundPairId); m_oplink->PairID4->setText(QString::number(pairid, 16).toUpper()); m_oplink->PairID4->setEnabled(false); m_oplink->Bind4->setText(bound ? tr("Unbind") : tr("Bind")); diff --git a/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp b/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp index 4bfda4563..8a49d6421 100644 --- a/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp @@ -197,7 +197,7 @@ void ConfigVehicleTypeWidget::refreshWidgetsValues(UAVObject *o) // is not ideal, but there you go. QString frameType = field->getValue().toString(); - int category = frameCategory(frameType); + int category = frameCategory(frameType); m_aircraft->aircraftType->setCurrentIndex(category); VehicleConfig *vehicleConfig = getVehicleConfigWidget(category); @@ -303,13 +303,13 @@ VehicleConfig *ConfigVehicleTypeWidget::createVehicleConfigWidget(int frameCateg { if (frameCategory == ConfigVehicleTypeWidget::FIXED_WING) { return new ConfigFixedWingWidget(); - } else if (frameCategory == ConfigVehicleTypeWidget::MULTIROTOR){ + } else if (frameCategory == ConfigVehicleTypeWidget::MULTIROTOR) { return new ConfigMultiRotorWidget(); } else if (frameCategory == ConfigVehicleTypeWidget::HELICOPTER) { return new ConfigCcpmWidget(); } else if (frameCategory == ConfigVehicleTypeWidget::GROUND) { return new ConfigGroundVehicleWidget(); - } else if (frameCategory ==ConfigVehicleTypeWidget::CUSTOM) { + } else if (frameCategory == ConfigVehicleTypeWidget::CUSTOM) { return new ConfigCustomWidget(); } return NULL;