Commit ca2d4a91 authored by Don Gagne's avatar Don Gagne

Working Safety Component setup

parent 2f73dea3
......@@ -244,12 +244,14 @@
<file alias="QGroundControl/FactControls/SetupButton.qml">qml/QGroundControl/FactControls/SetupButton.qml</file>
<file alias="QGroundControl/FactControls/FactLabel.qml">qml/QGroundControl/FactControls/FactLabel.qml</file>
<file alias="QGroundControl/FactControls/FactTextField.qml">qml/QGroundControl/FactControls/FactTextField.qml</file>
<file alias="QGroundControl/FactControls/FactCheckBox.qml">qml/QGroundControl/FactControls/FactCheckBox.qml</file>
<file alias="octo_x.png">files/images/px4/airframes/octo_x.png</file>
<file alias="px4fmu_2.x.png">files/images/px4/boards/px4fmu_2.x.png</file>
<file alias="SetupViewConnected.qml">src/VehicleSetup/SetupViewConnected.qml</file>
<file alias="SetupViewDisconnected.qml">src/VehicleSetup/SetupViewDisconnected.qml</file>
<file alias="SetupPane.qml">src/VehicleSetup/SetupPane.qml</file>
<file alias="SafetyComponent.qml">src/AutoPilotPlugins/PX4/SafetyComponent.qml</file>
</qresource>
......
......@@ -159,6 +159,7 @@
<default>2</default>
<min>0</min>
<max>1000</max>
<unit>timeouts</unit>
</parameter>
<parameter name="NAV_DLL_CHSK" type="INT32">
<short_desc>Skip comms hold wp</short_desc>
......@@ -2041,7 +2042,7 @@
<default>0.5</default>
<min>0</min>
<max>35</max>
<unit>second</unit>
<unit>seconds</unit>
</parameter>
</group>
<group name="mTECS">
......
......@@ -102,55 +102,35 @@ QWidget* SafetyComponent::setupWidget(void) const
const QVariantList& SafetyComponent::summaryItems(void)
{
// FIXME: No summary items yet
#if 0
if (!_summaryItems.count()) {
QString name;
QString state;
// FIXME: Need to pull receiver type from RSSI value
name = "Receiver type:";
state = "n/a";
name = "RTL min alt:";
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" };
name = "RTL home alt:";
QString summary("Chan ");
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));
bool allSticksMapped = true;
for (size_t i=0; i<sizeof(stickParams)/sizeof(stickParams[0]); i++) {
QVariant value;
if (_paramMgr->getParameterValue(_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 += "?";
}
}
name = "Telemetry loss RTL:";
if (!allSticksMapped) {
summary = "Not mapped";
}
name = "Ail, Ele, Rud, Throt:";
state = summary;
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));
}
#endif
return _summaryItems;
}
......@@ -7,14 +7,92 @@ import QGroundControl.FactControls 1.0
Rectangle {
QGCPalette { id: palette; colorGroup: QGCPalette.Active }
width: 400
width: 600
height: 400
color: palette.window
Column {
Label { text: "Work in Progress"; color: palette.windowText }
Label { text: "Return to Land Altitude"; color: palette.windowText }
FactLabel { fact: autopilot.parameters["RTL_RETURN_ALT"] }
FactTextField { fact: autopilot.parameters["RTL_RETURN_ALT"] }
anchors.fill: parent
spacing: 20
Column {
spacing: 10
Label { text: "Return to Land setup"; color: palette.windowText; font.pointSize: 20 }
Row {
Label { text: "Climb to minimum altitude of "; color: palette.windowText; anchors.baseline: climbField.baseline }
FactTextField { id: climbField; fact: autopilot.parameters["RTL_RETURN_ALT"]; showUnits: true }
}
Row {
Label { text: "When Home is reached, descend to altitude of "; color: palette.windowText; anchors.baseline: descendField.baseline }
FactTextField { id: descendField; fact: autopilot.parameters["RTL_DESCEND_ALT"]; showUnits: true }
}
Row {
CheckBox {
id: homeLoiterCheckbox
property Fact fact: autopilot.parameters["RTL_LAND_DELAY"]
checked: fact.value < 0
text: "Loiter at Home altitude for "
onClicked: {
fact.value = checked ? 60 : -1
}
style: CheckBoxStyle {
label: Text {
color: palette.windowText
text: control.text
}
}
}
FactTextField {
fact: autopilot.parameters["RTL_LAND_DELAY"];
showUnits: true
anchors.baseline: homeLoiterCheckbox.baseline
}
}
}
Column {
spacing: 10
Label { text: "Return to Land Triggers"; color: palette.windowText; font.pointSize: 20 }
Row {
FactCheckBox {
id: telemetryLossCheckbox
fact: autopilot.parameters["COM_DL_LOSS_EN"]
checkedValue: 1
uncheckedValue: 0
text: "Telemetry signal timeout - Return to Land"
anchors.baseline: telemetryLossField.baseline
}
Label { text: " after "; color: palette.windowText; anchors.baseline: telemetryLossField.baseline }
FactTextField {
id: telemetryLossField
fact: autopilot.parameters["NAV_DLL_N"];
showUnits: true
}
}
Row {
Label { text: "RC Transmitter signal loss - Return to Land after "; color: palette.windowText; anchors.baseline: rcLossField.baseline }
FactTextField { id: rcLossField; fact: autopilot.parameters["COM_RC_LOSS_T"]; showUnits: true }
}
}
Text {
width: parent.width
text: "Warning: You have an advanced safety configuration set using the NAV_RCL_OBC parameter. The above settings may not apply.";
visible: autopilot.parameters["NAV_RCL_OBC"].value == 1
color: palette.windowText
wrapMode: Text.Wrap
}
Text {
width: parent.width
text: "Warning: You have an advanced safety configuration set using the NAV_DLL_OBC parameter. The above settings may not apply.";
visible: autopilot.parameters["NAV_DLL_OBC"].value == 1
color: palette.windowText
wrapMode: Text.Wrap
}
}
}
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