20 Q_PROPERTY(QQuickItem* statusLog MEMBER _statusLog)
21 Q_PROPERTY(QQuickItem* progressBar MEMBER _progressBar)
23 Q_PROPERTY(QQuickItem* nextButton MEMBER _nextButton)
24 Q_PROPERTY(QQuickItem* cancelButton MEMBER _cancelButton)
25 Q_PROPERTY(QQuickItem* orientationCalAreaHelpText MEMBER _orientationCalAreaHelpText)
121 void _handleTextMessage(
int sysid,
int componentid,
int severity,
const QString &text,
const QString &description);
123 void _mavCommandResult(
int vehicleId,
int component,
int command,
int result,
int failureCode);
126 void _startLogCalibration();
127 void _startVisualCalibration();
129 void _appendStatusLog(
const QString &text);
130 void _refreshParams();
131 void _hideAllCalAreas();
132 void _resetInternalState();
138 void _restorePreviousCompassCalFitness();
140 enum StopCalibrationCode {
141 StopCalibrationSuccess,
142 StopCalibrationSuccessShowLog,
143 StopCalibrationFailed,
144 StopCalibrationCancelled
146 void _stopCalibration(StopCalibrationCode code);
150 void _sendStartMagCal();
152 void _updateAndEmitShowOrientationCalArea(
bool show);
156 QQuickItem *_statusLog =
nullptr;
157 QQuickItem *_progressBar =
nullptr;
158 QQuickItem *_nextButton =
nullptr;
159 QQuickItem *_cancelButton =
nullptr;
160 QQuickItem *_orientationCalAreaHelpText =
nullptr;
162 bool _showOrientationCalArea =
false;
168 bool _magCalStartAccepted =
false;
172 bool _magCalCancelBeforeStartPending =
false;
173 uint8_t _magCalCompassBits = 0;
175 uint8_t _rgCompassCalProgress[3];
176 bool _rgCompassCalComplete[3];
177 bool _rgCompassCalSucceeded[3];
178 float _rgCompassCalFitness[3];
180 bool _orientationCalDownSideDone =
false;;
181 bool _orientationCalUpsideDownSideDone =
false;;
182 bool _orientationCalLeftSideDone =
false;;
183 bool _orientationCalRightSideDone =
false;;
184 bool _orientationCalNoseDownSideDone =
false;;
185 bool _orientationCalTailDownSideDone =
false;;
187 bool _orientationCalDownSideVisible =
false;;
188 bool _orientationCalUpsideDownSideVisible =
false;;
189 bool _orientationCalLeftSideVisible =
false;;
190 bool _orientationCalRightSideVisible =
false;;
191 bool _orientationCalNoseDownSideVisible =
false;;
192 bool _orientationCalTailDownSideVisible =
false;;
194 bool _orientationCalDownSideInProgress =
false;;
195 bool _orientationCalUpsideDownSideInProgress =
false;;
196 bool _orientationCalLeftSideInProgress =
false;;
197 bool _orientationCalRightSideInProgress =
false;;
198 bool _orientationCalNoseDownSideInProgress =
false;;
199 bool _orientationCalTailDownSideInProgress =
false;;
201 bool _orientationCalDownSideRotate =
false;;
202 bool _orientationCalUpsideDownSideRotate =
false;;
203 bool _orientationCalLeftSideRotate =
false;;
204 bool _orientationCalRightSideRotate =
false;;
205 bool _orientationCalNoseDownSideRotate =
false;;
206 bool _orientationCalTailDownSideRotate =
false;;
208 bool _waitingForCancel =
false;
210 bool _restoreCompassCalFitness =
false;
211 float _previousCompassCalFitness = 0.;
212 static constexpr const char *_compassCalFitnessParam =
"COMPASS_CAL_FIT";
214 static constexpr int _supportedFirmwareCalVersion = 2;