AntiMicroX
Loading...
Searching...
No Matches
joygyroscopesensor.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
18#pragma once
19
20#include "joysensor.h"
21
22class SetJoystick;
23
28{
29 public:
30 explicit JoyGyroscopeSensor(int originset, SetJoystick *parent_set, QObject *parent);
31 virtual ~JoyGyroscopeSensor();
32
33 virtual float getXCoordinate() const override;
34 virtual float getYCoordinate() const override;
35 virtual float getZCoordinate() const override;
36 virtual QString sensorTypeName() const override;
37
38 virtual void getCalibration(double *offsetX, double *offsetY, double *offsetZ) const override;
39 virtual void setCalibration(double offsetX, double offsetY, double offsetZ) override;
40
41 public slots:
42 virtual void reset() override;
43
44 protected:
45 virtual void populateButtons();
47 virtual void applyCalibration() override;
48};
Definition joydpadxml.h:27
Represents a gyroscope sensor.
Definition joygyroscopesensor.h:28
virtual void getCalibration(double *offsetX, double *offsetY, double *offsetZ) const override
Reads the calibration values of the sensor.
Definition joygyroscopesensor.cpp:65
virtual ~JoyGyroscopeSensor()
Definition joygyroscopesensor.cpp:33
virtual void reset() override
Resets internal variables back to default.
Definition joygyroscopesensor.cpp:89
virtual float getXCoordinate() const override
Get the value for the corresponding X axis.
Definition joygyroscopesensor.cpp:39
virtual float getYCoordinate() const override
Get the value for the corresponding Y axis.
Definition joygyroscopesensor.cpp:45
virtual void populateButtons()
Initializes the JoySensorButton objects for this sensor.
Definition joygyroscopesensor.cpp:98
virtual float getZCoordinate() const override
Get the value for the corresponding Z axis.
Definition joygyroscopesensor.cpp:51
virtual void setCalibration(double offsetX, double offsetY, double offsetZ) override
Sets the sensor calibration values and sets the calibration flag.
Definition joygyroscopesensor.cpp:78
virtual QString sensorTypeName() const override
Get the translated sensor type name.
Definition joygyroscopesensor.cpp:57
virtual JoySensorDirection calculateSensorDirection() override
Find the direction zone of the current sensor position.
Definition joygyroscopesensor.cpp:149
virtual void applyCalibration() override
Applies calibration to queued input values.
Definition joygyroscopesensor.cpp:123
Represents one sensor in a SetJoystick and its connections to other parts of the application....
Definition joysensor.h:40
A set of mapped events which can by switched by a controller event. Contains controller input objects...
Definition setjoystick.h:40
JoySensorDirection
A bitfield style enum which encodes all possible three dimensional sensor directions....
Definition joysensordirection.h:28