6import QGroundControl.Controls
10 title: qsTr("ESC Calibration")
12 acceptButtonEnabled: false
14 readonly property string _highlightPrefix: "<font color=\"" + qgcPal.warningText + "\">"
15 readonly property string _highlightSuffix: "</font>"
20 function onOldFirmware() {
21 textLabel.text = _highlightPrefix + qsTr("ESC Calibration failed. ") + _highlightSuffix +
22 qsTr("%1 cannot perform ESC Calibration with this version of firmware. You will need to upgrade to a newer firmware.").arg(QGroundControl.appName)
23 escCalibrationDlg.acceptButtonEnabled = true
26 function onNewerFirmware() {
27 textLabel.text = _highlightPrefix + qsTr("ESC Calibration failed. ") + _highlightSuffix +
28 qsTr("%1 cannot perform ESC Calibration with this version of firmware. You will need to upgrade %1.").arg(QGroundControl.appName)
29 escCalibrationDlg.acceptButtonEnabled = true
32 function onDisconnectBattery() {
33 textLabel.text = _highlightPrefix + qsTr("ESC Calibration failed. ") + _highlightSuffix +
34 qsTr("You must disconnect the battery prior to performing ESC Calibration. Disconnect your battery and try again.")
35 escCalibrationDlg.acceptButtonEnabled = true
38 function onConnectBattery() {
39 textLabel.text = _highlightPrefix + qsTr("WARNING: Props must be removed from vehicle prior to performing ESC calibration.") + _highlightSuffix +
40 qsTr(" Connect the battery now and calibration will begin.")
43 function onBatteryConnected() {
44 textLabel.text = qsTr("Performing calibration. This will take a few seconds..")
47 function onCalibrationFailed(errorMessage) {
48 escCalibrationDlg.acceptButtonEnabled = true
49 textLabel.text = _highlightPrefix + qsTr("ESC Calibration failed. ") + _highlightSuffix + errorMessage
52 function onCalibrationSuccess() {
53 escCalibrationDlg.acceptButtonEnabled = true
54 textLabel.text = qsTr("Calibration complete. You can disconnect your battery now if you like.")
58 Component.onCompleted: controller.calibrateEsc()
63 wrapMode: Text.WordWrap
64 text: qsTr("Starting ESC calibration...")
65 Layout.fillWidth: true
66 Layout.maximumWidth: mainWindow.width / 2