The Joystick Settings window now supports selecting between multiple joysticks for control input and updates its UI accordingly. Much work is left to be done: light/dark styling, settings management, control mappings.
The JoystickWidget now has a parent so that it gets cleaned up when the MainWindow is closed preventing zombie-dialog syndrome.
The JoystickInput class now emits signals for both button press and button release events.
Renamed the Joystick Test menu option to Joystick Configuration to be more clear.
Renamed slot in ChartPlot to match connect() calls elsewhere.
The joystick widget now has theming capabilities. Also displays button presses properly now.
The joystick settings window has now been reworked to be a fixed minimum size and dynamically scale with both the number of buttons and axes on a given joystick/controller. Mapping functionality is incomplete at this point still, though the UI exists for it.
Refactored much of the joystick interface with the largest changes being the removal of dead/unused code including broken event-based SDL reading code. Additionally the mapping code should now work, though it hasn't been tested with controller switching or a real UAS. Finally the existing settings code has been commented-out as it is not compatible with the current state of this code and needs to be able to support different joysticks based on name.
Disable all UI for the joystick configuration when no joysticks are found.
Styling improvements to the joystick configuration window.
Refactored some variables and added some documentation. Also, now the joystickChanged signal emits NaN for axes that aren't mapped, so consumers should handle this properly.
Moved the JOYSTICK_*_MAPPING enum into JoystickInput where it belongs. Also renamed some local variables.
The hat readings from the joystick now works correctly. Also moved some signals over to using an enum from an int type.
The button/axis/hat readings are now compared to the previous readings and signals are only emitted if they changed. The joystickChanged signal is still emitted every sample period.
Added an inversion checkbox for each joystick axis so they can be individually inverted or not. This will be a joystick-specific configuration and independent of the autopilot used. Also refactored the code so that the JoystickAxis objects connect directly to the JoystickInput thread for updating the backend. The JoystickWidget is now just a facilitator and doesn't do any redirecting itself.
Fix for improperly-named slot causing runtime error.
The UI now updates properly for when a detected joystick is lacking either buttons or axes (as in the case of an in-built accelerometer).
Joystick axes can now be specified as being exclusively-positive in the range [0:1.0] for the throttle. This should really be a vehicle-specific setting.
The Joystick Settings window now supports selecting between multiple joysticks for control input and updates its UI accordingly. Much work is left to be done: light/dark styling, settings management, control mappings.
The JoystickWidget now has a parent so that it gets cleaned up when the MainWindow is closed preventing zombie-dialog syndrome.