Commit 0775d444 authored by nanthony21's avatar nanthony21

Moved deadband indicators to the right side column.

parent d4dbe920
......@@ -105,6 +105,7 @@ SetupPage {
width: _deadbandWidth
height: parent.height / 2
color: "#8c161a"
visible: controller.deadbandToggle
property real _percentDeadband: ((2 * deadbandValue) / (32768.0 * 2))
property real _deadbandWidth: parent.width * _percentDeadband
......@@ -743,6 +744,18 @@ SetupPage {
axisMonitorRepeater.itemAt(axis).loader.item.deadbandValue = value
}
}
onDeadbandToggled: {
if (value) {
for (var i=0;i<_activeJoystick.axisCount;i++) {
axisMonitorRepeater.itemAt(i).loader.item.deadbandBarVisible = true
}
}
else {
for (var i=0;i<_activeJoystick.axisCount;i++) {
axisMonitorRepeater.itemAt(i).loader.item.deadbandBarVisible = false
}
}
}
}
Repeater {
......
......@@ -257,7 +257,7 @@ void JoystickConfigController::_inputCenterWaitBegin(Joystick::AxisFunction_t fu
Q_UNUSED(function);
//sensing deadband
if (abs(value)*1.1f>_rgAxisInfo[axis].deadband) { //add 10% on top of existing deadband
if ((abs(value)*1.1f>_rgAxisInfo[axis].deadband)&&(_activeJoystick->deadband())) { //add 10% on top of existing deadband
_axisDeadbandChanged(axis,abs(value)*1.1f);
}
......@@ -451,6 +451,7 @@ void JoystickConfigController::_resetInternalCalibrationValues(void)
info->function = Joystick::maxFunction;
info->reversed = false;
info->deadband = 0;
emit axisDeadbandChanged(i,info->deadband);
info->axisMin = JoystickConfigController::_calCenterPoint;
info->axisMax = JoystickConfigController::_calCenterPoint;
info->axisTrim = JoystickConfigController::_calCenterPoint;
......@@ -489,6 +490,7 @@ void JoystickConfigController::_setInternalCalibrationValuesFromSettings(void)
info->axisMax = calibration.max;
info->reversed = calibration.reversed;
info->deadband = calibration.deadband;
emit axisDeadbandChanged(axis,info->deadband);
qCDebug(JoystickConfigControllerLog) << "Read settings name:axis:min:max:trim:reversed" << joystick->name() << axis << info->axisMin << info->axisMax << info->axisTrim << info->reversed;
}
......
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