|
|
@ -11,6 +11,7 @@ |
|
|
|
import QtQuick 2.3 |
|
|
|
import QtQuick 2.3 |
|
|
|
import QtQuick.Controls 1.2 |
|
|
|
import QtQuick.Controls 1.2 |
|
|
|
import QtGraphicalEffects 1.0 |
|
|
|
import QtGraphicalEffects 1.0 |
|
|
|
|
|
|
|
import QtQuick.Layouts 1.2 |
|
|
|
|
|
|
|
|
|
|
|
import QGroundControl.FactSystem 1.0 |
|
|
|
import QGroundControl.FactSystem 1.0 |
|
|
|
import QGroundControl.FactControls 1.0 |
|
|
|
import QGroundControl.FactControls 1.0 |
|
|
@ -34,12 +35,25 @@ SetupPage { |
|
|
|
|
|
|
|
|
|
|
|
QGCPalette { id: ggcPal; colorGroupEnabled: true } |
|
|
|
QGCPalette { id: ggcPal; colorGroupEnabled: true } |
|
|
|
|
|
|
|
|
|
|
|
property Fact _failsafeGCSEnable: controller.getParameterFact(-1, "FS_GCS_ENABLE") |
|
|
|
property Fact _failsafeGCSEnable: controller.getParameterFact(-1, "FS_GCS_ENABLE") |
|
|
|
property Fact _failsafeBattEnable: controller.getParameterFact(-1, "FS_BATT_ENABLE") |
|
|
|
property Fact _failsafeBattLowAct: controller.getParameterFact(-1, "r.BATT_FS_LOW_ACT") |
|
|
|
property Fact _failsafeBattMah: controller.getParameterFact(-1, "FS_BATT_MAH") |
|
|
|
property Fact _failsafeBattMah: controller.getParameterFact(-1, "r.BATT_LOW_MAH") |
|
|
|
property Fact _failsafeBattVoltage: controller.getParameterFact(-1, "FS_BATT_VOLTAGE") |
|
|
|
property Fact _failsafeBattVoltage: controller.getParameterFact(-1, "r.BATT_LOW_VOLT") |
|
|
|
property Fact _failsafeThrEnable: controller.getParameterFact(-1, "FS_THR_ENABLE") |
|
|
|
property Fact _failsafeThrEnable: controller.getParameterFact(-1, "FS_THR_ENABLE") |
|
|
|
property Fact _failsafeThrValue: controller.getParameterFact(-1, "FS_THR_VALUE") |
|
|
|
property Fact _failsafeThrValue: controller.getParameterFact(-1, "FS_THR_VALUE") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
property bool _failsafeBattCritActAvailable: controller.parameterExists(-1, "BATT_FS_CRT_ACT") |
|
|
|
|
|
|
|
property bool _failsafeBatt2LowActAvailable: controller.parameterExists(-1, "BATT2_FS_LOW_ACT") |
|
|
|
|
|
|
|
property bool _failsafeBatt2CritActAvailable: controller.parameterExists(-1, "BATT2_FS_CRT_ACT") |
|
|
|
|
|
|
|
property bool _batt2MonitorAvailable: controller.parameterExists(-1, "BATT2_MONITOR") |
|
|
|
|
|
|
|
property bool _batt2MonitorEnabled: _batt2MonitorAvailable ? _batt2Monitor.rawValue !== 0 : false |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
property Fact _failsafeBattCritAct: controller.getParameterFact(-1, "BATT_FS_CRT_ACT", false /* reportMissing */) |
|
|
|
|
|
|
|
property Fact _batt2Monitor: controller.getParameterFact(-1, "BATT2_MONITOR", false /* reportMissing */) |
|
|
|
|
|
|
|
property Fact _failsafeBatt2LowAct: controller.getParameterFact(-1, "BATT2_FS_LOW_ACT", false /* reportMissing */) |
|
|
|
|
|
|
|
property Fact _failsafeBatt2CritAct: controller.getParameterFact(-1, "BATT2_FS_CRT_ACT", false /* reportMissing */) |
|
|
|
|
|
|
|
property Fact _failsafeBatt2Mah: controller.getParameterFact(-1, "BATT2_LOW_MAH", false /* reportMissing */) |
|
|
|
|
|
|
|
property Fact _failsafeBatt2Voltage: controller.getParameterFact(-1, "BATT2_LOW_VOLT", false /* reportMissing */) |
|
|
|
|
|
|
|
|
|
|
|
property Fact _fenceAction: controller.getParameterFact(-1, "FENCE_ACTION") |
|
|
|
property Fact _fenceAction: controller.getParameterFact(-1, "FENCE_ACTION") |
|
|
|
property Fact _fenceAltMax: controller.getParameterFact(-1, "FENCE_ALT_MAX") |
|
|
|
property Fact _fenceAltMax: controller.getParameterFact(-1, "FENCE_ALT_MAX") |
|
|
@ -66,135 +80,193 @@ SetupPage { |
|
|
|
spacing: _margins / 2 |
|
|
|
spacing: _margins / 2 |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { |
|
|
|
id: failsafeLabel |
|
|
|
text: qsTr("Battery Failsafe Triggers") |
|
|
|
text: qsTr("Failsafe Triggers") |
|
|
|
|
|
|
|
font.family: ScreenTools.demiboldFontFamily |
|
|
|
font.family: ScreenTools.demiboldFontFamily |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Rectangle { |
|
|
|
Rectangle { |
|
|
|
id: failsafeSettings |
|
|
|
width: batteryFailsafeColumn.x + batteryFailsafeColumn.width + _margins |
|
|
|
width: throttleEnableCombo.x + throttleEnableCombo.width + _margins |
|
|
|
height: batteryFailsafeColumn.y + batteryFailsafeColumn.height + _margins |
|
|
|
height: mahField.y + mahField.height + _margins |
|
|
|
|
|
|
|
color: ggcPal.windowShade |
|
|
|
color: ggcPal.windowShade |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
Column { |
|
|
|
id: gcsEnableLabel |
|
|
|
id: batteryFailsafeColumn |
|
|
|
anchors.margins: _margins |
|
|
|
anchors.margins: _margins |
|
|
|
|
|
|
|
anchors.top: parent.top |
|
|
|
anchors.left: parent.left |
|
|
|
anchors.left: parent.left |
|
|
|
anchors.baseline: gcsEnableCombo.baseline |
|
|
|
spacing: _margins |
|
|
|
text: qsTr("Ground Station failsafe:") |
|
|
|
|
|
|
|
} |
|
|
|
GridLayout { |
|
|
|
|
|
|
|
id: gridLayout |
|
|
|
|
|
|
|
columnSpacing: _margins |
|
|
|
|
|
|
|
rowSpacing: _margins |
|
|
|
|
|
|
|
columns: 2 |
|
|
|
|
|
|
|
QGCLabel { text: qsTr("Battery low action:") } |
|
|
|
|
|
|
|
FactComboBox { |
|
|
|
|
|
|
|
fact: _failsafeBattLowAct |
|
|
|
|
|
|
|
indexModel: false |
|
|
|
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
FactComboBox { |
|
|
|
QGCLabel { |
|
|
|
id: gcsEnableCombo |
|
|
|
text: qsTr("Battery critical action:") |
|
|
|
anchors.topMargin: _margins |
|
|
|
visible: _failsafeBattCritActAvailable |
|
|
|
anchors.leftMargin: _margins |
|
|
|
} |
|
|
|
anchors.left: gcsEnableLabel.right |
|
|
|
FactComboBox { |
|
|
|
anchors.top: parent.top |
|
|
|
fact: _failsafeBattCritAct |
|
|
|
width: voltageField.width |
|
|
|
visible: _failsafeBattCritActAvailable |
|
|
|
fact: _failsafeGCSEnable |
|
|
|
indexModel: false |
|
|
|
indexModel: false |
|
|
|
Layout.fillWidth: true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCCheckBox { |
|
|
|
id: throttleEnableLabel |
|
|
|
text: qsTr("Voltage threshold:") |
|
|
|
anchors.margins: _margins |
|
|
|
checked: _failsafeBattVoltage.value != 0 |
|
|
|
anchors.left: parent.left |
|
|
|
onClicked: _failsafeBattVoltage.value = checked ? 10.5 : 0 |
|
|
|
anchors.baseline: throttleEnableCombo.baseline |
|
|
|
} |
|
|
|
text: qsTr("Throttle failsafe:") |
|
|
|
FactTextField { |
|
|
|
} |
|
|
|
fact: _failsafeBattVoltage |
|
|
|
|
|
|
|
showUnits: true |
|
|
|
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QGCComboBox { |
|
|
|
QGCCheckBox { |
|
|
|
id: throttleEnableCombo |
|
|
|
text: qsTr("MAH threshold:") |
|
|
|
anchors.topMargin: _margins |
|
|
|
checked: _failsafeBattMah.value != 0 |
|
|
|
anchors.left: gcsEnableCombo.left |
|
|
|
onClicked: _failsafeBattMah.value = checked ? 600 : 0 |
|
|
|
anchors.top: gcsEnableCombo.bottom |
|
|
|
} |
|
|
|
width: voltageField.width |
|
|
|
FactTextField { |
|
|
|
model: [qsTr("Disabled"), qsTr("Always RTL"), |
|
|
|
fact: _failsafeBattMah |
|
|
|
qsTr("Continue with Mission in Auto Mode"), qsTr("Always Land")] |
|
|
|
showUnits: true |
|
|
|
currentIndex: _failsafeThrEnable.value |
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
|
|
} |
|
|
|
onActivated: _failsafeThrEnable.value = index |
|
|
|
} // GridLayout |
|
|
|
} |
|
|
|
} // Column |
|
|
|
|
|
|
|
} // Rectangle |
|
|
|
|
|
|
|
} // Column - Battery Failsafe Settings |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
Column { |
|
|
|
id: throttlePWMLabel |
|
|
|
spacing: _margins / 2 |
|
|
|
anchors.margins: _margins |
|
|
|
visible: _batt2MonitorEnabled && _failsafeBatt2LowActAvailable |
|
|
|
anchors.left: parent.left |
|
|
|
|
|
|
|
anchors.baseline: throttlePWMField.baseline |
|
|
|
|
|
|
|
text: qsTr("PWM threshold:") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FactTextField { |
|
|
|
QGCLabel { |
|
|
|
id: throttlePWMField |
|
|
|
text: qsTr("Battery2 Failsafe Triggers") |
|
|
|
anchors.topMargin: _margins / 2 |
|
|
|
font.family: ScreenTools.demiboldFontFamily |
|
|
|
anchors.left: gcsEnableCombo.left |
|
|
|
} |
|
|
|
anchors.top: throttleEnableCombo.bottom |
|
|
|
|
|
|
|
fact: _failsafeThrValue |
|
|
|
|
|
|
|
showUnits: true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
Rectangle { |
|
|
|
id: batteryEnableLabel |
|
|
|
id: failsafeSettings |
|
|
|
|
|
|
|
width: battery2FailsafeColumn.x + battery2FailsafeColumn.width + _margins |
|
|
|
|
|
|
|
height: battery2FailsafeColumn.y + battery2FailsafeColumn.height + _margins |
|
|
|
|
|
|
|
color: ggcPal.windowShade |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Column { |
|
|
|
|
|
|
|
id: battery2FailsafeColumn |
|
|
|
anchors.margins: _margins |
|
|
|
anchors.margins: _margins |
|
|
|
|
|
|
|
anchors.top: parent.top |
|
|
|
anchors.left: parent.left |
|
|
|
anchors.left: parent.left |
|
|
|
anchors.baseline: batteryEnableCombo.baseline |
|
|
|
spacing: _margins |
|
|
|
text: qsTr("Battery failsafe:") |
|
|
|
|
|
|
|
} |
|
|
|
GridLayout { |
|
|
|
|
|
|
|
columnSpacing: _margins |
|
|
|
|
|
|
|
rowSpacing: _margins |
|
|
|
|
|
|
|
columns: 2 |
|
|
|
|
|
|
|
visible: _batt2MonitorEnabled && _failsafeBatt2LowActAvailable |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { text: qsTr("Battery low action:") } |
|
|
|
|
|
|
|
FactComboBox { |
|
|
|
|
|
|
|
fact: _failsafeBatt2LowAct |
|
|
|
|
|
|
|
indexModel: false |
|
|
|
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QGCComboBox { |
|
|
|
QGCLabel { |
|
|
|
id: batteryEnableCombo |
|
|
|
text: qsTr("Battery critical action:") |
|
|
|
anchors.topMargin: _margins |
|
|
|
} |
|
|
|
anchors.left: gcsEnableCombo.left |
|
|
|
FactComboBox { |
|
|
|
anchors.top: throttlePWMField.bottom |
|
|
|
fact: _failsafeBatt2CritAct |
|
|
|
width: voltageField.width |
|
|
|
indexModel: false |
|
|
|
model: [qsTr("Disabled"), qsTr("Land"), qsTr("Return to Launch")] |
|
|
|
Layout.fillWidth: true |
|
|
|
currentIndex: _failsafeBattEnable.value |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
onActivated: _failsafeBattEnable.value = index |
|
|
|
QGCCheckBox { |
|
|
|
} |
|
|
|
text: qsTr("Voltage threshold:") |
|
|
|
|
|
|
|
checked: _failsafeBatt2Voltage.value != 0 |
|
|
|
|
|
|
|
onClicked: _failsafeBatt2Voltage.value = checked ? 10.5 : 0 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
FactTextField { |
|
|
|
|
|
|
|
fact: _failsafeBatt2Voltage |
|
|
|
|
|
|
|
showUnits: true |
|
|
|
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QGCCheckBox { |
|
|
|
QGCCheckBox { |
|
|
|
id: voltageLabel |
|
|
|
text: qsTr("MAH threshold:") |
|
|
|
anchors.margins: _margins |
|
|
|
checked: _failsafeBatt2Mah.value != 0 |
|
|
|
anchors.left: parent.left |
|
|
|
onClicked: _failsafeBatt2Mah.value = checked ? 600 : 0 |
|
|
|
anchors.baseline: voltageField.baseline |
|
|
|
} |
|
|
|
text: qsTr("Voltage threshold:") |
|
|
|
FactTextField { |
|
|
|
checked: _failsafeBattVoltage.value != 0 |
|
|
|
fact: _failsafeBatt2Mah |
|
|
|
|
|
|
|
showUnits: true |
|
|
|
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} // GridLayout |
|
|
|
|
|
|
|
} // Column |
|
|
|
|
|
|
|
} // Rectangle |
|
|
|
|
|
|
|
} // Column - Battery2 Failsafe Settings |
|
|
|
|
|
|
|
|
|
|
|
onClicked: _failsafeBattVoltage.value = checked ? 10.5 : 0 |
|
|
|
Column { |
|
|
|
} |
|
|
|
spacing: _margins / 2 |
|
|
|
|
|
|
|
|
|
|
|
FactTextField { |
|
|
|
QGCLabel { |
|
|
|
id: voltageField |
|
|
|
text: qsTr("General Failsafe Triggers") |
|
|
|
anchors.topMargin: _margins / 2 |
|
|
|
font.family: ScreenTools.demiboldFontFamily |
|
|
|
anchors.left: gcsEnableCombo.left |
|
|
|
} |
|
|
|
anchors.top: batteryEnableCombo.bottom |
|
|
|
|
|
|
|
fact: _failsafeBattVoltage |
|
|
|
|
|
|
|
showUnits: true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QGCCheckBox { |
|
|
|
Rectangle { |
|
|
|
id: mahLabel |
|
|
|
width: generalFailsafeColumn.x + generalFailsafeColumn.width + _margins |
|
|
|
|
|
|
|
height: generalFailsafeColumn.y + generalFailsafeColumn.height + _margins |
|
|
|
|
|
|
|
color: ggcPal.windowShade |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Column { |
|
|
|
|
|
|
|
id: generalFailsafeColumn |
|
|
|
anchors.margins: _margins |
|
|
|
anchors.margins: _margins |
|
|
|
|
|
|
|
anchors.top: parent.top |
|
|
|
anchors.left: parent.left |
|
|
|
anchors.left: parent.left |
|
|
|
anchors.baseline: mahField.baseline |
|
|
|
spacing: _margins |
|
|
|
text: qsTr("MAH threshold:") |
|
|
|
|
|
|
|
checked: _failsafeBattMah.value != 0 |
|
|
|
GridLayout { |
|
|
|
|
|
|
|
columnSpacing: _margins |
|
|
|
|
|
|
|
rowSpacing: _margins |
|
|
|
|
|
|
|
columns: 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { text: qsTr("Ground Station failsafe:") } |
|
|
|
|
|
|
|
FactComboBox { |
|
|
|
|
|
|
|
fact: _failsafeGCSEnable |
|
|
|
|
|
|
|
indexModel: false |
|
|
|
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
onClicked: _failsafeBattMah.value = checked ? 600 : 0 |
|
|
|
QGCLabel { text: qsTr("Throttle failsafe:") } |
|
|
|
} |
|
|
|
QGCComboBox { |
|
|
|
|
|
|
|
model: [qsTr("Disabled"), qsTr("Always RTL"), |
|
|
|
|
|
|
|
qsTr("Continue with Mission in Auto Mode"), qsTr("Always Land")] |
|
|
|
|
|
|
|
currentIndex: _failsafeThrEnable.value |
|
|
|
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
|
|
|
|
|
|
FactTextField { |
|
|
|
onActivated: _failsafeThrEnable.value = index |
|
|
|
id: mahField |
|
|
|
} |
|
|
|
anchors.topMargin: _margins / 2 |
|
|
|
|
|
|
|
anchors.left: gcsEnableCombo.left |
|
|
|
QGCLabel { text: qsTr("PWM threshold:") } |
|
|
|
anchors.top: voltageField.bottom |
|
|
|
FactTextField { |
|
|
|
fact: _failsafeBattMah |
|
|
|
fact: _failsafeThrValue |
|
|
|
showUnits: true |
|
|
|
showUnits: true |
|
|
|
} |
|
|
|
Layout.fillWidth: true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} // GridLayout |
|
|
|
|
|
|
|
} // Column |
|
|
|
} // Rectangle - Failsafe Settings |
|
|
|
} // Rectangle - Failsafe Settings |
|
|
|
} // Column - Failsafe Settings |
|
|
|
} // Column - General Failsafe Settings |
|
|
|
|
|
|
|
|
|
|
|
Column { |
|
|
|
Column { |
|
|
|
spacing: _margins / 2 |
|
|
|
spacing: _margins / 2 |
|
|
|