dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
mixercurve.h
Go to the documentation of this file.
1 
13 /*
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful, but
20  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  * for more details.
23  *
24  * You should have received a copy of the GNU General Public License along
25  * with this program; if not, see <http://www.gnu.org/licenses/>
26  */
27 #ifndef MIXERCURVE_H
28 #define MIXERCURVE_H
29 
30 #include <QFrame>
31 #include <QWidget>
32 #include <QList>
33 #include <QTableWidget>
34 
35 #include "ui_mixercurve.h"
37 #include "dblspindelegate.h"
39 
40 namespace Ui {
41 class MixerCurvePlot;
42 }
43 
44 class MixerCurve : public QFrame
45 {
46  Q_OBJECT
47 
48 public:
49  explicit MixerCurve(QWidget *parent = nullptr);
50  ~MixerCurve();
51 
52  /* Enumeration options for ThrottleCurves */
54 
55  void setMixerType(MixerCurveType curveType, bool isCurve1 = true);
56  void initCurve(const QList<double> *points);
58  void initLinearCurve(int numPoints, double maxValue = 1, double minValue = 0);
59  void setCurve(const QList<double> *points);
60  void setMin(double value);
61  double getMin();
62  void setMax(double value);
63  double getMax();
64  double getCurveMin();
65  double getCurveMax();
66  double getCurveStep();
67  double setRange(double min, double max);
68 
69  MixerCurveWidget *getCurveWidget() { return m_curve; }
70  QComboBox *getCBCurveSource() { return m_mixerUI->CBCurve2Source; }
71 
72 signals:
73 
74 protected:
75  void showEvent(QShowEvent *event);
76  void resizeEvent(QResizeEvent *event);
77 
78 public slots:
79  void ResetCurve();
80  void PopupCurve();
81  void GenerateCurve();
82  void UpdateSettingsTable();
83 
84 private slots:
85  void CommandActivated(MixerNode *node = nullptr);
86  void SettingsTableChanged();
87  void CurveTypeChanged();
88  void CurveMinChanged(double value);
89  void CurveMaxChanged(double value);
90  void UpdateCurveUI();
91 
92 private:
93  Ui::MixerCurvePlot *m_mixerUI;
94  MixerCurveWidget *m_curve;
95  QTableWidget *m_settings;
96  MixerCurveType m_curveType;
97  DoubleSpinDelegate *m_spinDelegate;
98 };
99 
100 #endif // MIXERCURVE_H
void setMin(double value)
Definition: mixercurve.cpp:301
QComboBox * getCBCurveSource()
Definition: mixercurve.h:70
void UpdateSettingsTable()
Definition: mixercurve.cpp:338
void initLinearCurve(int numPoints, double maxValue=1, double minValue=0)
Definition: mixercurve.cpp:286
void ResetCurve()
Definition: mixercurve.cpp:130
void setMax(double value)
Definition: mixercurve.cpp:310
void showEvent(QShowEvent *event)
Definition: mixercurve.cpp:431
double getMax()
Definition: mixercurve.cpp:315
double getMin()
Definition: mixercurve.cpp:306
double getCurveStep()
Definition: mixercurve.cpp:333
double getCurveMin()
Definition: mixercurve.cpp:324
double getCurveMax()
Definition: mixercurve.cpp:328
void PopupCurve()
Definition: mixercurve.cpp:143
void initCurve(const QList< double > *points)
Definition: mixercurve.cpp:277
void setCurve(const QList< double > *points)
Definition: mixercurve.cpp:296
double setRange(double min, double max)
Definition: mixercurve.cpp:319
void resizeEvent(QResizeEvent *event)
Definition: mixercurve.cpp:446
MixerCurveWidget * getCurveWidget()
Definition: mixercurve.h:69
QList< double > getCurve()
Definition: mixercurve.cpp:282
MixerCurve(QWidget *parent=nullptr)
Definition: mixercurve.cpp:35
void setMixerType(MixerCurveType curveType, bool isCurve1=true)
Definition: mixercurve.cpp:90
void GenerateCurve()
Definition: mixercurve.cpp:226