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