@@ -82,7 +82,7 @@ class Joystick : public QThread
8282 Q_PROPERTY (QString name READ name CONSTANT)
8383 Q_PROPERTY (QStringList assignableActionTitles READ assignableActionTitles NOTIFY assignableActionsChanged)
8484 Q_PROPERTY (QStringList buttonActions READ buttonActions NOTIFY buttonActionsChanged)
85-
85+ Q_PROPERTY ( bool )
8686 enum ButtonEvent_t {
8787 BUTTON_UP,
8888 BUTTON_DOWN,
@@ -183,6 +183,9 @@ class Joystick : public QThread
183183 // / Set joystick button repeat rate (in Hz)
184184 void setButtonFrequency (float val);
185185
186+ QBitArray getButtonStates () const ;
187+ QList<float > getAxisValues () const ;
188+
186189signals:
187190 // The raw signals are only meant for use by calibration
188191 void rawAxisValueChanged (int index, int value);
@@ -196,7 +199,8 @@ class Joystick : public QThread
196199 void accumulatorChanged (bool accumulator);
197200 void enabledChanged (bool enabled);
198201 void circleCorrectionChanged (bool circleCorrection);
199- void axisValues (float roll, float pitch, float yaw, float throttle);
202+ void axisValuesUpdated (QList<float > axisValues);
203+ void dataUpdated (QList<float > axisValues, QBitArray buttons);
200204 void axisFrequencyHzChanged ();
201205 void buttonFrequencyHzChanged ();
202206 void startContinuousZoom (int direction);
@@ -279,6 +283,7 @@ private slots:
279283 QmlObjectListModel *_assignableButtonActions = nullptr ;
280284
281285 bool _accumulator = false ;
286+ float _throttleAccumulator = 0 .f;
282287 bool _calibrated = false ;
283288 bool _calibrationMode = false ;
284289 bool _circleCorrection = true ;
@@ -299,13 +304,20 @@ private slots:
299304
300305 static int _transmitterMode;
301306
302- static constexpr float _defaultAxisFrequencyHz = 25 .0f ;
303- static constexpr float _defaultButtonFrequencyHz = 5 .0f ;
307+ static constexpr float kMinAxisValue = -1 .0f ;
308+ static constexpr float kMaxAxisValue = 1 .0f ;
309+
310+ static constexpr float kDefaultAxisFrequencyHz = 25 .0f ;
311+ static constexpr float kDefaultButtonFrequencyHz = 5 .0f ;
312+
304313 // Arbitrary Limits
305- static constexpr float _minAxisFrequencyHz = 0 .25f ;
306- static constexpr float _maxAxisFrequencyHz = 200 .0f ;
307- static constexpr float _minButtonFrequencyHz = 0 .25f ;
308- static constexpr float _maxButtonFrequencyHz = 50 .0f ;
314+ static constexpr float kMinAxisFrequencyHz = 0 .25f ;
315+ static constexpr float kMaxAxisFrequencyHz = 200 .0f ;
316+ static constexpr float kMinButtonFrequencyHz = 0 .25f ;
317+ static constexpr float kMaxButtonFrequencyHz = 50 .0f ;
318+
319+ // for throttle to change from min to max it will take 1000ms
320+ static constexpr float kAccumulatorMaxSlewRate = 1000 .0f ;
309321
310322 static constexpr const char *_rgFunctionSettingsKey[maxFunction] = {
311323 " RollAxis" ,
0 commit comments