Commit f8a07f3c authored by Jacob Walser's avatar Jacob Walser

Disable joystick TX mode selection during calibration

parent 21099441
......@@ -659,6 +659,7 @@ SetupPage {
exclusiveGroup: modeGroup
text: "1"
checked: controller.transmitterMode == 1
enabled: !controller.calibrating
onClicked: controller.transmitterMode = 1
}
......@@ -667,6 +668,7 @@ SetupPage {
exclusiveGroup: modeGroup
text: "2"
checked: controller.transmitterMode == 2
enabled: !controller.calibrating
onClicked: controller.transmitterMode = 2
}
......@@ -675,6 +677,7 @@ SetupPage {
exclusiveGroup: modeGroup
text: "3"
checked: controller.transmitterMode == 3
enabled: !controller.calibrating
onClicked: controller.transmitterMode = 3
}
......@@ -683,6 +686,7 @@ SetupPage {
exclusiveGroup: modeGroup
text: "4"
checked: controller.transmitterMode == 4
enabled: !controller.calibrating
onClicked: controller.transmitterMode = 4
}
......
......@@ -597,6 +597,7 @@ void JoystickConfigController::_startCalibration(void)
_currentStep = 0;
_setupCurrentState();
emit calibratingChanged();
}
/// @brief Cancels the calibration process, setting things back to initial state.
......@@ -615,6 +616,7 @@ void JoystickConfigController::_stopCalibration(void)
_skipButton->setEnabled(false);
_setHelpImage(_imageCenter);
emit calibratingChanged();
}
/// @brief Saves the current axis values, so that we can detect when the use moves an input.
......@@ -810,7 +812,7 @@ void JoystickConfigController::setTransmitterMode(int mode)
{
if (mode > 0 && mode <= 4) {
_transmitterMode = mode;
if (_currentStep != -1) {
if (_currentStep != -1) { // This should never be true, mode selection is disabled during calibration
const stateMachineEntry* state = _getStateMachineEntry(_currentStep);
_setHelpImage(state->image);
} else {
......
......@@ -71,6 +71,7 @@ public:
Q_PROPERTY(int transmitterMode READ transmitterMode WRITE setTransmitterMode NOTIFY transmitterModeChanged)
Q_PROPERTY(QString imageHelp MEMBER _imageHelp NOTIFY imageHelpChanged)
Q_PROPERTY(bool calibrating READ calibrating NOTIFY calibratingChanged)
Q_INVOKABLE void cancelButtonClicked(void);
Q_INVOKABLE void skipButtonClicked(void);
......@@ -104,6 +105,8 @@ public:
int transmitterMode(void) { return _transmitterMode; }
void setTransmitterMode(int mode);
bool calibrating(void) { return _currentStep != -1; }
signals:
void axisValueChanged(int axis, int value);
......@@ -132,6 +135,7 @@ signals:
void imageHelpChanged(QString source);
void transmitterModeChanged(int mode);
void calibratingChanged(void);
// @brief Signalled when in unit test mode and a message box should be displayed by the next button
void nextButtonMessageBoxDisplayed(void);
......
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