diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc index c5124d90124242e374e15f16f37342f5f69253ee..ce254dd5845d1601d948d4c918dd4dca932179d5 100644 --- a/qgroundcontrol.qrc +++ b/qgroundcontrol.qrc @@ -268,6 +268,7 @@ src/AutoPilotPlugins/PX4/SafetyComponentSummary.qml src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml + src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml src/AutoPilotPlugins/PX4/RadioComponentSummary.qml src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml diff --git a/src/AutoPilotPlugins/PX4/SensorsComponent.cc b/src/AutoPilotPlugins/PX4/SensorsComponent.cc index 6e57166aa2fc06d3ff66b25b5d8d127baafbbf42..1f2088fa4e5fc628ba69696876f1c0de1f9f3ec9 100644 --- a/src/AutoPilotPlugins/PX4/SensorsComponent.cc +++ b/src/AutoPilotPlugins/PX4/SensorsComponent.cc @@ -31,8 +31,10 @@ // These two list must be kept in sync /// @brief Parameters which signal a change in setupComplete state -static const char* triggerParamsV1[] = { "SENS_MAG_XOFF", "SENS_GYRO_XOFF", "SENS_ACC_XOFF", "SENS_DPRES_OFF", NULL }; -static const char* triggerParamsV2[] = { "CAL_MAG0_ID", "CAL_GYRO0_ID", "CAL_ACC0_ID", "SENS_DPRES_OFF", NULL }; +static const char* triggerParamsV1[] = { "SENS_MAG_XOFF", "SENS_GYRO_XOFF", "SENS_ACC_XOFF", NULL }; +static const char* triggerParamsV2[] = { "CAL_MAG0_ID", "CAL_GYRO0_ID", "CAL_ACC0_ID", NULL }; +static const char* triggerParamsV1FixedWing[] = { "SENS_MAG_XOFF", "SENS_GYRO_XOFF", "SENS_ACC_XOFF", "SENS_DPRES_OFF", NULL }; +static const char* triggerParamsV2FixedWing[] = { "CAL_MAG0_ID", "CAL_GYRO0_ID", "CAL_ACC0_ID", "SENS_DPRES_OFF", NULL }; SensorsComponent::SensorsComponent(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent) : PX4Component(uas, autopilot, parent), @@ -102,7 +104,11 @@ QString SensorsComponent::setupStateDescription(void) const const char** SensorsComponent::setupCompleteChangedTriggerList(void) const { - return _paramsV1 ? triggerParamsV1 : triggerParamsV2; + if (_uas->getSystemType() == MAV_TYPE_FIXED_WING) { + return _paramsV1 ? triggerParamsV1FixedWing : triggerParamsV2FixedWing; + } else { + return _paramsV1 ? triggerParamsV1 : triggerParamsV2; + } } QStringList SensorsComponent::paramFilterList(void) const @@ -125,7 +131,16 @@ QWidget* SensorsComponent::setupWidget(void) const QUrl SensorsComponent::summaryQmlSource(void) const { - return QUrl::fromUserInput("qrc:/qml/SensorsComponentSummary.qml"); + QString summaryQml; + + qDebug() << _uas->getSystemType(); + if (_uas->getSystemType() == MAV_TYPE_FIXED_WING) { + summaryQml = "qrc:/qml/SensorsComponentSummaryFixedWing.qml"; + } else { + summaryQml = "qrc:/qml/SensorsComponentSummary.qml"; + } + + return QUrl::fromUserInput(summaryQml); } QString SensorsComponent::prerequisiteSetup(void) const diff --git a/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml b/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml index 9c8311c99897bc91541b4d4cb745de31b2e8ad5e..2c1f31420f2e88c3e650709b3c62fd163b6f157c 100644 --- a/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml @@ -5,6 +5,10 @@ import QtQuick.Controls.Styles 1.2 import QGroundControl.FactSystem 1.0 import QGroundControl.Controls 1.0 +/* + IMPORTANT NOTE: Any changes made here must also be made to SensorsComponentSummaryFixedWing.qml +*/ + Column { anchors.fill: parent anchors.margins: 8 @@ -44,15 +48,4 @@ Column { text: setupRequiredValue == 0 ? "Setup required" : "Ready" } } - - Row { - width: parent.width - - QGCLabel { id: airspeed; text: "Airspeed:" } - QGCLabel { - horizontalAlignment: Text.AlignRight; - width: parent.width - airspeed.contentWidth; - text: autopilot.parameters["SENS_DPRES_OFF"].value == 0.0 ? "Setup required" : "Ready" - } - } } diff --git a/src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml b/src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml new file mode 100644 index 0000000000000000000000000000000000000000..624e5e9f9506bf049f1e0292f31d5e597c62051c --- /dev/null +++ b/src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml @@ -0,0 +1,62 @@ +import QtQuick 2.2 +import QtQuick.Controls 1.2 +import QtQuick.Controls.Styles 1.2 + +import QGroundControl.FactSystem 1.0 +import QGroundControl.Controls 1.0 + +/* + IMPORTANT NOTE: Any changes made here must also be made to SensorsComponentSummary.qml +*/ + +Column { + anchors.fill: parent + anchors.margins: 8 + + Row { + width: parent.width + + QGCLabel { id: compass; text: "Compass:" } + QGCLabel { + horizontalAlignment: Text.AlignRight; + width: parent.width - compass.contentWidth; + property bool setupRequiredValue: autopilot.parameters["SENS_MAG_XOFF"] ? autopilot.parameters["SENS_MAG_XOFF"].value : autopilot.parameters["CAL_MAG0_ID"].value + text: setupRequiredValue == 0 ? "Setup required" : "Ready" + } + } + + Row { + width: parent.width + + QGCLabel { id: gyro; text: "Gyro:" } + QGCLabel { + horizontalAlignment: Text.AlignRight; + width: parent.width - gyro.contentWidth; + property bool setupRequiredValue: autopilot.parameters["SENS_GYRO_XOFF"] ? autopilot.parameters["SENS_GYRO_XOFF"].value : autopilot.parameters["CAL_GYRO0_ID"].value + text: setupRequiredValue == 0 ? "Setup required" : "Ready" + } + } + + Row { + width: parent.width + + QGCLabel { id: accel; text: "Accelerometer:" } + QGCLabel { + horizontalAlignment: Text.AlignRight; + width: parent.width - accel.contentWidth; + property bool setupRequiredValue: autopilot.parameters["SENS_ACC_XOFF"] ? autopilot.parameters["SENS_ACC_XOFF"].value : autopilot.parameters["CAL_ACC0_ID"].value + text: setupRequiredValue == 0 ? "Setup required" : "Ready" + } + } + + Row { + width: parent.width + + QGCLabel { id: airspeed; text: "Airspeed:" } + QGCLabel { + horizontalAlignment: Text.AlignRight; + width: parent.width - airspeed.contentWidth; + text: autopilot.parameters["SENS_DPRES_OFF"].value == 0.0 ? "Setup required" : "Ready" + } + } +}