Unverified Commit 58227dfd authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #7500 from mavlink/apmNewUI

Fix several issues with APM using the new UI model.
parents 75770477 e3a4b9ec
...@@ -62,10 +62,7 @@ SetupPage { ...@@ -62,10 +62,7 @@ SetupPage {
} }
} }
APMAirframeComponentController { APMAirframeComponentController { id: controller; }
id: controller
factPanel: airframePage.viewPanel
}
QGCLabel { QGCLabel {
id: helpText id: helpText
......
...@@ -7,16 +7,10 @@ import QGroundControl.Controls 1.0 ...@@ -7,16 +7,10 @@ import QGroundControl.Controls 1.0
import QGroundControl.Controllers 1.0 import QGroundControl.Controllers 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
FactPanel { Item {
id: panel anchors.fill: parent
anchors.fill: parent
color: qgcPal.windowShadeDark APMAirframeComponentController {id: controller; }
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
APMAirframeComponentController {
id: controller
factPanel: panel
}
property Fact _frameClass: controller.getParameterFact(-1, "FRAME_CLASS") property Fact _frameClass: controller.getParameterFact(-1, "FRAME_CLASS")
property Fact _frameType: controller.getParameterFact(-1, "FRAME_TYPE", false) property Fact _frameType: controller.getParameterFact(-1, "FRAME_TYPE", false)
......
...@@ -165,17 +165,17 @@ SetupPage { ...@@ -165,17 +165,17 @@ SetupPage {
// Whenever an MNT_RC_IN_* setting is changed make sure to turn on RC targeting // Whenever an MNT_RC_IN_* setting is changed make sure to turn on RC targeting
Connections { Connections {
target: _mountRCInPan target: _mountRCInPan
onValueChanged: _mountDefaultMode.value = _mountDefaultModeRCTargetting onValueChanged: if(_mountDefaultMode) _mountDefaultMode.value = _mountDefaultModeRCTargetting
} }
Connections { Connections {
target: _mountRCInRoll target: _mountRCInRoll
onValueChanged: _mountDefaultMode.value = _mountDefaultModeRCTargetting onValueChanged: if(_mountDefaultMode) _mountDefaultMode.value = _mountDefaultModeRCTargetting
} }
Connections { Connections {
target: _mountRCInTilt target: _mountRCInTilt
onValueChanged: _mountDefaultMode.value = _mountDefaultModeRCTargetting onValueChanged: if(_mountDefaultMode) _mountDefaultMode.value = _mountDefaultModeRCTargetting
} }
ListModel { ListModel {
......
...@@ -29,9 +29,7 @@ SetupPage { ...@@ -29,9 +29,7 @@ SetupPage {
spacing: _margins spacing: _margins
width: availableWidth width: availableWidth
FactPanelController { id: controller; factPanel: lightsPage.viewPanel } FactPanelController { id: controller; }
QGCPalette { id: palette; colorGroupEnabled: true }
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _oldFW: _activeVehicle.versionCompare(3, 5, 2) < 0 property bool _oldFW: _activeVehicle.versionCompare(3, 5, 2) < 0
...@@ -176,7 +174,7 @@ SetupPage { ...@@ -176,7 +174,7 @@ SetupPage {
anchors.top: settingsLabel.bottom anchors.top: settingsLabel.bottom
width: lights1Combo.x + lights1Combo.width + lightsStepCombo.width + _margins width: lights1Combo.x + lights1Combo.width + lightsStepCombo.width + _margins
height: lights2Combo.y + lights2Combo.height + lightsStepCombo.height + 2*_margins height: lights2Combo.y + lights2Combo.height + lightsStepCombo.height + 2*_margins
color: palette.windowShade color: qgcPal.windowShade
QGCLabel { QGCLabel {
id: lights1Label id: lights1Label
......
...@@ -252,13 +252,13 @@ SetupPage { ...@@ -252,13 +252,13 @@ SetupPage {
QGCButton { QGCButton {
text: qsTr("Calibrate") text: qsTr("Calibrate")
enabled: _escCalibration.rawValue === 0 enabled: _escCalibration && _escCalibration.rawValue === 0
onClicked: _escCalibration.rawValue = 3 onClicked: if(_escCalibration) _escCalibration.rawValue = 3
} }
Column { Column {
enabled: _escCalibration.rawValue === 3 enabled: _escCalibration && _escCalibration.rawValue === 3
QGCLabel { text: _escCalibration.rawValue === 3 ? qsTr("Now perform these steps:") : qsTr("Click Calibrate to start, then:") } QGCLabel { text: _escCalibration ? (_escCalibration.rawValue === 3 ? qsTr("Now perform these steps:") : qsTr("Click Calibrate to start, then:")) : "" }
QGCLabel { text: qsTr("- Disconnect USB and battery so flight controller powers down") } QGCLabel { text: qsTr("- Disconnect USB and battery so flight controller powers down") }
QGCLabel { text: qsTr("- Connect the battery") } QGCLabel { text: qsTr("- Connect the battery") }
QGCLabel { text: qsTr("- The arming tone will be played (if the vehicle has a buzzer attached)") } QGCLabel { text: qsTr("- The arming tone will be played (if the vehicle has a buzzer attached)") }
......
...@@ -17,7 +17,6 @@ import QGroundControl.Palette 1.0 ...@@ -17,7 +17,6 @@ import QGroundControl.Palette 1.0
Item { Item {
anchors.fill: parent anchors.fill: parent
color: qgcPal.windowShadeDark
FactPanelController { id: controller; } FactPanelController { id: controller; }
......
...@@ -8,9 +8,7 @@ import QGroundControl.Palette 1.0 ...@@ -8,9 +8,7 @@ import QGroundControl.Palette 1.0
Item { Item {
anchors.fill: parent anchors.fill: parent
color: qgcPal.windowShadeDark
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
FactPanelController { id: controller; } FactPanelController { id: controller; }
property Fact mapRollFact: controller.getParameterFact(-1, "RCMAP_ROLL") property Fact mapRollFact: controller.getParameterFact(-1, "RCMAP_ROLL")
......
...@@ -32,14 +32,14 @@ Item { ...@@ -32,14 +32,14 @@ Item {
VehicleSummaryRow { VehicleSummaryRow {
labelText: qsTr("Arming Checks:") labelText: qsTr("Arming Checks:")
valueText: fact.value & 1 ? qsTr("Enabled") : qsTr("Some disabled") valueText: fact ? (fact.value & 1 ? qsTr("Enabled") : qsTr("Some disabled")) : ""
property Fact fact: controller.getParameterFact(-1, "ARMING_CHECK") property Fact fact: controller.getParameterFact(-1, "ARMING_CHECK")
} }
VehicleSummaryRow { VehicleSummaryRow {
labelText: qsTr("Throttle failsafe:") labelText: qsTr("Throttle failsafe:")
valueText: fact.enumStringValue valueText: fact ? fact.enumStringValue : ""
visible: controller.vehicle.multiRotor visible: controller.vehicle.multiRotor
property Fact fact: controller.getParameterFact(-1, "FS_THR_ENABLE", false /* reportMissing */) property Fact fact: controller.getParameterFact(-1, "FS_THR_ENABLE", false /* reportMissing */)
...@@ -47,7 +47,7 @@ Item { ...@@ -47,7 +47,7 @@ Item {
VehicleSummaryRow { VehicleSummaryRow {
labelText: qsTr("Throttle failsafe:") labelText: qsTr("Throttle failsafe:")
valueText: fact.enumStringValue valueText: fact ? fact.enumStringValue : ""
visible: controller.vehicle.fixedWing visible: controller.vehicle.fixedWing
property Fact fact: controller.getParameterFact(-1, "THR_FAILSAFE", false /* reportMissing */) property Fact fact: controller.getParameterFact(-1, "THR_FAILSAFE", false /* reportMissing */)
...@@ -55,7 +55,7 @@ Item { ...@@ -55,7 +55,7 @@ Item {
VehicleSummaryRow { VehicleSummaryRow {
labelText: qsTr("Throttle failsafe:") labelText: qsTr("Throttle failsafe:")
valueText: fact.enumStringValue valueText: fact ? fact.enumStringValue : ""
visible: controller.vehicle.rover visible: controller.vehicle.rover
property Fact fact: controller.getParameterFact(-1, "FS_THR_ENABLE", false /* reportMissing */) property Fact fact: controller.getParameterFact(-1, "FS_THR_ENABLE", false /* reportMissing */)
...@@ -63,7 +63,7 @@ Item { ...@@ -63,7 +63,7 @@ Item {
VehicleSummaryRow { VehicleSummaryRow {
labelText: qsTr("Failsafe Action:") labelText: qsTr("Failsafe Action:")
valueText: fact.enumStringValue valueText: fact ? fact.enumStringValue : ""
visible: controller.vehicle.rover visible: controller.vehicle.rover
property Fact fact: controller.getParameterFact(-1, "FS_ACTION", false /* reportMissing */) property Fact fact: controller.getParameterFact(-1, "FS_ACTION", false /* reportMissing */)
...@@ -71,7 +71,7 @@ Item { ...@@ -71,7 +71,7 @@ Item {
VehicleSummaryRow { VehicleSummaryRow {
labelText: qsTr("Failsafe Crash Check:") labelText: qsTr("Failsafe Crash Check:")
valueText: fact.enumStringValue valueText: fact ? fact.enumStringValue : ""
visible: controller.vehicle.rover visible: controller.vehicle.rover
property Fact fact: controller.getParameterFact(-1, "FS_CRASH_CHECK", false /* reportMissing */) property Fact fact: controller.getParameterFact(-1, "FS_CRASH_CHECK", false /* reportMissing */)
...@@ -103,11 +103,22 @@ Item { ...@@ -103,11 +103,22 @@ Item {
VehicleSummaryRow { VehicleSummaryRow {
labelText: qsTr("GeoFence:") labelText: qsTr("GeoFence:")
valueText: _copterFenceEnable.value == 0 || _copterFenceType == 0 ? valueText: {
qsTr("Disabled") : if(_copterFenceEnable && _copterFenceType) {
(_copterFenceType.value == 1 ? if(_copterFenceEnable.value == 0 || _copterFenceType == 0) {
qsTr("Altitude") : return qsTr("Disabled")
(_copterFenceType.value == 2 ? qsTr("Circle") : qsTr("Altitude,Circle"))) } else {
if(_copterFenceType.value == 1) {
return qsTr("Altitude")
}
if(_copterFenceType.value == 2) {
return qsTr("Circle")
}
return qsTr("Altitude,Circle")
}
}
return ""
}
visible: controller.vehicle.multiRotor visible: controller.vehicle.multiRotor
} }
...@@ -121,16 +132,16 @@ Item { ...@@ -121,16 +132,16 @@ Item {
VehicleSummaryRow { VehicleSummaryRow {
labelText: qsTr("RTL min alt:") labelText: qsTr("RTL min alt:")
valueText: fact.value == 0 ? qsTr("current") : fact.valueString + " " + fact.units valueText: fact ? (fact.value == 0 ? qsTr("current") : fact.valueString + " " + fact.units) : ""
visible: controller.vehicle.multiRotor visible: controller.vehicle.multiRotor
property Fact fact: controller.getParameterFact(-1, "RTL_ALT", false /* reportMissing */) property Fact fact: controller.getParameterFact(-1, "RTL_ALT", false /* reportMissing */)
} }
VehicleSummaryRow { VehicleSummaryRow {
labelText: qsTr("RTL min alt:") labelText: qsTr("RTL min alt:")
valueText: fact.value < 0 ? qsTr("current") : fact.valueString + " " + fact.units valueText: fact ? (fact.value < 0 ? qsTr("current") : fact.valueString + " " + fact.units) : ""
visible: controller.vehicle.fixedWing visible: controller.vehicle.fixedWing
property Fact fact: controller.getParameterFact(-1, "ALT_HOLD_RTL", false /* reportMissing */) property Fact fact: controller.getParameterFact(-1, "ALT_HOLD_RTL", false /* reportMissing */)
} }
......
...@@ -15,7 +15,6 @@ import QGroundControl.ArduPilot 1.0 ...@@ -15,7 +15,6 @@ import QGroundControl.ArduPilot 1.0
Item { Item {
anchors.fill: parent anchors.fill: parent
color: qgcPal.windowShadeDark
APMSensorsComponentController { id: controller; } APMSensorsComponentController { id: controller; }
......
...@@ -18,7 +18,7 @@ class APMTuningComponent : public VehicleComponent ...@@ -18,7 +18,7 @@ class APMTuningComponent : public VehicleComponent
Q_OBJECT Q_OBJECT
public: public:
APMTuningComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); APMTuningComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = nullptr);
// Virtuals from VehicleComponent // Virtuals from VehicleComponent
QStringList setupCompleteChangedTriggerList(void) const final; QStringList setupCompleteChangedTriggerList(void) const final;
......
...@@ -28,7 +28,7 @@ SetupPage { ...@@ -28,7 +28,7 @@ SetupPage {
Column { Column {
width: availableWidth width: availableWidth
QGCPalette { id: palette; colorGroupEnabled: true } FactPanelController { id: controller; }
property bool _atcInputTCAvailable: controller.parameterExists(-1, "ATC_INPUT_TC") property bool _atcInputTCAvailable: controller.parameterExists(-1, "ATC_INPUT_TC")
property Fact _atcInputTC: controller.getParameterFact(-1, "ATC_INPUT_TC", false) property Fact _atcInputTC: controller.getParameterFact(-1, "ATC_INPUT_TC", false)
...@@ -133,7 +133,7 @@ SetupPage { ...@@ -133,7 +133,7 @@ SetupPage {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: basicTuningColumn.y + basicTuningColumn.height + _margins height: basicTuningColumn.y + basicTuningColumn.height + _margins
color: palette.windowShade color: qgcPal.windowShade
Column { Column {
id: basicTuningColumn id: basicTuningColumn
...@@ -284,7 +284,7 @@ SetupPage { ...@@ -284,7 +284,7 @@ SetupPage {
QGCLabel { QGCLabel {
text: qsTr("Warning: This setting should be higher than 'Spin While Armed'") text: qsTr("Warning: This setting should be higher than 'Spin While Armed'")
color: palette.warningText color: qgcPal.warningText
visible: _motSpinMin.rawValue < _motSpinArm.rawValue visible: _motSpinMin.rawValue < _motSpinArm.rawValue
} }
...@@ -315,7 +315,7 @@ SetupPage { ...@@ -315,7 +315,7 @@ SetupPage {
Rectangle { Rectangle {
height: autoTuneLabel.height + autoTuneRect.height height: autoTuneLabel.height + autoTuneRect.height
width: autoTuneRect.width width: autoTuneRect.width
color: palette.window color: qgcPal.window
QGCLabel { QGCLabel {
id: autoTuneLabel id: autoTuneLabel
...@@ -328,7 +328,7 @@ SetupPage { ...@@ -328,7 +328,7 @@ SetupPage {
width: autoTuneColumn.x + autoTuneColumn.width + _margins width: autoTuneColumn.x + autoTuneColumn.width + _margins
height: autoTuneColumn.y + autoTuneColumn.height + _margins height: autoTuneColumn.y + autoTuneColumn.height + _margins
anchors.top: autoTuneLabel.bottom anchors.top: autoTuneLabel.bottom
color: palette.windowShade color: qgcPal.windowShade
Column { Column {
id: autoTuneColumn id: autoTuneColumn
...@@ -375,7 +375,7 @@ SetupPage { ...@@ -375,7 +375,7 @@ SetupPage {
Rectangle { Rectangle {
height: inFlightTuneLabel.height + channel6TuningOption.height height: inFlightTuneLabel.height + channel6TuningOption.height
width: channel6TuningOption.width width: channel6TuningOption.width
color: palette.window color: qgcPal.window
QGCLabel { QGCLabel {
id: inFlightTuneLabel id: inFlightTuneLabel
......
...@@ -25,7 +25,7 @@ Flow { ...@@ -25,7 +25,7 @@ Flow {
Repeater { Repeater {
id: repeater id: repeater
model: fact.bitmaskStrings model: fact ? fact.bitmaskStrings : []
QGCCheckBox { QGCCheckBox {
id: checkbox id: checkbox
......
...@@ -59,7 +59,7 @@ Item { ...@@ -59,7 +59,7 @@ Item {
// Center point // Center point
Rectangle { Rectangle {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: ScreenTools.ScreenTools.defaultFontPixelWidth / 2 width: ScreenTools.defaultFontPixelWidth / 2
height: parent.height height: parent.height
color: qgcPal.window color: qgcPal.window
} }
......
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