SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
arginfogui.h
Go to the documentation of this file.
1 // Copyright (C) 2018 Edouard Griffiths, F4EXB //
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 as 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 V3 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/>. //
17 
18 #ifndef SDRGUI_SOAPYGUI_ARGINFOGUI_H_
19 #define SDRGUI_SOAPYGUI_ARGINFOGUI_H_
20 
21 #include <QWidget>
22 #include <QString>
23 
24 #include "export.h"
25 
26 namespace Ui {
27  class ArgInfoGUI;
28 }
29 
30 class SDRGUI_API ArgInfoGUI : public QWidget
31 {
32  Q_OBJECT
33 public:
35  {
38  ArgInfoDiscrete
39  };
40 
42  {
46  ArgInfoValueString
47  };
48 
49  explicit ArgInfoGUI(ArgInfoType type, ArgInfoValueType valueType, QWidget *parent = 0);
50  ~ArgInfoGUI();
51 
52  void setLabel(const QString& text);
53  void setToolTip(const QString& text);
54  void setUnits(const QString& units);
55 
56  ArgInfoType getType() const { return m_type; }
57  ArgInfoValueType getValueType() const { return m_valueType; }
58  void setRange(double min, double max);
59 
60  bool getBoolValue() const { return m_boolValue; }
61  void setBoolValue(bool value);
62  void addBoolValue(const QString& text, bool value);
63 
64  int getIntValue() const { return m_intValue; }
65  void setIntValue(int value);
66  void addIntValue(const QString& text, int value);
67 
68  double getFloatValue() const { return m_floatValue; }
69  void setFloatValue(double value);
70  void addFloatValue(const QString& text, double value);
71 
72  const QString& getStringValue() const { return m_stringValue; }
73  void setStringValue(const QString& value);
74  void addStringValue(const QString& text, const QString& value);
75 
76 signals:
77  void valueChanged();
78 
79 private slots:
80  void on_argCheck_toggled(bool checked);
81  void on_argEdit_editingFinished();
82  void on_argCombo_currentIndexChanged(int index);
83 
84 private:
85  int setIntegerValue(int value);
86  double setDoubleValue(double value);
87  void updateUIFromBool();
88  void updateUIFromInt();
89  void updateUIFromFloat();
90  void updateUIFromString();
91 
92  Ui::ArgInfoGUI* ui;
97  double m_floatValue;
98  QString m_stringValue;
99  bool m_hasRange;
100  double m_minValue;
101  double m_maxValue;
102 };
103 
104 #endif /* SDRGUI_SOAPYGUI_ARGINFOGUI_H_ */
int m_intValue
Definition: arginfogui.h:96
ArgInfoValueType m_valueType
Definition: arginfogui.h:94
double getFloatValue() const
Definition: arginfogui.h:68
double m_maxValue
Definition: arginfogui.h:101
ArgInfoValueType getValueType() const
Definition: arginfogui.h:57
ArgInfoType m_type
Definition: arginfogui.h:93
bool getBoolValue() const
Definition: arginfogui.h:60
#define SDRGUI_API
Definition: export.h:52
QString m_stringValue
Definition: arginfogui.h:98
bool m_boolValue
Definition: arginfogui.h:95
double m_minValue
Definition: arginfogui.h:100
const QString & getStringValue() const
Definition: arginfogui.h:72
Ui::ArgInfoGUI * ui
Definition: arginfogui.h:92
ArgInfoType getType() const
Definition: arginfogui.h:56
int getIntValue() const
Definition: arginfogui.h:64
bool m_hasRange
Definition: arginfogui.h:99
double m_floatValue
Definition: arginfogui.h:97
T max(const T &x, const T &y)
Definition: framework.h:446
T min(const T &x, const T &y)
Definition: framework.h:440