dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
scopegadgetoptionspage.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 
28 #ifndef SCOPEGADGETOPTIONSPAGE_H
29 #define SCOPEGADGETOPTIONSPAGE_H
30 
32 
34 #include "ui_scopegadgetoptionspage.h"
35 
36 #include <QString>
37 #include <QStringList>
38 #include <QDebug>
39 #include <QColorDialog>
40 
41 namespace Core {
43 }
44 
46 
47 namespace Ui {
49 }
50 
51 using namespace Core;
52 
54 {
55  Q_OBJECT
56 public:
57  enum userRoleShift { UR_UAVOBJECT, UR_UAVFIELD, UR_SCALE, UR_COLOR, UR_MEAN, UR_MATHFUNCTION };
58 
59  explicit ScopeGadgetOptionsPage(ScopeGadgetConfiguration *config, QObject *parent = nullptr);
60 
61  QWidget *createPage(QWidget *parent);
62  void apply();
63  void finish();
64 
65 private:
66  Ui::ScopeGadgetOptionsPage *options_page;
67  ScopeGadgetConfiguration *m_config;
68 
69  void addPlot2dCurveConfig(QString uavObject, QString uavField, int scale, unsigned int mean,
70  QString mathFunction, QVariant varColor);
71  void setPlot2dCurveProperties(QListWidgetItem *listWidgetItem, QString uavObject,
72  QString uavField, int scale, unsigned int mean,
73  QString mathFunction, QVariant varColor);
74  void set2dYAxisWidgetFromDataSource();
75  void setButtonColor(const QColor &color);
76  bool eventFilter(QObject *obj, QEvent *evt);
77 
78  QString dataSourceStyleSheetTemplate;
79  QListWidgetItem *selectedItem;
80 
81 private slots:
82  void on_lst2dCurves_currentRowChanged(int currentRow);
83  void on_lst2dItem_clicked(QListWidgetItem *);
84  void on_btnAdd2dCurve_clicked();
85  void on_btnApply2dCurve_clicked();
86  void on_btnRemove2dCurve_clicked();
87  void on_cmbUAVObjects_currentIndexChanged(QString val);
88  void on_cmbUAVObjectsSpectrogram_currentIndexChanged(QString val);
89  void on_btnColor_clicked();
90  void on_mathFunctionComboBox_currentIndexChanged(int currentIndex);
91  void on_cmbXAxisScatterplot2d_currentIndexChanged(QString currentText);
92  void on_cmbSpectrogramSource_currentIndexChanged(QString currentIndex);
93  void on_cmb2dPlotType_currentIndexChanged(QString);
94  void on_cmb3dPlotType_currentIndexChanged(QString);
95 };
96 
97 #endif // SCOPEGADGETOPTIONSPAGE_H
The IOptionsPage is an interface for providing options pages.
Definition: ioptionspage.h:42