Unverified Commit 9160c898 authored by Don Gagne's avatar Don Gagne Committed by GitHub
Browse files

Merge pull request #6507 from DonLakeFlyer/ArduCopter3.6

Adjust to new parameters in Copter 3.6
parents 4cc35937 fe7f3e93
......@@ -18,32 +18,32 @@ FactPanel {
factPanel: panel
}
property bool _useOldFrameParam: controller.parameterExists(-1, "FRAME")
property Fact _oldFrameParam: controller.getParameterFact(-1, "FRAME", false)
property Fact _newFrameParam: controller.getParameterFact(-1, "FRAME_CLASS", false)
property Fact _frameTypeParam: controller.getParameterFact(-1, "FRAME_TYPE", false)
property bool _frameAvailable: controller.parameterExists(-1, "FRAME")
property Fact _frame: controller.getParameterFact(-1, "FRAME", false)
property Fact _frameClass: controller.getParameterFact(-1, "FRAME_CLASS", false)
property Fact _frameType: controller.getParameterFact(-1, "FRAME_TYPE", false)
Column {
anchors.fill: parent
VehicleSummaryRow {
labelText: qsTr("Frame Type")
valueText: controller.currentAirframeTypeName() + " " + _oldFrameParam.enumStringValue
visible: _useOldFrameParam
valueText: visible ? controller.currentAirframeTypeName() + " " + _frame.enumStringValue : ""
visible: _frameAvailable
}
VehicleSummaryRow {
labelText: qsTr("Frame Class")
valueText: _newFrameParam.enumStringValue
visible: !_useOldFrameParam
valueText: visible ? _frameClass.enumStringValue : ""
visible: !_frameAvailable
}
VehicleSummaryRow {
labelText: qsTr("Frame Type")
valueText: _frameTypeParam.enumStringValue
visible: !_useOldFrameParam
valueText: visible ? _frameType.enumStringValue : ""
visible: !_frameAvailable
}
VehicleSummaryRow {
......
......@@ -31,46 +31,119 @@ SetupPage {
Component {
id: powerPageComponent
Column {
spacing: _margins
Flow {
id: flowLayout
width: availableWidth
spacing: _margins
property bool _batt2ParamsAvailable: controller.parameterExists(-1, "BATT2_FS_LOW_ACT")
property bool _batt2MonitorAvailable: controller.parameterExists(-1, "BATT2_MONITOR")
property Fact _batt2Monitor: controller.getParameterFact(-1, "BATT2_MONITOR", false /* reportMissing */)
QGCLabel { text: qsTr("Battery 1"); font.pointSize: ScreenTools.mediumFontPointSize }
QGCPalette { id: ggcPal; colorGroupEnabled: true }
Loader {
sourceComponent: powerSetupComponent
// Battery 1 settings
Column {
spacing: _margins / 2
QGCLabel {
text: qsTr("Battery 1")
font.family: ScreenTools.demiboldFontFamily
}
property Fact armVoltMin: controller.getParameterFact(-1, "r.ARMING_VOLT_MIN")
property Fact battAmpPerVolt: controller.getParameterFact(-1, "BATT_AMP_PERVOLT")
property Fact battCapacity: controller.getParameterFact(-1, "BATT_CAPACITY")
property Fact battCurrPin: controller.getParameterFact(-1, "BATT_CURR_PIN")
property Fact battMonitor: controller.getParameterFact(-1, "BATT_MONITOR")
property Fact battVoltMult: controller.getParameterFact(-1, "BATT_VOLT_MULT")
property Fact battVoltPin: controller.getParameterFact(-1, "BATT_VOLT_PIN")
property Fact vehicleVoltage: controller.vehicle.battery.voltage
property Fact vehicleCurrent: controller.vehicle.battery.current
Rectangle {
width: battery1Loader.x + battery1Loader.width + _margins
height: battery1Loader.y + battery1Loader.height + _margins
color: ggcPal.windowShade
Loader {
id: battery1Loader
anchors.margins: _margins
anchors.top: parent.top
anchors.left: parent.left
sourceComponent: powerSetupComponent
property Fact armVoltMin: controller.getParameterFact(-1, "r.ARMING_VOLT_MIN")
property Fact battAmpPerVolt: controller.getParameterFact(-1, "r.BATT_AMP_PERVLT")
property Fact battCapacity: controller.getParameterFact(-1, "BATT_CAPACITY")
property Fact battCurrPin: controller.getParameterFact(-1, "BATT_CURR_PIN")
property Fact battMonitor: controller.getParameterFact(-1, "BATT_MONITOR")
property Fact battVoltMult: controller.getParameterFact(-1, "BATT_VOLT_MULT")
property Fact battVoltPin: controller.getParameterFact(-1, "BATT_VOLT_PIN")
property Fact vehicleVoltage: controller.vehicle.battery.voltage
property Fact vehicleCurrent: controller.vehicle.battery.current
}
}
}
Item {
height: ScreenTools.defaultFontPixelHeight
width: 1
// Batter2 Monitor settings only - used when only monitor param is available
Column {
spacing: _margins / 2
visible: _batt2MonitorAvailable && !_batt2ParamsAvailable
QGCLabel {
text: qsTr("Battery 2")
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
width: batt2MonitorRow.x + batt2MonitorRow.width + _margins
height: batt2MonitorRow.y + batt2MonitorRow.height + _margins
color: ggcPal.windowShade
RowLayout {
id: batt2MonitorRow
anchors.margins: _margins
anchors.top: parent.top
anchors.left: parent.left
spacing: ScreenTools.defaultFontPixelWidth
visible: _batt2MonitorAvailable && !_batt2ParamsAvailable
QGCLabel { text: qsTr("Battery2 monitor:") }
FactComboBox {
id: monitorCombo
fact: _batt2Monitor
indexModel: false
}
}
}
}
QGCLabel { text: qsTr("Battery 2"); font.pointSize: ScreenTools.mediumFontPointSize }
// Battery 2 settings - Used when full params are available
Column {
spacing: _margins / 2
visible: _batt2ParamsAvailable
Loader {
sourceComponent: powerSetupComponent
QGCLabel {
text: qsTr("Battery 2")
font.family: ScreenTools.demiboldFontFamily
}
property Fact armVoltMin: controller.getParameterFact(-1, "r.ARMING_VOLT2_MIN")
property Fact battAmpPerVolt: controller.getParameterFact(-1, "BATT2_AMP_PERVOL")
property Fact battCapacity: controller.getParameterFact(-1, "BATT2_CAPACITY")
property Fact battCurrPin: controller.getParameterFact(-1, "BATT2_CURR_PIN")
property Fact battMonitor: controller.getParameterFact(-1, "BATT2_MONITOR")
property Fact battVoltMult: controller.getParameterFact(-1, "BATT2_VOLT_MULT")
property Fact battVoltPin: controller.getParameterFact(-1, "BATT2_VOLT_PIN")
property Fact vehicleVoltage: controller.vehicle.battery2.voltage
property Fact vehicleCurrent: controller.vehicle.battery2.current
Rectangle {
width: battery2Loader.x + battery2Loader.width + _margins
height: battery2Loader.y + battery2Loader.height + _margins
color: ggcPal.windowShade
Loader {
id: battery2Loader
anchors.margins: _margins
anchors.top: parent.top
anchors.left: parent.left
sourceComponent: _batt2ParamsAvailable ? powerSetupComponent : undefined
property Fact armVoltMin: controller.getParameterFact(-1, "r.ARMING_VOLT2_MIN", false /* reportMissing */)
property Fact battAmpPerVolt: controller.getParameterFact(-1, "r.BATT2_AMP_PERVLT", false /* reportMissing */)
property Fact battCapacity: controller.getParameterFact(-1, "BATT2_CAPACITY", false /* reportMissing */)
property Fact battCurrPin: controller.getParameterFact(-1, "BATT2_CURR_PIN", false /* reportMissing */)
property Fact battMonitor: controller.getParameterFact(-1, "BATT2_MONITOR", false /* reportMissing */)
property Fact battVoltMult: controller.getParameterFact(-1, "BATT2_VOLT_MULT", false /* reportMissing */)
property Fact battVoltPin: controller.getParameterFact(-1, "BATT2_VOLT_PIN", false /* reportMissing */)
property Fact vehicleVoltage: controller.vehicle.battery2.voltage
property Fact vehicleCurrent: controller.vehicle.battery2.current
}
}
}
}
} // Flow
} // Component - powerPageComponent
Component {
......
......@@ -24,20 +24,37 @@ FactPanel {
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
FactPanelController { id: controller; factPanel: panel }
property Fact battCapacity: controller.getParameterFact(-1, "BATT_CAPACITY")
property Fact battMonitor: controller.getParameterFact(-1, "BATT_MONITOR")
property bool _batt2MonitorAvailable: controller.parameterExists(-1, "BATT2_MONITOR")
property bool _batt2CapacityAvailable: controller.parameterExists(-1, "BATT2_CAPACITY")
property Fact _battCapacity: controller.getParameterFact(-1, "BATT_CAPACITY")
property Fact _batt2Capacity: controller.getParameterFact(-1, "BATT2_CAPACITY", false /* reportMissing */)
property Fact _battMonitor: controller.getParameterFact(-1, "BATT_MONITOR")
property Fact _batt2Monitor: controller.getParameterFact(-1, "BATT2_MONITOR", false /* reportMissing */)
Column {
anchors.fill: parent
VehicleSummaryRow {
labelText: qsTr("Battery monitor")
valueText: battMonitor.enumStringValue
valueText: _battMonitor.enumStringValue
}
VehicleSummaryRow {
labelText: qsTr("Battery capacity")
valueText: battCapacity.valueString + " " + battCapacity.units
valueText: _battCapacity.valueString + " " + _battCapacity.units
}
VehicleSummaryRow {
labelText: qsTr("Battery2 monitor")
valueText: _batt2MonitorAvailable ? _batt2Monitor.enumStringValue : ""
visible: _batt2MonitorAvailable
}
VehicleSummaryRow {
labelText: qsTr("Battery2 capacity")
valueText: _batt2CapacityAvailable ? _batt2Capacity.valueString + " " + _battCapacity.units : ""
visible: _batt2CapacityAvailable
}
}
}
......@@ -11,6 +11,7 @@
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtGraphicalEffects 1.0
import QtQuick.Layouts 1.2
import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
......@@ -34,12 +35,25 @@ SetupPage {
QGCPalette { id: ggcPal; colorGroupEnabled: true }
property Fact _failsafeGCSEnable: controller.getParameterFact(-1, "FS_GCS_ENABLE")
property Fact _failsafeBattEnable: controller.getParameterFact(-1, "FS_BATT_ENABLE")
property Fact _failsafeBattMah: controller.getParameterFact(-1, "FS_BATT_MAH")
property Fact _failsafeBattVoltage: controller.getParameterFact(-1, "FS_BATT_VOLTAGE")
property Fact _failsafeThrEnable: controller.getParameterFact(-1, "FS_THR_ENABLE")
property Fact _failsafeThrValue: controller.getParameterFact(-1, "FS_THR_VALUE")
property Fact _failsafeGCSEnable: controller.getParameterFact(-1, "FS_GCS_ENABLE")
property Fact _failsafeBattLowAct: controller.getParameterFact(-1, "r.BATT_FS_LOW_ACT")
property Fact _failsafeBattMah: controller.getParameterFact(-1, "r.BATT_LOW_MAH")
property Fact _failsafeBattVoltage: controller.getParameterFact(-1, "r.BATT_LOW_VOLT")
property Fact _failsafeThrEnable: controller.getParameterFact(-1, "FS_THR_ENABLE")
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 _fenceAltMax: controller.getParameterFact(-1, "FENCE_ALT_MAX")
......@@ -66,135 +80,193 @@ SetupPage {
spacing: _margins / 2
QGCLabel {
id: failsafeLabel
text: qsTr("Failsafe Triggers")
text: qsTr("Battery Failsafe Triggers")
font.family: ScreenTools.demiboldFontFamily
}
Rectangle {
id: failsafeSettings
width: throttleEnableCombo.x + throttleEnableCombo.width + _margins
height: mahField.y + mahField.height + _margins
width: batteryFailsafeColumn.x + batteryFailsafeColumn.width + _margins
height: batteryFailsafeColumn.y + batteryFailsafeColumn.height + _margins
color: ggcPal.windowShade
QGCLabel {
id: gcsEnableLabel
Column {
id: batteryFailsafeColumn
anchors.margins: _margins
anchors.top: parent.top
anchors.left: parent.left
anchors.baseline: gcsEnableCombo.baseline
text: qsTr("Ground Station failsafe:")
}
spacing: _margins
GridLayout {
id: gridLayout
columnSpacing: _margins
rowSpacing: _margins
columns: 2
QGCLabel { text: qsTr("Battery low action:") }
FactComboBox {
fact: _failsafeBattLowAct
indexModel: false
Layout.fillWidth: true
}
FactComboBox {
id: gcsEnableCombo
anchors.topMargin: _margins
anchors.leftMargin: _margins
anchors.left: gcsEnableLabel.right
anchors.top: parent.top
width: voltageField.width
fact: _failsafeGCSEnable
indexModel: false
}
QGCLabel {
text: qsTr("Battery critical action:")
visible: _failsafeBattCritActAvailable
}
FactComboBox {
fact: _failsafeBattCritAct
visible: _failsafeBattCritActAvailable
indexModel: false
Layout.fillWidth: true
}
QGCLabel {
id: throttleEnableLabel
anchors.margins: _margins
anchors.left: parent.left
anchors.baseline: throttleEnableCombo.baseline
text: qsTr("Throttle failsafe:")
}
QGCCheckBox {
text: qsTr("Voltage threshold:")
checked: _failsafeBattVoltage.value != 0
onClicked: _failsafeBattVoltage.value = checked ? 10.5 : 0
}
FactTextField {
fact: _failsafeBattVoltage
showUnits: true
Layout.fillWidth: true
}
QGCComboBox {
id: throttleEnableCombo
anchors.topMargin: _margins
anchors.left: gcsEnableCombo.left
anchors.top: gcsEnableCombo.bottom
width: voltageField.width
model: [qsTr("Disabled"), qsTr("Always RTL"),
qsTr("Continue with Mission in Auto Mode"), qsTr("Always Land")]
currentIndex: _failsafeThrEnable.value
onActivated: _failsafeThrEnable.value = index
}
QGCCheckBox {
text: qsTr("MAH threshold:")
checked: _failsafeBattMah.value != 0
onClicked: _failsafeBattMah.value = checked ? 600 : 0
}
FactTextField {
fact: _failsafeBattMah
showUnits: true
Layout.fillWidth: true
}
} // GridLayout
} // Column
} // Rectangle
} // Column - Battery Failsafe Settings
QGCLabel {
id: throttlePWMLabel
anchors.margins: _margins
anchors.left: parent.left
anchors.baseline: throttlePWMField.baseline
text: qsTr("PWM threshold:")
}
Column {
spacing: _margins / 2
visible: _batt2MonitorEnabled && _failsafeBatt2LowActAvailable
FactTextField {
id: throttlePWMField
anchors.topMargin: _margins / 2
anchors.left: gcsEnableCombo.left
anchors.top: throttleEnableCombo.bottom
fact: _failsafeThrValue
showUnits: true
}
QGCLabel {
text: qsTr("Battery2 Failsafe Triggers")
font.family: ScreenTools.demiboldFontFamily
}
QGCLabel {
id: batteryEnableLabel
Rectangle {
id: failsafeSettings
width: battery2FailsafeColumn.x + battery2FailsafeColumn.width + _margins
height: battery2FailsafeColumn.y + battery2FailsafeColumn.height + _margins
color: ggcPal.windowShade
Column {
id: battery2FailsafeColumn
anchors.margins: _margins
anchors.top: parent.top
anchors.left: parent.left
anchors.baseline: batteryEnableCombo.baseline
text: qsTr("Battery failsafe:")
}
spacing: _margins
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 {
id: batteryEnableCombo
anchors.topMargin: _margins
anchors.left: gcsEnableCombo.left
anchors.top: throttlePWMField.bottom
width: voltageField.width
model: [qsTr("Disabled"), qsTr("Land"), qsTr("Return to Launch")]
currentIndex: _failsafeBattEnable.value
QGCLabel {
text: qsTr("Battery critical action:")
}
FactComboBox {
fact: _failsafeBatt2CritAct
indexModel: false
Layout.fillWidth: true
}
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 {
id: voltageLabel
anchors.margins: _margins
anchors.left: parent.left
anchors.baseline: voltageField.baseline
text: qsTr("Voltage threshold:")
checked: _failsafeBattVoltage.value != 0
QGCCheckBox {
text: qsTr("MAH threshold:")
checked: _failsafeBatt2Mah.value != 0
onClicked: _failsafeBatt2Mah.value = checked ? 600 : 0
}
FactTextField {
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 {
id: voltageField
anchors.topMargin: _margins / 2
anchors.left: gcsEnableCombo.left
anchors.top: batteryEnableCombo.bottom
fact: _failsafeBattVoltage
showUnits: true
}
QGCLabel {
text: qsTr("General Failsafe Triggers")
font.family: ScreenTools.demiboldFontFamily
}
QGCCheckBox {
id: mahLabel
Rectangle {
width: generalFailsafeColumn.x + generalFailsafeColumn.width + _margins
height: generalFailsafeColumn.y + generalFailsafeColumn.height + _margins
color: ggcPal.windowShade
Column {
id: generalFailsafeColumn
anchors.margins: _margins
anchors.top: parent.top
anchors.left: parent.left
anchors.baseline: mahField.baseline
text: qsTr("MAH threshold:")
checked: _failsafeBattMah.value != 0
spacing: _margins
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 {
id: mahField
anchors.topMargin: _margins / 2
anchors.left: gcsEnableCombo.left
anchors.top: voltageField.bottom
fact: _failsafeBattMah
showUnits: true
}
onActivated: _failsafeThrEnable.value = index
}
QGCLabel { text: qsTr("PWM threshold:") }
FactTextField {
fact: _failsafeThrValue
showUnits: true
Layout.fillWidth: true
}
} // GridLayout
} // Column
} // Rectangle - Failsafe Settings
} // Column - Failsafe Settings
} // Column - General Failsafe Settings
Column {
spacing: _margins / 2
......
......@@ -34,8 +34,8 @@ SetupPage {
QGCPalette { id: palette; colorGroupEnabled: true }
property Fact _failsafeBattMah: controller.getParameterFact(-1, "FS_BATT_MAH")
property Fact _failsafeBattVoltage: controller.getParameterFact(-1, "FS_BATT_VOLTAGE")
property Fact _failsafeBattMah: controller.getParameterFact(-1, "r.BATT_LOW_MAH")
property Fact _failsafeBattVoltage: controller.getParameterFact(-1, "r.BATT_LOW_VOLT")
property Fact _failsafeThrEnable: controller.getParameterFact(-1, "THR_FAILSAFE")
property Fact _failsafeThrValue: controller.getParameterFact(-1, "THR_FS_VALUE")
property Fact _failsafeGCSEnable: controller.getParameterFact(-1, "FS_GCS_ENABL")
......
......@@ -14,7 +14,7 @@ FactPanel {
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
FactPanelController { id: controller; factPanel: panel }
property Fact _failsafeBattEnable: controller.getParameterFact(-1, "FS_BATT_ENABLE")
property Fact _failsafeBattLowAct: controller.getParameterFact(-1, "r.BATT_FS_LOW_ACT")
property Fact _failsafeThrEnable: controller.getParameterFact(-1, "FS_THR_ENABLE")
property Fact _fenceAction: controller.getParameterFact(-1, "FENCE_ACTION")
......@@ -28,60 +28,14 @@ FactPanel {
property Fact _armingCheck: controller.getParameterFact(-1, "ARMING_CHECK")
property string _failsafeBattEnableText
property string _failsafeThrEnableText
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")
Component.onCompleted: {
setFailsafeBattEnableText()
setFailsafeThrEnableText()
}
Connections {
target: _failsafeBattEnable
onValueChanged: setFailsafeBattEnableText()
}
Connections {
target: _failsafeThrEnable
onValueChanged: setFailsafeThrEnableText()
}
function setFailsafeThrEnableText() {
switch (_failsafeThrEnable.value) {
case 0:
_failsafeThrEnableText = qsTr("Disabled")
break
case 1:
_failsafeThrEnableText = qsTr("Always RTL")
break
case 2:
_failsafeThrEnableText = qsTr("Continue with Mission in Auto Mode")
break
case 3:
_failsafeThrEnableText = qsTr("Always Land")
break
default:
_failsafeThrEnableText = qsTr("Unknown")
}
}
function setFailsafeBattEnableText() {
switch (_failsafeBattEnable.value) {
case 0:
_failsafeBattEnableText = qsTr("Disabled")
break
case 1:
_failsafeBattEnableText = qsTr("Land")
break
case 2:
_failsafeBattEnableText = qsTr("Return to Launch")
break
default:
_failsafeThrEnableText = qsTr("Unknown")
}
}
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 */)
Column {
anchors.fill: parent
......@@ -93,12 +47,30 @@ FactPanel {
VehicleSummaryRow {
labelText: qsTr("Throttle failsafe:")
valueText: _failsafeThrEnableText
valueText: _failsafeBattLowAct.enumStringValue
}
VehicleSummaryRow {
labelText: qsTr("Batt low failsafe:")
valueText: _failsafeBattLowAct.enumStringValue
}
VehicleSummaryRow {
labelText: qsTr("Batt critical failsafe:")
valueText: _failsafeBattCritActAvailable ? _failsafeBattCritAct.enumStringValue : ""
visible: _failsafeBattCritActAvailable
}
VehicleSummaryRow {
labelText: qsTr("Batt2 low failsafe:")
valueText: _failsafeBatt2LowActAvailable ? _failsafeBatt2LowAct.enumStringValue : ""
visible: _failsafeBatt2LowActAvailable
}
VehicleSummaryRow {
labelText: qsTr("Battery failsafe:")
valueText: _failsafeBattEnableText
labelText: qsTr("Batt2 critical failsafe:")
valueText: _failsafeBatt2CritActAvailable ? _failsafeBatt2CritAct.enumStringValue : ""
visible: _failsafeBatt2CritActAvailable
}
VehicleSummaryRow {
......
......@@ -88,6 +88,8 @@ void FactPanelController::_reportMissingParameter(int componentId, const QString
QString missingParam = QString("%1:%2").arg(componentId).arg(name);
qCWarning(FactPanelControllerLog) << "Missing parameter:" << missingParam;
// If missing parameters a reported from the constructor of a derived class we
// will not have access to _factPanel yet. Just record list of missing facts
// in that case instead of notify. Once _factPanel is available they will be
......
......@@ -791,6 +791,8 @@ QString APMFirmwarePlugin::internalParameterMetaDataFile(Vehicle* vehicle)
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.4.xml");
case 5:
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.5.xml");
case 6:
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.6.xml");
default:
if (minorVersion < 3) {
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.3.xml");
......
This diff is collapsed.
......@@ -47,6 +47,7 @@
<file alias="APMParameterFactMetaData.Copter.3.3.xml">APMParameterFactMetaData.Copter.3.3.xml</file>
<file alias="APMParameterFactMetaData.Copter.3.4.xml">APMParameterFactMetaData.Copter.3.4.xml</file>
<file alias="APMParameterFactMetaData.Copter.3.5.xml">APMParameterFactMetaData.Copter.3.5.xml</file>
<file alias="APMParameterFactMetaData.Copter.3.6.xml">APMParameterFactMetaData.Copter.3.6.xml</file>
<file alias="APMParameterFactMetaData.Rover.3.0.xml">APMParameterFactMetaData.Rover.3.0.xml</file>
<file alias="APMParameterFactMetaData.Rover.3.2.xml">APMParameterFactMetaData.Rover.3.2.xml</file>
<file alias="APMParameterFactMetaData.Sub.3.4.xml">APMParameterFactMetaData.Sub.3.4.xml</file>
......
......@@ -148,6 +148,14 @@ ArduCopterFirmwarePlugin::ArduCopterFirmwarePlugin(void)
remapV3_5["ARMING_VOLT_MIN"] = QStringLiteral("ARMING_MIN_VOLT");
remapV3_5["ARMING_VOLT2_MIN"] = QStringLiteral("ARMING_MIN_VOLT2");
FirmwarePlugin::remapParamNameMap_t& remapV3_6 = _remapParamName[3][6];
remapV3_6["BATT_AMP_PERVLT"] = QStringLiteral("BATT_AMP_PERVOL");
remapV3_6["BATT2_AMP_PERVLT"] = QStringLiteral("BATT2_AMP_PERVOL");
remapV3_6["BATT_LOW_MAH"] = QStringLiteral("FS_BATT_MAH");
remapV3_6["BATT_LOW_VOLT"] = QStringLiteral("FS_BATT_VOLTAGE");
remapV3_6["BATT_FS_LOW_ACT"] = QStringLiteral("FS_BATT_ENABLE");
_remapParamNameIntialized = true;
}
}
......
Supports Markdown
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