Rev 172 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 172 | Rev 173 | ||
|---|---|---|---|
| 1 | #ifndef __ROOT_APP_H__ |
1 | #ifndef __ROOT_APP_H__ |
| 2 | #define __ROOT_APP_H__ |
2 | #define __ROOT_APP_H__ |
| 3 | 3 | ||
| 4 | //#define winWidth 1240 |
4 | //#define winWidth 1240 |
| 5 | //#define winHeight 800 |
5 | //#define winHeight 800 |
| 6 | #define WINDOW_NAME "CAMAC/MPOD/4MM DAQ software" |
6 | #define WINDOW_NAME "CAMAC/MPOD/4MM DAQ software" |
| 7 | #define measwin 3 |
7 | #define measwin 3 |
| 8 | #define analysiswin 4 |
8 | #define analysiswin 4 |
| 9 | #define BSIZE 10000 |
9 | #define BSIZE 10000 |
| 10 | 10 | ||
| 11 | #include "root_include.h" |
11 | #include "root_include.h" |
| 12 | #include "substructure.h" |
12 | #include "substructure.h" |
| 13 | #include "daq.h" |
13 | #include "daq.h" |
| 14 | #include "daqscope.h" |
14 | #include "daqscope.h" |
| 15 | #include <iostream> |
15 | #include <iostream> |
| 16 | #include <fstream> |
16 | #include <fstream> |
| 17 | #include <cmath> |
17 | #include <cmath> |
| 18 | #include <time.h> |
18 | #include <time.h> |
| 19 | 19 | ||
| 20 | enum EMenuIds { |
20 | enum EMenuIds { |
| 21 | M_FILE_SET_LAYOUT, |
21 | M_FILE_SET_LAYOUT, |
| 22 | M_FILE_SAVE_LAYOUT, |
22 | M_FILE_SAVE_LAYOUT, |
| 23 | M_FILE_SAVE_MSETTINGS, |
23 | M_FILE_SAVE_MSETTINGS, |
| 24 | M_FILE_SAVE_ASETTINGS, |
24 | M_FILE_SAVE_ASETTINGS, |
| - | 25 | M_FILE_DEF_MSETTINGS, |
|
| - | 26 | M_FILE_DEF_ASETTINGS, |
|
| - | 27 | M_FILE_DEF_SETTINGS, |
|
| 25 | M_FILE_CHECK_WIDTH, |
28 | M_FILE_CHECK_WIDTH, |
| 26 | M_FILE_EXIT, |
29 | M_FILE_EXIT, |
| 27 | 30 | ||
| 28 | M_ANALYSIS_HISTTYPE_1DADC, |
31 | M_ANALYSIS_HISTTYPE_1DADC, |
| 29 | M_ANALYSIS_HISTTYPE_1DTDC, |
32 | M_ANALYSIS_HISTTYPE_1DTDC, |
| 30 | M_ANALYSIS_HISTTYPE_2D, |
33 | M_ANALYSIS_HISTTYPE_2D, |
| 31 | M_ANALYSIS_INTEG, |
34 | M_ANALYSIS_INTEG, |
| 32 | M_ANALYSIS_INTEGX, |
35 | M_ANALYSIS_INTEGX, |
| 33 | M_ANALYSIS_INTEGY, |
36 | M_ANALYSIS_INTEGY, |
| 34 | M_ANALYSIS_PHOTMU, |
37 | M_ANALYSIS_PHOTMU, |
| 35 | M_ANALYSIS_BREAKDOWN, |
38 | M_ANALYSIS_BREAKDOWN, |
| 36 | M_ANALYSIS_SURFSCAN, |
39 | M_ANALYSIS_SURFSCAN, |
| 37 | M_ANALYSIS_TIMING, |
40 | M_ANALYSIS_TIMING, |
| 38 | 41 | ||
| 39 | M_HELP_WEBHELP, |
42 | M_HELP_WEBHELP, |
| 40 | M_HELP_ABOUT |
43 | M_HELP_ABOUT |
| 41 | }; |
44 | }; |
| 42 | 45 | ||
| 43 | // Separate functions ----------------------------------------- |
46 | // Separate functions ----------------------------------------- |
| 44 | void GetTime(int intime, char *outtime); |
47 | void GetTime(int intime, char *outtime); |
| 45 | void remove_ext(char *inname, char *outname); |
48 | void remove_ext(char *inname, char *outname); |
| 46 | void remove_from_last(char *inname, char search, char *outname); |
49 | void remove_from_last(char *inname, char search, char *outname); |
| 47 | void remove_before_last(char *inname, char search, char *outname); |
50 | void remove_before_last(char *inname, char search, char *outname); |
| 48 | void layoutMainWindow(int *w, int *h); |
51 | void layoutMainWindow(int *w, int *h); |
| 49 | void SeqNumber(int innum, int maxnum, char *outstr); |
52 | void SeqNumber(int innum, int maxnum, char *outstr); |
| 50 | void TimeEstimate(clock_t stopw0, time_t time0, float progress, char *retEstim, int offset); |
53 | void TimeEstimate(clock_t stopw0, time_t time0, float progress, char *retEstim, int offset); |
| 51 | void TimeEstimateNew(int nr, clock_t stopw0, time_t time0, int rX, int rY, int rZ, int xWait, int yWait, int zWait, char *retEstim); |
54 | void TimeEstimateNew(int nr, clock_t stopw0, time_t time0, int rX, int rY, int rZ, int xWait, int yWait, int zWait, char *retEstim); |
| 52 | void NormateSet(int file, int nrpoint, double *min, double *max, double *setCount, double *setAcc); |
55 | void NormateSet(int file, int nrpoint, double *min, double *max, double *setCount, double *setAcc); |
| 53 | double PointEstimate(int nrp, double *points); |
56 | double PointEstimate(int nrp, double *points); |
| 54 | // Separate functions ----------------------------------------- |
57 | // Separate functions ----------------------------------------- |
| 55 | 58 | ||
| 56 | 59 | ||
| 57 | // Window classes ---------------------------------------------------- |
60 | // Window classes ---------------------------------------------------- |
| 58 | //class TGWindow; |
61 | //class TGWindow; |
| 59 | //class TGMainFrame; |
62 | //class TGMainFrame; |
| 60 | 63 | ||
| 61 | // Subwindow layout class |
64 | // Subwindow layout class |
| 62 | /*class TGMdiSubwindow |
65 | /*class TGMdiSubwindow |
| 63 | { |
66 | { |
| 64 | RQ_OBJECT("TGMdiSubwindow") |
67 | RQ_OBJECT("TGMdiSubwindow") |
| 65 | 68 | ||
| 66 | protected: |
69 | protected: |
| 67 | TGMdiFrame *fMdiFrame; |
70 | TGMdiFrame *fMdiFrame; |
| 68 | 71 | ||
| 69 | public: |
72 | public: |
| 70 | TGMdiSubwindow(TGMdiMainFrame *main, int w, int h); |
73 | TGMdiSubwindow(TGMdiMainFrame *main, int w, int h); |
| 71 | TGMdiFrame *GetMdiFrame() const { return fMdiFrame; } |
74 | TGMdiFrame *GetMdiFrame() const { return fMdiFrame; } |
| 72 | // layoutchange is 0 when we close a subwindow and 1 when we change the layout (close multiple subwindows) |
75 | // layoutchange is 0 when we close a subwindow and 1 when we change the layout (close multiple subwindows) |
| 73 | virtual Bool_t CloseWindow(int layoutchange); |
76 | virtual Bool_t CloseWindow(int layoutchange); |
| 74 | 77 | ||
| 75 | // unique id is set for each subwindow |
78 | // unique id is set for each subwindow |
| 76 | // settingsPane->id = 0 |
79 | // settingsPane->id = 0 |
| 77 | int id; |
80 | int id; |
| 78 | };*/ |
81 | };*/ |
| 79 | 82 | ||
| 80 | // Main window class |
83 | // Main window class |
| 81 | class TGAppMainFrame |
84 | class TGAppMainFrame |
| 82 | { |
85 | { |
| 83 | RQ_OBJECT("TGAppMainFrame") |
86 | RQ_OBJECT("TGAppMainFrame") |
| 84 | 87 | ||
| 85 | protected: |
88 | protected: |
| 86 | TGMainFrame *fMain; |
89 | TGMainFrame *fMain; |
| 87 | // TGMdiMainFrame *fMainFrame; |
90 | // TGMdiMainFrame *fMainFrame; |
| 88 | // TGMdiMenuBar *fMenuBar; |
91 | // TGMdiMenuBar *fMenuBar; |
| 89 | TGMenuBar *fMenuBar; |
92 | TGMenuBar *fMenuBar; |
| 90 | TGLayoutHints *fMenuBarItemLayout; |
93 | TGLayoutHints *fMenuBarItemLayout; |
| 91 | TGPopupMenu *fMenuFile, *fMenuAnalysis, *fMenuHelp, *fMenuHisttype; |
94 | TGPopupMenu *fMenuFile, *fMenuAnalysis, *fMenuHelp, *fMenuHisttype; |
| 92 | TGTab *fTab, *analTab; |
95 | TGTab *fTab, *analTab; |
| 93 | int winWidth; |
96 | int winWidth; |
| 94 | int winHeight; |
97 | int winHeight; |
| 95 | // TGMdiSubwindow *settingsPane; |
98 | // TGMdiSubwindow *settingsPane; |
| 96 | 99 | ||
| 97 | // Variables for frame layouts and titles |
100 | // Variables for frame layouts and titles |
| 98 | TGCompositeFrame *fLayout[2]; |
101 | TGCompositeFrame *fLayout[2]; |
| 99 | TGHorizontalFrame *fTitle; |
102 | TGHorizontalFrame *fTitle; |
| 100 | 103 | ||
| 101 | void InitMenu(); |
104 | void InitMenu(); |
| 102 | void AppLayout(); |
105 | void AppLayout(); |
| 103 | void OpenWindow(int winid); |
106 | void OpenWindow(int winid); |
| 104 | void CloseWindow(); |
107 | void CloseWindow(); |
| 105 | Bool_t About(); |
108 | Bool_t About(); |
| 106 | 109 | ||
| 107 | int idtotal; |
110 | int idtotal; |
| 108 | bool cleanPlots; |
111 | bool cleanPlots; |
| 109 | int logChange; |
112 | int logChange; |
| 110 | int selChannel; |
113 | int selChannel; |
| 111 | bool acqStarted; |
114 | bool acqStarted; |
| 112 | unsigned int gBuf[BSIZE]; |
115 | unsigned int gBuf[BSIZE]; |
| 113 | clock_t clkt0; |
116 | clock_t clkt0; |
| 114 | time_t timet0; |
117 | time_t timet0; |
| 115 | bool liveUpdate; |
118 | bool liveUpdate; |
| 116 | int npeaks; |
119 | int npeaks; |
| 117 | 120 | ||
| 118 | public: |
121 | public: |
| 119 | TGAppMainFrame(const TGWindow *p, int w, int h); |
122 | TGAppMainFrame(const TGWindow *p, int w, int h); |
| 120 | virtual ~TGAppMainFrame(); |
123 | virtual ~TGAppMainFrame(); |
| 121 | 124 | ||
| 122 | void HandleMenu(Int_t id); |
125 | void HandleMenu(Int_t id); |
| 123 | 126 | ||
| 124 | // Splitter to a set number of frames |
127 | // Splitter to a set number of frames |
| 125 | bool TGSplitter(TGWindow *parent, const char *majorSplit, int *vertSplits, int *horSplits, const char *frameTitles[512], TGCompositeFrame **frames, int *frameWidth, int *frameHeight); |
128 | bool TGSplitter(TGWindow *parent, const char *majorSplit, int *vertSplits, int *horSplits, const char *frameTitles[512], TGCompositeFrame **frames, int *frameWidth, int *frameHeight); |
| 126 | void TGTitleLabel(TGWindow *parent, TGHorizontalFrame *fTitle, const char *title, Pixel_t foreColor, Pixel_t backColor, const char *font); |
129 | void TGTitleLabel(TGWindow *parent, TGHorizontalFrame *fTitle, const char *title, Pixel_t foreColor, Pixel_t backColor, const char *font); |
| 127 | 130 | ||
| 128 | // Layout setup |
131 | // Layout setup |
| 129 | void LayoutRead(int nrframes, int *w, int *h); |
132 | void LayoutRead(int nrframes, int *w, int *h); |
| 130 | void LayoutSave(); |
133 | void LayoutSave(); |
| 131 | void LayoutSet(); |
134 | void LayoutSet(); |
| - | 135 | void SaveMeasSettings(); |
|
| - | 136 | void SaveAnalSettings(); |
|
| - | 137 | void GetMeasSettings(); |
|
| - | 138 | void GetAnalSettings(); |
|
| 132 | void ToolTipSet(); |
139 | void ToolTipSet(); |
| 133 | void ToolTipSetSurfaceScan(); |
140 | void ToolTipSetSurfaceScan(); |
| 134 | void ToolTipSetRelativePDE(); |
141 | void ToolTipSetRelativePDE(); |
| 135 | void ToolTipSetTempAnalysis(); |
142 | void ToolTipSetTempAnalysis(); |
| 136 | 143 | ||
| 137 | // Subframes where we display everything |
144 | // Subframes where we display everything |
| 138 | TGCompositeFrame *measLayout[measwin]; |
145 | TGCompositeFrame *measLayout[measwin]; |
| 139 | TGCompositeFrame *analysisLayout[analysiswin]; |
146 | TGCompositeFrame *analysisLayout[analysiswin]; |
| 140 | 147 | ||
| 141 | // Substructures for Settings pane (measurement layout) |
148 | // Substructures for Settings pane (measurement layout) |
| 142 | TSubStructure *scansOn; |
149 | TSubStructure *scansOn; |
| 143 | TSubStructure *vHardlimit; |
150 | TSubStructure *vHardlimit; |
| 144 | TSubStructure *NCH; |
151 | TSubStructure *NCH; |
| 145 | TSubStructure *posUnits; |
152 | TSubStructure *posUnits; |
| 146 | TSubStructure *rotUnits; |
153 | TSubStructure *rotUnits; |
| 147 | TSubStructure *oscConnect; |
154 | TSubStructure *oscConnect; |
| 148 | TSubStructure *laserInfo; |
155 | TSubStructure *laserInfo; |
| 149 | TSubStructure *chtemp; |
156 | TSubStructure *chtemp; |
| 150 | TSubStructure *liveDisp; |
157 | TSubStructure *liveDisp; |
| 151 | 158 | ||
| 152 | // Substructures for Measurement pane (measurement layout) |
159 | // Substructures for Measurement pane (measurement layout) |
| 153 | TSubStructure *vOutCh; |
160 | TSubStructure *vOutCh; |
| 154 | TSubStructure *vOut; |
161 | TSubStructure *vOut; |
| 155 | TSubStructure *vOutOpt; |
162 | TSubStructure *vOutOpt; |
| 156 | TSubStructure *vOutButtons; |
163 | TSubStructure *vOutButtons; |
| 157 | TSubStructure *vOutStart; |
164 | TSubStructure *vOutStart; |
| 158 | TSubStructure *vOutStop; |
165 | TSubStructure *vOutStop; |
| 159 | TSubStructure *vOutStep; |
166 | TSubStructure *vOutStep; |
| 160 | TSubStructure *xPos; |
167 | TSubStructure *xPos; |
| 161 | TSubStructure *yPos; |
168 | TSubStructure *yPos; |
| 162 | TSubStructure *zPos; |
169 | TSubStructure *zPos; |
| 163 | TSubStructure *zPosMin; |
170 | TSubStructure *zPosMin; |
| 164 | TSubStructure *zPosMax; |
171 | TSubStructure *zPosMax; |
| 165 | TSubStructure *zPosStep; |
172 | TSubStructure *zPosStep; |
| 166 | TSubStructure *posButtons; |
173 | TSubStructure *posButtons; |
| 167 | TSubStructure *xPosMin; |
174 | TSubStructure *xPosMin; |
| 168 | TSubStructure *xPosMax; |
175 | TSubStructure *xPosMax; |
| 169 | TSubStructure *xPosStep; |
176 | TSubStructure *xPosStep; |
| 170 | TSubStructure *yPosMin; |
177 | TSubStructure *yPosMin; |
| 171 | TSubStructure *yPosMax; |
178 | TSubStructure *yPosMax; |
| 172 | TSubStructure *yPosStep; |
179 | TSubStructure *yPosStep; |
| 173 | TSubStructure *rotPos; |
180 | TSubStructure *rotPos; |
| 174 | TSubStructure *rotButtons; |
181 | TSubStructure *rotButtons; |
| - | 182 | TSubStructure *rotButEmergency; |
|
| 175 | TSubStructure *rotPosMin; |
183 | TSubStructure *rotPosMin; |
| 176 | TSubStructure *rotPosMax; |
184 | TSubStructure *rotPosMax; |
| 177 | TSubStructure *rotPosStep; |
185 | TSubStructure *rotPosStep; |
| 178 | TSubStructure *evtNum; |
186 | TSubStructure *evtNum; |
| 179 | TSubStructure *timeStamp; |
187 | TSubStructure *timeStamp; |
| 180 | TSubStructure *fileName; |
188 | TSubStructure *fileName; |
| 181 | TSubStructure *measProgress; |
189 | TSubStructure *measProgress; |
| 182 | 190 | ||
| 183 | // Substructures for Display pane (measurement layout) |
191 | // Substructures for Display pane (measurement layout) |
| 184 | TRootEmbeddedCanvas *measCanvas; |
192 | TRootEmbeddedCanvas *measCanvas; |
| 185 | 193 | ||
| 186 | // Action connections for Settings pane (measurement layout) |
194 | // Action connections for Settings pane (measurement layout) |
| 187 | void EnableScan(int type); |
195 | void EnableScan(int type); |
| 188 | void VoltageLimit(); |
196 | void VoltageLimit(); |
| 189 | void ChangeUnits(int type); |
197 | void ChangeUnits(int type); |
| 190 | void ChangeUnitsRot(int type); |
198 | void ChangeUnitsRot(int type); |
| 191 | void EnableLiveUpdate(); |
199 | void EnableLiveUpdate(); |
| 192 | 200 | ||
| 193 | // Action connections for Measurement pane (measurement layout) |
201 | // Action connections for Measurement pane (measurement layout) |
| 194 | int GetChannel(); |
202 | int GetChannel(); |
| 195 | void NegativePolarity(); |
203 | void NegativePolarity(); |
| 196 | void VoltOut(int opt); |
204 | void VoltOut(int opt); |
| 197 | void PositionSet(int opt); |
205 | void PositionSet(int opt); |
| 198 | void RotationSet(int opt); |
206 | void RotationSet(int opt); |
| 199 | void SaveFile(); |
207 | void SaveFile(); |
| 200 | void StartAcq(); |
208 | void StartAcq(); |
| 201 | 209 | ||
| 202 | // Substructures for Histogram selection pane (analysis layout) |
210 | // Substructures for Histogram selection pane (analysis layout) |
| 203 | TSubStructure *selectDir; |
211 | TSubStructure *selectDir; |
| 204 | TGListBox *fileList; |
212 | TGListBox *fileList; |
| 205 | TSubStructure *multiSelect; |
213 | TSubStructure *multiSelect; |
| 206 | TSubStructure *fileListCtrl; |
214 | TSubStructure *fileListCtrl; |
| 207 | TSubStructure *dispTime; |
215 | TSubStructure *dispTime; |
| 208 | TSubStructure *dispBias; |
216 | TSubStructure *dispBias; |
| 209 | TSubStructure *dispPos; |
217 | TSubStructure *dispPos; |
| 210 | TSubStructure *dispTemp; |
218 | TSubStructure *dispTemp; |
| 211 | TSubStructure *dispAngle; |
219 | TSubStructure *dispAngle; |
| 212 | TSubStructure *dispLaser; |
220 | TSubStructure *dispLaser; |
| 213 | 221 | ||
| 214 | // Substructures for Histogram pane (analysis layout) |
222 | // Substructures for Histogram pane (analysis layout) |
| 215 | TRootEmbeddedCanvas *analysisCanvas; |
223 | TRootEmbeddedCanvas *analysisCanvas; |
| 216 | 224 | ||
| 217 | // Substructures for Histogram controls pane (analysis layout) |
225 | // Substructures for Histogram controls pane (analysis layout) |
| 218 | TSubStructure *adcRange; |
226 | TSubStructure *adcRange; |
| 219 | TSubStructure *tdcRange; |
227 | TSubStructure *tdcRange; |
| 220 | TSubStructure *yRange; |
228 | TSubStructure *yRange; |
| 221 | TSubStructure *selectCh; |
229 | TSubStructure *selectCh; |
| 222 | TSubStructure *plotType; |
230 | TSubStructure *plotType; |
| 223 | TSubStructure *histOpt; |
231 | TSubStructure *histOpt; |
| 224 | TSubStructure *exportHist; |
232 | TSubStructure *exportHist; |
| 225 | TSubStructure *editSelHist; |
233 | TSubStructure *editSelHist; |
| 226 | TSubStructure *posUnitsPlot; |
234 | TSubStructure *posUnitsPlot; |
| 227 | 235 | ||
| 228 | // Substructures for analysis pane (analysis layout) |
236 | // Substructures for analysis pane (analysis layout) |
| 229 | TSubStructure *intSpect; |
237 | TSubStructure *intSpect; |
| 230 | TSubStructure *resol2d; |
238 | TSubStructure *resol2d; |
| 231 | TSubStructure *intSpectButtons; |
239 | TSubStructure *intSpectButtons; |
| 232 | 240 | ||
| 233 | TSubStructure *relPde; |
241 | TSubStructure *relPde; |
| 234 | TSubStructure *midPeak; |
242 | TSubStructure *midPeak; |
| 235 | TSubStructure *darkRun; |
243 | TSubStructure *darkRun; |
| 236 | TSubStructure *zeroAngle; |
244 | TSubStructure *zeroAngle; |
| 237 | TSubStructure *relPdeButtons; |
245 | TSubStructure *relPdeButtons; |
| 238 | 246 | ||
| 239 | TSubStructure *minPeak; |
247 | TSubStructure *minPeak; |
| 240 | TSubStructure *peakSepCalc; |
248 | TSubStructure *peakSepCalc; |
| 241 | TSubStructure *brDownButtons; |
249 | TSubStructure *brDownButtons; |
| 242 | 250 | ||
| 243 | TSubStructure *surfScanOpt; |
251 | TSubStructure *surfScanOpt; |
| 244 | TSubStructure *resolSurf; |
252 | TSubStructure *resolSurf; |
| 245 | TSubStructure *surfButtons; |
253 | TSubStructure *surfButtons; |
| 246 | 254 | ||
| 247 | TSubStructure *fitSigma; |
255 | TSubStructure *fitSigma; |
| 248 | TSubStructure *fitTresh; |
256 | TSubStructure *fitTresh; |
| 249 | TSubStructure *fitInter; |
257 | TSubStructure *fitInter; |
| 250 | TSubStructure *adcOffset; |
258 | TSubStructure *adcOffset; |
| 251 | TSubStructure *accError; |
259 | TSubStructure *accError; |
| 252 | TSubStructure *pedesLow; |
260 | TSubStructure *pedesLow; |
| 253 | TSubStructure *fitChecks; |
261 | TSubStructure *fitChecks; |
| 254 | TSubStructure *analysisProgress; |
262 | TSubStructure *analysisProgress; |
| 255 | 263 | ||
| 256 | // Action connections for Histogram file selection pane (analysis layout) |
264 | // Action connections for Histogram file selection pane (analysis layout) |
| 257 | void SelectDirectory(); |
265 | void SelectDirectory(); |
| 258 | void ListMultiSelect(int opt); |
266 | void ListMultiSelect(int opt); |
| 259 | void FileListNavigation(int opt); |
267 | void FileListNavigation(int opt); |
| 260 | void HeaderEdit(); |
268 | void HeaderEdit(); |
| 261 | void ClearHistogramList(); |
269 | void ClearHistogramList(); |
| 262 | 270 | ||
| 263 | // Action connections for Histogram controls pane (analysis layout) |
271 | // Action connections for Histogram controls pane (analysis layout) |
| 264 | void UpdateHistogram(int opt); |
272 | void UpdateHistogram(int opt); |
| 265 | void HistogramOptions(int opt); |
273 | void HistogramOptions(int opt); |
| 266 | void ChangeHisttype(int type); |
274 | void ChangeHisttype(int type); |
| 267 | 275 | ||
| 268 | // Action connections for analysis pane (analysis layout) |
276 | // Action connections for analysis pane (analysis layout) |
| 269 | void SelectDarkHist(); |
277 | void SelectDarkHist(); |
| 270 | void AnalysisDefaults(); |
278 | void AnalysisDefaults(); |
| 271 | void AnalysisHandle(int type); |
279 | void AnalysisHandle(int type); |
| 272 | void IntegSpectrum(TList *files, int direction, int edit); |
280 | void IntegSpectrum(TList *files, int direction, int edit); |
| 273 | void PhotonMu(TList *files, int edit); |
281 | void PhotonMu(TList *files, int edit); |
| 274 | void PlotEdgeDistribution(TList *files, int filenr, int points, double *min, double *max, double *xy, double *integAcc, int axis, bool edge2d, int edit); |
282 | void PlotEdgeDistribution(TList *files, int filenr, int points, double *min, double *max, double *xy, double *integAcc, int axis, bool edge2d, int edit); |
| 275 | void BreakdownVolt(TList *files, int edit); |
283 | void BreakdownVolt(TList *files, int edit); |
| 276 | void SurfaceScan(TList *files, int edit); |
284 | void SurfaceScan(TList *files, int edit); |
| 277 | 285 | ||
| 278 | // Substructures for Edit file header window (new tab) |
286 | // Substructures for Edit file header window (new tab) |
| 279 | TGListBox *editList; |
287 | TGListBox *editList; |
| 280 | TSubStructure *timeEditDisplay; |
288 | TSubStructure *timeEditDisplay; |
| 281 | TSubStructure *biasEdit; |
289 | TSubStructure *biasEdit; |
| 282 | TSubStructure *xPosEdit; |
290 | TSubStructure *xPosEdit; |
| 283 | TSubStructure *yPosEdit; |
291 | TSubStructure *yPosEdit; |
| 284 | TSubStructure *zPosEdit; |
292 | TSubStructure *zPosEdit; |
| 285 | TSubStructure *tempEdit; |
293 | TSubStructure *tempEdit; |
| 286 | TSubStructure *angleEdit; |
294 | TSubStructure *angleEdit; |
| 287 | TSubStructure *laserEdit; |
295 | TSubStructure *laserEdit; |
| 288 | TSubStructure *editHead; |
296 | TSubStructure *editHead; |
| 289 | TSubStructure *editMulti; |
297 | TSubStructure *editMulti; |
| 290 | TGLabel *selectWarn; |
298 | TGLabel *selectWarn; |
| 291 | 299 | ||
| 292 | // Action connections for Edit file header window (new tab) |
300 | // Action connections for Edit file header window (new tab) |
| 293 | void SetWarnings(); |
301 | void SetWarnings(); |
| 294 | void EditTickToggle(int type); |
302 | void EditTickToggle(int type); |
| 295 | void StartHeaderEdit(); |
303 | void StartHeaderEdit(); |
| 296 | void ShowHeaderEdit(int id); |
304 | void ShowHeaderEdit(int id); |
| 297 | void HeaderChange(char *histfile, bool *changetype); |
305 | void HeaderChange(char *histfile, bool *changetype); |
| 298 | void CloseEditTab(int tabval); |
306 | void CloseEditTab(int tabval); |
| 299 | 307 | ||
| 300 | // Substructures for temporary analysis edit window (new tab) |
308 | // Substructures for temporary analysis edit window (new tab) |
| 301 | TRootEmbeddedCanvas *tempAnalysisCanvas; |
309 | TRootEmbeddedCanvas *tempAnalysisCanvas; |
| 302 | TSubStructure *runningAver; |
310 | TSubStructure *runningAver; |
| 303 | TSubStructure *runningOff; |
311 | TSubStructure *runningOff; |
| 304 | TSubStructure *secondAxis; |
312 | TSubStructure *secondAxis; |
| 305 | TSubStructure *exportExitAnalysis; |
313 | TSubStructure *exportExitAnalysis; |
| 306 | 314 | ||
| 307 | TSubStructure *xCrop; |
315 | TSubStructure *xCrop; |
| 308 | TSubStructure *yCrop; |
316 | TSubStructure *yCrop; |
| 309 | TSubStructure *interpolSize; |
317 | TSubStructure *interpolSize; |
| 310 | TSubStructure *updateCrop; |
318 | TSubStructure *updateCrop; |
| 311 | 319 | ||
| 312 | // Action connections for temporary analysis edit window (new tab) |
320 | // Action connections for temporary analysis edit window (new tab) |
| 313 | void ApplyRunningAver(); |
321 | void ApplyRunningAver(); |
| 314 | void UpdateIntegrateSurface(int val); |
322 | void UpdateIntegrateSurface(int val); |
| 315 | void CloseTempAnalysisTab(int tabval); |
323 | void CloseTempAnalysisTab(int tabval); |
| 316 | void ExportTempAnalysisPlot(); |
324 | void ExportTempAnalysisPlot(); |
| 317 | 325 | ||
| 318 | // Additional functions |
326 | // Additional functions |
| 319 | void DisplayHistogram(char *histfile, int histtype, int opt); |
327 | void DisplayHistogram(char *histfile, int histtype, int opt); |
| 320 | void HeaderEditTab(TGTab *mainTab, bool create, int *tabid); |
328 | void HeaderEditTab(TGTab *mainTab, bool create, int *tabid); |
| 321 | void TempAnalysisTab(TGTab *mainTab, bool create, int *tabid, int analtype); |
329 | void TempAnalysisTab(TGTab *mainTab, bool create, int *tabid, int analtype); |
| 322 | void RunMeas(void *ptr, int runCase, int &scanon); |
330 | void RunMeas(void *ptr, int runCase, int &scanon); |
| 323 | int MyTimer(); |
331 | int MyTimer(); |
| 324 | 332 | ||
| 325 | // Open directory (separate for saving measurement and for opening histograms) |
333 | // Open directory (separate for saving measurement and for opening histograms) |
| 326 | char *currentMeasDir; |
334 | char *currentMeasDir; |
| 327 | char *currentAnalDir; |
335 | char *currentAnalDir; |
| 328 | 336 | ||
| 329 | // ROOT file variable structure ------------------------------- |
337 | // ROOT file variable structure ------------------------------- |
| 330 | struct EventHeader { |
338 | struct EventHeader { |
| 331 | int nrch; |
339 | int nrch; |
| 332 | int timestamp; |
340 | int timestamp; |
| 333 | double biasvolt; |
341 | double biasvolt; |
| 334 | int xpos; |
342 | int xpos; |
| 335 | int ypos; |
343 | int ypos; |
| 336 | int zpos; |
344 | int zpos; |
| 337 | double temperature; |
345 | double temperature; |
| 338 | double angle; |
346 | double angle; |
| 339 | char laserinfo[256]; |
347 | char laserinfo[256]; |
| 340 | } evtheader; |
348 | } evtheader; |
| 341 | 349 | ||
| 342 | struct EventData { |
350 | struct EventData { |
| 343 | int adcdata[8]; |
351 | int adcdata[8]; |
| 344 | int tdcdata[8]; |
352 | int tdcdata[8]; |
| 345 | } evtdata; |
353 | } evtdata; |
| 346 | 354 | ||
| 347 | struct EventMeas { |
355 | struct EventMeas { |
| 348 | double measdata; |
356 | double measdata; |
| 349 | } evtmeas; |
357 | } evtmeas; |
| 350 | 358 | ||
| 351 | TFile *inroot; |
359 | TFile *inroot; |
| 352 | TFile *outroot; |
360 | TFile *outroot; |
| 353 | // ROOT file variable structure ------------------------------- |
361 | // ROOT file variable structure ------------------------------- |
| 354 | 362 | ||
| 355 | daq *gDaq; |
363 | daq *gDaq; |
| 356 | daqscope *gScopeDaq; |
364 | daqscope *gScopeDaq; |
| 357 | }; |
365 | }; |
| 358 | 366 | ||
| 359 | // ------------------------------------------------------------------- |
367 | // ------------------------------------------------------------------- |
| 360 | 368 | ||
| 361 | #endif |
369 | #endif |
| 362 | 370 | ||