QGUIMain.hh
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef _QGUI_MAIN_HH_
00014 #define _QGUI_MAIN_HH_
00015
00016
00017
00018 #include "QGUIBaseFrame.hh"
00019 #include "QDaqCommonDefs.hh"
00020
00021
00022 #include "Rtypes.h"
00023
00024
00025 #include <iostream>
00026 #include <vector>
00027 #include <map>
00028
00029
00030
00031 class QGUIDataCollector;
00032 class QDaqClient;
00033 class TGTextButton;
00034 class TGTextEntry;
00035 class TGTextEdit;
00036 class TTImer;
00037 class QGuiScope;
00038 class QGUIHistogramDisplay;
00039
00040
00041 class QGUIMain: public QGUIBaseFrame
00042 {
00043
00044 public:
00045
00046
00047 QGUIMain(const TGWindow *p, size_t Width, size_t Height);
00048
00049
00050 QGUIMain(const TGWindow *p);
00051
00052
00053 virtual ~QGUIMain();
00054
00055
00056
00057
00058 void Close();
00059
00060
00061 void StartRun();
00062
00063
00064 void StopRun();
00065
00066
00067 void QScopeStart();
00068
00069
00070 void QScopeClosed();
00071
00072
00073 void OpenMonitorWindow();
00074
00075
00076 void MonitorWindowClosed();
00077
00078
00079 void ChangeRunNumber();
00080
00081
00082 void ChangeSettingBasket();
00083
00084
00085 void ClearComments();
00086
00087
00088 void ResetFields();
00089
00090
00091 void ToggleColor();
00092
00093
00094
00095
00096 protected:
00097
00098
00099
00100 private:
00101
00102
00103
00104 enum QGUIStatus_t
00105 {
00106 QGUI_WAITING_FOR_START =0,
00107 QGUI_WAITING_FOR_STOP =1,
00108 QGUI_UNKNOWN =2
00109 };
00110
00111
00112 void PopUp();
00113
00114
00115 void Zeros();
00116
00117
00118 bool Init();
00119
00120
00121 QGUIDataCollector* fStatus;
00122
00123 QDaqClient* fSocket;
00124
00125 QGuiScope* fScope;
00126 QGUIHistogramDisplay *fHistoDisplay;
00127
00128
00129
00130
00131 std::string fVersion;
00132
00133
00134 QGUIStatus_t fGUIStatus;
00135
00136
00137 TTimer *fTimer;
00138
00139
00140
00141
00142
00143 TGHorizontalFrame* fHTopFrame;
00144 TGHorizontalFrame* fHBotFrame;
00145 TGVerticalFrame* fVBtnFrame;
00146 TGVerticalFrame* fVRunFrame;
00147 TGHorizontalFrame* fHRunNumb;
00148
00149 TGVerticalFrame* fVBasket;
00150 TGHorizontalFrame* fHSetting;
00151 TGHorizontalFrame* fHSName;
00152 TGVerticalFrame* fVLabel;
00153 TGVerticalFrame* fVText;
00154
00155 TGHorizontalFrame* fHBottom;
00156 TGVerticalFrame* fVRight;
00157 TGVerticalFrame* fVLeft;
00158
00159
00160 TGTextButton* fCfgBtn;
00161 TGTextButton* fStartBtn;
00162 TGTextButton* fStopBtn;
00163 TGTextButton* fScopeBtn;
00164 TGTextButton* fHistoBtn;
00165 TGTextButton* fExitBtn;
00166 TGTextButton* fRunNumbBtn;
00167 TGTextButton* fSettingBtn;
00168 TGTextButton* fResetBtn;
00169
00170
00171 TGGroupFrame* fStatusGroup;
00172
00173
00174 TGTextEntry* fTxtNumber;
00175 TGTextEntry* fTxtSetting;
00176 TGTextEntry* fTxtSName;
00177 TGTextEntry* fTxtDAQStatus;
00178 TGTextEntry* fTxtGUIStatus;
00179
00180
00181 TGGroupFrame* fLogGroup;
00182 TGTextView* fLogger;
00183
00184
00185 TGGroupFrame* fEdtGroup;
00186 TGHorizontalFrame* fHEdtFrame;
00187 TGHorizontalFrame* fHClrFrame;
00188 TGTextEdit* fEdtComms;
00189 TGTextButton* fClrBtn;
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203 QDaqCommonDefs::QDaqState GetApolloStatus();
00204
00205
00206 void SetGUIStatus(QGUIStatus_t qGui);
00207 inline const QGUIStatus_t GetGUIStatus() const {return fGUIStatus;}
00208
00209
00210 void UpdateGUIStatus();
00211
00212
00213 void BuildNames();
00214
00215
00216 inline void SetVersion(const std::string& qVersion) {fVersion=qVersion;return;}
00217 inline const std::string& GetVersion() const {return fVersion;}
00218
00219
00220 std::string GetComments();
00221
00222
00223
00224 void SetMessage(TGTextView* qLog, const std::string& qMsg, bool without);
00225 void SetMessage(TGTextView* qLog, const std::string& qMsg) {return SetMessage(qLog,qMsg,false);}
00226
00227
00228
00229 void StartTimer();
00230
00231
00232 void StopTimer();
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243 void CreateFrames();
00244
00245
00246 void CreateButtonsFrame();
00247
00248
00249 void CreateRunControlFrame();
00250
00251
00252 void CreateLoggerFrame();
00253
00254
00255 void AddButtons(TGVerticalFrame* qWhere);
00256
00257
00258 void AddCommentsEditor(TGVerticalFrame* qWhere, const std::string& qFunctionName);
00259
00260
00261 void AddGUIStatusDisplay(TGVerticalFrame* qWhere);
00262
00263
00264 void CreateDisplay(TGHorizontalFrame* qWhere, const std::string& qLabel, TGTextEntry* &qText,
00265 TGTextButton* &qBtn, const std::string& qFunctionName);
00266
00267
00268 void CreateDisplay(TGHorizontalFrame* qWhere, const std::string& qLabel, TGTextEntry* &qText);
00269
00270
00271
00272
00273
00274
00275
00276 ClassDef(QGUIMain,0)
00277
00278 };
00279
00280 #endif // _QGUI_MAIN_HH_