MNE-CPP  beta 1.0
babymegsquidcontroldgl.h
Go to the documentation of this file.
1 //=============================================================================================================
35 /*
36  * revise this component by removing BabyMEG related.
37  */
38 
39 #ifndef BABYMEGSQUIDCONTROLDGL_H
40 #define BABYMEGSQUIDCONTROLDGL_H
41 
42 
43 //*************************************************************************************************************
44 //=============================================================================================================
45 // INCLUDES
46 //=============================================================================================================
47 
48 //#include "../ui_babymegsquidcontroldgl.h"
49 
50 //*************************************************************************************************************
51 //=============================================================================================================
52 // QT INCLUDES
53 //=============================================================================================================
54 
55 #include <QDialog>
56 #include <QScrollBar>
57 #include <QDebug>
58 
59 #include <QVector>
60 
61 #include <qmath.h>
62 #include <QGraphicsView>
63 #include <QGraphicsScene>
64 #include <QGraphicsItem>
65 #include <QGraphicsLineItem>
66 #include <QGraphicsRectItem>
67 #include <QGraphicsTextItem>
68 
69 #include "globalobj.h"
70 #include "plotter.h"
71 //*************************************************************************************************************
72 //=============================================================================================================
73 // Eigen INCLUDES
74 //=============================================================================================================
75 //#include "include/3rdParty/Eigen/Core"
76 #include <Eigen/Core>
77 
78 
79 //*************************************************************************************************************
80 //=============================================================================================================
81 // USED NAMESPACES
82 //=============================================================================================================
83 
84 using namespace Eigen;
85 
86 
87 class plotter;
88 class PlotSettings;
89 
90 namespace Ui
91 {
92 class BabyMEGSQUIDControlDgl;
93 }//namespace
94 
95 
96 //*************************************************************************************************************
97 //=============================================================================================================
98 // DEFINE NAMESPACE BabyMEGPlugin
99 //=============================================================================================================
100 
101 namespace BabyMEGPlugin
102 {
103 
104 
105 //*************************************************************************************************************
106 //=============================================================================================================
107 // FORWARD DECLARATIONS
108 //=============================================================================================================
109 
110 class BabyMEG;
111 
112 
113 //*************************************************************************************************************
114 //=============================================================================================================
115 // Structure definitions
116 //=============================================================================================================
117 struct FLLPara{
118  int Bias;
119  int Mod;
120  int Mode;
121  int PreGain;
122  int PostGain;
123  int slew;
124  int offset;
125  int LoPass;
126  int LPBW;
127  int HiPass;
128  int HPBW;
129  int AutoReset;
130  int ResetLock;
131  QString channame;
132 };
133 
134 struct FLLConfig{
135  QList < FLLPara > m_Fll;
136 };
137 
138 //*************************************************************************************************************
139 //=============================================================================================================
140 // GUI Status Machine Structure definitions
141 //=============================================================================================================
143  int CommType;
144  int ChannelSel;
145  int ChannelStat;
146  int OperMode;
147  int Retune;
148  int HeatThis;
149  int Atune;
150  int Reset;
151  int HeatAndTune;
152  int Save;
153  int _Save;
154  int GroupHeat;
155  int Last;
156  int Default;
157 
158  int HighPass;
159  int LowPass;
160  int PreGain;
161  int PostGain;
162  int Slew;
163  float HeatTime;
164  float CoolTime;
165 
166  int AutoRest;
167  int ResetLock;
168  float offset;
169  float bias;
170  float modulation;
171 
172  int TuneCheck;
173  int Amp;
174  int IntegratorReset;
175  int MicroReset;
176 
177  int BarGraphSelect;
178 
179  QVector <double> ParaGraph;
180 };
181 
182 //=============================================================================================================
188 class BabyMEGSQUIDControlDgl : public QDialog
189 {
190  Q_OBJECT
191 
192 
193 public:
194  explicit BabyMEGSQUIDControlDgl(BabyMEG* p_pBabyMEG,QWidget *parent = 0);
196 
197 private:
199 
200 protected:
201  virtual void closeEvent( QCloseEvent * event );
202 
203 public:
204  BabyMEG* m_pBabyMEG;
205  FLLConfig m_FLLConfig;
206  GUIStatMachine m_GUISM;
207  QVector <QGraphicsLineItem * > PolyLinePtr;
208  bool initplotflag;
209  QVector <QGraphicsRectItem * > PolyRectPtr;
210 
211  PlotSettings settings;
212  PlotSettings settings_tune;
213 
214  plotter *d_timeplot;
215 
216  int TableRows;
217  int TableCols;
218  QList < QString > chanNames;
219 
220  void SendCMD(QString CMDSTR);
221  void InitChannels(QString sReply);
222  void InitGUIConfig(QString sFLLPara);
223  void ReplyCmdProc(QString sReply);
224  void UpdateGUI();
225  QString GenChnInfo(QString);
226  void UpdateInfo(QString newText);
227  void ProcCmd(QString cmd, int index, QString Info);
228  void InitTuneGraph();
229  void TuneGraphDispProc(MatrixXf tmp);
230  void UpdateParaGraph();
231  float mmin(MatrixXf tmp,int chan);
232  float mmax(MatrixXf tmp,int chan);
233 
234 public slots:
235 
236  void RcvCMDData(QByteArray DATA);
237 
238  void Cancel();
239  void Init();
240  void SyncGUI();
241 
242  void Retune();
243  void Heat();
244  void Atune();
245  void Reset();
246  void HeatTune();
247 
248  void Save();
249  void Save1();
250  void GroupHeat();
251  void Last();
252  void Default();
253 
254  void TuneCheck();
255  void Amp();
256  void IntReset();
257  void MicroReset();
258 
259  void CommType(int index);
260  void ChanSele(int index);
261  void OperMode(int index);
262  void HighPass(int index);
263  void LowPass1(int index);
264  void SlewSele(int index);
265  void PreGaini(int index);
266  void PostGain(int index);
267  void AutoRest(int index);
268  void RestLock(int index);
269  void BarGraph(int index);
270 
271  void HeatTime();
272  void CoolTime();
273  void AdOffset();
274  void AdjuBias();
275  void AdjuModu();
276 
277 signals:
278  void SendCMDToMEGSource(QString CMDSTR);
279  void inittg();
280  void SCStart();
281  void SCStop();
282 };
283 
284 } //NAMESPACE
285 
286 #endif // BABYMEGSQUIDCONTROLDGL_H
Definition: aboutwindow.h:52
The BabyMEG class provides a Fiff data simulator.
Definition: babymeg.h:101
definitions of global varables.
The BabyMEGSQUIDControlDgl class provides the SQUID control dialog.