Commit 23624919 authored by Don Gagne's avatar Don Gagne

Better handling of battery already connected warning

parent 5c610f97
...@@ -110,6 +110,7 @@ QGCView { ...@@ -110,6 +110,7 @@ QGCView {
onCalibrationFailed: showMessage("ESC Calibration failed", errorMessage, StandardButton.Ok) onCalibrationFailed: showMessage("ESC Calibration failed", errorMessage, StandardButton.Ok)
onCalibrationSuccess: showMessage("ESC Calibration", "Calibration complete. You can disconnect your battery now if you like.", StandardButton.Ok) onCalibrationSuccess: showMessage("ESC Calibration", "Calibration complete. You can disconnect your battery now if you like.", StandardButton.Ok)
onConnectBattery: showMessage("ESC Calibration", "WARNING: Props must be removed from vehicle prior to performing ESC calibration.\n\nConnect the battery now and calibration will begin.", 0) onConnectBattery: showMessage("ESC Calibration", "WARNING: Props must be removed from vehicle prior to performing ESC calibration.\n\nConnect the battery now and calibration will begin.", 0)
onDisconnectBattery: showMessage("ESC Calibration failed", "You must disconnect the battery prior to performing ESC Calibration. Disconnect your battery and try again.", , StandardButton.Ok)
} }
Column { Column {
......
...@@ -105,8 +105,15 @@ void PowerComponentController::_handleUASTextMessage(int uasId, int compId, int ...@@ -105,8 +105,15 @@ void PowerComponentController::_handleUASTextMessage(int uasId, int compId, int
return; return;
} }
QString failedPrefix("calibration failed: "); QString failedPrefix("calibration failed: ");
if (text.startsWith(failedPrefix)) { if (text.startsWith(failedPrefix)) {
QString failureText = text.right(text.length() - failedPrefix.length());
if (failureText.startsWith("Disconnect battery")) {
emit disconnectBattery();
return;
}
_stopCalibration(); _stopCalibration();
emit calibrationFailed(text.right(text.length() - failedPrefix.length())); emit calibrationFailed(text.right(text.length() - failedPrefix.length()));
return; return;
......
...@@ -49,6 +49,7 @@ signals: ...@@ -49,6 +49,7 @@ signals:
void newerFirmware(void); void newerFirmware(void);
void incorrectFirmwareRevReporting(void); void incorrectFirmwareRevReporting(void);
void connectBattery(void); void connectBattery(void);
void disconnectBattery(void);
void batteryConnected(void); void batteryConnected(void);
void calibrationFailed(const QString& errorMessage); void calibrationFailed(const QString& errorMessage);
void calibrationSuccess(const QStringList& warningMessages); void calibrationSuccess(const QStringList& warningMessages);
......
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