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.
glscopegui.h
Go to the documentation of this file.
1 // Copyright (C) 2017 F4EXB //
3 // written by Edouard Griffiths //
4 // //
5 // This program is free software; you can redistribute it and/or modify //
6 // it under the terms of the GNU General Public License as published by //
7 // the Free Software Foundation as version 3 of the License, or //
8 // (at your option) any later version. //
9 // //
10 // This program is distributed in the hope that it will be useful, //
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
13 // GNU General Public License V3 for more details. //
14 // //
15 // You should have received a copy of the GNU General Public License //
16 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
18 
19 #ifndef SDRBASE_GUI_GLSCOPENGGUI_H_
20 #define SDRBASE_GUI_GLSCOPENGGUI_H_
21 
22 #include <QWidget>
23 #include <QComboBox>
24 
25 #include "dsp/dsptypes.h"
26 #include "export.h"
27 #include "util/message.h"
28 #include "dsp/scopevis.h"
29 #include "settings/serializable.h"
30 
31 namespace Ui {
32  class GLScopeGUI;
33 }
34 
35 class MessageQueue;
36 class GLScope;
37 
38 class SDRGUI_API GLScopeGUI : public QWidget, public Serializable {
39  Q_OBJECT
40 
41 public:
42  enum DisplayMode {
47  DisplayPol
48  };
49 
50  explicit GLScopeGUI(QWidget* parent = 0);
51  ~GLScopeGUI();
52 
53  void setBuddies(MessageQueue* messageQueue, ScopeVis* scopeVis, GLScope* glScope);
54 
55  void setSampleRate(int sampleRate);
56  void resetToDefaults();
57  virtual QByteArray serialize() const;
58  virtual bool deserialize(const QByteArray& data);
59 
60  bool handleMessage(Message* message);
61 
62  // preconfiguration methods
63  // global (first line):
64  void setDisplayMode(DisplayMode displayMode);
65  void setTraceIntensity(int value);
66  void setGridIntensity(int value);
67  void setTimeBase(int step);
68  void setTimeOffset(int step);
69  void setTraceLength(int step);
70  void setPreTrigger(int step);
71  // trace (second line):
72  void changeTrace(int traceIndex, const ScopeVis::TraceData& traceData);
73  void addTrace(const ScopeVis::TraceData& traceData);
74  void focusOnTrace(int traceIndex);
75  // trigger (third line):
76  void changeTrigger(int triggerIndex, const ScopeVis::TriggerData& triggerData);
77  void addTrigger(const ScopeVis::TriggerData& triggerData);
78  void focusOnTrigger(int triggerIndex);
79 
80 private:
82  {
83  public:
84  TrigUIBlocker(Ui::GLScopeGUI *ui);
85  ~TrigUIBlocker();
86 
87  void unBlock();
88 
89  private:
90  Ui::GLScopeGUI *m_ui;
100  };
101 
103  {
104  public:
105  TraceUIBlocker(Ui::GLScopeGUI *ui);
106  ~TraceUIBlocker();
107 
108  void unBlock();
109 
110  private:
111  Ui::GLScopeGUI *m_ui;
122  };
123 
125  {
126  public:
127  MainUIBlocker(Ui::GLScopeGUI *ui);
128  ~MainUIBlocker();
129 
130  void unBlock();
131 
132  private:
133  Ui::GLScopeGUI *m_ui;
139 // bool m_oldStateTime;
140 // bool m_oldStateTimeOfs;
141 // bool m_oldStateTraceLen;
142  };
143 
144  Ui::GLScopeGUI* ui;
145 
149 
156 
157  static const double amps[27];
158 
159  void applySettings();
160  // First row
161  void setTraceIndexDisplay();
162  void setTimeScaleDisplay();
163  void setTraceLenDisplay();
164  void setTimeOfsDisplay();
165  // Second row
166  void setAmpScaleDisplay();
167  void setAmpOfsDisplay();
168  void setTraceDelayDisplay();
169  // Third row
170  void setTrigIndexDisplay();
171  void setTrigCountDisplay();
172  void setTrigLevelDisplay();
173  void setTrigDelayDisplay();
174  void setTrigPreDisplay();
175 
176  void changeCurrentTrace();
177  void changeCurrentTrigger();
178 
179  void fillTraceData(ScopeVis::TraceData& traceData);
180  void fillTriggerData(ScopeVis::TriggerData& triggerData);
181  void setTriggerUI(const ScopeVis::TriggerData& triggerData);
182  void setTraceUI(const ScopeVis::TraceData& traceData);
183 
184  void fillProjectionCombo(QComboBox* comboBox);
185  void disableLiveMode(bool disable);
186 
187 private slots:
188  void on_scope_sampleRateChanged(int value);
189  void on_scope_traceSizeChanged(uint32_t value);
190  void on_scope_preTriggerChanged(uint32_t value);
191  // First row
192  void on_onlyX_toggled(bool checked);
193  void on_onlyY_toggled(bool checked);
194  void on_horizontalXY_toggled(bool checked);
195  void on_verticalXY_toggled(bool checked);
196  void on_polar_toggled(bool checked);
197  void on_polarPoints_toggled(bool checked);
198  void on_traceIntensity_valueChanged(int value);
199  void on_gridIntensity_valueChanged(int value);
200  void on_time_valueChanged(int value);
201  void on_timeOfs_valueChanged(int value);
202  void on_traceLen_valueChanged(int value);
203  // Second row
204  void on_trace_valueChanged(int value);
205  void on_traceAdd_clicked(bool checked);
206  void on_traceDel_clicked(bool checked);
207  void on_traceUp_clicked(bool checked);
208  void on_traceDown_clicked(bool checked);
209  void on_traceMode_currentIndexChanged(int index);
210  void on_amp_valueChanged(int value);
211  void on_ofsCoarse_valueChanged(int value);
212  void on_ofsFine_valueChanged(int value);
213  void on_traceDelayCoarse_valueChanged(int value);
214  void on_traceDelayFine_valueChanged(int value);
215  void on_traceView_toggled(bool checked);
216  void on_traceColor_clicked();
217  void on_memorySave_clicked(bool checked);
218  void on_memoryLoad_clicked(bool checked);
219  void on_mem_valueChanged(int value);
220  // Third row
221  void on_trig_valueChanged(int value);
222  void on_trigAdd_clicked(bool checked);
223  void on_trigDel_clicked(bool checked);
224  void on_trigUp_clicked(bool checked);
225  void on_trigDown_clicked(bool checked);
226  void on_trigMode_currentIndexChanged(int index);
227  void on_trigCount_valueChanged(int value);
228  void on_trigPos_toggled(bool checked);
229  void on_trigNeg_toggled(bool checked);
230  void on_trigBoth_toggled(bool checked);
231  void on_trigHoldoff_valueChanged(int value);
232  void on_trigLevelCoarse_valueChanged(int value);
233  void on_trigLevelFine_valueChanged(int value);
234  void on_trigDelayCoarse_valueChanged(int value);
235  void on_trigDelayFine_valueChanged(int value);
236  void on_trigPre_valueChanged(int value);
237  void on_trigColor_clicked();
238  void on_trigOneShot_toggled(bool checked);
239  void on_freerun_toggled(bool checked);
240 };
241 
242 
243 #endif /* SDRBASE_GUI_GLSCOPENGGUI_H_ */
int m_timeOffset
Definition: glscopegui.h:152
Ui::GLScopeGUI * ui
Definition: glscopegui.h:144
MessageQueue * m_messageQueue
Definition: glscopegui.h:146
int m_timeBase
Definition: glscopegui.h:151
unsigned int uint32_t
Definition: rtptypes_win.h:46
#define SDRGUI_API
Definition: export.h:52
Ui::GLScopeGUI * m_ui
Definition: glscopegui.h:90
int m_traceLenMult
Definition: glscopegui.h:153
ScopeVis * m_scopeVis
Definition: glscopegui.h:147
int m_sampleRate
Definition: glscopegui.h:150
Ui::GLScopeGUI * m_ui
Definition: glscopegui.h:111
QColor m_focusedTraceColor
Definition: glscopegui.h:154
Ui::GLScopeGUI * m_ui
Definition: glscopegui.h:133
GLScope * m_glScope
Definition: glscopegui.h:148
QColor m_focusedTriggerColor
Definition: glscopegui.h:155