Unverified Commit 5e4c477b authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #6641 from DonLakeFlyer/ArduPilotParams

ArduPilot: Fixup Power/Safety for new/missing params
parents c489483d 06339ea1
......@@ -30,20 +30,20 @@ QString APMSafetyComponent::name(void) const
QString APMSafetyComponent::description(void) const
{
switch (_vehicle->vehicleType()) {
case MAV_TYPE_SUBMARINE:
return tr("Safety Setup is used to setup failsafe actions, leak detection, and arming checks.");
break;
case MAV_TYPE_GROUND_ROVER:
case MAV_TYPE_FIXED_WING:
case MAV_TYPE_QUADROTOR:
case MAV_TYPE_COAXIAL:
case MAV_TYPE_HELICOPTER:
case MAV_TYPE_HEXAROTOR:
case MAV_TYPE_OCTOROTOR:
case MAV_TYPE_TRICOPTER:
default:
return tr("Safety Setup is used to setup triggers for Return to Land as well as the settings for Return to Land itself.");
break;
case MAV_TYPE_SUBMARINE:
return tr("Safety Setup is used to setup failsafe actions, leak detection, and arming checks.");
break;
case MAV_TYPE_GROUND_ROVER:
case MAV_TYPE_FIXED_WING:
case MAV_TYPE_QUADROTOR:
case MAV_TYPE_COAXIAL:
case MAV_TYPE_HELICOPTER:
case MAV_TYPE_HEXAROTOR:
case MAV_TYPE_OCTOROTOR:
case MAV_TYPE_TRICOPTER:
default:
return tr("Safety Setup is used to setup triggers for Return to Land as well as the settings for Return to Land itself.");
break;
}
}
......@@ -73,26 +73,22 @@ QUrl APMSafetyComponent::setupSource(void) const
QString qmlFile;
switch (_vehicle->vehicleType()) {
case MAV_TYPE_FIXED_WING:
qmlFile = QStringLiteral("qrc:/qml/APMSafetyComponentPlane.qml");
break;
case MAV_TYPE_QUADROTOR:
case MAV_TYPE_COAXIAL:
case MAV_TYPE_HELICOPTER:
case MAV_TYPE_HEXAROTOR:
case MAV_TYPE_OCTOROTOR:
case MAV_TYPE_TRICOPTER:
qmlFile = QStringLiteral("qrc:/qml/APMSafetyComponentCopter.qml");
break;
case MAV_TYPE_SUBMARINE:
qmlFile = QStringLiteral("qrc:/qml/APMSafetyComponentSub.qml");
break;
case MAV_TYPE_GROUND_ROVER:
qmlFile = QStringLiteral("qrc:/qml/APMSafetyComponentRover.qml");
break;
default:
qmlFile = QStringLiteral("qrc:/qml/APMNotSupported.qml");
break;
case MAV_TYPE_FIXED_WING:
case MAV_TYPE_QUADROTOR:
case MAV_TYPE_COAXIAL:
case MAV_TYPE_HELICOPTER:
case MAV_TYPE_HEXAROTOR:
case MAV_TYPE_OCTOROTOR:
case MAV_TYPE_TRICOPTER:
case MAV_TYPE_GROUND_ROVER:
qmlFile = QStringLiteral("qrc:/qml/APMSafetyComponent.qml");
break;
case MAV_TYPE_SUBMARINE:
qmlFile = QStringLiteral("qrc:/qml/APMSafetyComponentSub.qml");
break;
default:
qmlFile = QStringLiteral("qrc:/qml/APMNotSupported.qml");
break;
}
return QUrl::fromUserInput(qmlFile);
......@@ -103,26 +99,22 @@ QUrl APMSafetyComponent::summaryQmlSource(void) const
QString qmlFile;
switch (_vehicle->vehicleType()) {
case MAV_TYPE_FIXED_WING:
qmlFile = QStringLiteral("qrc:/qml/APMSafetyComponentSummaryPlane.qml");
break;
case MAV_TYPE_QUADROTOR:
case MAV_TYPE_COAXIAL:
case MAV_TYPE_HELICOPTER:
case MAV_TYPE_HEXAROTOR:
case MAV_TYPE_OCTOROTOR:
case MAV_TYPE_TRICOPTER:
qmlFile = QStringLiteral("qrc:/qml/APMSafetyComponentSummaryCopter.qml");
break;
case MAV_TYPE_SUBMARINE:
qmlFile = QStringLiteral("qrc:/qml/APMSafetyComponentSummarySub.qml");
break;
case MAV_TYPE_GROUND_ROVER:
qmlFile = QStringLiteral("qrc:/qml/APMSafetyComponentSummaryRover.qml");
break;
default:
qmlFile = QStringLiteral("qrc:/qml/APMNotSupported.qml");
break;
case MAV_TYPE_FIXED_WING:
case MAV_TYPE_QUADROTOR:
case MAV_TYPE_COAXIAL:
case MAV_TYPE_HELICOPTER:
case MAV_TYPE_HEXAROTOR:
case MAV_TYPE_OCTOROTOR:
case MAV_TYPE_TRICOPTER:
case MAV_TYPE_GROUND_ROVER:
qmlFile = QStringLiteral("qrc:/qml/APMSafetyComponentSummary.qml");
break;
case MAV_TYPE_SUBMARINE:
qmlFile = QStringLiteral("qrc:/qml/APMSafetyComponentSummarySub.qml");
break;
default:
qmlFile = QStringLiteral("qrc:/qml/APMNotSupported.qml");
break;
}
return QUrl::fromUserInput(qmlFile);
......
This diff is collapsed.
import QtQuick 2.3
import QtQuick.Controls 1.2
import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
FactPanel {
id: panel
anchors.fill: parent
color: qgcPal.windowShadeDark
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
FactPanelController { id: controller; factPanel: panel }
property Fact _copterFenceAction: controller.getParameterFact(-1, "FENCE_ACTION", false /* reportMissing */)
property Fact _copterFenceEnable: controller.getParameterFact(-1, "FENCE_ENABLE", false /* reportMissing */)
property Fact _copterFenceType: controller.getParameterFact(-1, "FENCE_TYPE", false /* reportMissing */)
property Fact _batt1Monitor: controller.getParameterFact(-1, "BATT_MONITOR")
property Fact _batt2Monitor: controller.getParameterFact(-1, "BATT2_MONITOR", false /* reportMissing */)
property bool _batt2MonitorAvailable: controller.parameterExists(-1, "BATT2_MONITOR")
property bool _batt1MonitorEnabled: _batt1Monitor.rawValue !== 0
property bool _batt2MonitorEnabled: _batt2MonitorAvailable && _batt2Monitor.rawValue !== 0
property Fact _batt1FSLowAct: controller.getParameterFact(-1, "r.BATT_FS_LOW_ACT", false /* reportMissing */)
property Fact _batt1FSCritAct: controller.getParameterFact(-1, "BATT_FS_CRT_ACT", false /* reportMissing */)
property Fact _batt2FSLowAct: controller.getParameterFact(-1, "BATT2_FS_LOW_ACT", false /* reportMissing */)
property Fact _batt2FSCritAct: controller.getParameterFact(-1, "BATT2_FS_CRT_ACT", false /* reportMissing */)
property bool _batt1FSCritActAvailable: controller.parameterExists(-1, "BATT_FS_CRT_ACT")
Column {
anchors.fill: parent
VehicleSummaryRow {
labelText: qsTr("Arming Checks:")
valueText: fact.value & 1 ? qsTr("Enabled") : qsTr("Some disabled")
property Fact fact: controller.getParameterFact(-1, "ARMING_CHECK")
}
VehicleSummaryRow {
labelText: qsTr("Throttle failsafe:")
valueText: Fact.enumStringValue
visible: controller.vehicle.multiRotor
property Fact fact: controller.getParameterFact(-1, "FS_THR_ENABLE", false /* reportMissing */)
}
VehicleSummaryRow {
labelText: qsTr("Throttle failsafe:")
valueText: fact.enumStringValue
visible: controller.vehicle.fixedWing
property Fact fact: controller.getParameterFact(-1, "THR_FAILSAFE", false /* reportMissing */)
}
VehicleSummaryRow {
labelText: qsTr("Throttle failsafe:")
valueText: fact.enumStringValue
visible: controller.vehicle.rover
property Fact fact: controller.getParameterFact(-1, "FS_THR_ENABLE", false /* reportMissing */)
}
VehicleSummaryRow {
labelText: qsTr("Failsafe Action:")
valueText: fact.enumStringValue
visible: controller.vehicle.rover
property Fact fact: controller.getParameterFact(-1, "FS_ACTION", false /* reportMissing */)
}
VehicleSummaryRow {
labelText: qsTr("Failsafe Crash Check:")
valueText: fact.enumStringValue
visible: controller.vehicle.rover
property Fact fact: controller.getParameterFact(-1, "FS_CRASH_CHECK", false /* reportMissing */)
}
VehicleSummaryRow {
labelText: qsTr("Batt1 low failsafe:")
valueText: _batt1MonitorEnabled ? _batt1FSLowAct.enumStringValue : ""
visible: _batt1MonitorEnabled
}
VehicleSummaryRow {
labelText: qsTr("Batt1 critical failsafe:")
valueText: _batt1FSCritActAvailable ? _batt1FSCritAct.enumStringValue : ""
visible: _batt1FSCritActAvailable
}
VehicleSummaryRow {
labelText: qsTr("Batt2 low failsafe:")
valueText: _batt2MonitorEnabled ? _batt2FSLowAct.enumStringValue : ""
visible: _batt2MonitorEnabled
}
VehicleSummaryRow {
labelText: qsTr("Batt2 critical failsafe:")
valueText: _batt2MonitorEnabled ? _batt2FSCritAct.enumStringValue : ""
visible: _batt2MonitorEnabled
}
VehicleSummaryRow {
labelText: qsTr("GeoFence:")
valueText: _copterFenceEnable.value == 0 || _copterFenceType == 0 ?
qsTr("Disabled") :
(_copterFenceType.value == 1 ?
qsTr("Altitude") :
(_copterFenceType.value == 2 ? qsTr("Circle") : qsTr("Altitude,Circle")))
visible: controller.vehicle.multiRotor
}
VehicleSummaryRow {
labelText: qsTr("GeoFence:")
valueText: _copterFenceAction.value == 0 ?
qsTr("Report only") :
(_copterFenceAction.value == 1 ? qsTr("RTL or Land") : qsTr("Unknown"))
visible: controller.vehicle.multiRotor && _copterFenceEnable.value !== 0
}
VehicleSummaryRow {
labelText: qsTr("RTL min alt:")
valueText: fact.value == 0 ? qsTr("current") : fact.valueString + " " + fact.units
visible: controller.vehicle.multiRotor
property Fact fact: controller.getParameterFact(-1, "RTL_ALT", false /* reportMissing */)
}
VehicleSummaryRow {
labelText: qsTr("RTL min alt:")
valueText: fact.value < 0 ? qsTr("current") : fact.valueString + " " + fact.units
visible: controller.vehicle.fixedWing
property Fact fact: controller.getParameterFact(-1, "ALT_HOLD_RTL", false /* reportMissing */)
}
}
}
......@@ -785,6 +785,9 @@ QString APMFirmwarePlugin::internalParameterMetaDataFile(Vehicle* vehicle)
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.3.xml");
} else if (majorVersion == 3) {
switch (minorVersion) {
case 0:
case 1:
case 2:
case 3:
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.3.xml");
case 4:
......@@ -792,11 +795,8 @@ QString APMFirmwarePlugin::internalParameterMetaDataFile(Vehicle* vehicle)
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");
}
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.6.xml");
}
}
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Copter.3.5.xml");
......@@ -812,6 +812,9 @@ QString APMFirmwarePlugin::internalParameterMetaDataFile(Vehicle* vehicle)
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Plane.3.3.xml");
} else if (majorVersion == 3) {
switch (minorVersion) {
case 0:
case 1:
case 2:
case 3:
case 4:
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Plane.3.3.xml");
......@@ -820,10 +823,9 @@ QString APMFirmwarePlugin::internalParameterMetaDataFile(Vehicle* vehicle)
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Plane.3.5.xml");
case 7:
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Plane.3.7.xml");
case 8:
default:
if (minorVersion < 3) {
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Plane.3.3.xml");
}
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Plane.3.8.xml");
}
}
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Plane.3.8.xml");
......@@ -836,8 +838,12 @@ QString APMFirmwarePlugin::internalParameterMetaDataFile(Vehicle* vehicle)
case 0:
case 1:
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Rover.3.0.xml");
default:
case 2:
case 3:
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Rover.3.2.xml");
case 4:
default:
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Rover.3.4.xml");
}
}
return QStringLiteral(":/FirmwarePlugin/APM/APMParameterFactMetaData.Rover.3.2.xml");
......
This diff is collapsed.
......@@ -15,13 +15,9 @@
<file alias="APMPowerComponent.qml">../../AutoPilotPlugins/APM/APMPowerComponent.qml</file>
<file alias="APMPowerComponentSummary.qml">../../AutoPilotPlugins/APM/APMPowerComponentSummary.qml</file>
<file alias="APMRadioComponentSummary.qml">../../AutoPilotPlugins/APM/APMRadioComponentSummary.qml</file>
<file alias="APMSafetyComponentCopter.qml">../../AutoPilotPlugins/APM/APMSafetyComponentCopter.qml</file>
<file alias="APMSafetyComponentPlane.qml">../../AutoPilotPlugins/APM/APMSafetyComponentPlane.qml</file>
<file alias="APMSafetyComponentRover.qml">../../AutoPilotPlugins/APM/APMSafetyComponentRover.qml</file>
<file alias="APMSafetyComponent.qml">../../AutoPilotPlugins/APM/APMSafetyComponent.qml</file>
<file alias="APMSafetyComponentSub.qml">../../AutoPilotPlugins/APM/APMSafetyComponentSub.qml</file>
<file alias="APMSafetyComponentSummaryCopter.qml">../../AutoPilotPlugins/APM/APMSafetyComponentSummaryCopter.qml</file>
<file alias="APMSafetyComponentSummaryPlane.qml">../../AutoPilotPlugins/APM/APMSafetyComponentSummaryPlane.qml</file>
<file alias="APMSafetyComponentSummaryRover.qml">../../AutoPilotPlugins/APM/APMSafetyComponentSummaryRover.qml</file>
<file alias="APMSafetyComponentSummary.qml">../../AutoPilotPlugins/APM/APMSafetyComponentSummary.qml</file>
<file alias="APMSafetyComponentSummarySub.qml">../../AutoPilotPlugins/APM/APMSafetyComponentSummarySub.qml</file>
<file alias="APMSensorsComponent.qml">../../AutoPilotPlugins/APM/APMSensorsComponent.qml</file>
<file alias="APMSensorsComponentSummary.qml">../../AutoPilotPlugins/APM/APMSensorsComponentSummary.qml</file>
......@@ -51,6 +47,7 @@
<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.Rover.3.4.xml">APMParameterFactMetaData.Rover.3.4.xml</file>
<file alias="APMParameterFactMetaData.Sub.3.4.xml">APMParameterFactMetaData.Sub.3.4.xml</file>
<file alias="APMParameterFactMetaData.Sub.3.5.xml">APMParameterFactMetaData.Sub.3.5.xml</file>
<file alias="Copter.OfflineEditing.params">Copter3.5.OfflineEditing.params</file>
......
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