Browse Source

Create field for manual Magnetic Declination setup for Submarines

Write "Manual Declination" instead of "Automatic Declination" as
that is more intuitive for users
QGC4.4
Willian Galvani 4 years ago committed by Don Gagne
parent
commit
95dc810159
  1. 31
      src/AutoPilotPlugins/APM/APMSensorsComponent.qml
  2. 2
      src/FirmwarePlugin/APM/APMSensorParams.qml

31
src/AutoPilotPlugins/APM/APMSensorsComponent.qml

@ -446,6 +446,37 @@ SetupPage { @@ -446,6 +446,37 @@ SetupPage {
model: _orientationsDialogShowCompass ? 3 : 0
delegate: singleCompassSettingsComponent
}
QGCLabel {
id: magneticDeclinationLabel
width: parent.width
visible: globals.activeVehicle.sub && _orientationsDialogShowCompass
text: qsTr("Magnetic Declination")
}
Column {
visible: magneticDeclinationLabel.visible
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.left: parent.left
anchors.right: parent.right
spacing: ScreenTools.defaultFontPixelHeight
QGCCheckBox {
id: manualMagneticDeclinationCheckBox
text: qsTr("Manual Magnetic Declination")
property Fact autoDecFact: controller.getParameterFact(-1, "COMPASS_AUTODEC")
property int manual: 0
property int automatic: 1
checked: autoDecFact.rawValue === manual
onClicked: autoDecFact.value = (checked ? manual : automatic)
}
FactTextField {
fact: sensorParams.declinationFact
enabled: manualMagneticDeclinationCheckBox.checked
}
}
} // Column
} // QGCFlickable
} // QGCViewDialog

2
src/FirmwarePlugin/APM/APMSensorParams.qml

@ -92,4 +92,6 @@ Item { @@ -92,4 +92,6 @@ Item {
property bool compass2Calibrated: compass2Available ? compass2OfsXFact.value != 0.0 && compass2OfsYFact.value != 0.0 &&compass2OfsZFact.value != 0.0 : false
property bool compass3Calibrated: compass3Available ? compass3OfsXFact.value != 0.0 && compass3OfsYFact.value != 0.0 &&compass3OfsZFact.value != 0.0 : false
property var rgCompassCalibrated: [ compass1Calibrated, compass2Calibrated, compass3Calibrated ]
property Fact declinationFact: factPanelController.getParameterFact(-1, "COMPASS_DEC")
}

Loading…
Cancel
Save