The Joystick class.
More...
#include <joystick.hh>
|
void | xChange (float value) |
| Signal emitted in order to realize value change of x coordinate. More...
|
|
void | yChange (float value) |
| Signal emitted in order to realize value change of y coordinate. More...
|
|
|
float | checkValue (const float &value, const float &min, const float &max) const |
| Check if coordinate value is in proper range. More...
|
|
void | resizeEvent (QResizeEvent *event) override |
| Event handler to change size of widget. More...
|
|
virtual void | paintEvent (QPaintEvent *event) override |
| Draw analog joystick with it's background. More...
|
|
Definition at line 24 of file joystick.hh.
◆ Joystick()
Joystick::Joystick |
( |
QWidget * |
parent = nullptr | ) |
|
|
explicit |
- Parameters
-
[in] | parent | Pointer to parent QWidget object |
Definition at line 22 of file joystick.cpp.
◆ ~Joystick()
◆ addXAnimation
void Joystick::addXAnimation |
( |
| ) |
|
|
slot |
◆ addYAnimation
void Joystick::addYAnimation |
( |
| ) |
|
|
slot |
◆ checkValue()
float Joystick::checkValue |
( |
const float & |
value, |
|
|
const float & |
min, |
|
|
const float & |
max |
|
) |
| const |
|
private |
- Parameters
-
[in] | value | Value to be check |
[in] | min | Minimal value |
[in] | max | Maximal value |
- Return values
-
min | - value is below range |
max | - value is above range |
value | - value is in proper range |
Definition at line 126 of file joystick.cpp.
◆ movePos
void Joystick::movePos |
( |
const QPoint & |
coordinates | ) |
|
|
slot |
Calculate coordinates which will be used to draw knob from raw coordinates passed as parameter. Emit signal that coordionates changed.
- Parameters
-
[in] | coordinates | Point with coordinates read from serial port |
Definition at line 94 of file joystick.cpp.
◆ paintEvent()
void Joystick::paintEvent |
( |
QPaintEvent * |
event | ) |
|
|
overrideprivatevirtual |
- Parameters
-
[in] | event | Paint event [not used] |
Definition at line 173 of file joystick.cpp.
◆ removeXAnimation
void Joystick::removeXAnimation |
( |
| ) |
|
|
slot |
◆ removeYAnimation
void Joystick::removeYAnimation |
( |
| ) |
|
|
slot |
◆ resizeEvent()
void Joystick::resizeEvent |
( |
QResizeEvent * |
event | ) |
|
|
overrideprivate |
Change geometry of widget to properly display visualization
- Parameters
-
[in] | event | Resize event [not used] |
Definition at line 131 of file joystick.cpp.
◆ setAlignment
void Joystick::setAlignment |
( |
Qt::Alignment |
align | ) |
|
|
slot |
- Parameters
-
[in] | align | Type of alignment used in resizeEvent |
Definition at line 89 of file joystick.cpp.
◆ setX
void Joystick::setX |
( |
const float & |
value | ) |
|
|
slot |
- Parameters
-
[in] | value | Value of x coordinate in range from -1.f to 1.f |
Definition at line 41 of file joystick.cpp.
◆ setY
void Joystick::setY |
( |
const float & |
value | ) |
|
|
slot |
- Parameters
-
[in] | value | Value of y coordinate in range from -1.f to 1.f |
Definition at line 52 of file joystick.cpp.
◆ x()
float Joystick::x |
( |
| ) |
const |
|
inline |
- Returns
- Value of x coordinate
Definition at line 41 of file joystick.hh.
◆ xChange
void Joystick::xChange |
( |
float |
value | ) |
|
|
signal |
- Parameters
-
[in] | value | Value of x coordinate |
◆ y()
float Joystick::y |
( |
| ) |
const |
|
inline |
- Returns
- Value of y coordinate
Definition at line 47 of file joystick.hh.
◆ yChange
void Joystick::yChange |
( |
float |
value | ) |
|
|
signal |
- Parameters
-
[in] | value | Value of y coordinate |
◆ _alignment
Qt::Alignment Joystick::_alignment |
|
private |
◆ _animation
QParallelAnimationGroup* Joystick::_animation |
|
private |
◆ _bounds
◆ _knopBounds
QRectF Joystick::_knopBounds |
|
private |
◆ _midPoint
const float Joystick::_midPoint = 2048.0 |
|
private |
◆ _x
◆ _xAnimation
QPropertyAnimation* Joystick::_xAnimation |
|
private |
◆ _y
◆ _yAnimation
QPropertyAnimation* Joystick::_yAnimation |
|
private |
The documentation for this class was generated from the following files: