Commit 0c6ae2a7 authored by Don Gagne's avatar Don Gagne

Handle sensor difference for Fixed Wing

parent 059df23d
......@@ -268,6 +268,7 @@
<file alias="SafetyComponentSummary.qml">src/AutoPilotPlugins/PX4/SafetyComponentSummary.qml</file>
<file alias="SensorsComponentSummary.qml">src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml</file>
<file alias="SensorsComponentSummaryFixedWing.qml">src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml</file>
<file alias="RadioComponentSummary.qml">src/AutoPilotPlugins/PX4/RadioComponentSummary.qml</file>
<file alias="FlightModesComponentSummary.qml">src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml</file>
<file alias="AirframeComponentSummary.qml">src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml</file>
......
......@@ -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
......
......@@ -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"
}
}
}
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"
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment