Commit 01a12b30 authored by DonLakeFlyer's avatar DonLakeFlyer

Add sensorsHaveFixedOrientation, wifiReliableForCalibration

Remove showSensorCalibrationOrient
parent b1841b76
...@@ -37,9 +37,9 @@ SetupPage { ...@@ -37,9 +37,9 @@ SetupPage {
readonly property string boardRotationText: qsTr("If the orientation is in the direction of flight, select ROTATION_NONE.") readonly property string boardRotationText: qsTr("If the orientation is in the direction of flight, select ROTATION_NONE.")
readonly property string compassRotationText: qsTr("If the orientation is in the direction of flight, select ROTATION_NONE.") readonly property string compassRotationText: qsTr("If the orientation is in the direction of flight, select ROTATION_NONE.")
readonly property string compassHelp: qsTr("For Compass calibration you will need to rotate your vehicle through a number of positions.") readonly property string compassHelp: qsTr("For Compass calibration you will need to rotate your vehicle through a number of positions. Click Ok to start calibration.")
readonly property string gyroHelp: qsTr("For Gyroscope calibration you will need to place your vehicle on a surface and leave it still.") readonly property string gyroHelp: qsTr("For Gyroscope calibration you will need to place your vehicle on a surface and leave it still. Click Ok to start calibration.")
readonly property string accelHelp: qsTr("For Accelerometer calibration you will need to place your vehicle on all six sides on a perfectly level surface and hold it still in each orientation for a few seconds.") readonly property string accelHelp: qsTr("For Accelerometer calibration you will need to place your vehicle on all six sides on a perfectly level surface and hold it still in each orientation for a few seconds. Click Ok to start calibration.")
readonly property string levelHelp: qsTr("To level the horizon you need to place the vehicle in its level flight position and press OK.") readonly property string levelHelp: qsTr("To level the horizon you need to place the vehicle in its level flight position and press OK.")
readonly property string airspeedHelp: qsTr("For Airspeed calibration you will need to keep your airspeed sensor out of any wind and then blow across the sensor.") readonly property string airspeedHelp: qsTr("For Airspeed calibration you will need to keep your airspeed sensor out of any wind and then blow across the sensor.")
...@@ -106,6 +106,9 @@ SetupPage { ...@@ -106,6 +106,9 @@ SetupPage {
property bool showCompass1Rot: cal_mag1_id.value > 0 && cal_mag1_rot.value >= 0 property bool showCompass1Rot: cal_mag1_id.value > 0 && cal_mag1_rot.value >= 0
property bool showCompass2Rot: cal_mag2_id.value > 0 && cal_mag2_rot.value >= 0 property bool showCompass2Rot: cal_mag2_id.value > 0 && cal_mag2_rot.value >= 0
property bool _sensorsHaveFixedOrientation: QGroundControl.corePlugin.options.sensorsHaveFixedOrientation
property bool _wifiReliableForCalibration: QGroundControl.corePlugin.options.wifiReliableForCalibration
SensorsComponentController { SensorsComponentController {
id: controller id: controller
factPanel: sensorsPage.viewPanel factPanel: sensorsPage.viewPanel
...@@ -123,7 +126,7 @@ SetupPage { ...@@ -123,7 +126,7 @@ SetupPage {
onResetStatusTextArea: statusLog.text = statusTextAreaDefaultText onResetStatusTextArea: statusLog.text = statusTextAreaDefaultText
onSetCompassRotations: { onSetCompassRotations: {
if (showCompass0Rot || showCompass1Rot || showCompass2Rot) { if (!_sensorsHaveFixedOrientation && (showCompass0Rot || showCompass1Rot || showCompass2Rot)) {
setOrientationsDialogShowBoardOrientation = false setOrientationsDialogShowBoardOrientation = false
showDialog(setOrientationsDialogComponent, qsTr("Set Compass Rotation(s)"), sensorsPage.showDialogDefaultWidth, StandardButton.Ok) showDialog(setOrientationsDialogComponent, qsTr("Set Compass Rotation(s)"), sensorsPage.showDialogDefaultWidth, StandardButton.Ok)
} }
...@@ -141,8 +144,7 @@ SetupPage { ...@@ -141,8 +144,7 @@ SetupPage {
Component.onCompleted: { Component.onCompleted: {
var usingUDP = controller.usingUDPLink() var usingUDP = controller.usingUDPLink()
if (usingUDP) { if (usingUDP && !_wifiReliableForCalibration) {
console.log("onUsingUDPLink")
showMessage("Sensor Calibration", "Performing sensor calibration over a WiFi connection is known to be unreliable. You should disconnect and perform calibration using a direct USB connection instead.", StandardButton.Ok) showMessage("Sensor Calibration", "Performing sensor calibration over a WiFi connection is known to be unreliable. You should disconnect and perform calibration using a direct USB connection instead.", StandardButton.Ok)
} }
} }
...@@ -178,6 +180,11 @@ SetupPage { ...@@ -178,6 +180,11 @@ SetupPage {
text: preCalibrationDialogHelp text: preCalibrationDialogHelp
} }
Column {
anchors.fill: parent
spacing: 5
visible: !_sensorsHaveFixedOrientation
QGCLabel { QGCLabel {
id: boardRotationHelp id: boardRotationHelp
width: parent.width width: parent.width
...@@ -202,6 +209,7 @@ SetupPage { ...@@ -202,6 +209,7 @@ SetupPage {
} }
} }
} }
}
property bool setOrientationsDialogShowBoardOrientation: true property bool setOrientationsDialogShowBoardOrientation: true
...@@ -414,7 +422,7 @@ SetupPage { ...@@ -414,7 +422,7 @@ SetupPage {
id: setOrientationsButton id: setOrientationsButton
width: parent.buttonWidth width: parent.buttonWidth
text: qsTr("Set Orientations") text: qsTr("Set Orientations")
visible: QGroundControl.corePlugin.options.showSensorCalibrationOrient visible: !_sensorsHaveFixedOrientation
onClicked: { onClicked: {
setOrientationsDialogShowBoardOrientation = true setOrientationsDialogShowBoardOrientation = true
......
...@@ -33,7 +33,8 @@ public: ...@@ -33,7 +33,8 @@ public:
Q_PROPERTY(bool showSensorCalibrationAccel READ showSensorCalibrationAccel NOTIFY showSensorCalibrationAccelChanged) Q_PROPERTY(bool showSensorCalibrationAccel READ showSensorCalibrationAccel NOTIFY showSensorCalibrationAccelChanged)
Q_PROPERTY(bool showSensorCalibrationLevel READ showSensorCalibrationLevel NOTIFY showSensorCalibrationLevelChanged) Q_PROPERTY(bool showSensorCalibrationLevel READ showSensorCalibrationLevel NOTIFY showSensorCalibrationLevelChanged)
Q_PROPERTY(bool showSensorCalibrationAirspeed READ showSensorCalibrationAirspeed NOTIFY showSensorCalibrationAirspeedChanged) Q_PROPERTY(bool showSensorCalibrationAirspeed READ showSensorCalibrationAirspeed NOTIFY showSensorCalibrationAirspeedChanged)
Q_PROPERTY(bool showSensorCalibrationOrient READ showSensorCalibrationOrient NOTIFY showSensorCalibrationOrientChanged) Q_PROPERTY(bool sensorsHaveFixedOrientation READ sensorsHaveFixedOrientation CONSTANT)
Q_PROPERTY(bool wifiReliableForCalibration READ wifiReliableForCalibration CONSTANT)
Q_PROPERTY(bool showFirmwareUpgrade READ showFirmwareUpgrade NOTIFY showFirmwareUpgradeChanged) Q_PROPERTY(bool showFirmwareUpgrade READ showFirmwareUpgrade NOTIFY showFirmwareUpgradeChanged)
Q_PROPERTY(QString firmwareUpgradeSingleURL READ firmwareUpgradeSingleURL CONSTANT) Q_PROPERTY(QString firmwareUpgradeSingleURL READ firmwareUpgradeSingleURL CONSTANT)
Q_PROPERTY(bool guidedBarShowEmergencyStop READ guidedBarShowEmergencyStop NOTIFY guidedBarShowEmergencyStopChanged) Q_PROPERTY(bool guidedBarShowEmergencyStop READ guidedBarShowEmergencyStop NOTIFY guidedBarShowEmergencyStopChanged)
...@@ -61,7 +62,8 @@ public: ...@@ -61,7 +62,8 @@ public:
virtual bool showSensorCalibrationAccel () const { return true; } virtual bool showSensorCalibrationAccel () const { return true; }
virtual bool showSensorCalibrationLevel () const { return true; } virtual bool showSensorCalibrationLevel () const { return true; }
virtual bool showSensorCalibrationAirspeed () const { return true; } virtual bool showSensorCalibrationAirspeed () const { return true; }
virtual bool showSensorCalibrationOrient () const { return true; } virtual bool wifiReliableForCalibration () const { return false; }
virtual bool sensorsHaveFixedOrientation () const { return false; }
virtual bool showFirmwareUpgrade () const { return true; } virtual bool showFirmwareUpgrade () const { return true; }
...@@ -79,7 +81,6 @@ signals: ...@@ -79,7 +81,6 @@ signals:
void showSensorCalibrationAccelChanged (bool show); void showSensorCalibrationAccelChanged (bool show);
void showSensorCalibrationLevelChanged (bool show); void showSensorCalibrationLevelChanged (bool show);
void showSensorCalibrationAirspeedChanged (bool show); void showSensorCalibrationAirspeedChanged (bool show);
void showSensorCalibrationOrientChanged (bool show);
void showFirmwareUpgradeChanged (bool show); void showFirmwareUpgradeChanged (bool show);
void guidedBarShowEmergencyStopChanged (bool show); void guidedBarShowEmergencyStopChanged (bool show);
void guidedBarShowOrbitChanged (bool show); void guidedBarShowOrbitChanged (bool show);
......
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