diff --git a/src/AutoPilotPlugins/APM/APMSafetyComponent.h b/src/AutoPilotPlugins/APM/APMSafetyComponent.h index 805e97ea36fe34755bdc317d894a5214ca04a3e0..bf0682036ee128b8504425bc2b2c3780ed3a669b 100644 --- a/src/AutoPilotPlugins/APM/APMSafetyComponent.h +++ b/src/AutoPilotPlugins/APM/APMSafetyComponent.h @@ -45,7 +45,8 @@ public: QUrl setupSource(void) const final; QUrl summaryQmlSource(void) const final; QString prerequisiteSetup(void) const final; - + bool allowSetupWhileArmed(void) const final { return true; } + private: const QString _name; QVariantList _summaryItems; diff --git a/src/AutoPilotPlugins/APM/APMTuningComponent.h b/src/AutoPilotPlugins/APM/APMTuningComponent.h index 90fcfe50819dd0d6ae6655a5d21b4444a8cc2bb8..ac18f0b6b57303cfafbf5df1c715a4fec02315bb 100644 --- a/src/AutoPilotPlugins/APM/APMTuningComponent.h +++ b/src/AutoPilotPlugins/APM/APMTuningComponent.h @@ -45,7 +45,8 @@ public: QUrl setupSource(void) const final; QUrl summaryQmlSource(void) const final; QString prerequisiteSetup(void) const final; - + bool allowSetupWhileArmed(void) const final { return true; } + private: const QString _name; QVariantList _summaryItems; diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponent.h b/src/AutoPilotPlugins/PX4/PX4TuningComponent.h index 89aeb4097fd2abae2daee74cb54c71b008753cc0..599b287d48618a7ee3bcf6cd375616e2ab4c0e13 100644 --- a/src/AutoPilotPlugins/PX4/PX4TuningComponent.h +++ b/src/AutoPilotPlugins/PX4/PX4TuningComponent.h @@ -34,18 +34,19 @@ public: PX4TuningComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); // Virtuals from VehicleComponent - virtual QStringList setupCompleteChangedTriggerList(void) const; + QStringList setupCompleteChangedTriggerList(void) const final; // Virtuals from VehicleComponent - virtual QString name(void) const; - virtual QString description(void) const; - virtual QString iconResource(void) const; - virtual bool requiresSetup(void) const; - virtual bool setupComplete(void) const; - virtual QUrl setupSource(void) const; - virtual QUrl summaryQmlSource(void) const; - virtual QString prerequisiteSetup(void) const; - + QString name(void) const final; + QString description(void) const final; + QString iconResource(void) const final; + bool requiresSetup(void) const final; + bool setupComplete(void) const final; + QUrl setupSource(void) const final; + QUrl summaryQmlSource(void) const final; + QString prerequisiteSetup(void) const final; + bool allowSetupWhileArmed(void) const final { return true; } + private: const QString _name; }; diff --git a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopter.qml b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopter.qml index ae3e5116da502bedd43f80b016db41a3c8b57ac4..9ec2de80ccda85e33891d4ba37f1b1b1104cdc4b 100644 --- a/src/AutoPilotPlugins/PX4/PX4TuningComponentCopter.qml +++ b/src/AutoPilotPlugins/PX4/PX4TuningComponentCopter.qml @@ -27,7 +27,8 @@ import QtQuick.Controls 1.4 import QGroundControl.Controls 1.0 FactSliderPanel { - anchors.fill: parent + anchors.fill: parent + panelTitle: "Tuning" sliderModel: ListModel { ListElement { diff --git a/src/AutoPilotPlugins/PX4/SafetyComponent.h b/src/AutoPilotPlugins/PX4/SafetyComponent.h index 9cbf37e2b08e3fe90171027a99f2898a34621118..77208b6e8b2f2c97e11ef1ab0bd416ad51f0d436 100644 --- a/src/AutoPilotPlugins/PX4/SafetyComponent.h +++ b/src/AutoPilotPlugins/PX4/SafetyComponent.h @@ -39,18 +39,19 @@ public: SafetyComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); // Virtuals from VehicleComponent - virtual QStringList setupCompleteChangedTriggerList(void) const; + QStringList setupCompleteChangedTriggerList(void) const; // Virtuals from VehicleComponent - virtual QString name(void) const; - virtual QString description(void) const; - virtual QString iconResource(void) const; - virtual bool requiresSetup(void) const; - virtual bool setupComplete(void) const; - virtual QUrl setupSource(void) const; - virtual QUrl summaryQmlSource(void) const; - virtual QString prerequisiteSetup(void) const; - + QString name(void) const final; + QString description(void) const final; + QString iconResource(void) const final; + bool requiresSetup(void) const final; + bool setupComplete(void) const final; + QUrl setupSource(void) const final; + QUrl summaryQmlSource(void) const final; + QString prerequisiteSetup(void) const final; + bool allowSetupWhileArmed(void) const final { return true; } + private: const QString _name; QVariantList _summaryItems; diff --git a/src/QmlControls/FactSliderPanel.qml b/src/QmlControls/FactSliderPanel.qml index b1d132122f78aca06df10d3ffe3f0621e7440a29..6b6bfe1cce4306c76907a76ea1f8f36ad3e03f23 100644 --- a/src/QmlControls/FactSliderPanel.qml +++ b/src/QmlControls/FactSliderPanel.qml @@ -80,30 +80,31 @@ QGCView { font.weight: Font.DemiBold } - Rectangle { - id: sliderRect - anchors.topMargin: _margins / 2 + + Column { + anchors.margins: _margins anchors.left: parent.left anchors.right: parent.right anchors.top: panelLabel.bottom - height: sliderColumns.y + sliderColumns.height + _margins - color: palette.windowShade + spacing: _margins - Column { - id: sliderColumns - anchors.margins: _margins - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top - spacing: _margins + Repeater { + id: sliderRepeater + model: sliderModel - Repeater { - id: sliderRepeater - model: sliderModel + Rectangle { + id: sliderRect + anchors.left: parent.left + anchors.right: parent.right + height: sliderColumn.y + sliderColumn.height + _margins + color: palette.windowShade Column { - anchors.left: parent.left - anchors.right: parent.right + id: sliderColumn + anchors.margins: _margins + anchors.left: parent.left + anchors.right: parent.right + anchors.top: sliderRect.top property alias sliderValue: slider.value @@ -132,11 +133,11 @@ QGCView { fact.value = value } } - } + } // Slider } // Column - } // Repeater - } // Column - } // Rectangle + } // Rectangle + } // Repeater + } // Column } // QGCFlickable } // QGCViewPanel } // QGCView diff --git a/src/VehicleSetup/SetupView.qml b/src/VehicleSetup/SetupView.qml index fb030cd167ebafd5fe77b2bd6185d70d200ee371..cb4ee371d057cb89e8686769fa64b0a8dcdf73cb 100644 --- a/src/VehicleSetup/SetupView.qml +++ b/src/VehicleSetup/SetupView.qml @@ -101,7 +101,7 @@ Rectangle { function showVehicleComponentPanel(vehicleComponent) { - if (multiVehicleManager.activeVehicle.armed) { + if (multiVehicleManager.activeVehicle.armed && !vehicleComponent.allowSetupWhileArmed) { _messagePanelText = _armedVehicleText panelLoader.sourceComponent = messagePanelComponent } else { diff --git a/src/VehicleSetup/VehicleComponent.cc b/src/VehicleSetup/VehicleComponent.cc index 4331692637d63403f5db4c5cfc8bee5bd3689c8b..a01163483d8ea1c5717fcd3e8912d124c1a444e4 100644 --- a/src/VehicleSetup/VehicleComponent.cc +++ b/src/VehicleSetup/VehicleComponent.cc @@ -73,3 +73,9 @@ void VehicleComponent::_triggerUpdated(QVariant /*value*/) { emit setupCompleteChanged(setupComplete()); } + +bool VehicleComponent::allowSetupWhileArmed(void) const +{ + // Default is to not allow setup while armed + return false; +} diff --git a/src/VehicleSetup/VehicleComponent.h b/src/VehicleSetup/VehicleComponent.h index 3e4fba29322c1c26ca42c104d02847417202fc71..7a2f9fce63669c03ad34cfc72d568bca189a15a6 100644 --- a/src/VehicleSetup/VehicleComponent.h +++ b/src/VehicleSetup/VehicleComponent.h @@ -42,14 +42,15 @@ class VehicleComponent : public QObject { Q_OBJECT - Q_PROPERTY(QString name READ name CONSTANT) - Q_PROPERTY(QString description READ description CONSTANT) - Q_PROPERTY(bool requiresSetup READ requiresSetup CONSTANT) - Q_PROPERTY(bool setupComplete READ setupComplete STORED false NOTIFY setupCompleteChanged) - Q_PROPERTY(QString iconResource READ iconResource CONSTANT) - Q_PROPERTY(QUrl setupSource READ setupSource CONSTANT) - Q_PROPERTY(QUrl summaryQmlSource READ summaryQmlSource CONSTANT) - Q_PROPERTY(QString prerequisiteSetup READ prerequisiteSetup) + Q_PROPERTY(QString name READ name CONSTANT) + Q_PROPERTY(QString description READ description CONSTANT) + Q_PROPERTY(bool requiresSetup READ requiresSetup CONSTANT) + Q_PROPERTY(bool setupComplete READ setupComplete STORED false NOTIFY setupCompleteChanged) + Q_PROPERTY(QString iconResource READ iconResource CONSTANT) + Q_PROPERTY(QUrl setupSource READ setupSource CONSTANT) + Q_PROPERTY(QUrl summaryQmlSource READ summaryQmlSource CONSTANT) + Q_PROPERTY(QString prerequisiteSetup READ prerequisiteSetup CONSTANT) + Q_PROPERTY(bool allowSetupWhileArmed READ allowSetupWhileArmed CONSTANT) public: VehicleComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); @@ -63,6 +64,9 @@ public: virtual QUrl setupSource(void) const = 0; virtual QUrl summaryQmlSource(void) const = 0; virtual QString prerequisiteSetup(void) const = 0; + + // @return true: Setup panel can be shown while vehicle is armed + virtual bool allowSetupWhileArmed(void) const; virtual void addSummaryQmlComponent(QQmlContext* context, QQuickItem* parent); diff --git a/src/comm/PX4MockLink.params b/src/comm/PX4MockLink.params index 124acd0b8aef643377e807e0a191357b5f38bb47..81dbb44862c4b95cb9bb05bb8cd3ccd6df9916cb 100644 --- a/src/comm/PX4MockLink.params +++ b/src/comm/PX4MockLink.params @@ -282,6 +282,7 @@ 1 50 MPC_MANTHR_MIN 0.080 9 1 50 MPC_THR_MAX 1 9 1 50 MPC_THR_MIN 0.1 9 +1 50 MPC_THR_HOVER 0.5 9 1 50 MPC_TILTMAX_AIR 45 9 1 50 MPC_TILTMAX_LND 15 9 1 50 MPC_XY_FF 0.5 9