Commit d46cdc93 authored by DonLakeFlyer's avatar DonLakeFlyer

parent 9d4088b0
......@@ -569,6 +569,26 @@ SetupPage {
} // QGCViewDialog
} // Component - calibratePressureDialogComponent
Component {
id: calibrateGyroDialogComponent
QGCViewDialog {
id: calibrateGyroDialog
function accept() {
controller.calibrateGyro()
calibrateGyroDialog.hideDialog()
}
QGCLabel {
anchors.left: parent.left
anchors.right: parent.right
wrapMode: Text.WordWrap
text: qsTr("For Gyroscope calibration you will need to place your vehicle on a surface and leave it still.\n\nClick Ok to start calibration.")
}
}
}
QGCFlickable {
id: buttonFlickable
anchors.left: parent.left
......@@ -621,12 +641,19 @@ SetupPage {
}
}
QGCButton {
width: _buttonWidth
text: qsTr("Gyro")
visible: activeVehicle && (activeVehicle.multiRotor | activeVehicle.rover)
onClicked: mainWindow.showComponentDialog(calibrateGyroDialogComponent, qsTr("Calibrate Gyro"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
}
QGCButton {
width: _buttonWidth
text: _calibratePressureText
onClicked: mainWindow.showComponentDialog(calibratePressureDialogComponent, _calibratePressureText, mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
readonly property string _calibratePressureText: activeVehicle.fixedWing ? qsTr("Cal Baro/Airspeed") : qsTr("Calibrate Pressure")
readonly property string _calibratePressureText: activeVehicle.fixedWing ? qsTr("Baro/Airspeed") : qsTr("Pressure")
}
QGCButton {
......
......@@ -7,9 +7,7 @@
*
****************************************************************************/
#ifndef APMSensorsComponentController_H
#define APMSensorsComponentController_H
#pragma once
#include <QObject>
......@@ -81,20 +79,22 @@ public:
Q_PROPERTY(double compass2CalFitness READ compass2CalFitness NOTIFY compass2CalFitnessChanged)
Q_PROPERTY(double compass3CalFitness READ compass3CalFitness NOTIFY compass3CalFitnessChanged)
Q_INVOKABLE void calibrateCompass(void);
Q_INVOKABLE void calibrateAccel(void);
Q_INVOKABLE void calibrateMotorInterference(void);
Q_INVOKABLE void levelHorizon(void);
Q_INVOKABLE void calibratePressure(void);
Q_INVOKABLE void cancelCalibration(void);
Q_INVOKABLE void nextClicked(void);
Q_INVOKABLE bool usingUDPLink(void);
Q_INVOKABLE void calibrateCompass (void);
Q_INVOKABLE void calibrateAccel (void);
Q_INVOKABLE void calibrateGyro (void);
Q_INVOKABLE void calibrateMotorInterference (void);
Q_INVOKABLE void levelHorizon (void);
Q_INVOKABLE void calibratePressure (void);
Q_INVOKABLE void cancelCalibration (void);
Q_INVOKABLE void nextClicked (void);
Q_INVOKABLE bool usingUDPLink (void);
bool compassSetupNeeded(void) const;
bool accelSetupNeeded(void) const;
bool compassSetupNeeded (void) const;
bool accelSetupNeeded (void) const;
typedef enum {
CalTypeAccel,
CalTypeGyro,
CalTypeOnboardCompass,
CalTypeOffboardCompass,
CalTypeLevelHorizon,
......@@ -113,40 +113,40 @@ public:
double compass3CalFitness(void) const { return _rgCompassCalFitness[2]; }
signals:
void showGyroCalAreaChanged(void);
void showOrientationCalAreaChanged(void);
void orientationCalSidesDoneChanged(void);
void orientationCalSidesVisibleChanged(void);
void orientationCalSidesInProgressChanged(void);
void orientationCalSidesRotateChanged(void);
void resetStatusTextArea(void);
void waitingForCancelChanged(void);
void setupNeededChanged(void);
void calibrationComplete(CalType_t calType);
void compass1CalSucceededChanged(bool compass1CalSucceeded);
void compass2CalSucceededChanged(bool compass2CalSucceeded);
void compass3CalSucceededChanged(bool compass3CalSucceeded);
void compass1CalFitnessChanged(double compass1CalFitness);
void compass2CalFitnessChanged(double compass2CalFitness);
void compass3CalFitnessChanged(double compass3CalFitness);
void setAllCalButtonsEnabled(bool enabled);
void showGyroCalAreaChanged (void);
void showOrientationCalAreaChanged (void);
void orientationCalSidesDoneChanged (void);
void orientationCalSidesVisibleChanged (void);
void orientationCalSidesInProgressChanged (void);
void orientationCalSidesRotateChanged (void);
void resetStatusTextArea (void);
void waitingForCancelChanged (void);
void setupNeededChanged (void);
void calibrationComplete (CalType_t calType);
void compass1CalSucceededChanged (bool compass1CalSucceeded);
void compass2CalSucceededChanged (bool compass2CalSucceeded);
void compass3CalSucceededChanged (bool compass3CalSucceeded);
void compass1CalFitnessChanged (double compass1CalFitness);
void compass2CalFitnessChanged (double compass2CalFitness);
void compass3CalFitnessChanged (double compass3CalFitness);
void setAllCalButtonsEnabled (bool enabled);
private slots:
void _handleUASTextMessage(int uasId, int compId, int severity, QString text);
void _handleUASTextMessage (int uasId, int compId, int severity, QString text);
void _mavlinkMessageReceived(LinkInterface* link, mavlink_message_t message);
void _mavCommandResult(int vehicleId, int component, int command, int result, bool noReponseFromVehicle);
void _mavCommandResult (int vehicleId, int component, int command, int result, bool noReponseFromVehicle);
private:
void _startLogCalibration(void);
void _startVisualCalibration(void);
void _appendStatusLog(const QString& text);
void _refreshParams(void);
void _hideAllCalAreas(void);
void _resetInternalState(void);
void _handleCommandAck(mavlink_message_t& message);
void _handleMagCalProgress(mavlink_message_t& message);
void _handleMagCalReport(mavlink_message_t& message);
void _restorePreviousCompassCalFitness(void);
void _startLogCalibration (void);
void _startVisualCalibration (void);
void _appendStatusLog (const QString& text);
void _refreshParams (void);
void _hideAllCalAreas (void);
void _resetInternalState (void);
void _handleCommandAck (mavlink_message_t& message);
void _handleMagCalProgress (mavlink_message_t& message);
void _handleMagCalReport (mavlink_message_t& message);
void _restorePreviousCompassCalFitness (void);
enum StopCalibrationCode {
StopCalibrationSuccess,
......@@ -212,5 +212,3 @@ private:
static const int _supportedFirmwareCalVersion = 2;
};
#endif
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