Browse Source

Merge pull request #5277 from DonLakeFlyer/APMMissingCal

ArduPilot: Support perflight barometer/airspeed calibration
QGC4.4
Don Gagne 8 years ago committed by GitHub
parent
commit
45b7136ea8
  1. 184
      src/AutoPilotPlugins/APM/APMSensorsComponent.qml
  2. 28
      src/AutoPilotPlugins/APM/APMSensorsComponentController.cc
  3. 13
      src/AutoPilotPlugins/APM/APMSensorsComponentController.h
  4. 1
      src/AutoPilotPlugins/Common/RadioComponent.qml
  5. 182
      src/AutoPilotPlugins/PX4/SensorsComponent.qml
  6. 5
      src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc
  7. 2
      src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h
  8. 5
      src/FirmwarePlugin/FirmwarePlugin.cc
  9. 4
      src/FirmwarePlugin/FirmwarePlugin.h
  10. 5
      src/Vehicle/Vehicle.cc
  11. 2
      src/Vehicle/Vehicle.h

184
src/AutoPilotPlugins/APM/APMSensorsComponent.qml

@ -30,10 +30,9 @@ SetupPage {
Component { Component {
id: sensorsPageComponent id: sensorsPageComponent
RowLayout { Item {
width: availableWidth width: availableWidth
height: availableHeight height: availableHeight
spacing: ScreenTools.defaultFontPixelWidth / 2
// Help text which is shown both in the status text area prior to pressing a cal button and in the // Help text which is shown both in the status text area prior to pressing a cal button and in the
// pre-calibration dialog. // pre-calibration dialog.
@ -74,10 +73,13 @@ SetupPage {
readonly property int _calTypeCompass: 1 ///< Calibrate compass readonly property int _calTypeCompass: 1 ///< Calibrate compass
readonly property int _calTypeAccel: 2 ///< Calibrate accel readonly property int _calTypeAccel: 2 ///< Calibrate accel
readonly property int _calTypeSet: 3 ///< Set orientations only readonly property int _calTypeSet: 3 ///< Set orientations only
readonly property int _buttonWidth: ScreenTools.defaultFontPixelWidth * 15
property bool _orientationsDialogShowCompass: true property bool _orientationsDialogShowCompass: true
property string _orientationDialogHelp: orientationHelpSet property string _orientationDialogHelp: orientationHelpSet
property int _orientationDialogCalType property int _orientationDialogCalType
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property real _margins: ScreenTools.defaultFontPixelHeight / 2
function showOrientationsDialog(calType) { function showOrientationsDialog(calType) {
var dialogTitle var dialogTitle
@ -117,14 +119,8 @@ SetupPage {
factPanel: sensorsPage.viewPanel factPanel: sensorsPage.viewPanel
statusLog: statusTextArea statusLog: statusTextArea
progressBar: progressBar progressBar: progressBar
compassButton: compassButton
accelButton: accelButton
compassMotButton: motorInterferenceButton
levelButton: levelHorizonButton
calibratePressureButton: calibratePressureButton
nextButton: nextButton nextButton: nextButton
cancelButton: cancelButton cancelButton: cancelButton
setOrientationsButton: setOrientationsButton
orientationCalAreaHelpText: orientationCalAreaHelpText orientationCalAreaHelpText: orientationCalAreaHelpText
property var rgCompassCalFitness: [ controller.compass1CalFitness, controller.compass2CalFitness, controller.compass3CalFitness ] property var rgCompassCalFitness: [ controller.compass1CalFitness, controller.compass2CalFitness, controller.compass3CalFitness ]
@ -152,6 +148,10 @@ SetupPage {
break break
} }
} }
onSetAllCalButtonsEnabled: {
buttonColumn.enabled = enabled
}
} }
Component.onCompleted: { Component.onCompleted: {
@ -462,112 +462,122 @@ SetupPage {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: qsTr("Pressure calibration will set the depth to zero at the current pressure reading.") text: _helpText
readonly property string _altText: _activeVehicle.sub ? qsTr("depth") : qsTr("altitude")
readonly property string _helpText: qsTr("Pressure calibration will set the %1 to zero at the current pressure reading. %2").arg(_altText).arg(_helpTextFW)
readonly property string _helpTextFW: _activeVehicle.fixedWing ? qsTr("Cover airspeed sensor for calibration.") : ""
} }
} // QGCViewDialog } // QGCViewDialog
} // Component - calibratePressureDialogComponent } // Component - calibratePressureDialogComponent
/// Left button column QGCFlickable {
Column { id: buttonFlickable
spacing: ScreenTools.defaultFontPixelHeight / 2 anchors.left: parent.left
Layout.alignment: Qt.AlignLeft | Qt.AlignTop anchors.top: parent.top
anchors.bottom: parent.bottom
width: _buttonWidth
contentHeight: nextCancelColumn.y + nextCancelColumn.height + _margins
readonly property int buttonWidth: ScreenTools.defaultFontPixelWidth * 15 // Calibration button column - Calibratin buttons are kept in a separate column from Next/Cancel buttons
// so we can enable/disable them all as a group
Column {
id: buttonColumn
spacing: _margins
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
IndicatorButton { IndicatorButton {
id: accelButton width: _buttonWidth
width: parent.buttonWidth text: qsTr("Accelerometer")
text: qsTr("Accelerometer") indicatorGreen: !accelCalNeeded
indicatorGreen: !accelCalNeeded
onClicked: showOrientationsDialog(_calTypeAccel) onClicked: showOrientationsDialog(_calTypeAccel)
} }
IndicatorButton {
width: _buttonWidth
text: qsTr("Compass")
indicatorGreen: !compassCalNeeded
IndicatorButton { onClicked: {
id: compassButton if (controller.accelSetupNeeded) {
width: parent.buttonWidth showMessage(qsTr("Calibrate Compass"), qsTr("Accelerometer must be calibrated prior to Compass."), StandardButton.Ok)
text: qsTr("Compass") } else {
indicatorGreen: !compassCalNeeded showOrientationsDialog(_calTypeCompass)
}
onClicked: {
if (controller.accelSetupNeeded) {
showMessage(qsTr("Calibrate Compass"), qsTr("Accelerometer must be calibrated prior to Compass."), StandardButton.Ok)
} else {
showOrientationsDialog(_calTypeCompass)
} }
} }
}
QGCButton { QGCButton {
id: levelHorizonButton width: _buttonWidth
width: parent.buttonWidth text: _levelHorizonText
text: _levelHorizonText
readonly property string _levelHorizonText: qsTr("Level Horizon") readonly property string _levelHorizonText: qsTr("Level Horizon")
onClicked: { onClicked: {
if (controller.accelSetupNeeded) { if (controller.accelSetupNeeded) {
showMessage(_levelHorizonText, qsTr("Accelerometer must be calibrated prior to Level Horizon."), StandardButton.Ok) showMessage(_levelHorizonText, qsTr("Accelerometer must be calibrated prior to Level Horizon."), StandardButton.Ok)
} else { } else {
showDialog(levelHorizonDialogComponent, _levelHorizonText, qgcView.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok) showDialog(levelHorizonDialogComponent, _levelHorizonText, qgcView.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
}
} }
} }
}
QGCButton { QGCButton {
id: calibratePressureButton width: _buttonWidth
width: parent.buttonWidth text: _calibratePressureText
text: _calibratePressureText onClicked: showDialog(calibratePressureDialogComponent, _calibratePressureText, qgcView.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
visible: _activeVehicle ? _activeVehicle.supportsCalibratePressure : false
readonly property string _calibratePressureText: qsTr("Calibrate Pressure") readonly property string _calibratePressureText: _activeVehicle.fixedWing ? qsTr("Cal Baro/Airspeed") : qsTr("Calibrate Pressure")
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
onClicked: {
showDialog(calibratePressureDialogComponent, _calibratePressureText, qgcView.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
} }
}
QGCButton {
id: motorInterferenceButton
width: parent.buttonWidth
text: qsTr("CompassMot")
visible: _activeVehicle ? _activeVehicle.supportsMotorInterference : false
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle QGCButton {
width: _buttonWidth
text: qsTr("CompassMot")
visible: _activeVehicle ? _activeVehicle.supportsMotorInterference : false
onClicked: showDialog(compassMotDialogComponent, qsTr("CompassMot - Compass Motor Interference Calibration"), qgcView.showDialogFullWidth, StandardButton.Cancel | StandardButton.Ok) onClicked: showDialog(compassMotDialogComponent, qsTr("CompassMot - Compass Motor Interference Calibration"), qgcView.showDialogFullWidth, StandardButton.Cancel | StandardButton.Ok)
} }
QGCButton { QGCButton {
id: nextButton width: _buttonWidth
width: parent.buttonWidth text: qsTr("Sensor Settings")
text: qsTr("Next") onClicked: showOrientationsDialog(_calTypeSet)
enabled: false }
onClicked: controller.nextClicked() } // Column - Cal Buttons
}
QGCButton { Column {
id: cancelButton id: nextCancelColumn
width: parent.buttonWidth anchors.topMargin: buttonColumn.spacing
text: qsTr("Cancel") anchors.top: buttonColumn.bottom
enabled: false anchors.left: buttonColumn.left
onClicked: controller.cancelCalibration() spacing: buttonColumn.spacing
}
QGCButton {
id: nextButton
width: _buttonWidth
text: qsTr("Next")
enabled: false
onClicked: controller.nextClicked()
}
QGCButton { QGCButton {
id: setOrientationsButton id: cancelButton
width: parent.buttonWidth width: _buttonWidth
text: qsTr("Sensor Settings") text: qsTr("Cancel")
onClicked: showOrientationsDialog(_calTypeSet) enabled: false
onClicked: controller.cancelCalibration()
}
} }
} // Column - Buttons } // QGCFlickable - buttons
/// Right column - cal area /// Right column - cal area
Column { Column {
anchors.leftMargin: _margins
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
Layout.fillWidth: true anchors.left: buttonFlickable.right
anchors.right: parent.right
ProgressBar { ProgressBar {
id: progressBar id: progressBar

28
src/AutoPilotPlugins/APM/APMSensorsComponentController.cc

@ -27,14 +27,8 @@ APMSensorsComponentController::APMSensorsComponentController(void)
: _sensorsComponent(NULL) : _sensorsComponent(NULL)
, _statusLog(NULL) , _statusLog(NULL)
, _progressBar(NULL) , _progressBar(NULL)
, _compassButton(NULL)
, _accelButton(NULL)
, _compassMotButton(NULL)
, _levelButton(NULL)
, _calibratePressureButton(NULL)
, _nextButton(NULL) , _nextButton(NULL)
, _cancelButton(NULL) , _cancelButton(NULL)
, _setOrientationsButton(NULL)
, _showOrientationCalArea(false) , _showOrientationCalArea(false)
, _calTypeInProgress(CalTypeNone) , _calTypeInProgress(CalTypeNone)
, _orientationCalDownSideDone(false) , _orientationCalDownSideDone(false)
@ -110,12 +104,7 @@ void APMSensorsComponentController::_startLogCalibration(void)
connect(_uas, &UASInterface::textMessageReceived, this, &APMSensorsComponentController::_handleUASTextMessage); connect(_uas, &UASInterface::textMessageReceived, this, &APMSensorsComponentController::_handleUASTextMessage);
_compassButton->setEnabled(false); emit setAllCalButtonsEnabled(false);
_accelButton->setEnabled(false);
_compassMotButton->setEnabled(false);
_levelButton->setEnabled(false);
_calibratePressureButton->setEnabled(false);
_setOrientationsButton->setEnabled(false);
if (_calTypeInProgress == CalTypeAccel || _calTypeInProgress == CalTypeCompassMot) { if (_calTypeInProgress == CalTypeAccel || _calTypeInProgress == CalTypeCompassMot) {
_nextButton->setEnabled(true); _nextButton->setEnabled(true);
} }
@ -124,13 +113,9 @@ void APMSensorsComponentController::_startLogCalibration(void)
void APMSensorsComponentController::_startVisualCalibration(void) void APMSensorsComponentController::_startVisualCalibration(void)
{ {
_compassButton->setEnabled(false); emit setAllCalButtonsEnabled(false);
_accelButton->setEnabled(false);
_compassMotButton->setEnabled(false);
_levelButton->setEnabled(false);
_calibratePressureButton->setEnabled(false);
_setOrientationsButton->setEnabled(false);
_cancelButton->setEnabled(true); _cancelButton->setEnabled(true);
_nextButton->setEnabled(false);
_resetInternalState(); _resetInternalState();
@ -169,12 +154,7 @@ void APMSensorsComponentController::_stopCalibration(APMSensorsComponentControll
disconnect(_uas, &UASInterface::textMessageReceived, this, &APMSensorsComponentController::_handleUASTextMessage); disconnect(_uas, &UASInterface::textMessageReceived, this, &APMSensorsComponentController::_handleUASTextMessage);
_compassButton->setEnabled(true); emit setAllCalButtonsEnabled(true);
_accelButton->setEnabled(true);
_compassMotButton->setEnabled(true);
_levelButton->setEnabled(true);
_calibratePressureButton->setEnabled(true);
_setOrientationsButton->setEnabled(true);
_nextButton->setEnabled(false); _nextButton->setEnabled(false);
_cancelButton->setEnabled(false); _cancelButton->setEnabled(false);

13
src/AutoPilotPlugins/APM/APMSensorsComponentController.h

@ -34,14 +34,8 @@ public:
Q_PROPERTY(QQuickItem* statusLog MEMBER _statusLog) Q_PROPERTY(QQuickItem* statusLog MEMBER _statusLog)
Q_PROPERTY(QQuickItem* progressBar MEMBER _progressBar) Q_PROPERTY(QQuickItem* progressBar MEMBER _progressBar)
Q_PROPERTY(QQuickItem* compassButton MEMBER _compassButton)
Q_PROPERTY(QQuickItem* accelButton MEMBER _accelButton)
Q_PROPERTY(QQuickItem* compassMotButton MEMBER _compassMotButton)
Q_PROPERTY(QQuickItem* levelButton MEMBER _levelButton)
Q_PROPERTY(QQuickItem* calibratePressureButton MEMBER _calibratePressureButton)
Q_PROPERTY(QQuickItem* nextButton MEMBER _nextButton) Q_PROPERTY(QQuickItem* nextButton MEMBER _nextButton)
Q_PROPERTY(QQuickItem* cancelButton MEMBER _cancelButton) Q_PROPERTY(QQuickItem* cancelButton MEMBER _cancelButton)
Q_PROPERTY(QQuickItem* setOrientationsButton MEMBER _setOrientationsButton)
Q_PROPERTY(QQuickItem* orientationCalAreaHelpText MEMBER _orientationCalAreaHelpText) Q_PROPERTY(QQuickItem* orientationCalAreaHelpText MEMBER _orientationCalAreaHelpText)
Q_PROPERTY(bool compassSetupNeeded READ compassSetupNeeded NOTIFY setupNeededChanged) Q_PROPERTY(bool compassSetupNeeded READ compassSetupNeeded NOTIFY setupNeededChanged)
@ -135,6 +129,7 @@ signals:
void compass1CalFitnessChanged(double compass1CalFitness); void compass1CalFitnessChanged(double compass1CalFitness);
void compass2CalFitnessChanged(double compass2CalFitness); void compass2CalFitnessChanged(double compass2CalFitness);
void compass3CalFitnessChanged(double compass3CalFitness); void compass3CalFitnessChanged(double compass3CalFitness);
void setAllCalButtonsEnabled(bool enabled);
private slots: private slots:
void _handleUASTextMessage(int uasId, int compId, int severity, QString text); void _handleUASTextMessage(int uasId, int compId, int severity, QString text);
@ -168,14 +163,8 @@ private:
QQuickItem* _statusLog; QQuickItem* _statusLog;
QQuickItem* _progressBar; QQuickItem* _progressBar;
QQuickItem* _compassButton;
QQuickItem* _accelButton;
QQuickItem* _compassMotButton;
QQuickItem* _levelButton;
QQuickItem* _calibratePressureButton;
QQuickItem* _nextButton; QQuickItem* _nextButton;
QQuickItem* _cancelButton; QQuickItem* _cancelButton;
QQuickItem* _setOrientationsButton;
QQuickItem* _orientationCalAreaHelpText; QQuickItem* _orientationCalAreaHelpText;
bool _showOrientationCalArea; bool _showOrientationCalArea;

1
src/AutoPilotPlugins/Common/RadioComponent.qml

@ -418,7 +418,6 @@ SetupPage {
QGCButton { QGCButton {
text: qsTr("Copy Trims") text: qsTr("Copy Trims")
visible: QGroundControl.multiVehicleManager.activeVehicle.px4Firmware
onClicked: showDialog(copyTrimsDialogComponent, dialogTitle, radioPage.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel) onClicked: showDialog(copyTrimsDialogComponent, dialogTitle, radioPage.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel)
} }

182
src/AutoPilotPlugins/PX4/SensorsComponent.qml

@ -106,8 +106,10 @@ 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 _sensorsHaveFixedOrientation: QGroundControl.corePlugin.options.sensorsHaveFixedOrientation
property bool _wifiReliableForCalibration: QGroundControl.corePlugin.options.wifiReliableForCalibration property bool _wifiReliableForCalibration: QGroundControl.corePlugin.options.wifiReliableForCalibration
property int _buttonWidth: ScreenTools.defaultFontPixelWidth * 15
SensorsComponentController { SensorsComponentController {
id: controller id: controller
@ -332,107 +334,113 @@ SetupPage {
} // QGCViewDialog } // QGCViewDialog
} // Component - setOrientationsDialogComponent } // Component - setOrientationsDialogComponent
Column { QGCFlickable {
id: buttonColumn id: buttonFlickable
spacing: ScreenTools.defaultFontPixelHeight / 2 anchors.top: parent.top
anchors.bottom: parent.bottom
readonly property int buttonWidth: ScreenTools.defaultFontPixelWidth * 15 width: _buttonWidth
contentHeight: buttonColumn.height + buttonColumn.spacing
IndicatorButton {
id: compassButton Column {
width: parent.buttonWidth id: buttonColumn
text: qsTr("Compass") spacing: ScreenTools.defaultFontPixelHeight / 2
indicatorGreen: cal_mag0_id.value != 0
visible: QGroundControl.corePlugin.options.showSensorCalibrationCompass IndicatorButton {
id: compassButton
onClicked: { width: _buttonWidth
preCalibrationDialogType = "compass" text: qsTr("Compass")
preCalibrationDialogHelp = compassHelp indicatorGreen: cal_mag0_id.value != 0
showDialog(preCalibrationDialogComponent, qsTr("Calibrate Compass"), sensorsPage.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok) visible: QGroundControl.corePlugin.options.showSensorCalibrationCompass
onClicked: {
preCalibrationDialogType = "compass"
preCalibrationDialogHelp = compassHelp
showDialog(preCalibrationDialogComponent, qsTr("Calibrate Compass"), sensorsPage.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
}
} }
}
IndicatorButton { IndicatorButton {
id: gyroButton id: gyroButton
width: parent.buttonWidth width: _buttonWidth
text: qsTr("Gyroscope") text: qsTr("Gyroscope")
indicatorGreen: cal_gyro0_id.value != 0 indicatorGreen: cal_gyro0_id.value != 0
visible: QGroundControl.corePlugin.options.showSensorCalibrationGyro visible: QGroundControl.corePlugin.options.showSensorCalibrationGyro
onClicked: { onClicked: {
preCalibrationDialogType = "gyro" preCalibrationDialogType = "gyro"
preCalibrationDialogHelp = gyroHelp preCalibrationDialogHelp = gyroHelp
showDialog(preCalibrationDialogComponent, qsTr("Calibrate Gyro"), sensorsPage.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok) showDialog(preCalibrationDialogComponent, qsTr("Calibrate Gyro"), sensorsPage.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
}
} }
}
IndicatorButton { IndicatorButton {
id: accelButton id: accelButton
width: parent.buttonWidth width: _buttonWidth
text: qsTr("Accelerometer") text: qsTr("Accelerometer")
indicatorGreen: cal_acc0_id.value != 0 indicatorGreen: cal_acc0_id.value != 0
visible: QGroundControl.corePlugin.options.showSensorCalibrationAccel visible: QGroundControl.corePlugin.options.showSensorCalibrationAccel
onClicked: { onClicked: {
preCalibrationDialogType = "accel" preCalibrationDialogType = "accel"
preCalibrationDialogHelp = accelHelp preCalibrationDialogHelp = accelHelp
showDialog(preCalibrationDialogComponent, qsTr("Calibrate Accelerometer"), sensorsPage.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok) showDialog(preCalibrationDialogComponent, qsTr("Calibrate Accelerometer"), sensorsPage.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
}
} }
}
IndicatorButton { IndicatorButton {
id: levelButton id: levelButton
width: parent.buttonWidth width: _buttonWidth
text: qsTr("Level Horizon") text: qsTr("Level Horizon")
indicatorGreen: sens_board_x_off.value != 0 || sens_board_y_off != 0 | sens_board_z_off != 0 indicatorGreen: sens_board_x_off.value != 0 || sens_board_y_off != 0 | sens_board_z_off != 0
enabled: cal_acc0_id.value != 0 && cal_gyro0_id.value != 0 enabled: cal_acc0_id.value != 0 && cal_gyro0_id.value != 0
visible: QGroundControl.corePlugin.options.showSensorCalibrationLevel visible: QGroundControl.corePlugin.options.showSensorCalibrationLevel
onClicked: { onClicked: {
preCalibrationDialogType = "level" preCalibrationDialogType = "level"
preCalibrationDialogHelp = levelHelp preCalibrationDialogHelp = levelHelp
showDialog(preCalibrationDialogComponent, qsTr("Level Horizon"), sensorsPage.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok) showDialog(preCalibrationDialogComponent, qsTr("Level Horizon"), sensorsPage.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
}
} }
}
IndicatorButton { IndicatorButton {
id: airspeedButton id: airspeedButton
width: parent.buttonWidth width: _buttonWidth
text: qsTr("Airspeed") text: qsTr("Airspeed")
visible: (controller.vehicle.fixedWing || controller.vehicle.vtol) && controller.getParameterFact(-1, "CBRK_AIRSPD_CHK").value != 162128 && QGroundControl.corePlugin.options.showSensorCalibrationAirspeed visible: (controller.vehicle.fixedWing || controller.vehicle.vtol) && controller.getParameterFact(-1, "CBRK_AIRSPD_CHK").value != 162128 && QGroundControl.corePlugin.options.showSensorCalibrationAirspeed
indicatorGreen: sens_dpres_off.value != 0 indicatorGreen: sens_dpres_off.value != 0
onClicked: { onClicked: {
preCalibrationDialogType = "airspeed" preCalibrationDialogType = "airspeed"
preCalibrationDialogHelp = airspeedHelp preCalibrationDialogHelp = airspeedHelp
showDialog(preCalibrationDialogComponent, qsTr("Calibrate Airspeed"), sensorsPage.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok) showDialog(preCalibrationDialogComponent, qsTr("Calibrate Airspeed"), sensorsPage.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
}
} }
}
QGCButton { QGCButton {
id: cancelButton id: cancelButton
width: parent.buttonWidth width: _buttonWidth
text: qsTr("Cancel") text: qsTr("Cancel")
enabled: false enabled: false
onClicked: controller.cancelCalibration() onClicked: controller.cancelCalibration()
} }
QGCButton { QGCButton {
id: setOrientationsButton id: setOrientationsButton
width: parent.buttonWidth width: _buttonWidth
text: qsTr("Set Orientations") text: qsTr("Set Orientations")
visible: !_sensorsHaveFixedOrientation visible: !_sensorsHaveFixedOrientation
onClicked: { onClicked: {
setOrientationsDialogShowBoardOrientation = true setOrientationsDialogShowBoardOrientation = true
showDialog(setOrientationsDialogComponent, qsTr("Set Orientations"), sensorsPage.showDialogDefaultWidth, StandardButton.Ok) showDialog(setOrientationsDialogComponent, qsTr("Set Orientations"), sensorsPage.showDialogDefaultWidth, StandardButton.Ok)
}
} }
} } // Column - Buttons
} // Column - Buttons } // QGCFLickable - Buttons
Column { Column {
anchors.leftMargin: ScreenTools.defaultFontPixelWidth / 2 anchors.leftMargin: ScreenTools.defaultFontPixelWidth / 2
anchors.left: buttonColumn.right anchors.left: buttonFlickable.right
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom

5
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.cc

@ -132,11 +132,6 @@ bool ArduSubFirmwarePlugin::supportsJSButton(void)
return true; return true;
} }
bool ArduSubFirmwarePlugin::supportsCalibratePressure(void)
{
return true;
}
bool ArduSubFirmwarePlugin::supportsMotorInterference(void) bool ArduSubFirmwarePlugin::supportsMotorInterference(void)
{ {
return false; return false;

2
src/FirmwarePlugin/APM/ArduSubFirmwarePlugin.h

@ -79,8 +79,6 @@ public:
bool supportsJSButton(void); bool supportsJSButton(void);
bool supportsCalibratePressure(void);
bool supportsMotorInterference(void); bool supportsMotorInterference(void);
QString brandImageIndoor(const Vehicle* vehicle) const { Q_UNUSED(vehicle); return QStringLiteral("/qmlimages/APM/BrandImageSub"); } QString brandImageIndoor(const Vehicle* vehicle) const { Q_UNUSED(vehicle); return QStringLiteral("/qmlimages/APM/BrandImageSub"); }

5
src/FirmwarePlugin/FirmwarePlugin.cc

@ -139,11 +139,6 @@ bool FirmwarePlugin::supportsRadio(void)
return true; return true;
} }
bool FirmwarePlugin::supportsCalibratePressure(void)
{
return false;
}
bool FirmwarePlugin::supportsMotorInterference(void) bool FirmwarePlugin::supportsMotorInterference(void)
{ {
return true; return true;

4
src/FirmwarePlugin/FirmwarePlugin.h

@ -170,10 +170,6 @@ public:
/// to be assigned via parameters in firmware. Default is false. /// to be assigned via parameters in firmware. Default is false.
virtual bool supportsJSButton(void); virtual bool supportsJSButton(void);
/// Returns true if the firmware supports calibrating the pressure sensor so the altitude will read
/// zero at the current pressure. Default is false.
virtual bool supportsCalibratePressure(void);
/// Returns true if the firmware supports calibrating motor interference offsets for the compass /// Returns true if the firmware supports calibrating motor interference offsets for the compass
/// (CompassMot). Default is true. /// (CompassMot). Default is true.
virtual bool supportsMotorInterference(void); virtual bool supportsMotorInterference(void);

5
src/Vehicle/Vehicle.cc

@ -1964,11 +1964,6 @@ bool Vehicle::supportsJSButton(void) const
return _firmwarePlugin->supportsJSButton(); return _firmwarePlugin->supportsJSButton();
} }
bool Vehicle::supportsCalibratePressure(void) const
{
return _firmwarePlugin->supportsCalibratePressure();
}
bool Vehicle::supportsMotorInterference(void) const bool Vehicle::supportsMotorInterference(void) const
{ {
return _firmwarePlugin->supportsMotorInterference(); return _firmwarePlugin->supportsMotorInterference();

2
src/Vehicle/Vehicle.h

@ -282,7 +282,6 @@ public:
Q_PROPERTY(bool supportsThrottleModeCenterZero READ supportsThrottleModeCenterZero CONSTANT) Q_PROPERTY(bool supportsThrottleModeCenterZero READ supportsThrottleModeCenterZero CONSTANT)
Q_PROPERTY(bool supportsJSButton READ supportsJSButton CONSTANT) Q_PROPERTY(bool supportsJSButton READ supportsJSButton CONSTANT)
Q_PROPERTY(bool supportsRadio READ supportsRadio CONSTANT) Q_PROPERTY(bool supportsRadio READ supportsRadio CONSTANT)
Q_PROPERTY(bool supportsCalibratePressure READ supportsCalibratePressure CONSTANT)
Q_PROPERTY(bool supportsMotorInterference READ supportsMotorInterference CONSTANT) Q_PROPERTY(bool supportsMotorInterference READ supportsMotorInterference CONSTANT)
Q_PROPERTY(bool autoDisconnect MEMBER _autoDisconnect NOTIFY autoDisconnectChanged) Q_PROPERTY(bool autoDisconnect MEMBER _autoDisconnect NOTIFY autoDisconnectChanged)
Q_PROPERTY(QString prearmError READ prearmError WRITE setPrearmError NOTIFY prearmErrorChanged) Q_PROPERTY(QString prearmError READ prearmError WRITE setPrearmError NOTIFY prearmErrorChanged)
@ -519,7 +518,6 @@ public:
bool supportsThrottleModeCenterZero(void) const; bool supportsThrottleModeCenterZero(void) const;
bool supportsRadio(void) const; bool supportsRadio(void) const;
bool supportsJSButton(void) const; bool supportsJSButton(void) const;
bool supportsCalibratePressure(void) const;
bool supportsMotorInterference(void) const; bool supportsMotorInterference(void) const;
void setGuidedMode(bool guidedMode); void setGuidedMode(bool guidedMode);

Loading…
Cancel
Save