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