AntiMicroX
joysensorstatusbox.h
Go to the documentation of this file.
1 /* antimicrox Gamepad to KB+M event mapper
2  * Copyright (C) 2022 Max Maisel <max.maisel@posteo.de>
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13 
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 #pragma once
18 
19 #include <QSize>
20 #include <QWidget>
21 
22 class JoySensor;
23 class QPaintEvent;
24 
32 class JoySensorStatusBox : public QWidget
33 {
34  Q_OBJECT
35 
36  public:
37  explicit JoySensorStatusBox(QWidget *parent = nullptr);
38 
39  void setSensor(JoySensor *sensor);
40  JoySensor *getSensor() const;
41 
42  virtual QSize sizeHint() const override;
43 
44  protected:
45  virtual void paintEvent(QPaintEvent *event) override;
46  void drawArtificialHorizon();
47 
48  private:
50 };
JoySensorStatusBox::JoySensorStatusBox
JoySensorStatusBox(QWidget *parent=nullptr)
Definition: joysensorstatusbox.cpp:35
JoySensor::getZCoordinate
virtual float getZCoordinate() const =0
JoySensorStatusBox::setSensor
void setSensor(JoySensor *sensor)
Sets the to be visualized sensor.
Definition: joysensorstatusbox.cpp:47
globalvariables.h
joysensor.h
JoySensor::calculatePitch
double calculatePitch() const
Calculate the pitch angle (in degrees) corresponding to the current position of controller.
Definition: joysensor.cpp:425
JoySensor::getDiagonalRange
double getDiagonalRange() const
Get the assigned diagonal range value.
Definition: joysensor.cpp:264
JoySensorStatusBox::drawArtificialHorizon
void drawArtificialHorizon()
draws the artificial horizon instrument on the screen
Definition: joysensorstatusbox.cpp:85
JoySensorType
JoySensorType
Definition: joysensortype.h:23
JoySensor::radToDeg
static double radToDeg(double value)
Utility function which converts a given value from radians to degree.
Definition: joysensor.cpp:519
JoySensorStatusBox
The GUI sensor position indicator widget.
Definition: joysensorstatusbox.h:32
JoySensor::calculateRoll
double calculateRoll() const
Calculate the roll angle (in degrees) corresponding to the current position of controller.
Definition: joysensor.cpp:455
JoySensorStatusBox::sizeHint
virtual QSize sizeHint() const override
Definition: joysensorstatusbox.cpp:71
JoySensor::getType
JoySensorType getType() const
Returns the sensor type.
Definition: joysensor.cpp:247
JoySensorStatusBox::m_sensor
JoySensor * m_sensor
Definition: joysensorstatusbox.h:49
common.h
joyaxis.h
JoySensorStatusBox::getSensor
JoySensor * getSensor() const
Get the visualized sensor object.
Definition: joysensorstatusbox.cpp:69
JoySensor::getMaxZone
double getMaxZone() const
Get the assigned max zone value.
Definition: joysensor.cpp:270
JoySensor::getXCoordinate
virtual float getXCoordinate() const =0
JoySensor
Represents one sensor in a SetJoystick and its connections to other parts of the application....
Definition: joysensor.h:39
GYROSCOPE
@ GYROSCOPE
Definition: joysensortype.h:26
JoySensorStatusBox::paintEvent
virtual void paintEvent(QPaintEvent *event) override
Definition: joysensorstatusbox.cpp:73
JoySensor::getDeadZone
double getDeadZone() const
Get the assigned dead zone value.
Definition: joysensor.cpp:258
PadderCommon::inputDaemonMutex
QMutex inputDaemonMutex
Definition: common.cpp:223
JoySensor::getYCoordinate
virtual float getYCoordinate() const =0
ACCELEROMETER
@ ACCELEROMETER
Definition: joysensortype.h:25
joysensorstatusbox.h