AntiMicroX
joysensoreditdialog.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 "joysensorpreset.h"
20 
21 #include <QDialog>
22 
23 class JoySensor;
24 class QWidget;
25 
26 namespace Ui {
28 }
29 
33 class JoySensorEditDialog : public QDialog
34 {
35  Q_OBJECT
36 
37  public:
38  explicit JoySensorEditDialog(JoySensor *sensor, QWidget *parent = nullptr);
40 
41  private:
42  Ui::JoySensorEditDialog *m_ui;
44 
47 
48  private slots:
49  void implementPresets(int index);
50 
53  void updateSensorStats(float x, float y, float z);
55  void updateSensorDelaySpinBox(int value);
56  void updateSensorDelaySlider(double value);
57  void setSensorDelay(double value);
58 };
JoySensor::calculateDistance
double calculateDistance() const
Get the vector length of the sensor.
Definition: joysensor.cpp:408
JoySensor::moved
void moved(float xaxis, float yaxis, float zaxis)
JoySensorEditDialog::updateSensorDelaySpinBox
void updateSensorDelaySpinBox(int value)
Update QDoubleSpinBox value based on updated sensor delay value.
Definition: joysensoreditdialog.cpp:249
JoySensorEditDialog::m_ui
Ui::JoySensorEditDialog * m_ui
Definition: joysensoreditdialog.h:42
JoySensor::setDeadZone
void setDeadZone(double value)
Sets the dead zone of the sensor to the given value.
Definition: joysensor.cpp:599
SetJoystick::getIndex
int getIndex() const
Definition: setjoystick.cpp:507
JoySensor::getZCoordinate
virtual float getZCoordinate() const =0
JoySensorPreset::setSensorPreset
void setSensorPreset(Preset)
Assigns given preset to the underlying sensor This function defines the preset mappings and sensor pa...
Definition: joysensorpreset.cpp:250
MouseSensorSettingsDialog
Mouse settings dialog specialized for sensors.
Definition: mousesensorsettingsdialog.h:29
JoySensorPreset::getPresetName
QString getPresetName(Preset)
Get the translated name of a given preset.
Definition: joysensorpreset.cpp:212
SetJoystick::getName
QString getName() const
Definition: setjoystick.cpp:948
JoySensorEditDialog::updateSensorDelaySlider
void updateSensorDelaySlider(double value)
Update QSlider value based on value from QDoubleSpinBox.
Definition: joysensoreditdialog.cpp:259
JoySensorEditDialog::openMouseSettingsDialog
void openMouseSettingsDialog()
Opens sensor mouse settings dialog.
Definition: joysensoreditdialog.cpp:180
JoySensorEditDialog::m_preset
JoySensorPreset m_preset
Definition: joysensoreditdialog.h:46
antkeymapper.h
joysensor.h
JoySensor::getDistanceFromDeadZone
double getDistanceFromDeadZone() const
Get current radial distance of the sensor past the assigned dead zone.
Definition: joysensor.cpp:289
JoySensorEditDialog::updateWindowTitleSensorName
void updateWindowTitleSensorName()
Shows the sensor name in dialog title.
Definition: joysensoreditdialog.cpp:219
joysensoreditdialog.h
JoySensorEditDialog::m_keypad_unlocked
bool m_keypad_unlocked
Definition: joysensoreditdialog.h:43
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
JoySensorEditDialog::~JoySensorEditDialog
~JoySensorEditDialog()
Definition: joysensoreditdialog.cpp:157
JoySensorPreset
Defines presets for a sensor.
Definition: joysensorpreset.h:24
JoySensor::setSensorName
void setSensorName(QString tempName)
Sets the name of this sensor.
Definition: joysensor.cpp:663
JoySensorEditDialog::updateSensorStats
void updateSensorStats(float x, float y, float z)
Updates the numerical sensor values on the screen.
Definition: joysensoreditdialog.cpp:195
JoySensor::radToDeg
static double radToDeg(double value)
Utility function which converts a given value from radians to degree.
Definition: joysensor.cpp:519
Ui
Definition: aboutdialog.h:26
JoySensorPreset::Preset
Preset
Definition: joysensorpreset.h:29
joysensorpreset.h
JoySensor::calculateRoll
double calculateRoll() const
Calculate the roll angle (in degrees) corresponding to the current position of controller.
Definition: joysensor.cpp:455
JoySensorEditDialog::implementPresets
void implementPresets(int index)
Preset combo box event handler. Applies selected preset to underlying sensor.
Definition: joysensoreditdialog.cpp:162
JoySensorEditDialog::setSensorDelay
void setSensorDelay(double value)
Sensor delay change event handler Converts the double value from the SpinBox to int and pass it to Jo...
Definition: joysensoreditdialog.cpp:271
SetJoystick::getRealIndex
int getRealIndex() const
Definition: setjoystick.cpp:509
mousesensorsettingsdialog.h
JoySensorEditDialog::m_sensor
JoySensor * m_sensor
Definition: joysensoreditdialog.h:45
JoySensorEditDialog
The configuration dialog for a JoySensor itself.
Definition: joysensoreditdialog.h:33
event.h
JoySensorEditDialog::enableMouseSettingButton
void enableMouseSettingButton()
Definition: joysensoreditdialog.cpp:190
JoySensor::setMaxZone
void setMaxZone(double value)
Sets the maximum zone of the sensor to the given value.
Definition: joysensor.cpp:614
inputdevice.h
JoySensor::sensorNameChanged
void sensorNameChanged()
JoySensor::getType
JoySensorType getType() const
Returns the sensor type.
Definition: joysensor.cpp:247
JoySensorEditDialog::JoySensorEditDialog
JoySensorEditDialog(JoySensor *sensor, QWidget *parent=nullptr)
Definition: joysensoreditdialog.cpp:37
common.h
buttoneditdialog.h
GlobalVariables::JoySensor::GYRO_MAX
static const double GYRO_MAX
Definition: globalvariables.h:232
GlobalVariables::JoySensor::ACCEL_MAX
static const double ACCEL_MAX
Definition: globalvariables.h:230
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
setjoystick.h
joysensorbutton.h
JoySensorPreset::getAvailablePresets
QList< Preset > getAvailablePresets()
Get available presets for the underlying sensor type.
Definition: joysensorpreset.cpp:37
JoySensor::getSensorName
QString getSensorName() const
Returns the sensor name.
Definition: joysensor.cpp:242
JoySensor::getSensorDelay
unsigned int getSensorDelay() const
Get the assigned input delay.
Definition: joysensor.cpp:276
JoySensor::getParentSet
SetJoystick * getParentSet() const
Get pointer to the set that a sensor belongs to.
Definition: joysensor.cpp:774
number
it is up to the author donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License If the distribution and or use of the Library is restricted in certain countries either by patents or by copyrighted the original copyright holder who places the Library under this License may add an geographical distribution limitation excluding those so that distribution is permitted only in or among countries not thus excluded In such this License incorporates the limitation as if written in the body of this License The Free Software Foundation may publish revised and or new versions of the Lesser General Public License from time to time Such new versions will be similar in spirit to the present but may differ in detail to address new problems or concerns Each version is given a distinguishing version number If the Library specifies a version number of this License which applies to it and any later you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation If the Library does not specify a license version number
Definition: lgpl-2.1.txt:423
JoySensor::getDeadZone
double getDeadZone() const
Get the assigned dead zone value.
Definition: joysensor.cpp:258
PadderCommon::inputDaemonMutex
QMutex inputDaemonMutex
Definition: common.cpp:223
JoySensor::setDiagonalRange
void setDiagonalRange(double value)
Set the diagonal range value for a sensor.
Definition: joysensor.cpp:629
JoySensorPreset::currentPreset
Preset currentPreset()
Determines the preset used by the underlying sensor.
Definition: joysensorpreset.cpp:62
JoySensor::getYCoordinate
virtual float getYCoordinate() const =0
ACCELEROMETER
@ ACCELEROMETER
Definition: joysensortype.h:25
JoySensor::getPartialName
QString getPartialName(bool forceFullFormat=false, bool displayNames=false) const
Get the name of this sensor.
Definition: joysensor.cpp:219