@@ -83,7 +83,6 @@ class Joystick : public QThread
8383 Q_PROPERTY (QStringList assignableActionTitles READ assignableActionTitles NOTIFY assignableActionsChanged)
8484 Q_PROPERTY (QStringList buttonActions READ buttonActions NOTIFY buttonActionsChanged)
8585 Q_PROPERTY (bool enableManualControlExtensions READ enableManualControlExtensions WRITE setEnableManualControlExtensions NOTIFY enableManualControlExtensionsChanged)
86-
8786 enum ButtonEvent_t {
8887 BUTTON_UP,
8988 BUTTON_DOWN,
@@ -188,6 +187,9 @@ class Joystick : public QThread
188187 bool enableManualControlExtensions () const { return _enableManualControlExtensions; }
189188 void setEnableManualControlExtensions (bool enable);
190189
190+ QBitArray getButtonStates () const ;
191+ QList<float > getAxisValues () const ;
192+
191193signals:
192194 // The raw signals are only meant for use by calibration
193195 void rawAxisValueChanged (int index, int value);
@@ -203,6 +205,8 @@ class Joystick : public QThread
203205 void circleCorrectionChanged (bool circleCorrection);
204206 void enableManualControlExtensionsChanged ();
205207 void axisValues (float roll, float pitch, float yaw, float throttle);
208+ void axisValuesUpdated (QList<float > axisValues);
209+ void dataUpdated (QList<float > axisValues, QBitArray buttons);
206210 void axisFrequencyHzChanged ();
207211 void buttonFrequencyHzChanged ();
208212 void startContinuousZoom (int direction);
@@ -286,6 +290,7 @@ private slots:
286290 QmlObjectListModel *_assignableButtonActions = nullptr ;
287291
288292 bool _accumulator = false ;
293+ float _throttleAccumulator = 0 .f;
289294 bool _calibrated = false ;
290295 bool _calibrationMode = false ;
291296 bool _circleCorrection = true ;
@@ -307,13 +312,20 @@ private slots:
307312
308313 static int _transmitterMode;
309314
310- static constexpr float _defaultAxisFrequencyHz = 25 .0f ;
311- static constexpr float _defaultButtonFrequencyHz = 5 .0f ;
315+ static constexpr float kMinAxisValue = -1 .0f ;
316+ static constexpr float kMaxAxisValue = 1 .0f ;
317+
318+ static constexpr float kDefaultAxisFrequencyHz = 25 .0f ;
319+ static constexpr float kDefaultButtonFrequencyHz = 5 .0f ;
320+
312321 // Arbitrary Limits
313- static constexpr float _minAxisFrequencyHz = 0 .25f ;
314- static constexpr float _maxAxisFrequencyHz = 200 .0f ;
315- static constexpr float _minButtonFrequencyHz = 0 .25f ;
316- static constexpr float _maxButtonFrequencyHz = 50 .0f ;
322+ static constexpr float kMinAxisFrequencyHz = 0 .25f ;
323+ static constexpr float kMaxAxisFrequencyHz = 200 .0f ;
324+ static constexpr float kMinButtonFrequencyHz = 0 .25f ;
325+ static constexpr float kMaxButtonFrequencyHz = 50 .0f ;
326+
327+ // for throttle to change from min to max it will take 1000ms
328+ static constexpr float kAccumulatorMaxSlewRate = 1000 .0f ;
317329
318330 static constexpr const char *_rgFunctionSettingsKey[maxAxisFunction] = {
319331 " RollAxis" ,
0 commit comments