Commit 14a59a98 authored by Don Gagne's avatar Don Gagne

Mag Cal UI

parent a2e9481b
......@@ -195,8 +195,6 @@ Rectangle {
}
VehicleRotationCal {
width: 200
height: 200
calValid: true
calInProgress: controller.gyroCalInProgress
imageSource: "qrc:///qml/VehicleDown.png"
......@@ -206,10 +204,10 @@ Rectangle {
}
Rectangle {
id: accelCalArea
id: orientationCalArea
width: parent.calDisplayAreaWidth
height: parent.height
visible: controller.showAccelCalArea
visible: controller.showOrientationCalArea
color: qgcPal.windowShade
QGCLabel {
......@@ -227,46 +225,40 @@ Rectangle {
spacing: 5
VehicleRotationCal {
width: 200
height: 200
calValid: controller.accelCalDownSideDone
calInProgress: controller.accelCalDownSideInProgress
imageSource: "qrc:///qml/VehicleDown.png"
calValid: controller.orientationCalDownSideDone
calInProgress: controller.orientationCalDownSideInProgress
calInProgressText: controller.calInProgressText
imageSource: "qrc:///qml/VehicleDown.png"
}
VehicleRotationCal {
width: 200
height: 200
calValid: controller.accelCalUpsideDownSideDone
calInProgress: controller.accelCalUpsideDownSideInProgress
imageSource: "qrc:///qml/VehicleUpsideDown.png"
calValid: controller.orientationCalUpsideDownSideDone
calInProgress: controller.orientationCalUpsideDownSideInProgress
calInProgressText: controller.calInProgressText
imageSource: "qrc:///qml/VehicleUpsideDown.png"
}
VehicleRotationCal {
width: 200
height: 200
calValid: controller.accelCalNoseDownSideDone
calInProgress: controller.accelCalNoseDownSideInProgress
imageSource: "qrc:///qml/VehicleNoseDown.png"
calValid: controller.orientationCalNoseDownSideDone
calInProgress: controller.orientationCalNoseDownSideInProgress
calInProgressText: controller.calInProgressText
imageSource: "qrc:///qml/VehicleNoseDown.png"
}
VehicleRotationCal {
width: 200
height: 200
calValid: controller.accelCalTailDownSideDone
calInProgress: controller.accelCalTailDownSideInProgress
imageSource: "qrc:///qml/VehicleTailDown.png"
calValid: controller.orientationCalTailDownSideDone
calInProgress: controller.orientationCalTailDownSideInProgress
calInProgressText: controller.calInProgressText
imageSource: "qrc:///qml/VehicleTailDown.png"
}
VehicleRotationCal {
width: 200
height: 200
calValid: controller.accelCalLeftSideDone
calInProgress: controller.accelCalLeftSideInProgress
imageSource: "qrc:///qml/VehicleLeft.png"
calValid: controller.orientationCalLeftSideDone
calInProgress: controller.orientationCalLeftSideInProgress
calInProgressText: controller.calInProgressText
imageSource: "qrc:///qml/VehicleLeft.png"
}
VehicleRotationCal {
width: 200
height: 200
calValid: controller.accelCalRightSideDone
calInProgress: controller.accelCalRightSideInProgress
imageSource: "qrc:///qml/VehicleRight.png"
calValid: controller.orientationCalRightSideDone
calInProgress: controller.orientationCalRightSideInProgress
calInProgressText: controller.calInProgressText
imageSource: "qrc:///qml/VehicleRight.png"
}
}
}
......
......@@ -56,23 +56,25 @@ public:
Q_PROPERTY(bool showCompass2 MEMBER _showCompass2 CONSTANT)
Q_PROPERTY(bool showGyroCalArea MEMBER _showGyroCalArea NOTIFY showGyroCalAreaChanged)
Q_PROPERTY(bool showAccelCalArea MEMBER _showAccelCalArea NOTIFY showAccelCalAreaChanged)
Q_PROPERTY(bool showOrientationCalArea MEMBER _showOrientationCalArea NOTIFY showOrientationCalAreaChanged)
Q_PROPERTY(bool gyroCalInProgress MEMBER _gyroCalInProgress NOTIFY gyroCalInProgressChanged)
Q_PROPERTY(bool accelCalDownSideDone MEMBER _accelCalDownSideDone NOTIFY accelCalSidesDoneChanged)
Q_PROPERTY(bool accelCalUpsideDownSideDone MEMBER _accelCalUpsideDownSideDone NOTIFY accelCalSidesDoneChanged)
Q_PROPERTY(bool accelCalLeftSideDone MEMBER _accelCalLeftSideDone NOTIFY accelCalSidesDoneChanged)
Q_PROPERTY(bool accelCalRightSideDone MEMBER _accelCalRightSideDone NOTIFY accelCalSidesDoneChanged)
Q_PROPERTY(bool accelCalNoseDownSideDone MEMBER _accelCalNoseDownSideDone NOTIFY accelCalSidesDoneChanged)
Q_PROPERTY(bool accelCalTailDownSideDone MEMBER _accelCalTailDownSideDone NOTIFY accelCalSidesDoneChanged)
Q_PROPERTY(QString calInProgressText MEMBER _calInProgressText NOTIFY calInProgressTextChanged)
Q_PROPERTY(bool accelCalDownSideInProgress MEMBER _accelCalDownSideInProgress NOTIFY accelCalSidesInProgressChanged)
Q_PROPERTY(bool accelCalUpsideDownSideInProgress MEMBER _accelCalUpsideDownSideInProgress NOTIFY accelCalSidesInProgressChanged)
Q_PROPERTY(bool accelCalLeftSideInProgress MEMBER _accelCalLeftSideInProgress NOTIFY accelCalSidesInProgressChanged)
Q_PROPERTY(bool accelCalRightSideInProgress MEMBER _accelCalRightSideInProgress NOTIFY accelCalSidesInProgressChanged)
Q_PROPERTY(bool accelCalNoseDownSideInProgress MEMBER _accelCalNoseDownSideInProgress NOTIFY accelCalSidesInProgressChanged)
Q_PROPERTY(bool accelCalTailDownSideInProgress MEMBER _accelCalTailDownSideInProgress NOTIFY accelCalSidesInProgressChanged)
Q_PROPERTY(bool orientationCalDownSideDone MEMBER _orientationCalDownSideDone NOTIFY orientationCalSidesDoneChanged)
Q_PROPERTY(bool orientationCalUpsideDownSideDone MEMBER _orientationCalUpsideDownSideDone NOTIFY orientationCalSidesDoneChanged)
Q_PROPERTY(bool orientationCalLeftSideDone MEMBER _orientationCalLeftSideDone NOTIFY orientationCalSidesDoneChanged)
Q_PROPERTY(bool orientationCalRightSideDone MEMBER _orientationCalRightSideDone NOTIFY orientationCalSidesDoneChanged)
Q_PROPERTY(bool orientationCalNoseDownSideDone MEMBER _orientationCalNoseDownSideDone NOTIFY orientationCalSidesDoneChanged)
Q_PROPERTY(bool orientationCalTailDownSideDone MEMBER _orientationCalTailDownSideDone NOTIFY orientationCalSidesDoneChanged)
Q_PROPERTY(bool orientationCalDownSideInProgress MEMBER _orientationCalDownSideInProgress NOTIFY orientationCalSidesInProgressChanged)
Q_PROPERTY(bool orientationCalUpsideDownSideInProgress MEMBER _orientationCalUpsideDownSideInProgress NOTIFY orientationCalSidesInProgressChanged)
Q_PROPERTY(bool orientationCalLeftSideInProgress MEMBER _orientationCalLeftSideInProgress NOTIFY orientationCalSidesInProgressChanged)
Q_PROPERTY(bool orientationCalRightSideInProgress MEMBER _orientationCalRightSideInProgress NOTIFY orientationCalSidesInProgressChanged)
Q_PROPERTY(bool orientationCalNoseDownSideInProgress MEMBER _orientationCalNoseDownSideInProgress NOTIFY orientationCalSidesInProgressChanged)
Q_PROPERTY(bool orientationCalTailDownSideInProgress MEMBER _orientationCalTailDownSideInProgress NOTIFY orientationCalSidesInProgressChanged)
Q_INVOKABLE void calibrateCompass(void);
Q_INVOKABLE void calibrateGyro(void);
......@@ -83,10 +85,11 @@ public:
signals:
void showGyroCalAreaChanged(void);
void showAccelCalAreaChanged(void);
void showOrientationCalAreaChanged(void);
void gyroCalInProgressChanged(void);
void accelCalSidesDoneChanged(void);
void accelCalSidesInProgressChanged(void);
void orientationCalSidesDoneChanged(void);
void orientationCalSidesInProgressChanged(void);
void calInProgressTextChanged(const QString& newText);
private slots:
void _handleUASTextMessage(int uasId, int compId, int severity, QString text);
......@@ -101,8 +104,10 @@ private:
void _updateAndEmitGyroCalInProgress(bool inProgress);
void _updateAndEmitCalInProgressText(const QString& text);
void _updateAndEmitShowGyroCalArea(bool show);
void _updateAndEmitShowAccelCalArea(bool show);
void _updateAndEmitShowOrientationCalArea(bool show);
QQuickItem* _statusLog;
QQuickItem* _progressBar;
......@@ -112,27 +117,31 @@ private:
QQuickItem* _airspeedButton;
bool _showGyroCalArea;
bool _showAccelCalArea;
bool _showOrientationCalArea;
bool _showCompass0;
bool _showCompass1;
bool _showCompass2;
bool _gyroCalInProgress;
bool _accelCalDownSideDone;
bool _accelCalUpsideDownSideDone;
bool _accelCalLeftSideDone;
bool _accelCalRightSideDone;
bool _accelCalNoseDownSideDone;
bool _accelCalTailDownSideDone;
bool _accelCalDownSideInProgress;
bool _accelCalUpsideDownSideInProgress;
bool _accelCalLeftSideInProgress;
bool _accelCalRightSideInProgress;
bool _accelCalNoseDownSideInProgress;
bool _accelCalTailDownSideInProgress;
bool _magCalInProgress;
bool _accelCalInProgress;
QString _calInProgressText;
bool _orientationCalDownSideDone;
bool _orientationCalUpsideDownSideDone;
bool _orientationCalLeftSideDone;
bool _orientationCalRightSideDone;
bool _orientationCalNoseDownSideDone;
bool _orientationCalTailDownSideDone;
bool _orientationCalDownSideInProgress;
bool _orientationCalUpsideDownSideInProgress;
bool _orientationCalLeftSideInProgress;
bool _orientationCalRightSideInProgress;
bool _orientationCalNoseDownSideInProgress;
bool _orientationCalTailDownSideInProgress;
bool _textLoggingStarted;
......
......@@ -29,25 +29,28 @@ import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0
Rectangle {
property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
property ScreenTools __screenTools: ScreenTools { }
// Indicates whether calibration is valid for this control
property bool calValid: false
// Indicates whether the control is currently being calibrated
property bool calInProgress: false
// Text to show while calibration is in progress
property string calInProgressText: "Hold Still"
// Image source
property var imageSource: ""
property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
property ScreenTools __screenTools: ScreenTools { }
width: 200
height: 200
color: calInProgress ? "yellow" : (calValid ? "green" : "red")
Rectangle {
readonly property int inset: 5
property string calText: calInProgress ? "Hold Still" : (calValid ? "Completed" : "Incomplete")
property string calText: calInProgress ? calInProgressText : (calValid ? "Completed" : "Incomplete")
x: inset
y: inset
......
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