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(quint32 sysid,
int componentid,
int severity,
const QString& text,
122 const QString& description);
124 void _mavCommandResult(quint32 vehicleId,
int component,
int command,
int result,
int failureCode);
127 void _startLogCalibration();
128 void _startVisualCalibration();
130 void _appendStatusLog(
const QString &text);
131 void _refreshParams();
132 void _hideAllCalAreas();
133 void _resetInternalState();
139 void _restorePreviousCompassCalFitness();
141 enum StopCalibrationCode {
142 StopCalibrationSuccess,
143 StopCalibrationSuccessShowLog,
144 StopCalibrationFailed,
145 StopCalibrationCancelled
147 void _stopCalibration(StopCalibrationCode code);
151 void _sendStartMagCal();
153 void _updateAndEmitShowOrientationCalArea(
bool show);
157 QQuickItem *_statusLog =
nullptr;
158 QQuickItem *_progressBar =
nullptr;
159 QQuickItem *_nextButton =
nullptr;
160 QQuickItem *_cancelButton =
nullptr;
161 QQuickItem *_orientationCalAreaHelpText =
nullptr;
163 bool _showOrientationCalArea =
false;
169 bool _magCalStartAccepted =
false;
173 bool _magCalCancelBeforeStartPending =
false;
174 uint8_t _magCalCompassBits = 0;
176 uint8_t _rgCompassCalProgress[3];
177 bool _rgCompassCalComplete[3];
178 bool _rgCompassCalSucceeded[3];
179 float _rgCompassCalFitness[3];
181 bool _orientationCalDownSideDone =
false;;
182 bool _orientationCalUpsideDownSideDone =
false;;
183 bool _orientationCalLeftSideDone =
false;;
184 bool _orientationCalRightSideDone =
false;;
185 bool _orientationCalNoseDownSideDone =
false;;
186 bool _orientationCalTailDownSideDone =
false;;
188 bool _orientationCalDownSideVisible =
false;;
189 bool _orientationCalUpsideDownSideVisible =
false;;
190 bool _orientationCalLeftSideVisible =
false;;
191 bool _orientationCalRightSideVisible =
false;;
192 bool _orientationCalNoseDownSideVisible =
false;;
193 bool _orientationCalTailDownSideVisible =
false;;
195 bool _orientationCalDownSideInProgress =
false;;
196 bool _orientationCalUpsideDownSideInProgress =
false;;
197 bool _orientationCalLeftSideInProgress =
false;;
198 bool _orientationCalRightSideInProgress =
false;;
199 bool _orientationCalNoseDownSideInProgress =
false;;
200 bool _orientationCalTailDownSideInProgress =
false;;
202 bool _orientationCalDownSideRotate =
false;;
203 bool _orientationCalUpsideDownSideRotate =
false;;
204 bool _orientationCalLeftSideRotate =
false;;
205 bool _orientationCalRightSideRotate =
false;;
206 bool _orientationCalNoseDownSideRotate =
false;;
207 bool _orientationCalTailDownSideRotate =
false;;
209 bool _waitingForCancel =
false;
211 bool _restoreCompassCalFitness =
false;
212 float _previousCompassCalFitness = 0.;
213 static constexpr const char *_compassCalFitnessParam =
"COMPASS_CAL_FIT";
215 static constexpr int _supportedFirmwareCalVersion = 2;