Commit 8c0e81d9 authored by Gregory Dymarek's avatar Gregory Dymarek

Cleanup

parent e44fed2f
...@@ -143,9 +143,9 @@ void Joystick::run(void) ...@@ -143,9 +143,9 @@ void Joystick::run(void)
// We only send the buttons the firmwware has reserved // We only send the buttons the firmwware has reserved
int reservedButtonCount = _activeVehicle->manualControlReservedButtonCount(); int reservedButtonCount = _activeVehicle->manualControlReservedButtonCount();
if (reservedButtonCount == -1) { if (reservedButtonCount == -1)
reservedButtonCount = _buttonCount; reservedButtonCount = _buttonCount;
}
quint16 newButtonBits = 0; // New set of button which are down quint16 newButtonBits = 0; // New set of button which are down
quint16 buttonPressedBits = 0; // Buttons pressed for manualControl signal quint16 buttonPressedBits = 0; // Buttons pressed for manualControl signal
......
...@@ -55,14 +55,14 @@ JoystickAndroid::JoystickAndroid(const QString& name, int id, MultiVehicleManage ...@@ -55,14 +55,14 @@ JoystickAndroid::JoystickAndroid(const QString& name, int id, MultiVehicleManage
axisValue[i] = 0; axisValue[i] = 0;
} }
qDebug() << "joystick constructor:" << _name; _axisCount = 4;
qDebug() << "axis:" <<_axisCount << "buttons:" <<_buttonCount;
QtAndroidPrivate::registerGenericMotionEventListener(this); QtAndroidPrivate::registerGenericMotionEventListener(this);
QtAndroidPrivate::registerKeyEventListener(this); QtAndroidPrivate::registerKeyEventListener(this);
} }
JoystickAndroid::~JoystickAndroid() { JoystickAndroid::~JoystickAndroid() {
qDebug() << "joystick destructor" << _name;
delete btnCode; delete btnCode;
delete axisCode; delete axisCode;
...@@ -150,11 +150,11 @@ bool JoystickAndroid::update(void) ...@@ -150,11 +150,11 @@ bool JoystickAndroid::update(void)
} }
bool JoystickAndroid::getButton(int i) { bool JoystickAndroid::getButton(int i) {
return btnValue[ btnCode[i] ]; return btnValue[ i ];
} }
int JoystickAndroid::getAxis(int i) { int JoystickAndroid::getAxis(int i) {
return axisValue[ axisCode[i] ]; return axisValue[ i ];
} }
......
...@@ -287,6 +287,7 @@ Rectangle { ...@@ -287,6 +287,7 @@ Rectangle {
setupComplete: joystickManager.activeJoystick ? joystickManager.activeJoystick.calibrated : false setupComplete: joystickManager.activeJoystick ? joystickManager.activeJoystick.calibrated : false
exclusiveGroup: setupButtonGroup exclusiveGroup: setupButtonGroup
visible: _fullParameterVehicleAvailable && joystickManager.joysticks.length != 0 visible: _fullParameterVehicleAvailable && joystickManager.joysticks.length != 0
//visible: true
text: "Joystick" text: "Joystick"
onClicked: showJoystickPanel() onClicked: showJoystickPanel()
......
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