Browse Source

Merge pull request #6507 from DonLakeFlyer/ArduCopter3.6

Adjust to new parameters in Copter 3.6
QGC4.4
Don Gagne 7 years ago committed by GitHub
parent
commit
9160c898dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      src/AutoPilotPlugins/APM/APMAirframeComponentSummary.qml
  2. 133
      src/AutoPilotPlugins/APM/APMPowerComponent.qml
  3. 25
      src/AutoPilotPlugins/APM/APMPowerComponentSummary.qml
  4. 288
      src/AutoPilotPlugins/APM/APMSafetyComponentCopter.qml
  5. 4
      src/AutoPilotPlugins/APM/APMSafetyComponentPlane.qml
  6. 86
      src/AutoPilotPlugins/APM/APMSafetyComponentSummaryCopter.qml
  7. 2
      src/FactSystem/FactControls/FactPanelController.cc
  8. 2
      src/FirmwarePlugin/APM/APMFirmwarePlugin.cc
  9. 9398
      src/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.6.xml
  10. 1
      src/FirmwarePlugin/APM/APMResources.qrc
  11. 8
      src/FirmwarePlugin/APM/ArduCopterFirmwarePlugin.cc

22
src/AutoPilotPlugins/APM/APMAirframeComponentSummary.qml

@ -18,32 +18,32 @@ FactPanel {
factPanel: panel factPanel: panel
} }
property bool _useOldFrameParam: controller.parameterExists(-1, "FRAME") property bool _frameAvailable: controller.parameterExists(-1, "FRAME")
property Fact _oldFrameParam: controller.getParameterFact(-1, "FRAME", false)
property Fact _newFrameParam: controller.getParameterFact(-1, "FRAME_CLASS", false) property Fact _frame: controller.getParameterFact(-1, "FRAME", false)
property Fact _frameTypeParam: controller.getParameterFact(-1, "FRAME_TYPE", false) property Fact _frameClass: controller.getParameterFact(-1, "FRAME_CLASS", false)
property Fact _frameType: controller.getParameterFact(-1, "FRAME_TYPE", false)
Column { Column {
anchors.fill: parent anchors.fill: parent
VehicleSummaryRow { VehicleSummaryRow {
labelText: qsTr("Frame Type") labelText: qsTr("Frame Type")
valueText: controller.currentAirframeTypeName() + " " + _oldFrameParam.enumStringValue valueText: visible ? controller.currentAirframeTypeName() + " " + _frame.enumStringValue : ""
visible: _useOldFrameParam visible: _frameAvailable
} }
VehicleSummaryRow { VehicleSummaryRow {
labelText: qsTr("Frame Class") labelText: qsTr("Frame Class")
valueText: _newFrameParam.enumStringValue valueText: visible ? _frameClass.enumStringValue : ""
visible: !_useOldFrameParam visible: !_frameAvailable
} }
VehicleSummaryRow { VehicleSummaryRow {
labelText: qsTr("Frame Type") labelText: qsTr("Frame Type")
valueText: _frameTypeParam.enumStringValue valueText: visible ? _frameType.enumStringValue : ""
visible: !_useOldFrameParam visible: !_frameAvailable
} }
VehicleSummaryRow { VehicleSummaryRow {

133
src/AutoPilotPlugins/APM/APMPowerComponent.qml

@ -31,46 +31,119 @@ SetupPage {
Component { Component {
id: powerPageComponent id: powerPageComponent
Column { Flow {
spacing: _margins 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 { // Battery 1 settings
sourceComponent: powerSetupComponent Column {
spacing: _margins / 2
QGCLabel {
text: qsTr("Battery 1")
font.family: ScreenTools.demiboldFontFamily
}
property Fact armVoltMin: controller.getParameterFact(-1, "r.ARMING_VOLT_MIN") Rectangle {
property Fact battAmpPerVolt: controller.getParameterFact(-1, "BATT_AMP_PERVOLT") width: battery1Loader.x + battery1Loader.width + _margins
property Fact battCapacity: controller.getParameterFact(-1, "BATT_CAPACITY") height: battery1Loader.y + battery1Loader.height + _margins
property Fact battCurrPin: controller.getParameterFact(-1, "BATT_CURR_PIN") color: ggcPal.windowShade
property Fact battMonitor: controller.getParameterFact(-1, "BATT_MONITOR")
property Fact battVoltMult: controller.getParameterFact(-1, "BATT_VOLT_MULT") Loader {
property Fact battVoltPin: controller.getParameterFact(-1, "BATT_VOLT_PIN") id: battery1Loader
property Fact vehicleVoltage: controller.vehicle.battery.voltage anchors.margins: _margins
property Fact vehicleCurrent: controller.vehicle.battery.current 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 { // Batter2 Monitor settings only - used when only monitor param is available
height: ScreenTools.defaultFontPixelHeight Column {
width: 1 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 { QGCLabel {
sourceComponent: powerSetupComponent text: qsTr("Battery 2")
font.family: ScreenTools.demiboldFontFamily
}
property Fact armVoltMin: controller.getParameterFact(-1, "r.ARMING_VOLT2_MIN") Rectangle {
property Fact battAmpPerVolt: controller.getParameterFact(-1, "BATT2_AMP_PERVOL") width: battery2Loader.x + battery2Loader.width + _margins
property Fact battCapacity: controller.getParameterFact(-1, "BATT2_CAPACITY") height: battery2Loader.y + battery2Loader.height + _margins
property Fact battCurrPin: controller.getParameterFact(-1, "BATT2_CURR_PIN") color: ggcPal.windowShade
property Fact battMonitor: controller.getParameterFact(-1, "BATT2_MONITOR")
property Fact battVoltMult: controller.getParameterFact(-1, "BATT2_VOLT_MULT") Loader {
property Fact battVoltPin: controller.getParameterFact(-1, "BATT2_VOLT_PIN") id: battery2Loader
property Fact vehicleVoltage: controller.vehicle.battery2.voltage anchors.margins: _margins
property Fact vehicleCurrent: controller.vehicle.battery2.current 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 - powerPageComponent
Component { Component {

25
src/AutoPilotPlugins/APM/APMPowerComponentSummary.qml

@ -24,20 +24,37 @@ FactPanel {
QGCPalette { id: qgcPal; colorGroupEnabled: enabled } QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
FactPanelController { id: controller; factPanel: panel } FactPanelController { id: controller; factPanel: panel }
property Fact battCapacity: controller.getParameterFact(-1, "BATT_CAPACITY") property bool _batt2MonitorAvailable: controller.parameterExists(-1, "BATT2_MONITOR")
property Fact battMonitor: controller.getParameterFact(-1, "BATT_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 { Column {
anchors.fill: parent anchors.fill: parent
VehicleSummaryRow { VehicleSummaryRow {
labelText: qsTr("Battery monitor") labelText: qsTr("Battery monitor")
valueText: battMonitor.enumStringValue valueText: _battMonitor.enumStringValue
} }
VehicleSummaryRow { VehicleSummaryRow {
labelText: qsTr("Battery capacity") 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
} }
} }
} }

288
src/AutoPilotPlugins/APM/APMSafetyComponentCopter.qml

@ -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

4
src/AutoPilotPlugins/APM/APMSafetyComponentPlane.qml

@ -34,8 +34,8 @@ SetupPage {
QGCPalette { id: palette; colorGroupEnabled: true } QGCPalette { id: palette; colorGroupEnabled: true }
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, "THR_FAILSAFE") property Fact _failsafeThrEnable: controller.getParameterFact(-1, "THR_FAILSAFE")
property Fact _failsafeThrValue: controller.getParameterFact(-1, "THR_FS_VALUE") property Fact _failsafeThrValue: controller.getParameterFact(-1, "THR_FS_VALUE")
property Fact _failsafeGCSEnable: controller.getParameterFact(-1, "FS_GCS_ENABL") property Fact _failsafeGCSEnable: controller.getParameterFact(-1, "FS_GCS_ENABL")

86
src/AutoPilotPlugins/APM/APMSafetyComponentSummaryCopter.qml

@ -14,7 +14,7 @@ FactPanel {
QGCPalette { id: qgcPal; colorGroupEnabled: enabled } QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
FactPanelController { id: controller; factPanel: panel } 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 _failsafeThrEnable: controller.getParameterFact(-1, "FS_THR_ENABLE")
property Fact _fenceAction: controller.getParameterFact(-1, "FENCE_ACTION") property Fact _fenceAction: controller.getParameterFact(-1, "FENCE_ACTION")
@ -28,60 +28,14 @@ FactPanel {
property Fact _armingCheck: controller.getParameterFact(-1, "ARMING_CHECK") property Fact _armingCheck: controller.getParameterFact(-1, "ARMING_CHECK")
property string _failsafeBattEnableText property bool _failsafeBattCritActAvailable: controller.parameterExists(-1, "BATT_FS_CRT_ACT")
property string _failsafeThrEnableText property bool _failsafeBatt2LowActAvailable: controller.parameterExists(-1, "BATT2_FS_LOW_ACT")
property bool _failsafeBatt2CritActAvailable: controller.parameterExists(-1, "BATT2_FS_CRT_ACT")
Component.onCompleted: { property Fact _failsafeBattCritAct: controller.getParameterFact(-1, "BATT_FS_CRT_ACT", false /* reportMissing */)
setFailsafeBattEnableText() property Fact _batt2Monitor: controller.getParameterFact(-1, "BATT2_MONITOR", false /* reportMissing */)
setFailsafeThrEnableText() property Fact _failsafeBatt2LowAct: controller.getParameterFact(-1, "BATT2_FS_LOW_ACT", false /* reportMissing */)
} property Fact _failsafeBatt2CritAct: controller.getParameterFact(-1, "BATT2_FS_CRT_ACT", false /* reportMissing */)
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")
}
}
Column { Column {
anchors.fill: parent anchors.fill: parent
@ -93,12 +47,30 @@ FactPanel {
VehicleSummaryRow { VehicleSummaryRow {
labelText: qsTr("Throttle failsafe:") 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 { VehicleSummaryRow {
labelText: qsTr("Battery failsafe:") labelText: qsTr("Batt2 critical failsafe:")
valueText: _failsafeBattEnableText valueText: _failsafeBatt2CritActAvailable ? _failsafeBatt2CritAct.enumStringValue : ""
visible: _failsafeBatt2CritActAvailable
} }
VehicleSummaryRow { VehicleSummaryRow {

2
src/FactSystem/FactControls/FactPanelController.cc

@ -88,6 +88,8 @@ void FactPanelController::_reportMissingParameter(int componentId, const QString
QString missingParam = QString("%1:%2").arg(componentId).arg(name); 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 // 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 // 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 // in that case instead of notify. Once _factPanel is available they will be

2
src/FirmwarePlugin/APM/APMFirmwarePlugin.cc

@ -791,6 +791,8 @@ QString APMFirmwarePlugin::internalParameterMetaDataFile(Vehicle* vehicle)
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.4.xml"); return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.4.xml");
case 5: case 5:
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.5.xml"); return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.5.xml");
case 6:
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.6.xml");
default: default:
if (minorVersion < 3) { if (minorVersion < 3) {
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.3.xml"); return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.3.xml");

9398
src/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.6.xml

File diff suppressed because it is too large Load Diff

1
src/FirmwarePlugin/APM/APMResources.qrc

@ -47,6 +47,7 @@
<file alias="APMParameterFactMetaData.Copter.3.3.xml">APMParameterFactMetaData.Copter.3.3.xml</file> <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.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.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.0.xml">APMParameterFactMetaData.Rover.3.0.xml</file>
<file alias="APMParameterFactMetaData.Rover.3.2.xml">APMParameterFactMetaData.Rover.3.2.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> <file alias="APMParameterFactMetaData.Sub.3.4.xml">APMParameterFactMetaData.Sub.3.4.xml</file>

8
src/FirmwarePlugin/APM/ArduCopterFirmwarePlugin.cc

@ -148,6 +148,14 @@ ArduCopterFirmwarePlugin::ArduCopterFirmwarePlugin(void)
remapV3_5["ARMING_VOLT_MIN"] = QStringLiteral("ARMING_MIN_VOLT"); remapV3_5["ARMING_VOLT_MIN"] = QStringLiteral("ARMING_MIN_VOLT");
remapV3_5["ARMING_VOLT2_MIN"] = QStringLiteral("ARMING_MIN_VOLT2"); 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; _remapParamNameIntialized = true;
} }
} }

Loading…
Cancel
Save