diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc
index f96b3370fb87393301ae44ce5f98460f9789093f..1e687daefaf8f5fce14bb5f3e61f769b0cd51761 100644
--- a/qgroundcontrol.qrc
+++ b/qgroundcontrol.qrc
@@ -235,7 +235,9 @@
files/QLoggingCategory/qtlogging.ini
+
+
src/test.qml
qml/QGroundControl/FactControls/qmldir
@@ -254,7 +256,15 @@
src/VehicleSetup/SetupPane.qml
src/AutoPilotPlugins/PX4/SafetyComponent.qml
+
+ src/AutoPilotPlugins/PX4/SafetyComponentSummary.qml
+ src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml
+ src/AutoPilotPlugins/PX4/RadioComponentSummary.qml
+ src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml
+ src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml
+
+
src/AutoPilotPlugins/PX4/ParameterFactMetaData.xml
diff --git a/src/AutoPilotPlugins/PX4/AirframeComponent.cc b/src/AutoPilotPlugins/PX4/AirframeComponent.cc
index 18cf67fd74654c31194f913df0ec309beea4c256..c9c40938d2e8b80bcdd8383fdbb762641d46188b 100644
--- a/src/AutoPilotPlugins/PX4/AirframeComponent.cc
+++ b/src/AutoPilotPlugins/PX4/AirframeComponent.cc
@@ -162,65 +162,7 @@ QWidget* AirframeComponent::setupWidget(void) const
return new QGCPX4AirframeConfig;
}
-const QVariantList& AirframeComponent::summaryItems(void)
+QUrl AirframeComponent::summaryQmlSource(void) const
{
- // Fill the items on first reference
- // FIXME: These items are not live
-
- if (!_summaryItems.count()) {
- QString name;
- QString state;
- QVariant value;
-
- name = "System ID:";
- if (_paramMgr->getParameterValue(_paramMgr->getDefaultComponentId(), "MAV_SYS_ID", value)) {
- if (value.toInt() == 0) {
- state = "Setup required";
- } else {
- state = value.toString();
- }
- } else {
- // Why is the parameter missing?
- Q_ASSERT(false);
- }
-
- VehicleComponentSummaryItem* item = new VehicleComponentSummaryItem(name, state, this);
- _summaryItems.append(QVariant::fromValue(item));
-
- name = "Airframe:";
- if (_paramMgr->getParameterValue(_paramMgr->getDefaultComponentId(), "SYS_AUTOSTART", value)) {
- if (value.toInt() == 0) {
- state = "Setup required";
- } else {
- state = value.toString();
- }
- } else {
- // Why is the parameter missing?
- Q_ASSERT(false);
- }
-
- item = new VehicleComponentSummaryItem(name, state, this);
- _summaryItems.append(QVariant::fromValue(item));
-
- name = "Type:";
- if (_paramMgr->getParameterValue(_paramMgr->getDefaultComponentId(), "MAV_TYPE", value)) {
- int index = value.toInt();
-
- if (index < 0 || index >= (int)cMavTypes) {
- state = "Unknown";
- } else {
- state = mavTypeInfo[index].description;
- }
- } else {
- // Why is the parameter missing?
- Q_ASSERT(false);
- state = "Unknown";
- }
-
- item = new VehicleComponentSummaryItem(name, state, this);
- _summaryItems.append(QVariant::fromValue(item));
- }
-
- return _summaryItems;
+ return QUrl::fromUserInput("qrc:/qml/AirframeComponentSummary.qml");
}
-
diff --git a/src/AutoPilotPlugins/PX4/AirframeComponent.h b/src/AutoPilotPlugins/PX4/AirframeComponent.h
index c4d1143a8066af0a4616c3a14d26fb1eff08c6ff..67d24011336f7f577369296ea23110faa0554d6f 100644
--- a/src/AutoPilotPlugins/PX4/AirframeComponent.h
+++ b/src/AutoPilotPlugins/PX4/AirframeComponent.h
@@ -49,7 +49,7 @@ public:
virtual QString setupStateDescription(void) const;
virtual QWidget* setupWidget(void) const;
virtual QStringList paramFilterList(void) const;
- virtual const QVariantList& summaryItems(void);
+ virtual QUrl summaryQmlSource(void) const;
private:
const QString _name;
diff --git a/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml b/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml
new file mode 100644
index 0000000000000000000000000000000000000000..352151fa09cb208c834aee360a21ea341a98b896
--- /dev/null
+++ b/src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml
@@ -0,0 +1,32 @@
+import QtQuick 2.2
+import QtQuick.Controls 1.2
+import QtQuick.Controls.Styles 1.2
+import QGroundControl.FactSystem 1.0
+import QGroundControl.FactControls 1.0
+
+Column {
+ anchors.fill: parent
+ anchors.margins: 8
+
+ Row {
+ width: parent.width
+
+ Text { id: systemId; text: "System ID:" }
+ Text {
+ horizontalAlignment: Text.AlignRight
+ width: parent.width - systemId.contentWidth
+ text: autopilot.parameters["MAV_SYS_ID"].value
+ }
+ }
+
+ Row {
+ width: parent.width
+
+ Text { id: airframe; text: "Airframe:" }
+ Text {
+ horizontalAlignment: Text.AlignRight
+ width: parent.width - airframe.contentWidth
+ text: autopilot.parameters["SYS_AUTOSTART"].value == 0 ? "Setup required" : autopilot.parameters["SYS_AUTOSTART"].value
+ }
+ }
+}
diff --git a/src/AutoPilotPlugins/PX4/FlightModesComponent.cc b/src/AutoPilotPlugins/PX4/FlightModesComponent.cc
index 4d66d670faf1cafd11fa962474203fcb65e4e55b..18c49bddf4c6c9f469d8aba2128eafc2b1fee023 100644
--- a/src/AutoPilotPlugins/PX4/FlightModesComponent.cc
+++ b/src/AutoPilotPlugins/PX4/FlightModesComponent.cc
@@ -117,44 +117,7 @@ QWidget* FlightModesComponent::setupWidget(void) const
return new FlightModeConfig();
}
-const QVariantList& FlightModesComponent::summaryItems(void)
+QUrl FlightModesComponent::summaryQmlSource(void) const
{
- if (!_summaryItems.count()) {
-
- // Create summary items for each mode switch
-
- for (size_t i=0; igetParameterValue(_paramMgr->getDefaultComponentId(), switchList[i].param, value)) {
- int chan = value.toInt();
-
- if (chan == 0) {
- // Switch is not mapped
- if (i == 0) {
- // Mode switch is required
- Q_ASSERT(strcmp(switchList[0].param, "RC_MAP_MODE_SW") == 0);
- state = "Setup required";
- } else {
- state = "None";
- }
- } else {
- state = tr("Chan %1").arg(chan);
- }
- } else {
- // Why is the parameter missing?
- Q_ASSERT(false);
- state = "Unknown";
- }
-
- VehicleComponentSummaryItem* item = new VehicleComponentSummaryItem(name, state, this);
- _summaryItems.append(QVariant::fromValue(item));
- }
- }
-
- return _summaryItems;
+ return QUrl::fromUserInput("qrc:/qml/FlightModesComponentSummary.qml");
}
diff --git a/src/AutoPilotPlugins/PX4/FlightModesComponent.h b/src/AutoPilotPlugins/PX4/FlightModesComponent.h
index ccae9b0965915868e71699632ae08966b4a16f8f..e284859da2420bf0552027221885a737cf77d212 100644
--- a/src/AutoPilotPlugins/PX4/FlightModesComponent.h
+++ b/src/AutoPilotPlugins/PX4/FlightModesComponent.h
@@ -49,7 +49,7 @@ public:
virtual QString setupStateDescription(void) const;
virtual QWidget* setupWidget(void) const;
virtual QStringList paramFilterList(void) const;
- virtual const QVariantList& summaryItems(void);
+ virtual QUrl summaryQmlSource(void) const;
private:
const QString _name;
diff --git a/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml b/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml
new file mode 100644
index 0000000000000000000000000000000000000000..ac8ab7ae1093d40f0740f042e641747720eec997
--- /dev/null
+++ b/src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml
@@ -0,0 +1,54 @@
+import QtQuick 2.2
+import QtQuick.Controls 1.2
+import QtQuick.Controls.Styles 1.2
+import QGroundControl.FactSystem 1.0
+import QGroundControl.FactControls 1.0
+
+Column {
+ anchors.fill: parent
+ anchors.margins: 8
+
+ Row {
+ width: parent.width
+
+ Text { id: mode; text: "Mode switch:" }
+ Text {
+ horizontalAlignment: Text.AlignRight
+ width: parent.width - mode.contentWidth
+ text: autopilot.parameters["RC_MAP_MODE_SW"].value == 0 ? "Setup required" : autopilot.parameters["RC_MAP_MODE_SW"].value
+ }
+ }
+
+ Row {
+ width: parent.width
+
+ Text { id: posctl; text: "Position Ctl switch:" }
+ Text {
+ horizontalAlignment: Text.AlignRight
+ width: parent.width - posctl.contentWidth
+ text: autopilot.parameters["RC_MAP_POSCTL_SW"].value == 0 ? "Not mapped" : autopilot.parameters["RC_MAP_POSCTL_SW"].value
+ }
+ }
+
+ Row {
+ width: parent.width
+
+ Text { id: loiter; text: "Loiter switch:" }
+ Text {
+ horizontalAlignment: Text.AlignRight
+ width: parent.width - loiter.contentWidth
+ text: autopilot.parameters["RC_MAP_LOITER_SW"].value == 0 ? "Not mapped" : autopilot.parameters["RC_MAP_LOITER_SW"].value
+ }
+ }
+
+ Row {
+ width: parent.width
+
+ Text { id: rtl; text: "Return switch:" }
+ Text {
+ horizontalAlignment: Text.AlignRight
+ width: parent.width - rtl.contentWidth
+ text: autopilot.parameters["RC_MAP_RETURN_SW"].value == 0 ? "Not mapped" : autopilot.parameters["RC_MAP_RETURN_SW"].value
+ }
+ }
+}
diff --git a/src/AutoPilotPlugins/PX4/RadioComponent.cc b/src/AutoPilotPlugins/PX4/RadioComponent.cc
index 0e6ca43463f2b5ad0b7a51bb08a9af3970c0852e..b9b15155487d315cb7aa4a459cb93651dbf480b5 100644
--- a/src/AutoPilotPlugins/PX4/RadioComponent.cc
+++ b/src/AutoPilotPlugins/PX4/RadioComponent.cc
@@ -101,54 +101,7 @@ QWidget* RadioComponent::setupWidget(void) const
return new PX4RCCalibration;
}
-const QVariantList& RadioComponent::summaryItems(void)
+QUrl RadioComponent::summaryQmlSource(void) const
{
- if (!_summaryItems.count()) {
- QString name;
- QString state;
-
- // FIXME: Need to pull receiver type from RSSI value
- name = "Receiver type:";
- state = "n/a";
-
- VehicleComponentSummaryItem* item = new VehicleComponentSummaryItem(name, state, this);
- _summaryItems.append(QVariant::fromValue(item));
-
- static const char* stickParams[] = { "RC_MAP_ROLL", "RC_MAP_PITCH", "RC_MAP_YAW", "RC_MAP_THROTTLE" };
-
- QString summary("Chan ");
-
- bool allSticksMapped = true;
- for (size_t i=0; igetParameterValue(_paramMgr->getDefaultComponentId(), stickParams[i], value)) {
- if (value.toInt() == 0) {
- allSticksMapped = false;
- break;
- } else {
- if (i != 0) {
- summary += ",";
- }
- summary += value.toString();
- }
- } else {
- // Why is the parameter missing?
- Q_ASSERT(false);
- summary += "?";
- }
- }
-
- if (!allSticksMapped) {
- summary = "Not mapped";
- }
-
- name = "Ail, Ele, Rud, Throt:";
- state = summary;
-
- item = new VehicleComponentSummaryItem(name, state, this);
- _summaryItems.append(QVariant::fromValue(item));
- }
-
- return _summaryItems;
+ return QUrl::fromUserInput("qrc:/qml/RadioComponentSummary.qml");
}
diff --git a/src/AutoPilotPlugins/PX4/RadioComponent.h b/src/AutoPilotPlugins/PX4/RadioComponent.h
index 092e265301ca1f6203180cbf4e6c2f2188ecbf90..06dbe0cc5868d624bf73583ac7349d89900e1cc0 100644
--- a/src/AutoPilotPlugins/PX4/RadioComponent.h
+++ b/src/AutoPilotPlugins/PX4/RadioComponent.h
@@ -50,7 +50,7 @@ public:
virtual QString setupStateDescription(void) const;
virtual QWidget* setupWidget(void) const;
virtual QStringList paramFilterList(void) const;
- virtual const QVariantList& summaryItems(void);
+ virtual QUrl summaryQmlSource(void) const;
private:
const QString _name;
diff --git a/src/AutoPilotPlugins/PX4/SafetyComponent.cc b/src/AutoPilotPlugins/PX4/SafetyComponent.cc
index 3ddaf3dc6f197718ed545a84bd7e16e4ab9143f8..e9bfc540cf47bc0d2be07e971c014e72994b16cf 100644
--- a/src/AutoPilotPlugins/PX4/SafetyComponent.cc
+++ b/src/AutoPilotPlugins/PX4/SafetyComponent.cc
@@ -100,37 +100,7 @@ QWidget* SafetyComponent::setupWidget(void) const
return holder;
}
-const QVariantList& SafetyComponent::summaryItems(void)
+QUrl SafetyComponent::summaryQmlSource(void) const
{
- if (!_summaryItems.count()) {
- QString name;
- QString state;
-
- name = "RTL min alt:";
-
- VehicleComponentSummaryItem* item = new VehicleComponentSummaryItem(name, state, this);
- _summaryItems.append(QVariant::fromValue(item));
-
- name = "RTL home alt:";
-
- item = new VehicleComponentSummaryItem(name, state, this);
- _summaryItems.append(QVariant::fromValue(item));
-
- name = "RTL home loiter:";
-
- item = new VehicleComponentSummaryItem(name, state, this);
- _summaryItems.append(QVariant::fromValue(item));
-
- name = "Telemetry loss RTL:";
-
- item = new VehicleComponentSummaryItem(name, state, this);
- _summaryItems.append(QVariant::fromValue(item));
-
- name = "RC loss RTL:";
-
- item = new VehicleComponentSummaryItem(name, state, this);
- _summaryItems.append(QVariant::fromValue(item));
- }
-
- return _summaryItems;
+ return QUrl::fromUserInput("qrc:/qml/SafetyComponentSummary.qml");
}
diff --git a/src/AutoPilotPlugins/PX4/SafetyComponent.h b/src/AutoPilotPlugins/PX4/SafetyComponent.h
index 3d137790c23568c2189cd37cd1a7d79dd4c0be98..853394f8a135b1c37b8eeecad4a08384ace3026a 100644
--- a/src/AutoPilotPlugins/PX4/SafetyComponent.h
+++ b/src/AutoPilotPlugins/PX4/SafetyComponent.h
@@ -50,7 +50,7 @@ public:
virtual QString setupStateDescription(void) const;
virtual QWidget* setupWidget(void) const;
virtual QStringList paramFilterList(void) const;
- virtual const QVariantList& summaryItems(void);
+ virtual QUrl summaryQmlSource(void) const;
private:
const QString _name;
diff --git a/src/AutoPilotPlugins/PX4/SafetyComponent.qml b/src/AutoPilotPlugins/PX4/SafetyComponent.qml
index d0d14a77e7edd9537920676c900474eff4754598..f6187dc100b931a6784978356206ab3086e9381f 100644
--- a/src/AutoPilotPlugins/PX4/SafetyComponent.qml
+++ b/src/AutoPilotPlugins/PX4/SafetyComponent.qml
@@ -32,7 +32,7 @@ Rectangle {
id: homeLoiterCheckbox
property Fact fact: autopilot.parameters["RTL_LAND_DELAY"]
- checked: fact.value < 0
+ checked: fact.value > 0
text: "Loiter at Home altitude for "
onClicked: {
diff --git a/src/AutoPilotPlugins/PX4/SafetyComponentSummary.qml b/src/AutoPilotPlugins/PX4/SafetyComponentSummary.qml
new file mode 100644
index 0000000000000000000000000000000000000000..913077d80ce037e406df396cec6c7023a63bf988
--- /dev/null
+++ b/src/AutoPilotPlugins/PX4/SafetyComponentSummary.qml
@@ -0,0 +1,65 @@
+import QtQuick 2.2
+import QtQuick.Controls 1.2
+import QtQuick.Controls.Styles 1.2
+import QGroundControl.FactSystem 1.0
+import QGroundControl.FactControls 1.0
+
+Column {
+ anchors.fill: parent
+ anchors.margins: 8
+
+ Row {
+ width: parent.width
+
+ Text { id: rtlMinAlt; text: "RTL min alt:" }
+ Text {
+ horizontalAlignment: Text.AlignRight;
+ width: parent.width - rtlMinAlt.contentWidth;
+ text: autopilot.parameters["RTL_RETURN_ALT"].valueString
+ }
+ }
+
+ Row {
+ width: parent.width
+
+ Text { id: rtlHomeAlt; text: "RTL home alt:" }
+ Text {
+ horizontalAlignment: Text.AlignRight;
+ width: parent.width - rtlHomeAlt.contentWidth;
+ text: autopilot.parameters["RTL_DESCEND_ALT"].valueString
+ }
+ }
+
+ Row {
+ width: parent.width
+
+ Text { id: rtlLoiter; text: "RTL loiter delay:" }
+ Text {
+ horizontalAlignment: Text.AlignRight;
+ width: parent.width - rtlLoiter.contentWidth;
+ text: autopilot.parameters["RTL_LAND_DELAY"].value < 0 ? "Disabled" : autopilot.parameters["RTL_LAND_DELAY"].valueString
+ }
+ }
+
+ Row {
+ width: parent.width
+
+ Text { id: commLoss; text: "Telemetry loss RTL:" }
+ Text {
+ horizontalAlignment: Text.AlignRight;
+ width: parent.width - commLoss.contentWidth;
+ text: autopilot.parameters["COM_DL_LOSS_EN"].value != 1 ? "Disabled" : autopilot.parameters["NAV_DLL_N"].valueString
+ }
+ }
+
+ Row {
+ width: parent.width
+
+ Text { id: rcLoss; text: "RC loss RTL (seconds):" }
+ Text {
+ horizontalAlignment: Text.AlignRight;
+ width: parent.width - rcLoss.contentWidth;
+ text: autopilot.parameters["COM_RC_LOSS_T"].valueString
+ }
+ }
+}
diff --git a/src/AutoPilotPlugins/PX4/SensorsComponent.cc b/src/AutoPilotPlugins/PX4/SensorsComponent.cc
index afeefc96780da74a35ffb4477c4c9be7ffb128a5..bd3710a1b71cd06eee47300402ec1420c14ad362 100644
--- a/src/AutoPilotPlugins/PX4/SensorsComponent.cc
+++ b/src/AutoPilotPlugins/PX4/SensorsComponent.cc
@@ -33,9 +33,6 @@
/// @brief Parameters which signal a change in setupComplete state
static const char* triggerParams[] = { "SENS_MAG_XOFF", "SENS_GYRO_XOFF", "SENS_ACC_XOFF", "SENS_DPRES_OFF", NULL };
-/// @brief Used to translate from parameter name to user string
-static const char* triggerSensors[] = { "Compass", "Gyro", "Acceleromter", "Airspeed", NULL };
-
SensorsComponent::SensorsComponent(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent) :
PX4Component(uas, autopilot, parent),
_name(tr("Sensors"))
@@ -117,108 +114,7 @@ QWidget* SensorsComponent::setupWidget(void) const
return new QGCPX4SensorCalibration;
}
-const QVariantList& SensorsComponent::summaryItems(void)
+QUrl SensorsComponent::summaryQmlSource(void) const
{
- if (!_summaryItems.count()) {
- QString name;
- QString state;
-
- // Summary item for each Sensor
-
- int i = 0;
- while (triggerParams[i] != NULL) {
- QVariant value;
-
- name = tr("%1:").arg(triggerSensors[i]);
-
- if (_paramMgr->getParameterValue(_paramMgr->getDefaultComponentId(), triggerParams[i], value)) {
- if (value.toFloat() == 0.0f) {
- state = "Setup required";
- } else {
- state = "Ready";
- }
- } else {
- // Why is the parameter missing?
- Q_ASSERT(false);
- }
-
- VehicleComponentSummaryItem* item = new VehicleComponentSummaryItem(name, state, this);
- _summaryItems.append(QVariant::fromValue(item));
-
- i++;
- }
-
- // Summary item for each orientation param
-
- static const char* orientationSensors[] = { "Autopilot orientation:", "Compass orientation:" };
- static const char* orientationParams[] = { "SENS_BOARD_ROT", "SENS_EXT_MAG_ROT" };
- static const size_t cOrientationSensors = sizeof(orientationSensors)/sizeof(orientationSensors[0]);
-
- static const char* orientationValues[] = {
- "Line of flight",
- "Yaw:45",
- "Yaw:90",
- "Yaw:135",
- "Yaw:180",
- "Yaw:225",
- "Yaw:270",
- "Yaw:315",
- "Roll:180",
- "Roll:180 Yaw:45",
- "Roll:180 Yaw:90",
- "Roll:180 Yaw:135",
- "Pitch:180",
- "Roll:180 Yaw:225",
- "Roll:180 Yaw:270",
- "Roll:180 Yaw:315",
- "Roll:90",
- "Roll:90 Yaw:45",
- "Roll:90 Yaw:90",
- "Roll:90 Yaw:135",
- "Roll:270",
- "Roll:270 Yaw:45",
- "Roll:270 Yaw:90",
- "Roll:270 Yaw:135",
- "Pitch:90",
- "Pitch:270",
- "Pitch:180",
- "Pitch:180 Yaw:90",
- "Pitch:180 Yaw:270",
- "Roll:90 Pitch:90",
- "Roll:180 Pitch:90",
- "Roll:270 Pitch:90",
- "Roll:90 Pitch:180",
- "Roll:270 Pitch:180",
- "Roll:90 Pitch:270",
- "Roll:180 Pitch:270",
- "Roll:270 Pitch:270",
- "Roll:90 Pitch:180 Yaw:90",
- "Roll:90 Yaw:270"
- };
- static const size_t cOrientationValues = sizeof(orientationValues)/sizeof(orientationValues[0]);
-
- for (size_t i=0; igetParameterValue(_paramMgr->getDefaultComponentId(), orientationParams[i], value)) {
- int index = value.toInt();
- if (index < 0 || index >= (int)cOrientationValues) {
- state = "Setup required";
- } else {
- state = orientationValues[index];
- }
- } else {
- // Why is the parameter missing?
- Q_ASSERT(false);
- state = "Unknown";
- }
-
- VehicleComponentSummaryItem* item = new VehicleComponentSummaryItem(name, state, this);
- _summaryItems.append(QVariant::fromValue(item));
- }
- }
-
- return _summaryItems;
+ return QUrl::fromUserInput("qrc:/qml/SensorsComponentSummary.qml");
}
diff --git a/src/AutoPilotPlugins/PX4/SensorsComponent.h b/src/AutoPilotPlugins/PX4/SensorsComponent.h
index 7872f45b3bf0f1178597dd3d4fef601453b6167d..5fae18b00f99c3e17856471c512afc4a62a8652e 100644
--- a/src/AutoPilotPlugins/PX4/SensorsComponent.h
+++ b/src/AutoPilotPlugins/PX4/SensorsComponent.h
@@ -49,7 +49,7 @@ public:
virtual QString setupStateDescription(void) const;
virtual QWidget* setupWidget(void) const;
virtual QStringList paramFilterList(void) const;
- virtual const QVariantList& summaryItems(void);
+ virtual QUrl summaryQmlSource(void) const;
private:
const QString _name;
diff --git a/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml b/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml
new file mode 100644
index 0000000000000000000000000000000000000000..be7b52d238fe20de1e4d0ec86b90018dac1db495
--- /dev/null
+++ b/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml
@@ -0,0 +1,54 @@
+import QtQuick 2.2
+import QtQuick.Controls 1.2
+import QtQuick.Controls.Styles 1.2
+import QGroundControl.FactSystem 1.0
+import QGroundControl.FactControls 1.0
+
+Column {
+ anchors.fill: parent
+ anchors.margins: 8
+
+ Row {
+ width: parent.width
+
+ Text { id: compass; text: "Compass:" }
+ Text {
+ horizontalAlignment: Text.AlignRight;
+ width: parent.width - compass.contentWidth;
+ text: autopilot.parameters["SENS_MAG_XOFF"].value == 0.0 ? "Setup required" : "Ready"
+ }
+ }
+
+ Row {
+ width: parent.width
+
+ Text { id: gyro; text: "Gyro:" }
+ Text {
+ horizontalAlignment: Text.AlignRight;
+ width: parent.width - gyro.contentWidth;
+ text: autopilot.parameters["SENS_GYRO_XOFF"].value == 0.0 ? "Setup required" : "Ready"
+ }
+ }
+
+ Row {
+ width: parent.width
+
+ Text { id: accel; text: "Accelerometer:" }
+ Text {
+ horizontalAlignment: Text.AlignRight;
+ width: parent.width - accel.contentWidth;
+ text: autopilot.parameters["SENS_ACC_XOFF"].value == 0.0 ? "Setup required" : "Ready"
+ }
+ }
+
+ Row {
+ width: parent.width
+
+ Text { id: airspeed; text: "Airspeed:" }
+ Text {
+ horizontalAlignment: Text.AlignRight;
+ width: parent.width - airspeed.contentWidth;
+ text: autopilot.parameters["SENS_DPRES_OFF"].value == 0.0 ? "Setup required" : "Ready"
+ }
+ }
+}
diff --git a/src/VehicleSetup/SetupViewConnected.qml b/src/VehicleSetup/SetupViewConnected.qml
index 46226eda278bcd6ce0012ccd445f2a0a73870610..b0857fd14735eb2008010141017a4d1771b35f51 100644
--- a/src/VehicleSetup/SetupViewConnected.qml
+++ b/src/VehicleSetup/SetupViewConnected.qml
@@ -27,7 +27,7 @@ Rectangle {
spacing: 5
Rectangle { id: header; color: "lightblue"; radius: 10.0; width: parent.width; height: titleText.height + 20; opacity: 0.8;
- Text { id: titleText; anchors.centerIn: parent; font.pointSize: 24; text: "Vehicle Summary" }
+ Text { id: titleText; anchors.centerIn: parent; font.pointSize: 24; text: "Vehicle Setup" }
}
Flow {
@@ -42,7 +42,7 @@ Rectangle {
width: 250
height: 200
- property var summaryModel: modelData.summaryItems
+ property var summaryQmlSource: modelData.summaryQmlSource
text: modelData.name
property bool setupComplete: modelData.setupComplete
@@ -100,15 +100,9 @@ Rectangle {
GradientStop { position: 1; color: "#000000" }
}
- ListView {
- id: summaryList
+ Loader {
anchors.fill: parent
- anchors.margins: 4
- model: control.summaryModel
- delegate: Row { width: parent.width
- Text { id: firstCol; text: modelData.name }
- Text { horizontalAlignment: Text.AlignRight; width: parent.width - firstCol.contentWidth; text: modelData.state }
- }
+ source: summaryQmlSource
}
}
}
diff --git a/src/VehicleSetup/SetupViewDisconnected.qml b/src/VehicleSetup/SetupViewDisconnected.qml
index f2d1926a55719c5f37677f991e0ccc206f78fdc3..37e0a35cb9deff7d82359824415650cb04440891 100644
--- a/src/VehicleSetup/SetupViewDisconnected.qml
+++ b/src/VehicleSetup/SetupViewDisconnected.qml
@@ -14,7 +14,7 @@ Rectangle {
anchors.fill: parent
Rectangle { id: header; color: "lightblue"; radius: 10.0; width: parent.width; height: titleText.height + 20; opacity: 0.8;
- Text { id: titleText; anchors.centerIn: parent; font.pointSize: 24; text: "Vehicle Summary" }
+ Text { id: titleText; anchors.centerIn: parent; font.pointSize: 24; text: "Vehicle Setup" }
}
Text { width: parent.width; height: parent.height - header.height - footer.height;
@@ -22,7 +22,7 @@ Rectangle {
color: palette.windowText
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
- text: "No vehicle currently connected. Vehicle Setup is only available while vehicle is connected." }
+ text: "Vehicle Setup is only available while vehicle is connected." }
Rectangle { id: footer; anchors.bottom: parent.bottom; color: "lightblue"; radius: 10.0; width: parent.width; height: titleText.height + 20; opacity: 0.8;
diff --git a/src/VehicleSetup/VehicleComponent.h b/src/VehicleSetup/VehicleComponent.h
index 4c603b4d880dcb6349728c11e3600d1bc7f68982..3dddff7873043ff88d7d64ae2f891d12587f6ced 100644
--- a/src/VehicleSetup/VehicleComponent.h
+++ b/src/VehicleSetup/VehicleComponent.h
@@ -49,7 +49,7 @@ class VehicleComponent : public QObject
Q_PROPERTY(QString setupStateDescription READ setupStateDescription STORED false)
Q_PROPERTY(QString icon READ icon CONSTANT)
Q_PROPERTY(QWidget* setupWidget READ setupWidget STORED false)
- Q_PROPERTY(QVariantList summaryItems READ summaryItems CONSTANT);
+ Q_PROPERTY(QUrl summaryQmlSource READ summaryQmlSource CONSTANT);
public:
VehicleComponent(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent = NULL);
@@ -63,7 +63,7 @@ public:
virtual QString setupStateDescription(void) const = 0;
virtual QWidget* setupWidget(void) const = 0;
virtual QStringList paramFilterList(void) const = 0;
- virtual const QVariantList& summaryItems(void) = 0;
+ virtual QUrl summaryQmlSource(void) const = 0;
virtual void addSummaryQmlComponent(QQmlContext* context, QQuickItem* parent);