Rev 167 | Rev 173 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 167 | Rev 172 | ||
---|---|---|---|
1 | #include "../include/sipmscan.h" |
1 | #include "../include/sipmscan.h" |
2 | #include "../include/workstation.h" |
2 | #include "../include/workstation.h" |
3 | #include "../include/substructure.h" |
3 | #include "../include/substructure.h" |
4 | 4 | ||
5 | #include <stdio.h> |
5 | #include <stdio.h> |
6 | #include <stdlib.h> |
6 | #include <stdlib.h> |
7 | 7 | ||
8 | // Main window constructor (+layout) --------------------------------- |
8 | // Main window constructor (+layout) --------------------------------- |
9 | 9 | ||
10 | TGAppMainFrame::TGAppMainFrame(const TGWindow *p, int w, int h) |
10 | TGAppMainFrame::TGAppMainFrame(const TGWindow *p, int w, int h) |
11 | { |
11 | { |
12 | TGCompositeFrame *fT1; |
12 | TGCompositeFrame *fT1; |
13 | idtotal = 0; |
13 | idtotal = 0; |
14 | 14 | ||
15 | char *cTemp; |
15 | char *cTemp; |
16 | 16 | ||
17 | // Prepare the default open directory (basedir) |
17 | // Prepare the default open directory (basedir) |
- | 18 | currentMeasDir = new char[1024]; |
|
- | 19 | sprintf(currentMeasDir, "%s/results", rootdir); |
|
18 |
|
20 | currentAnalDir = new char[1024]; |
19 | sprintf( |
21 | sprintf(currentAnalDir, "%s/results", rootdir); |
20 | 22 | ||
21 | // CAMAC and Scope objects |
23 | // CAMAC and Scope objects |
22 | gDaq = new daq(); |
24 | gDaq = new daq(); |
23 | gScopeDaq = new daqscope(); |
25 | gScopeDaq = new daqscope(); |
24 | 26 | ||
25 | // Define main window and menubar |
27 | // Define main window and menubar |
26 | fMain = new TGMainFrame(p, w, h, kVerticalFrame); |
28 | fMain = new TGMainFrame(p, w, h, kVerticalFrame); |
27 | 29 | ||
28 | // Initialize the menu |
30 | // Initialize the menu |
29 | fMenuBar = new TGMenuBar(fMain, 200, 30); |
31 | fMenuBar = new TGMenuBar(fMain, 200, 30); |
30 | InitMenu(); |
32 | InitMenu(); |
31 | fMain->AddFrame(fMenuBar, new TGLayoutHints(kLHintsExpandX | kLHintsTop)); |
33 | fMain->AddFrame(fMenuBar, new TGLayoutHints(kLHintsExpandX | kLHintsTop)); |
32 | 34 | ||
33 | // Prepare the tabbed structure |
35 | // Prepare the tabbed structure |
34 | fTab = new TGTab(fMain, 500, 500); |
36 | fTab = new TGTab(fMain, 500, 500); |
35 | 37 | ||
36 | // Read the layout we wish to use |
38 | // Read the layout we wish to use |
37 | int frmWidth[measwin+analysiswin], frmHeight[measwin+analysiswin]; |
39 | int frmWidth[measwin+analysiswin], frmHeight[measwin+analysiswin]; |
38 | LayoutRead(measwin+analysiswin, frmWidth, frmHeight); |
40 | LayoutRead(measwin+analysiswin, frmWidth, frmHeight); |
39 | 41 | ||
40 | // Structure the measurement layout window |
42 | // Structure the measurement layout window |
41 | int *vert, *hor, *wPane, *hPane; |
43 | int *vert, *hor, *wPane, *hPane; |
42 | 44 | ||
43 | vert = new int[2]; hor = new int; |
45 | vert = new int[2]; hor = new int; |
44 | *hor = 1; |
46 | *hor = 1; |
45 | vert[0] = 1; vert[1] = 0; |
47 | vert[0] = 1; vert[1] = 0; |
46 | 48 | ||
47 | const char *measFrmTit[] = {"Settings pane", "Display", "Main measurement window"}; |
49 | const char *measFrmTit[] = {"Settings pane", "Display", "Main measurement window"}; |
48 | wPane = new int[measwin]; hPane = new int[measwin]; |
50 | wPane = new int[measwin]; hPane = new int[measwin]; |
49 | for(int i = 0; i < measwin; i++) |
51 | for(int i = 0; i < measwin; i++) |
50 | { |
52 | { |
51 | wPane[i] = frmWidth[i]; |
53 | wPane[i] = frmWidth[i]; |
52 | hPane[i] = frmHeight[i]; |
54 | hPane[i] = frmHeight[i]; |
53 | } |
55 | } |
54 | 56 | ||
55 | fT1 = fTab->AddTab("Measurement"); |
57 | fT1 = fTab->AddTab("Measurement"); |
56 | TGSplitter(fT1, "horizontal", hor, vert, measFrmTit, measLayout, wPane, hPane); |
58 | TGSplitter(fT1, "horizontal", hor, vert, measFrmTit, measLayout, wPane, hPane); |
57 | fT1->AddFrame(fLayout[idtotal], new TGLayoutHints(kLHintsExpandX | kLHintsExpandY)); |
59 | fT1->AddFrame(fLayout[idtotal], new TGLayoutHints(kLHintsExpandX | kLHintsExpandY)); |
58 | idtotal++; |
60 | idtotal++; |
59 | delete[] vert; delete hor; delete[] wPane; delete[] hPane; |
61 | delete[] vert; delete hor; delete[] wPane; delete[] hPane; |
60 | 62 | ||
61 | // Structure the analysis layout window |
63 | // Structure the analysis layout window |
62 | vert = new int[2]; hor = new int; |
64 | vert = new int[2]; hor = new int; |
63 | *hor = 1; |
65 | *hor = 1; |
64 | vert[0] = 1; vert[1] = 1; |
66 | vert[0] = 1; vert[1] = 1; |
65 | 67 | ||
66 | const char *analysisFrmTit[] = {"Histogram file selection", "Analysis", "Histogram", "Histogram controls"}; |
68 | const char *analysisFrmTit[] = {"Histogram file selection", "Analysis", "Histogram", "Histogram controls"}; |
67 | wPane = new int[analysiswin]; hPane = new int[analysiswin]; |
69 | wPane = new int[analysiswin]; hPane = new int[analysiswin]; |
68 | for(int i = 0; i < analysiswin; i++) |
70 | for(int i = 0; i < analysiswin; i++) |
69 | { |
71 | { |
70 | wPane[i] = frmWidth[i+measwin]; |
72 | wPane[i] = frmWidth[i+measwin]; |
71 | hPane[i] = frmHeight[i+measwin]; |
73 | hPane[i] = frmHeight[i+measwin]; |
72 | } |
74 | } |
73 | 75 | ||
74 | fT1 = fTab->AddTab("Analysis"); |
76 | fT1 = fTab->AddTab("Analysis"); |
75 | TGSplitter(fT1, "horizontal", hor, vert, analysisFrmTit, analysisLayout, wPane, hPane); |
77 | TGSplitter(fT1, "horizontal", hor, vert, analysisFrmTit, analysisLayout, wPane, hPane); |
76 | fT1->AddFrame(fLayout[idtotal], new TGLayoutHints(kLHintsExpandX | kLHintsExpandY)); |
78 | fT1->AddFrame(fLayout[idtotal], new TGLayoutHints(kLHintsExpandX | kLHintsExpandY)); |
77 | idtotal++; |
79 | idtotal++; |
78 | delete[] vert; delete hor; delete[] wPane; delete[] hPane; |
80 | delete[] vert; delete hor; delete[] wPane; delete[] hPane; |
79 | 81 | ||
80 | // Structure the monitoring layout window (Fieldpoint) //TODO |
82 | // Structure the monitoring layout window (Fieldpoint) //TODO |
81 | fT1 = fTab->AddTab("Monitoring"); |
83 | fT1 = fTab->AddTab("Monitoring"); |
82 | fTab->SetEnabled(2,kFALSE); //TODO |
84 | fTab->SetEnabled(2,kFALSE); //TODO |
83 | 85 | ||
84 | // Structure the help layout window |
86 | // Structure the help layout window |
85 | fT1 = fTab->AddTab("Help"); |
87 | fT1 = fTab->AddTab("Help"); |
86 | TGTextView *helpdesc; |
88 | TGTextView *helpdesc; |
87 | const TGFont *tfont = gClient->GetFont(HELPFONT); |
89 | const TGFont *tfont = gClient->GetFont(HELPFONT); |
88 | FontStruct_t helpFont = tfont->GetFontStruct(); |
90 | FontStruct_t helpFont = tfont->GetFontStruct(); |
89 | helpdesc = new TGTextView(fT1,100,100); |
91 | helpdesc = new TGTextView(fT1,100,100); |
90 | helpdesc->SetFont(helpFont); |
92 | helpdesc->SetFont(helpFont); |
91 | helpdesc->SetForegroundColor(0x000000); |
93 | helpdesc->SetForegroundColor(0x000000); |
92 | fT1->AddFrame(helpdesc, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY)); |
94 | fT1->AddFrame(helpdesc, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY)); |
93 | 95 | ||
94 | cTemp = new char[1024]; |
96 | cTemp = new char[1024]; |
95 | sprintf(cTemp, "%s/doc/README", rootdir); |
97 | sprintf(cTemp, "%s/doc/README", rootdir); |
96 | if(helpdesc->LoadFile(cTemp)) |
98 | if(helpdesc->LoadFile(cTemp)) |
97 | { |
99 | { |
98 | if(DBGSIG) printf("TGAppMainFrame(): Help file correctly loaded.\n"); |
100 | if(DBGSIG) printf("TGAppMainFrame(): Help file correctly loaded.\n"); |
99 | } |
101 | } |
100 | else |
102 | else |
101 | printf("Error! Help file not loaded.\n"); |
103 | printf("Error! Help file not loaded.\n"); |
102 | delete[] cTemp; |
104 | delete[] cTemp; |
103 | helpdesc->AddLine(""); |
105 | helpdesc->AddLine(""); |
104 | 106 | ||
105 | fMain->AddFrame(fTab, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY)); |
107 | fMain->AddFrame(fTab, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY)); |
106 | 108 | ||
107 | // Set the inner layout of each frame |
109 | // Set the inner layout of each frame |
108 | AppLayout(); |
110 | AppLayout(); |
109 | 111 | ||
110 | fMain->SetWindowName(WINDOW_NAME); |
112 | fMain->SetWindowName(WINDOW_NAME); |
111 | fMain->MapSubwindows(); |
113 | fMain->MapSubwindows(); |
112 | fMain->MapWindow(); |
114 | fMain->MapWindow(); |
113 | fMain->Layout(); |
115 | fMain->Layout(); |
114 | 116 | ||
115 | // Prepare initial settings |
117 | // Prepare initial settings |
116 | EnableScan(0); //. |
118 | EnableScan(0); //. |
117 | EnableScan(1); // Grey out scan |
119 | EnableScan(1); // Grey out scan |
118 | EnableScan(2); // options by default |
120 | EnableScan(2); // options by default |
119 | EnableScan(3); //. |
121 | EnableScan(3); //. |
120 | EnableLiveUpdate(); //. Disable the live histogram update at beginning |
122 | EnableLiveUpdate(); //. Disable the live histogram update at beginning |
121 | VoltOut(1); //. Get the output voltage save in file |
123 | VoltOut(1); //. Get the output voltage save in file |
122 | HistogramOptions(1); //. Enable clean plots by default |
124 | HistogramOptions(1); //. Enable clean plots by default |
123 | plotType->widgetTB[0]->SetDown(kTRUE); //. |
125 | plotType->widgetTB[0]->SetDown(kTRUE); //. |
124 | fMenuHisttype->CheckEntry(M_ANALYSIS_HISTTYPE_1DADC); // Set the ADC histogram |
126 | fMenuHisttype->CheckEntry(M_ANALYSIS_HISTTYPE_1DADC); // Set the ADC histogram |
125 | fMenuHisttype->UnCheckEntry(M_ANALYSIS_HISTTYPE_1DTDC); // to show by default |
127 | fMenuHisttype->UnCheckEntry(M_ANALYSIS_HISTTYPE_1DTDC); // to show by default |
126 | fMenuHisttype->UnCheckEntry(M_ANALYSIS_HISTTYPE_2D); //. |
128 | fMenuHisttype->UnCheckEntry(M_ANALYSIS_HISTTYPE_2D); //. |
127 | acqStarted = false; //. At program start, the acquisition is stopped |
129 | acqStarted = false; //. At program start, the acquisition is stopped |
128 | ToolTipSet(); //. Turn on tooltips |
130 | ToolTipSet(); //. Turn on tooltips |
129 | PositionSet(1); //. Get starting table position |
131 | PositionSet(1); //. Get starting table position |
130 | RotationSet(1); //. Get starting rotation |
132 | RotationSet(1); //. Get starting rotation |
131 | 133 | ||
132 | if(DBGSIG > 1) |
134 | if(DBGSIG > 1) |
133 | { |
135 | { |
134 | printf("TGAppMainFrame(): At end of constructor\n"); |
136 | printf("TGAppMainFrame(): At end of constructor\n"); |
135 | gObjectTable->Print(); |
137 | gObjectTable->Print(); |
136 | } |
138 | } |
137 | } |
139 | } |
138 | 140 | ||
139 | TGAppMainFrame::~TGAppMainFrame() |
141 | TGAppMainFrame::~TGAppMainFrame() |
140 | { |
142 | { |
141 | fMain->Cleanup(); |
143 | fMain->Cleanup(); |
142 | delete fMain; |
144 | delete fMain; |
143 | } |
145 | } |
144 | 146 | ||
145 | // ------------------------------------------------------------------- |
147 | // ------------------------------------------------------------------- |
146 | 148 | ||
147 | // Event handler for menubar actions --------------------------------- |
149 | // Event handler for menubar actions --------------------------------- |
148 | 150 | ||
149 | void TGAppMainFrame::HandleMenu(Int_t id) |
151 | void TGAppMainFrame::HandleMenu(Int_t id) |
150 | { |
152 | { |
151 | // int ret = 0; |
153 | // int ret = 0; |
152 | char cmd[256]; |
154 | char cmd[256]; |
153 | 155 | ||
154 | switch(id) |
156 | switch(id) |
155 | { |
157 | { |
156 | case M_FILE_SET_LAYOUT: |
158 | case M_FILE_SET_LAYOUT: |
157 | LayoutSet(); |
159 | LayoutSet(); |
158 | break; |
160 | break; |
159 | 161 | ||
160 | case M_FILE_SAVE_LAYOUT: |
162 | case M_FILE_SAVE_LAYOUT: |
161 | LayoutSave(); |
163 | LayoutSave(); |
162 | break; |
164 | break; |
163 | 165 | ||
164 | case M_FILE_SAVE_MSETTINGS: |
166 | case M_FILE_SAVE_MSETTINGS: |
165 | // Here, we save the set values in the measurement layout (automatically done when we safely exit the application and after each start of measurement). |
167 | // Here, we save the set values in the measurement layout (automatically done when we safely exit the application and after each start of measurement). |
166 | break; |
168 | break; |
167 | 169 | ||
168 | case M_FILE_SAVE_ASETTINGS: |
170 | case M_FILE_SAVE_ASETTINGS: |
169 | // Here, we save the set values in the analysis layout (automatically done when we safely exit the application and after each start of analysis). |
171 | // Here, we save the set values in the analysis layout (automatically done when we safely exit the application and after each start of analysis). |
170 | break; |
172 | break; |
171 | 173 | ||
172 | case M_FILE_CHECK_WIDTH: |
174 | case M_FILE_CHECK_WIDTH: |
173 | printf("\nSettings window: %dx%d\n", measLayout[0]->GetWidth(), measLayout[0]->GetHeight()); |
175 | printf("\nSettings window: %dx%d\n", measLayout[0]->GetWidth(), measLayout[0]->GetHeight()); |
174 | printf("Histogram window: %dx%d\n", measLayout[1]->GetWidth(), measLayout[1]->GetHeight()); |
176 | printf("Histogram window: %dx%d\n", measLayout[1]->GetWidth(), measLayout[1]->GetHeight()); |
175 | printf("Main measurement window: %dx%d\n", measLayout[2]->GetWidth(), measLayout[2]->GetHeight()); |
177 | printf("Main measurement window: %dx%d\n", measLayout[2]->GetWidth(), measLayout[2]->GetHeight()); |
176 | printf("Histogram file window: %dx%d\n", analysisLayout[0]->GetWidth(), analysisLayout[0]->GetHeight()); |
178 | printf("Histogram file window: %dx%d\n", analysisLayout[0]->GetWidth(), analysisLayout[0]->GetHeight()); |
177 | printf("Analysis window: %dx%d\n", analysisLayout[1]->GetWidth(), analysisLayout[1]->GetHeight()); |
179 | printf("Analysis window: %dx%d\n", analysisLayout[1]->GetWidth(), analysisLayout[1]->GetHeight()); |
178 | printf("Histogram window: %dx%d\n", analysisLayout[2]->GetWidth(), analysisLayout[2]->GetHeight()); |
180 | printf("Histogram window: %dx%d\n", analysisLayout[2]->GetWidth(), analysisLayout[2]->GetHeight()); |
179 | printf("Histogram controls window: %dx%d\n", analysisLayout[3]->GetWidth(), analysisLayout[3]->GetHeight()); |
181 | printf("Histogram controls window: %dx%d\n", analysisLayout[3]->GetWidth(), analysisLayout[3]->GetHeight()); |
180 | 182 | ||
181 | printf("Main window: %dx%d\n", fMain->GetWidth(), fMain->GetHeight()); |
183 | printf("Main window: %dx%d\n", fMain->GetWidth(), fMain->GetHeight()); |
182 | printf("Menu bar: %dx%d\n", fMenuBar->GetWidth(), fMenuBar->GetHeight()); |
184 | printf("Menu bar: %dx%d\n", fMenuBar->GetWidth(), fMenuBar->GetHeight()); |
183 | printf("Tab window: %dx%d\n", fTab->GetWidth(), fTab->GetHeight()); |
185 | printf("Tab window: %dx%d\n", fTab->GetWidth(), fTab->GetHeight()); |
184 | break; |
186 | break; |
185 | 187 | ||
186 | case M_FILE_EXIT: |
188 | case M_FILE_EXIT: |
187 | CloseWindow(); |
189 | CloseWindow(); |
188 | break; |
190 | break; |
189 | 191 | ||
190 | case M_ANALYSIS_HISTTYPE_1DADC: |
192 | case M_ANALYSIS_HISTTYPE_1DADC: |
191 | ChangeHisttype(0); |
193 | ChangeHisttype(0); |
192 | break; |
194 | break; |
193 | 195 | ||
194 | case M_ANALYSIS_HISTTYPE_1DTDC: |
196 | case M_ANALYSIS_HISTTYPE_1DTDC: |
195 | ChangeHisttype(1); |
197 | ChangeHisttype(1); |
196 | break; |
198 | break; |
197 | 199 | ||
198 | case M_ANALYSIS_HISTTYPE_2D: |
200 | case M_ANALYSIS_HISTTYPE_2D: |
199 | ChangeHisttype(2); |
201 | ChangeHisttype(2); |
200 | break; |
202 | break; |
201 | 203 | ||
202 | case M_ANALYSIS_INTEG: |
204 | case M_ANALYSIS_INTEG: |
203 | fTab->SetTab(1); |
205 | fTab->SetTab(1); |
204 | analTab->SetTab(0); |
206 | analTab->SetTab(0); |
205 | for(int i = 0; i < 3; i++) |
207 | for(int i = 0; i < 3; i++) |
206 | { |
208 | { |
207 | if(intSpect->widgetChBox[i]->IsDown()) |
209 | if(intSpect->widgetChBox[i]->IsDown()) |
208 | intSpect->widgetChBox[i]->SetState(kButtonUp); |
210 | intSpect->widgetChBox[i]->SetState(kButtonUp); |
209 | } |
211 | } |
210 | break; |
212 | break; |
211 | 213 | ||
212 | case M_ANALYSIS_INTEGX: |
214 | case M_ANALYSIS_INTEGX: |
213 | fTab->SetTab(1); |
215 | fTab->SetTab(1); |
214 | analTab->SetTab(0); |
216 | analTab->SetTab(0); |
215 | for(int i = 0; i < 3; i++) |
217 | for(int i = 0; i < 3; i++) |
216 | { |
218 | { |
217 | if(i == 0) |
219 | if(i == 0) |
218 | intSpect->widgetChBox[i]->SetState(kButtonDown); |
220 | intSpect->widgetChBox[i]->SetState(kButtonDown); |
219 | else |
221 | else |
220 | { |
222 | { |
221 | if(intSpect->widgetChBox[i]->IsDown()) |
223 | if(intSpect->widgetChBox[i]->IsDown()) |
222 | intSpect->widgetChBox[i]->SetState(kButtonUp); |
224 | intSpect->widgetChBox[i]->SetState(kButtonUp); |
223 | } |
225 | } |
224 | } |
226 | } |
225 | break; |
227 | break; |
226 | 228 | ||
227 | case M_ANALYSIS_INTEGY: |
229 | case M_ANALYSIS_INTEGY: |
228 | fTab->SetTab(1); |
230 | fTab->SetTab(1); |
229 | analTab->SetTab(0); |
231 | analTab->SetTab(0); |
230 | for(int i = 0; i < 3; i++) |
232 | for(int i = 0; i < 3; i++) |
231 | { |
233 | { |
232 | if(i == 1) |
234 | if(i == 1) |
233 | intSpect->widgetChBox[i]->SetState(kButtonDown); |
235 | intSpect->widgetChBox[i]->SetState(kButtonDown); |
234 | else |
236 | else |
235 | { |
237 | { |
236 | if(intSpect->widgetChBox[i]->IsDown()) |
238 | if(intSpect->widgetChBox[i]->IsDown()) |
237 | intSpect->widgetChBox[i]->SetState(kButtonUp); |
239 | intSpect->widgetChBox[i]->SetState(kButtonUp); |
238 | } |
240 | } |
239 | } |
241 | } |
240 | break; |
242 | break; |
241 | 243 | ||
242 | case M_ANALYSIS_PHOTMU: |
244 | case M_ANALYSIS_PHOTMU: |
243 | fTab->SetTab(1); |
245 | fTab->SetTab(1); |
244 | analTab->SetTab(1); |
246 | analTab->SetTab(1); |
245 | for(int i = 0; i < 3; i++) |
247 | for(int i = 0; i < 3; i++) |
246 | { |
248 | { |
247 | if(i == 2) |
249 | if(i == 2) |
248 | intSpect->widgetChBox[i]->SetState(kButtonDown); |
250 | intSpect->widgetChBox[i]->SetState(kButtonDown); |
249 | else |
251 | else |
250 | { |
252 | { |
251 | if(intSpect->widgetChBox[i]->IsDown()) |
253 | if(intSpect->widgetChBox[i]->IsDown()) |
252 | intSpect->widgetChBox[i]->SetState(kButtonUp); |
254 | intSpect->widgetChBox[i]->SetState(kButtonUp); |
253 | } |
255 | } |
254 | } |
256 | } |
255 | break; |
257 | break; |
256 | 258 | ||
257 | case M_ANALYSIS_BREAKDOWN: |
259 | case M_ANALYSIS_BREAKDOWN: |
258 | fTab->SetTab(1); |
260 | fTab->SetTab(1); |
259 | analTab->SetTab(2); |
261 | analTab->SetTab(2); |
260 | break; |
262 | break; |
261 | 263 | ||
262 | case M_ANALYSIS_SURFSCAN: |
264 | case M_ANALYSIS_SURFSCAN: |
263 | fTab->SetTab(1); |
265 | fTab->SetTab(1); |
264 | analTab->SetTab(3); |
266 | analTab->SetTab(3); |
265 | break; |
267 | break; |
266 | 268 | ||
267 | case M_ANALYSIS_TIMING: |
269 | case M_ANALYSIS_TIMING: |
268 | fTab->SetTab(1); |
270 | fTab->SetTab(1); |
269 | analTab->SetTab(4); |
271 | analTab->SetTab(4); |
270 | break; |
272 | break; |
271 | 273 | ||
272 | case M_HELP_WEBHELP: |
274 | case M_HELP_WEBHELP: |
273 | printf("TGAppMainFrame::HandleMenu(): Opening %s/doc/documentation.html in a web browser.\n", rootdir); |
275 | printf("TGAppMainFrame::HandleMenu(): Opening %s/doc/documentation.html in a web browser.\n", rootdir); |
274 | sprintf(cmd, "xdg-open %s/doc/documentation.html &", rootdir); |
276 | sprintf(cmd, "xdg-open %s/doc/documentation.html &", rootdir); |
275 | system(cmd); |
277 | system(cmd); |
276 | break; |
278 | break; |
277 | 279 | ||
278 | case M_HELP_ABOUT: |
280 | case M_HELP_ABOUT: |
279 | About(); |
281 | About(); |
280 | break; |
282 | break; |
281 | 283 | ||
282 | default: |
284 | default: |
283 | // fMainFrame->SetCurrent(id); |
285 | // fMainFrame->SetCurrent(id); |
284 | break; |
286 | break; |
285 | } |
287 | } |
286 | } |
288 | } |
287 | 289 | ||
288 | // ------------------------------------------------------------------- |
290 | // ------------------------------------------------------------------- |
289 | 291 | ||
290 | // Initialize the main window menu ----------------------------------- |
292 | // Initialize the main window menu ----------------------------------- |
291 | 293 | ||
292 | void TGAppMainFrame::InitMenu() |
294 | void TGAppMainFrame::InitMenu() |
293 | { |
295 | { |
294 | fMenuBarItemLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0); |
296 | fMenuBarItemLayout = new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 4, 0, 0); |
295 | 297 | ||
296 | // Popup menu in menubar for File controls |
298 | // Popup menu in menubar for File controls |
297 | fMenuFile = new TGPopupMenu(gClient->GetRoot()); |
299 | fMenuFile = new TGPopupMenu(gClient->GetRoot()); |
298 | fMenuFile->AddEntry(new TGHotString("Set &user layout"), M_FILE_SET_LAYOUT); |
300 | fMenuFile->AddEntry(new TGHotString("Set &user layout"), M_FILE_SET_LAYOUT); |
299 | fMenuFile->AddEntry(new TGHotString("Save ¤t layout"), M_FILE_SAVE_LAYOUT); |
301 | fMenuFile->AddEntry(new TGHotString("Save ¤t layout"), M_FILE_SAVE_LAYOUT); |
300 | fMenuFile->AddSeparator(); |
302 | fMenuFile->AddSeparator(); |
301 | fMenuFile->AddEntry(new TGHotString("Save current &measurement settings"), M_FILE_SAVE_MSETTINGS); |
303 | fMenuFile->AddEntry(new TGHotString("Save current &measurement settings"), M_FILE_SAVE_MSETTINGS); |
302 | fMenuFile->AddEntry(new TGHotString("Save current &analysis settings"), M_FILE_SAVE_ASETTINGS); |
304 | fMenuFile->AddEntry(new TGHotString("Save current &analysis settings"), M_FILE_SAVE_ASETTINGS); |
303 | fMenuFile->AddEntry(new TGHotString("&Check frame width (Testing)"), M_FILE_CHECK_WIDTH); |
305 | fMenuFile->AddEntry(new TGHotString("&Check frame width (Testing)"), M_FILE_CHECK_WIDTH); |
304 | fMenuFile->AddSeparator(); |
306 | fMenuFile->AddSeparator(); |
305 | fMenuFile->AddEntry(new TGHotString("E&xit"), M_FILE_EXIT); |
307 | fMenuFile->AddEntry(new TGHotString("E&xit"), M_FILE_EXIT); |
306 | 308 | ||
307 | // Popup menu in menubar for Analysis controls |
309 | // Popup menu in menubar for Analysis controls |
308 | fMenuHisttype = new TGPopupMenu(gClient->GetRoot()); // adds a cascade menu that will be incorporated into analysis controls |
310 | fMenuHisttype = new TGPopupMenu(gClient->GetRoot()); // adds a cascade menu that will be incorporated into analysis controls |
309 | fMenuHisttype->AddEntry(new TGHotString("1D &ADC histogram"), M_ANALYSIS_HISTTYPE_1DADC); |
311 | fMenuHisttype->AddEntry(new TGHotString("1D &ADC histogram"), M_ANALYSIS_HISTTYPE_1DADC); |
310 | fMenuHisttype->AddEntry(new TGHotString("1D &TDC histogram"), M_ANALYSIS_HISTTYPE_1DTDC); |
312 | fMenuHisttype->AddEntry(new TGHotString("1D &TDC histogram"), M_ANALYSIS_HISTTYPE_1DTDC); |
311 | fMenuHisttype->AddEntry(new TGHotString("&2D ADC vs. TDC histogram"), M_ANALYSIS_HISTTYPE_2D); |
313 | fMenuHisttype->AddEntry(new TGHotString("&2D ADC vs. TDC histogram"), M_ANALYSIS_HISTTYPE_2D); |
312 | 314 | ||
313 | fMenuAnalysis = new TGPopupMenu(gClient->GetRoot()); // adds a new popup menu to the menubar |
315 | fMenuAnalysis = new TGPopupMenu(gClient->GetRoot()); // adds a new popup menu to the menubar |
314 | fMenuAnalysis->AddPopup(new TGHotString("&Histogram type"), fMenuHisttype); |
316 | fMenuAnalysis->AddPopup(new TGHotString("&Histogram type"), fMenuHisttype); |
315 | fMenuAnalysis->AddEntry(new TGHotString("&Integrate spectrum"), M_ANALYSIS_INTEG); |
317 | fMenuAnalysis->AddEntry(new TGHotString("&Integrate spectrum"), M_ANALYSIS_INTEG); |
316 | fMenuAnalysis->AddEntry(new TGHotString("Integrate spectrum (&X direction)"), M_ANALYSIS_INTEGX); |
318 | fMenuAnalysis->AddEntry(new TGHotString("Integrate spectrum (&X direction)"), M_ANALYSIS_INTEGX); |
317 | fMenuAnalysis->AddEntry(new TGHotString("Integrate spectrum (&Y direction)"), M_ANALYSIS_INTEGY); |
319 | fMenuAnalysis->AddEntry(new TGHotString("Integrate spectrum (&Y direction)"), M_ANALYSIS_INTEGY); |
318 | fMenuAnalysis->AddEntry(new TGHotString("&Relative PDE"), M_ANALYSIS_PHOTMU); |
320 | fMenuAnalysis->AddEntry(new TGHotString("&Relative PDE"), M_ANALYSIS_PHOTMU); |
319 | fMenuAnalysis->AddEntry(new TGHotString("&Breakdown voltage"), M_ANALYSIS_BREAKDOWN); |
321 | fMenuAnalysis->AddEntry(new TGHotString("&Breakdown voltage"), M_ANALYSIS_BREAKDOWN); |
320 | fMenuAnalysis->AddEntry(new TGHotString("Surface 2&D scan"), M_ANALYSIS_SURFSCAN); |
322 | fMenuAnalysis->AddEntry(new TGHotString("Surface 2&D scan"), M_ANALYSIS_SURFSCAN); |
321 | fMenuAnalysis->AddEntry(new TGHotString("&Timing analysis"), M_ANALYSIS_TIMING); |
323 | fMenuAnalysis->AddEntry(new TGHotString("&Timing analysis"), M_ANALYSIS_TIMING); |
322 | 324 | ||
323 | // Popup menu in menubar for File controls |
325 | // Popup menu in menubar for File controls |
324 | fMenuHelp = new TGPopupMenu(gClient->GetRoot()); |
326 | fMenuHelp = new TGPopupMenu(gClient->GetRoot()); |
325 | fMenuHelp->AddEntry(new TGHotString("Open &help in web browser"), M_HELP_WEBHELP); |
327 | fMenuHelp->AddEntry(new TGHotString("Open &help in web browser"), M_HELP_WEBHELP); |
326 | fMenuHelp->AddEntry(new TGHotString("&About"), M_HELP_ABOUT); |
328 | fMenuHelp->AddEntry(new TGHotString("&About"), M_HELP_ABOUT); |
327 | 329 | ||
328 | // Connect all menu items with actions |
330 | // Connect all menu items with actions |
329 | fMenuFile->Connect("Activated(Int_t)", "TGAppMainFrame", this, "HandleMenu(Int_t)"); |
331 | fMenuFile->Connect("Activated(Int_t)", "TGAppMainFrame", this, "HandleMenu(Int_t)"); |
330 | fMenuAnalysis->Connect("Activated(Int_t)", "TGAppMainFrame", this, "HandleMenu(Int_t)"); |
332 | fMenuAnalysis->Connect("Activated(Int_t)", "TGAppMainFrame", this, "HandleMenu(Int_t)"); |
331 | fMenuHelp->Connect("Activated(Int_t)", "TGAppMainFrame", this, "HandleMenu(Int_t)"); |
333 | fMenuHelp->Connect("Activated(Int_t)", "TGAppMainFrame", this, "HandleMenu(Int_t)"); |
332 | 334 | ||
333 | // Draw the created popup menus on the menubar |
335 | // Draw the created popup menus on the menubar |
334 | fMenuBar->AddPopup(new TGHotString("&File"), fMenuFile, fMenuBarItemLayout); |
336 | fMenuBar->AddPopup(new TGHotString("&File"), fMenuFile, fMenuBarItemLayout); |
335 | fMenuBar->AddPopup(new TGHotString("&Analysis"),fMenuAnalysis,fMenuBarItemLayout); |
337 | fMenuBar->AddPopup(new TGHotString("&Analysis"),fMenuAnalysis,fMenuBarItemLayout); |
336 | fMenuBar->AddPopup(new TGHotString("&Help"), fMenuHelp, fMenuBarItemLayout); |
338 | fMenuBar->AddPopup(new TGHotString("&Help"), fMenuHelp, fMenuBarItemLayout); |
337 | } |
339 | } |
338 | 340 | ||
339 | // ------------------------------------------------------------------- |
341 | // ------------------------------------------------------------------- |
340 | 342 | ||
341 | // Setting the application subwindow layout -------------------------- |
343 | // Setting the application subwindow layout -------------------------- |
342 | 344 | ||
343 | void TGAppMainFrame::AppLayout() |
345 | void TGAppMainFrame::AppLayout() |
344 | { |
346 | { |
345 | double numform[6], numform2[6]; |
347 | double numform[6], numform2[6]; |
346 | int *checksel; |
348 | int *checksel; |
347 | char selected[256]; |
349 | char selected[256]; |
348 | int subgroup[2]; |
350 | int subgroup[2]; |
349 | TGCompositeFrame *fH1, *fV1, *fH2, *fT1; |
351 | TGCompositeFrame *fH1, *fV1, *fH2, *fT1; |
350 | TGGroupFrame *fG1; |
352 | TGGroupFrame *fG1; |
351 | 353 | ||
352 | TGLayoutHints *f0centerX = new TGLayoutHints(kLHintsCenterX,2,2,2,2); |
354 | TGLayoutHints *f0centerX = new TGLayoutHints(kLHintsCenterX,2,2,2,2); |
353 | TGLayoutHints *f0leftX = new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2); |
355 | TGLayoutHints *f0leftX = new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2); |
354 | TGLayoutHints *f0leftXnoleft = new TGLayoutHints(kLHintsLeft | kLHintsTop,0,2,2,2); |
356 | TGLayoutHints *f0leftXnoleft = new TGLayoutHints(kLHintsLeft | kLHintsTop,0,2,2,2); |
355 | TGLayoutHints *f0leftXpad = new TGLayoutHints(kLHintsLeft | kLHintsTop,12,12,2,2); |
357 | TGLayoutHints *f0leftXpad = new TGLayoutHints(kLHintsLeft | kLHintsTop,12,12,2,2); |
356 | TGLayoutHints *f0rightX = new TGLayoutHints(kLHintsRight | kLHintsTop,2,2,2,2); |
358 | TGLayoutHints *f0rightX = new TGLayoutHints(kLHintsRight | kLHintsTop,2,2,2,2); |
357 | TGLayoutHints *f0rightXpad = new TGLayoutHints(kLHintsRight | kLHintsTop,12,12,2,2); |
359 | TGLayoutHints *f0rightXpad = new TGLayoutHints(kLHintsRight | kLHintsTop,12,12,2,2); |
358 | TGLayoutHints *f0centerY = new TGLayoutHints(kLHintsCenterY,2,2,2,2); |
360 | TGLayoutHints *f0centerY = new TGLayoutHints(kLHintsCenterY,2,2,2,2); |
359 | TGLayoutHints *f0center2d = new TGLayoutHints(kLHintsCenterX | kLHintsCenterY,2,2,2,2); |
361 | TGLayoutHints *f0center2d = new TGLayoutHints(kLHintsCenterX | kLHintsCenterY,2,2,2,2); |
360 | TGLayoutHints *f1expandX = new TGLayoutHints(kLHintsExpandX,2,2,2,2); |
362 | TGLayoutHints *f1expandX = new TGLayoutHints(kLHintsExpandX,2,2,2,2); |
361 | TGLayoutHints *f1expand2d = new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,2,2,2,2); |
363 | TGLayoutHints *f1expand2d = new TGLayoutHints(kLHintsExpandX | kLHintsExpandY,2,2,2,2); |
362 | TGLayoutHints *f1expandXpad = new TGLayoutHints(kLHintsExpandX,12,12,2,2); |
364 | TGLayoutHints *f1expandXpad = new TGLayoutHints(kLHintsExpandX,12,12,2,2); |
363 | 365 | ||
364 | // Settings pane --------------------------------------------------------------------------- |
366 | // Settings pane --------------------------------------------------------------------------- |
365 | subgroup[0] = (measLayout[0]->GetWidth())-4; |
367 | subgroup[0] = (measLayout[0]->GetWidth())-4; |
366 | 368 | ||
367 | // Check buttons to toggle voltage, surface and Z axis scans |
369 | // Check buttons to toggle voltage, surface and Z axis scans |
368 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *scansOn -> 4 check buttons (voltage, surface, Z axis, incidence angle scans)\n"); |
370 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *scansOn -> 4 check buttons (voltage, surface, Z axis, incidence angle scans)\n"); |
369 | scansOn = new TSubStructure(); |
371 | scansOn = new TSubStructure(); |
370 | checksel = new int[4]; |
372 | checksel = new int[4]; |
371 | checksel[0] = 0; checksel[1] = 0; checksel[2] = 0; checksel[3] = 0; |
373 | checksel[0] = 0; checksel[1] = 0; checksel[2] = 0; checksel[3] = 0; |
372 | const char *selnames[] = {"Voltage scan ON/OFF", "Surface scan ON/OFF", "Z-axis scan ON/OFF","Rotation scan ON/OFF","0","0","0","0","0","0","0","0","0","0","0","0"}; |
374 | const char *selnames[] = {"Voltage scan ON/OFF", "Surface scan ON/OFF", "Z-axis scan ON/OFF","Rotation scan ON/OFF","0","0","0","0","0","0","0","0","0","0","0","0"}; |
373 | if(scansOn->TGCheckList(measLayout[0], subgroup[0], 30, 4, selnames, checksel, "vertical", "center")) |
375 | if(scansOn->TGCheckList(measLayout[0], subgroup[0], 30, 4, selnames, checksel, "vertical", "center")) |
374 | measLayout[0]->AddFrame(scansOn->outsidebox, f1expandXpad); |
376 | measLayout[0]->AddFrame(scansOn->outsidebox, f1expandXpad); |
375 | delete[] checksel; |
377 | delete[] checksel; |
376 | 378 | ||
377 | // Hard limit for maximum voltage we can set |
379 | // Hard limit for maximum voltage we can set |
378 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *vHardlimit -> Number entry for voltage limit\n"); |
380 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *vHardlimit -> Number entry for voltage limit\n"); |
379 | vHardlimit = new TSubStructure(); |
381 | vHardlimit = new TSubStructure(); |
380 | for(int i = 0; i < 6; i++) numform[i] = 0; |
382 | for(int i = 0; i < 6; i++) numform[i] = 0; |
381 | numform[0] = 6; numform[1] = 2; |
383 | numform[0] = 6; numform[1] = 2; |
382 | if(vHardlimit->TGLabelNEntry(measLayout[0], subgroup[0], 30, "Voltage limit:", 70.00, numform, "center")) |
384 | if(vHardlimit->TGLabelNEntry(measLayout[0], subgroup[0], 30, "Voltage limit:", 70.00, numform, "center")) |
383 | measLayout[0]->AddFrame(vHardlimit->outsidebox, f1expandXpad); |
385 | measLayout[0]->AddFrame(vHardlimit->outsidebox, f1expandXpad); |
384 | 386 | ||
385 | // Number of used channels |
387 | // Number of used channels |
386 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *NCH -> Number entry for number of channels to capture\n"); |
388 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *NCH -> Number entry for number of channels to capture\n"); |
387 | NCH = new TSubStructure(); |
389 | NCH = new TSubStructure(); |
388 | for(int i = 0; i < 6; i++) numform[i] = 0; |
390 | for(int i = 0; i < 6; i++) numform[i] = 0; |
389 | numform[0] = 3; numform[2] = 2; numform[3] = 2; numform[4] = 1; numform[5] = 8; |
391 | numform[0] = 3; numform[2] = 2; numform[3] = 2; numform[4] = 1; numform[5] = 8; |
390 | if(NCH->TGLabelNEntry(measLayout[0], subgroup[0], 30, "Nr. of channels:", 1, numform, "center")) |
392 | if(NCH->TGLabelNEntry(measLayout[0], subgroup[0], 30, "Nr. of channels:", 1, numform, "center")) |
391 | measLayout[0]->AddFrame(NCH->outsidebox, f1expandXpad); |
393 | measLayout[0]->AddFrame(NCH->outsidebox, f1expandXpad); |
392 | 394 | ||
393 | // Select the units to use for table positioning (micrometer, table position units) |
395 | // Select the units to use for table positioning (micrometer, table position units) |
394 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *posUnits -> Dropdown menu for selecting the units for table positioning\n"); |
396 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *posUnits -> Dropdown menu for selecting the units for table positioning\n"); |
395 | posUnits = new TSubStructure(); |
397 | posUnits = new TSubStructure(); |
396 | selnames[0] = "table units"; selnames[1] = "micrometers"; |
398 | selnames[0] = "table units"; selnames[1] = "micrometers"; |
397 | sprintf(selected, "table units"); |
399 | sprintf(selected, "table units"); |
398 | if(posUnits->TGLabelDrop(measLayout[0], 2*subgroup[0]/3, 30, "Position units:", 2, selnames, selected)) |
400 | if(posUnits->TGLabelDrop(measLayout[0], 2*subgroup[0]/3, 30, "Position units:", 2, selnames, selected)) |
399 | measLayout[0]->AddFrame(posUnits->outsidebox, f1expandXpad); |
401 | measLayout[0]->AddFrame(posUnits->outsidebox, f1expandXpad); |
400 | 402 | ||
401 | // Select the units to use for rotation platform (degrees, table rotation units) |
403 | // Select the units to use for rotation platform (degrees, table rotation units) |
402 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *rotUnits -> Dropdown menu for selecting the units for rotation\n"); |
404 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *rotUnits -> Dropdown menu for selecting the units for rotation\n"); |
403 | rotUnits = new TSubStructure(); |
405 | rotUnits = new TSubStructure(); |
404 | selnames[0] = "table units"; selnames[1] = "degrees"; |
406 | selnames[0] = "table units"; selnames[1] = "degrees"; |
405 | sprintf(selected, "degrees"); |
407 | sprintf(selected, "degrees"); |
406 | if(rotUnits->TGLabelDrop(measLayout[0], 2*subgroup[0]/3, 30, "Rotation units:", 2, selnames, selected)) |
408 | if(rotUnits->TGLabelDrop(measLayout[0], 2*subgroup[0]/3, 30, "Rotation units:", 2, selnames, selected)) |
407 | measLayout[0]->AddFrame(rotUnits->outsidebox, f1expandXpad); |
409 | measLayout[0]->AddFrame(rotUnits->outsidebox, f1expandXpad); |
408 | 410 | ||
409 | // Button and textbox to enter the oscilloscope IP address |
411 | // Button and textbox to enter the oscilloscope IP address |
410 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *oscConnect -> Text Entry (oscilloscope IP address)\n"); |
412 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *oscConnect -> Text Entry (oscilloscope IP address)\n"); |
411 | oscConnect = new TSubStructure(); |
413 | oscConnect = new TSubStructure(); |
412 | if(oscConnect->TGLabelTEntryButton(measLayout[0], subgroup[0], 30, "Scope IP:", "178.172.43.157", "Connect", "twoline")) |
414 | if(oscConnect->TGLabelTEntryButton(measLayout[0], subgroup[0], 30, "Scope IP:", "178.172.43.157", "Connect", "twoline")) |
413 | measLayout[0]->AddFrame(oscConnect->outsidebox, f1expandXpad); |
415 | measLayout[0]->AddFrame(oscConnect->outsidebox, f1expandXpad); |
414 | 416 | ||
415 | // Laser settings (freq., tune, ND filter) |
417 | // Laser settings (freq., tune, ND filter) |
416 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *laserInfo -> Text Entry (Laser setting information)\n"); |
418 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *laserInfo -> Text Entry (Laser setting information)\n"); |
417 | laserInfo = new TSubStructure(); |
419 | laserInfo = new TSubStructure(); |
418 | if(laserInfo->TGLabelTEntry(measLayout[0], subgroup[0], 30, "Laser settings:", "kHz, tune, ND", "twoline")) |
420 | if(laserInfo->TGLabelTEntry(measLayout[0], subgroup[0], 30, "Laser settings:", "kHz, tune, ND", "twoline")) |
419 | measLayout[0]->AddFrame(laserInfo->outsidebox, f1expandXpad); |
421 | measLayout[0]->AddFrame(laserInfo->outsidebox, f1expandXpad); |
420 | 422 | ||
421 | // Chamber temperature (will only be manually set until we can get it directly from the chamber) |
423 | // Chamber temperature (will only be manually set until we can get it directly from the chamber) |
422 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *chtemp -> Number entry for chamber temperature\n"); |
424 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *chtemp -> Number entry for chamber temperature\n"); |
423 | chtemp = new TSubStructure(); |
425 | chtemp = new TSubStructure(); |
424 | for(int i = 0; i < 6; i++) numform[i] = 0; |
426 | for(int i = 0; i < 6; i++) numform[i] = 0; |
425 | numform[0] = 5; numform[1] = 1; numform[3] = 2; numform[4] = -70.; numform[5] = 140.; |
427 | numform[0] = 5; numform[1] = 1; numform[3] = 2; numform[4] = -70.; numform[5] = 140.; |
426 | if(chtemp->TGLabelNEntry(measLayout[0], subgroup[0], 30, "Chamber temp.:", 25.0, numform, "center")) |
428 | if(chtemp->TGLabelNEntry(measLayout[0], subgroup[0], 30, "Chamber temp.:", 25.0, numform, "center")) |
427 | measLayout[0]->AddFrame(chtemp->outsidebox, f1expandXpad); |
429 | measLayout[0]->AddFrame(chtemp->outsidebox, f1expandXpad); |
428 | 430 | ||
429 | // Check button to toggle live update of histogram (in display canvas) |
431 | // Check button to toggle live update of histogram (in display canvas) |
430 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *liveDisp -> 1 check button (live histogram update)\n"); |
432 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *liveDisp -> 1 check button (live histogram update)\n"); |
431 | liveDisp = new TSubStructure(); |
433 | liveDisp = new TSubStructure(); |
432 | checksel = new int; |
434 | checksel = new int; |
433 | *checksel = 0; |
435 | *checksel = 0; |
434 | selnames[0] = "Live histogram ON/OFF"; |
436 | selnames[0] = "Live histogram ON/OFF"; |
435 | if(liveDisp->TGCheckList(measLayout[0], subgroup[0], 30, 1, selnames, checksel, "vertical", "center")) |
437 | if(liveDisp->TGCheckList(measLayout[0], subgroup[0], 30, 1, selnames, checksel, "vertical", "center")) |
436 | measLayout[0]->AddFrame(liveDisp->outsidebox, f1expandXpad); |
438 | measLayout[0]->AddFrame(liveDisp->outsidebox, f1expandXpad); |
437 | delete checksel; |
439 | delete checksel; |
438 | 440 | ||
439 | // Actions for Settings pane //TODO |
441 | // Actions for Settings pane //TODO |
440 | scansOn->widgetChBox[0]->Connect("Clicked()", "TGAppMainFrame", this, "EnableScan(=0)"); |
442 | scansOn->widgetChBox[0]->Connect("Clicked()", "TGAppMainFrame", this, "EnableScan(=0)"); |
441 | scansOn->widgetChBox[1]->Connect("Clicked()", "TGAppMainFrame", this, "EnableScan(=1)"); |
443 | scansOn->widgetChBox[1]->Connect("Clicked()", "TGAppMainFrame", this, "EnableScan(=1)"); |
442 | scansOn->widgetChBox[2]->Connect("Clicked()", "TGAppMainFrame", this, "EnableScan(=2)"); |
444 | scansOn->widgetChBox[2]->Connect("Clicked()", "TGAppMainFrame", this, "EnableScan(=2)"); |
443 | scansOn->widgetChBox[3]->Connect("Clicked()", "TGAppMainFrame", this, "EnableScan(=3)"); |
445 | scansOn->widgetChBox[3]->Connect("Clicked()", "TGAppMainFrame", this, "EnableScan(=3)"); |
444 | vHardlimit->widgetNE[0]->Connect("ValueSet(Long_t)", "TGAppMainFrame", this, "VoltageLimit()"); |
446 | vHardlimit->widgetNE[0]->Connect("ValueSet(Long_t)", "TGAppMainFrame", this, "VoltageLimit()"); |
445 | (vHardlimit->widgetNE[0]->GetNumberEntry())->Connect("ReturnPressed()", "TGAppMainFrame", this, "VoltageLimit()"); |
447 | (vHardlimit->widgetNE[0]->GetNumberEntry())->Connect("ReturnPressed()", "TGAppMainFrame", this, "VoltageLimit()"); |
446 | posUnits->widgetCB->Connect("Selected(Int_t)", "TGAppMainFrame", this, "ChangeUnits(Int_t)"); |
448 | posUnits->widgetCB->Connect("Selected(Int_t)", "TGAppMainFrame", this, "ChangeUnits(Int_t)"); |
447 | rotUnits->widgetCB->Connect("Selected(Int_t)", "TGAppMainFrame", this, "ChangeUnitsRot(Int_t)"); |
449 | rotUnits->widgetCB->Connect("Selected(Int_t)", "TGAppMainFrame", this, "ChangeUnitsRot(Int_t)"); |
448 | liveDisp->widgetChBox[0]->Connect("Clicked()", "TGAppMainFrame", this, "EnableLiveUpdate()"); |
450 | liveDisp->widgetChBox[0]->Connect("Clicked()", "TGAppMainFrame", this, "EnableLiveUpdate()"); |
449 | // Settings pane --------------------------------------------------------------------------- |
451 | // Settings pane --------------------------------------------------------------------------- |
450 | 452 | ||
451 | // Main window ----------------------------------------------------------------------------- |
453 | // Main window ----------------------------------------------------------------------------- |
452 | TGTab *setTab; |
454 | TGTab *setTab; |
453 | 455 | ||
454 | // Voltage, position and incidence angle tab |
456 | // Voltage, position and incidence angle tab |
455 | subgroup[0] = 2*(measLayout[2]->GetWidth())/7-14; |
457 | subgroup[0] = 2*(measLayout[2]->GetWidth())/7-14; |
456 | subgroup[1] = (measLayout[2]->GetHeight())/2-4; |
458 | subgroup[1] = (measLayout[2]->GetHeight())/2-4; |
457 | setTab = new TGTab(measLayout[2], subgroup[0], subgroup[1]); |
459 | setTab = new TGTab(measLayout[2], subgroup[0], subgroup[1]); |
458 | 460 | ||
459 | fT1 = setTab->AddTab("Voltage, position and incidence angle"); |
461 | fT1 = setTab->AddTab("Voltage, position and incidence angle"); |
460 | fH1 = new TGCompositeFrame(fT1, measLayout[2]->GetWidth(), subgroup[1], kFixedHeight | kHorizontalFrame); |
462 | fH1 = new TGCompositeFrame(fT1, measLayout[2]->GetWidth(), subgroup[1], kFixedHeight | kHorizontalFrame); |
461 | 463 | ||
462 | // Left pane (Bias voltage controls) |
464 | // Left pane (Bias voltage controls) |
463 | fV1 = new TGCompositeFrame(fH1, subgroup[0], subgroup[1], kFixedWidth | kFixedHeight | kVerticalFrame); |
465 | fV1 = new TGCompositeFrame(fH1, subgroup[0], subgroup[1], kFixedWidth | kFixedHeight | kVerticalFrame); |
464 | fG1 = new TGGroupFrame(fV1, "Bias voltage controls"); |
466 | fG1 = new TGGroupFrame(fV1, "Bias voltage controls"); |
465 | 467 | ||
466 | // Output voltage supply channel |
468 | // Output voltage supply channel |
467 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *vOutCh -> Dropdown menu for bias voltage channel\n"); |
469 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *vOutCh -> Dropdown menu for bias voltage channel\n"); |
468 | vOutCh = new TSubStructure(); |
470 | vOutCh = new TSubStructure(); |
469 | selnames[0] = "U0"; selnames[1] = "U1"; selnames[2] = "U2"; selnames[3] = "U3"; selnames[4] = "U4"; selnames[5] = "U5"; selnames[6] = "U6"; selnames[7] = "U7"; selnames[8] = "U100"; selnames[9] = "U101"; selnames[10] = "U102"; selnames[11] = "U103"; selnames[12] = "U104"; selnames[13] = "U105"; selnames[14] = "U106"; selnames[15] = "U107"; |
471 | selnames[0] = "U0"; selnames[1] = "U1"; selnames[2] = "U2"; selnames[3] = "U3"; selnames[4] = "U4"; selnames[5] = "U5"; selnames[6] = "U6"; selnames[7] = "U7"; selnames[8] = "U100"; selnames[9] = "U101"; selnames[10] = "U102"; selnames[11] = "U103"; selnames[12] = "U104"; selnames[13] = "U105"; selnames[14] = "U106"; selnames[15] = "U107"; |
470 | sprintf(selected, "U0"); |
472 | sprintf(selected, "U0"); |
471 | if(vOutCh->TGLabelDrop(fG1, 2*subgroup[0]/3, 30, "Output channel:", 16, selnames, selected)) |
473 | if(vOutCh->TGLabelDrop(fG1, 2*subgroup[0]/3, 30, "Output channel:", 16, selnames, selected)) |
472 | fG1->AddFrame(vOutCh->outsidebox, f1expandXpad); |
474 | fG1->AddFrame(vOutCh->outsidebox, f1expandXpad); |
473 | 475 | ||
474 | // Output voltage setting |
476 | // Output voltage setting |
475 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *vOutOpt -> 2 check buttons (negative polarity, ON/OFF toggle switch)\n"); |
477 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *vOutOpt -> 2 check buttons (negative polarity, ON/OFF toggle switch)\n"); |
476 | vOutOpt = new TSubStructure(); |
478 | vOutOpt = new TSubStructure(); |
477 | checksel = new int[2]; |
479 | checksel = new int[2]; |
478 | checksel[0] = 0; checksel[1] = 0; |
480 | checksel[0] = 0; checksel[1] = 0; |
479 | selnames[1] = "Output ON/OFF"; selnames[0] = "Negative polarity"; |
481 | selnames[1] = "Output ON/OFF"; selnames[0] = "Negative polarity"; |
480 | if(vOutOpt->TGCheckList(fG1, 3*subgroup[0]/4, 30, 2, selnames, checksel, "vertical", "center")) |
482 | if(vOutOpt->TGCheckList(fG1, 3*subgroup[0]/4, 30, 2, selnames, checksel, "vertical", "center")) |
481 | fG1->AddFrame(vOutOpt->outsidebox, f1expandXpad); |
483 | fG1->AddFrame(vOutOpt->outsidebox, f1expandXpad); |
482 | delete[] checksel; |
484 | delete[] checksel; |
483 | 485 | ||
484 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *vOut -> Number entry for bias voltage\n"); |
486 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *vOut -> Number entry for bias voltage\n"); |
485 | vOut = new TSubStructure(); |
487 | vOut = new TSubStructure(); |
486 | for(int i = 0; i < 6; i++) numform[i] = 0; |
488 | for(int i = 0; i < 6; i++) numform[i] = 0; |
487 | numform[0] = 7; numform[1] = 2; numform[3] = 2; numform[4] = 0.; numform[5] = vHardlimit->widgetNE[0]->GetNumber(); |
489 | numform[0] = 7; numform[1] = 2; numform[3] = 2; numform[4] = 0.; numform[5] = vHardlimit->widgetNE[0]->GetNumber(); |
488 | if(vOut->TGLabelNEntry(fG1, 3*subgroup[0]/4, 30, "Output voltage:", 0.00, numform, "center")) |
490 | if(vOut->TGLabelNEntry(fG1, 3*subgroup[0]/4, 30, "Output voltage:", 0.00, numform, "center")) |
489 | fG1->AddFrame(vOut->outsidebox, f1expandXpad); |
491 | fG1->AddFrame(vOut->outsidebox, f1expandXpad); |
490 | 492 | ||
491 | // Set, get and reset voltage buttons |
493 | // Set, get and reset voltage buttons |
492 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *vOutButtons -> 3 buttons (set bias voltage, read current bias voltage, reset voltage output when it gets interlocked)\n"); |
494 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *vOutButtons -> 3 buttons (set bias voltage, read current bias voltage, reset voltage output when it gets interlocked)\n"); |
493 | vOutButtons = new TSubStructure(); |
495 | vOutButtons = new TSubStructure(); |
494 | selnames[0] = "Set"; selnames[1] = "Get"; selnames[2] = "Reset"; |
496 | selnames[0] = "Set"; selnames[1] = "Get"; selnames[2] = "Reset"; |
495 | if(vOutButtons->TGMultiButton(fG1, 3*subgroup[0]/4, 30, 3, selnames, "center")) |
497 | if(vOutButtons->TGMultiButton(fG1, 3*subgroup[0]/4, 30, 3, selnames, "center")) |
496 | fG1->AddFrame(vOutButtons->outsidebox, f1expandXpad); |
498 | fG1->AddFrame(vOutButtons->outsidebox, f1expandXpad); |
497 | 499 | ||
498 | // Voltage scan controls |
500 | // Voltage scan controls |
499 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *vOutStart -> Number entry for starting bias voltage\n"); |
501 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *vOutStart -> Number entry for starting bias voltage\n"); |
500 | vOutStart = new TSubStructure(); |
502 | vOutStart = new TSubStructure(); |
501 | for(int i = 0; i < 6; i++) numform[i] = 0; |
503 | for(int i = 0; i < 6; i++) numform[i] = 0; |
502 | numform[0] = 7; numform[1] = 2; |
504 | numform[0] = 7; numform[1] = 2; |
503 | if(vOutStart->TGLabelNEntry(fG1, 3*subgroup[0]/4, 30, "V (min):", 0.00, numform, "center")) |
505 | if(vOutStart->TGLabelNEntry(fG1, 3*subgroup[0]/4, 30, "V (min):", 0.00, numform, "center")) |
504 | fG1->AddFrame(vOutStart->outsidebox, f1expandXpad); |
506 | fG1->AddFrame(vOutStart->outsidebox, f1expandXpad); |
505 | 507 | ||
506 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *vOutStop -> Number entry for starting bias voltage\n"); |
508 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *vOutStop -> Number entry for starting bias voltage\n"); |
507 | vOutStop = new TSubStructure(); |
509 | vOutStop = new TSubStructure(); |
508 | for(int i = 0; i < 6; i++) numform[i] = 0; |
510 | for(int i = 0; i < 6; i++) numform[i] = 0; |
509 | numform[0] = 7; numform[1] = 2; |
511 | numform[0] = 7; numform[1] = 2; |
510 | if(vOutStop->TGLabelNEntry(fG1, 3*subgroup[0]/4, 30, "V (max):", 0.00, numform, "center")) |
512 | if(vOutStop->TGLabelNEntry(fG1, 3*subgroup[0]/4, 30, "V (max):", 0.00, numform, "center")) |
511 | fG1->AddFrame(vOutStop->outsidebox, f1expandXpad); |
513 | fG1->AddFrame(vOutStop->outsidebox, f1expandXpad); |
512 | 514 | ||
513 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *vOutStep -> Number entry for starting bias voltage\n"); |
515 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *vOutStep -> Number entry for starting bias voltage\n"); |
514 | vOutStep = new TSubStructure(); |
516 | vOutStep = new TSubStructure(); |
515 | for(int i = 0; i < 6; i++) numform[i] = 0; |
517 | for(int i = 0; i < 6; i++) numform[i] = 0; |
516 | numform[0] = 7; numform[1] = 2; |
518 | numform[0] = 7; numform[1] = 2; |
517 | if(vOutStep->TGLabelNEntry(fG1, 3*subgroup[0]/4, 30, "V (step):", 0.00, numform, "center")) |
519 | if(vOutStep->TGLabelNEntry(fG1, 3*subgroup[0]/4, 30, "V (step):", 0.00, numform, "center")) |
518 | fG1->AddFrame(vOutStep->outsidebox, f1expandXpad); |
520 | fG1->AddFrame(vOutStep->outsidebox, f1expandXpad); |
519 | 521 | ||
520 | fV1->AddFrame(fG1, f1expand2d); |
522 | fV1->AddFrame(fG1, f1expand2d); |
521 | // Left pane (Bias voltage controls) |
523 | // Left pane (Bias voltage controls) |
522 | fH1->AddFrame(fV1, f0leftX); |
524 | fH1->AddFrame(fV1, f0leftX); |
523 | 525 | ||
524 | // Center pane (Table position controls) |
526 | // Center pane (Table position controls) |
525 | subgroup[0] = 3*(measLayout[2]->GetWidth())/7-13; |
527 | subgroup[0] = 3*(measLayout[2]->GetWidth())/7-13; |
526 | fV1 = new TGCompositeFrame(fH1, subgroup[0], subgroup[1], kFixedWidth | kFixedHeight | kVerticalFrame); |
528 | fV1 = new TGCompositeFrame(fH1, subgroup[0], subgroup[1], kFixedWidth | kFixedHeight | kVerticalFrame); |
527 | fG1 = new TGGroupFrame(fV1, "Table position controls"); |
529 | fG1 = new TGGroupFrame(fV1, "Table position controls"); |
528 | 530 | ||
529 | // X, Y and Z positions |
531 | // X, Y and Z positions |
530 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *xPos, *yPos, *zPos, *zPosMin, *zPosMax, *zPosStep -> Settings for position and Z axis scan\n"); |
532 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *xPos, *yPos, *zPos, *zPosMin, *zPosMax, *zPosStep -> Settings for position and Z axis scan\n"); |
531 | fH2 = new TGCompositeFrame(fG1, 3*subgroup[0]/4, 30, kFixedWidth | kHorizontalFrame); |
533 | fH2 = new TGCompositeFrame(fG1, 3*subgroup[0]/4, 30, kFixedWidth | kHorizontalFrame); |
532 | xPos = new TSubStructure(); |
534 | xPos = new TSubStructure(); |
533 | for(int i = 0; i < 6; i++) numform[i] = 0; |
535 | for(int i = 0; i < 6; i++) numform[i] = 0; |
534 | numform[0] = 9; numform[3] = 2; numform[4] = -100; numform[5] = 215000; |
536 | numform[0] = 9; numform[3] = 2; numform[4] = -100; numform[5] = 215000; |
535 | if(xPos->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "X:", 0, numform, "center")) |
537 | if(xPos->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "X:", 0, numform, "center")) |
536 | fH2->AddFrame(xPos->outsidebox, f0centerX); |
538 | fH2->AddFrame(xPos->outsidebox, f0centerX); |
537 | 539 | ||
538 | zPosMin = new TSubStructure(); |
540 | zPosMin = new TSubStructure(); |
539 | numform[5] = 375000; |
541 | numform[5] = 375000; |
540 | if(zPosMin->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "Z (min):", 0, numform, "center")) |
542 | if(zPosMin->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "Z (min):", 0, numform, "center")) |
541 | fH2->AddFrame(zPosMin->outsidebox, f0centerX); |
543 | fH2->AddFrame(zPosMin->outsidebox, f0centerX); |
542 | fG1->AddFrame(fH2, f1expandXpad); |
544 | fG1->AddFrame(fH2, f1expandXpad); |
543 | 545 | ||
544 | fH2 = new TGCompositeFrame(fG1, 3*subgroup[0]/4, 30, kFixedWidth | kHorizontalFrame); |
546 | fH2 = new TGCompositeFrame(fG1, 3*subgroup[0]/4, 30, kFixedWidth | kHorizontalFrame); |
545 | yPos = new TSubStructure(); |
547 | yPos = new TSubStructure(); |
546 | numform[5] = 215000; |
548 | numform[5] = 215000; |
547 | if(yPos->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "Y:", 0, numform, "center")) |
549 | if(yPos->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "Y:", 0, numform, "center")) |
548 | fH2->AddFrame(yPos->outsidebox, f0centerX); |
550 | fH2->AddFrame(yPos->outsidebox, f0centerX); |
549 | 551 | ||
550 | zPosMax = new TSubStructure(); |
552 | zPosMax = new TSubStructure(); |
551 | numform[5] = 375000; |
553 | numform[5] = 375000; |
552 | if(zPosMax->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "Z (max):", 0, numform, "center")) |
554 | if(zPosMax->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "Z (max):", 0, numform, "center")) |
553 | fH2->AddFrame(zPosMax->outsidebox, f0centerX); |
555 | fH2->AddFrame(zPosMax->outsidebox, f0centerX); |
554 | fG1->AddFrame(fH2, f1expandXpad); |
556 | fG1->AddFrame(fH2, f1expandXpad); |
555 | 557 | ||
556 | fH2 = new TGCompositeFrame(fG1, 3*subgroup[0]/4, 30, kFixedWidth | kHorizontalFrame); |
558 | fH2 = new TGCompositeFrame(fG1, 3*subgroup[0]/4, 30, kFixedWidth | kHorizontalFrame); |
557 | zPos = new TSubStructure(); |
559 | zPos = new TSubStructure(); |
558 | numform[5] = 375000; |
560 | numform[5] = 375000; |
559 | if(zPos->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "Z:", 0, numform, "center")) |
561 | if(zPos->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "Z:", 0, numform, "center")) |
560 | fH2->AddFrame(zPos->outsidebox, f0centerX); |
562 | fH2->AddFrame(zPos->outsidebox, f0centerX); |
561 | 563 | ||
562 | zPosStep = new TSubStructure(); |
564 | zPosStep = new TSubStructure(); |
563 | for(int i = 0; i < 6; i++) numform[i] = 0; |
565 | for(int i = 0; i < 6; i++) numform[i] = 0; |
564 | numform[0] = 9; |
566 | numform[0] = 9; |
565 | if(zPosStep->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "Z (step):", 0, numform, "center")) |
567 | if(zPosStep->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "Z (step):", 0, numform, "center")) |
566 | fH2->AddFrame(zPosStep->outsidebox, f0centerX); |
568 | fH2->AddFrame(zPosStep->outsidebox, f0centerX); |
567 | fG1->AddFrame(fH2, f1expandXpad); |
569 | fG1->AddFrame(fH2, f1expandXpad); |
568 | 570 | ||
569 | // Set, get, home and reset position buttons |
571 | // Set, get, home and reset position buttons |
570 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *posButtons -> |
572 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *posButtons -> 5 buttons (set position, read current position, home the motor, reset all three controllers and emergency stop)\n"); |
571 | posButtons = new TSubStructure(); |
573 | posButtons = new TSubStructure(); |
572 | selnames[0] = "Set"; selnames[1] = "Get"; selnames[2] = "Home"; selnames[3] = "Reset"; |
574 | selnames[0] = "Set"; selnames[1] = "Get"; selnames[2] = "Home"; selnames[3] = "Reset"; selnames[4] = "Emergency stop"; |
573 | if(posButtons->TGMultiButton(fG1, 3*subgroup[0]/4, 30, |
575 | if(posButtons->TGMultiButton(fG1, 3*subgroup[0]/4, 30, 5, selnames, "center")) |
574 | fG1->AddFrame(posButtons->outsidebox, f1expandXpad); |
576 | fG1->AddFrame(posButtons->outsidebox, f1expandXpad); |
575 | 577 | ||
576 | // Position scan controls |
578 | // Position scan controls |
577 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *xPosMin, *xPosMax, *xPosStep, *yPosMin, *yPosMax, *yPosStep -> Settings for X and Y axis scans\n"); |
579 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *xPosMin, *xPosMax, *xPosStep, *yPosMin, *yPosMax, *yPosStep -> Settings for X and Y axis scans\n"); |
578 | fH2 = new TGCompositeFrame(fG1, 3*subgroup[0]/4, 30, kFixedWidth | kHorizontalFrame); |
580 | fH2 = new TGCompositeFrame(fG1, 3*subgroup[0]/4, 30, kFixedWidth | kHorizontalFrame); |
579 | xPosMin = new TSubStructure(); |
581 | xPosMin = new TSubStructure(); |
580 | for(int i = 0; i < 6; i++) numform[i] = 0; |
582 | for(int i = 0; i < 6; i++) numform[i] = 0; |
581 | numform[0] = 9; numform[3] = 2; numform[4] = -100; numform[5] = 215000; |
583 | numform[0] = 9; numform[3] = 2; numform[4] = -100; numform[5] = 215000; |
582 | if(xPosMin->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "X (min):", 0, numform, "center")) |
584 | if(xPosMin->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "X (min):", 0, numform, "center")) |
583 | fH2->AddFrame(xPosMin->outsidebox, f0centerX); |
585 | fH2->AddFrame(xPosMin->outsidebox, f0centerX); |
584 | 586 | ||
585 | yPosMin = new TSubStructure(); |
587 | yPosMin = new TSubStructure(); |
586 | if(yPosMin->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "Y (min):", 0, numform, "center")) |
588 | if(yPosMin->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "Y (min):", 0, numform, "center")) |
587 | fH2->AddFrame(yPosMin->outsidebox, f0centerX); |
589 | fH2->AddFrame(yPosMin->outsidebox, f0centerX); |
588 | fG1->AddFrame(fH2, f1expandXpad); |
590 | fG1->AddFrame(fH2, f1expandXpad); |
589 | 591 | ||
590 | fH2 = new TGCompositeFrame(fG1, 3*subgroup[0]/4, 30, kFixedWidth | kHorizontalFrame); |
592 | fH2 = new TGCompositeFrame(fG1, 3*subgroup[0]/4, 30, kFixedWidth | kHorizontalFrame); |
591 | xPosMax = new TSubStructure(); |
593 | xPosMax = new TSubStructure(); |
592 | if(xPosMax->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "X (max):", 0, numform, "center")) |
594 | if(xPosMax->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "X (max):", 0, numform, "center")) |
593 | fH2->AddFrame(xPosMax->outsidebox, f0centerX); |
595 | fH2->AddFrame(xPosMax->outsidebox, f0centerX); |
594 | 596 | ||
595 | yPosMax = new TSubStructure(); |
597 | yPosMax = new TSubStructure(); |
596 | if(yPosMax->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "Y (max):", 0, numform, "center")) |
598 | if(yPosMax->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "Y (max):", 0, numform, "center")) |
597 | fH2->AddFrame(yPosMax->outsidebox, f0centerX); |
599 | fH2->AddFrame(yPosMax->outsidebox, f0centerX); |
598 | fG1->AddFrame(fH2, f1expandXpad); |
600 | fG1->AddFrame(fH2, f1expandXpad); |
599 | 601 | ||
600 | fH2 = new TGCompositeFrame(fG1, 3*subgroup[0]/4, 30, kFixedWidth | kHorizontalFrame); |
602 | fH2 = new TGCompositeFrame(fG1, 3*subgroup[0]/4, 30, kFixedWidth | kHorizontalFrame); |
601 | xPosStep = new TSubStructure(); |
603 | xPosStep = new TSubStructure(); |
602 | for(int i = 0; i < 6; i++) numform[i] = 0; |
604 | for(int i = 0; i < 6; i++) numform[i] = 0; |
603 | numform[0] = 9; |
605 | numform[0] = 9; |
604 | if(xPosStep->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "X (step):", 0, numform, "center")) |
606 | if(xPosStep->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "X (step):", 0, numform, "center")) |
605 | fH2->AddFrame(xPosStep->outsidebox, f0centerX); |
607 | fH2->AddFrame(xPosStep->outsidebox, f0centerX); |
606 | 608 | ||
607 | yPosStep = new TSubStructure(); |
609 | yPosStep = new TSubStructure(); |
608 | if(yPosStep->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "Y (step):", 0, numform, "center")) |
610 | if(yPosStep->TGLabelNEntry(fH2, 8*subgroup[0]/16, 30, "Y (step):", 0, numform, "center")) |
609 | fH2->AddFrame(yPosStep->outsidebox, f0centerX); |
611 | fH2->AddFrame(yPosStep->outsidebox, f0centerX); |
610 | fG1->AddFrame(fH2, f1expandXpad); |
612 | fG1->AddFrame(fH2, f1expandXpad); |
611 | 613 | ||
612 | fV1->AddFrame(fG1, f1expand2d); |
614 | fV1->AddFrame(fG1, f1expand2d); |
613 | // Center pane (Table position controls) |
615 | // Center pane (Table position controls) |
614 | fH1->AddFrame(fV1, f0leftX); |
616 | fH1->AddFrame(fV1, f0leftX); |
615 | 617 | ||
616 | // Right pane (Incidence angle controls) |
618 | // Right pane (Incidence angle controls) |
617 | subgroup[0] = 2*(measLayout[2]->GetWidth())/7-14; |
619 | subgroup[0] = 2*(measLayout[2]->GetWidth())/7-14; |
618 | fV1 = new TGCompositeFrame(fH1, subgroup[0], subgroup[1], kFixedWidth | kFixedHeight | kVerticalFrame); |
620 | fV1 = new TGCompositeFrame(fH1, subgroup[0], subgroup[1], kFixedWidth | kFixedHeight | kVerticalFrame); |
619 | fG1 = new TGGroupFrame(fV1, "Incidence angle controls"); |
621 | fG1 = new TGGroupFrame(fV1, "Incidence angle controls"); |
620 | 622 | ||
621 | // Rotation positions |
623 | // Rotation positions |
622 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *rotPos -> Setting for rotation position\n"); |
624 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *rotPos -> Setting for rotation position\n"); |
623 | rotPos = new TSubStructure(); |
625 | rotPos = new TSubStructure(); |
624 | for(int i = 0; i < 6; i++) numform[i] = 0; |
626 | for(int i = 0; i < 6; i++) numform[i] = 0; |
625 | numform[0] = 7; numform[1] = 2; numform[3] = 2; numform[4] = -180.; numform[5] = 180.; |
627 | numform[0] = 7; numform[1] = 2; numform[3] = 2; numform[4] = -180.; numform[5] = 180.; |
626 | if(rotPos->TGLabelNEntry(fG1, 3*subgroup[0]/4, 30, "Incidence angle:", 0., numform, "center")) |
628 | if(rotPos->TGLabelNEntry(fG1, 3*subgroup[0]/4, 30, "Incidence angle:", 0., numform, "center")) |
627 | fG1->AddFrame(rotPos->outsidebox, f1expandXpad); |
629 | fG1->AddFrame(rotPos->outsidebox, f1expandXpad); |
628 | 630 | ||
629 | // Set, get, home and reset rotation buttons |
631 | // Set, get, home and reset rotation buttons |
630 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *rotButtons -> |
632 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *rotButtons -> 5 buttons (set rotation, read current rotation, home the motor, reset controller and emergency stop)\n"); |
631 | rotButtons = new TSubStructure(); |
633 | rotButtons = new TSubStructure(); |
632 | selnames[0] = "Set"; selnames[1] = "Get"; selnames[2] = "Home"; selnames[3] = "Reset"; |
634 | selnames[0] = "Set"; selnames[1] = "Get"; selnames[2] = "Home"; selnames[3] = "Reset"; selnames[4] = "Emergency stop"; |
633 | if(rotButtons->TGMultiButton(fG1, 3*subgroup[0]/4, 30, |
635 | if(rotButtons->TGMultiButton(fG1, 3*subgroup[0]/4, 30, 5, selnames, "center")) |
634 | fG1->AddFrame(rotButtons->outsidebox, f1expandXpad); |
636 | fG1->AddFrame(rotButtons->outsidebox, f1expandXpad); |
635 | 637 | ||
636 | // Rotation scan controls |
638 | // Rotation scan controls |
637 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *rotPosMin -> Number entry for starting angle\n"); |
639 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *rotPosMin -> Number entry for starting angle\n"); |
638 | rotPosMin = new TSubStructure(); |
640 | rotPosMin = new TSubStructure(); |
639 | if(rotPosMin->TGLabelNEntry(fG1, 3*subgroup[0]/4, 30, "Angle (min):", 0.0, numform, "center")) |
641 | if(rotPosMin->TGLabelNEntry(fG1, 3*subgroup[0]/4, 30, "Angle (min):", 0.0, numform, "center")) |
640 | fG1->AddFrame(rotPosMin->outsidebox, f1expandXpad); |
642 | fG1->AddFrame(rotPosMin->outsidebox, f1expandXpad); |
641 | 643 | ||
642 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *rotPosMax -> Number entry for finishing angle\n"); |
644 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *rotPosMax -> Number entry for finishing angle\n"); |
643 | rotPosMax = new TSubStructure(); |
645 | rotPosMax = new TSubStructure(); |
644 | if(rotPosMax->TGLabelNEntry(fG1, 3*subgroup[0]/4, 30, "Angle (max):", 0.0, numform, "center")) |
646 | if(rotPosMax->TGLabelNEntry(fG1, 3*subgroup[0]/4, 30, "Angle (max):", 0.0, numform, "center")) |
645 | fG1->AddFrame(rotPosMax->outsidebox, f1expandXpad); |
647 | fG1->AddFrame(rotPosMax->outsidebox, f1expandXpad); |
646 | 648 | ||
647 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *rotPosStep -> Number entry for angle step\n"); |
649 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *rotPosStep -> Number entry for angle step\n"); |
648 | rotPosStep = new TSubStructure(); |
650 | rotPosStep = new TSubStructure(); |
649 | for(int i = 0; i < 6; i++) numform[i] = 0; |
651 | for(int i = 0; i < 6; i++) numform[i] = 0; |
650 | numform[0] = 7; numform[1] = 1; |
652 | numform[0] = 7; numform[1] = 1; |
651 | if(rotPosStep->TGLabelNEntry(fG1, 3*subgroup[0]/4, 30, "Angle (step):", 0.0, numform, "center")) |
653 | if(rotPosStep->TGLabelNEntry(fG1, 3*subgroup[0]/4, 30, "Angle (step):", 0.0, numform, "center")) |
652 | fG1->AddFrame(rotPosStep->outsidebox, f1expandXpad); |
654 | fG1->AddFrame(rotPosStep->outsidebox, f1expandXpad); |
653 | 655 | ||
654 | fV1->AddFrame(fG1, f1expand2d); |
656 | fV1->AddFrame(fG1, f1expand2d); |
655 | // Right pane (Incidence angle controls) |
657 | // Right pane (Incidence angle controls) |
656 | fH1->AddFrame(fV1, f0leftX); |
658 | fH1->AddFrame(fV1, f0leftX); |
657 | 659 | ||
658 | fT1->AddFrame(fH1, f1expand2d); |
660 | fT1->AddFrame(fH1, f1expand2d); |
659 | 661 | ||
660 | // Waveform tab |
662 | // Waveform tab |
661 | //TODO |
663 | //TODO |
662 | measLayout[2]->AddFrame(setTab, f0leftX); |
664 | measLayout[2]->AddFrame(setTab, f0leftX); |
663 | 665 | ||
664 | // Bottom pane (File controls) |
666 | // Bottom pane (File controls) |
665 | subgroup[0] = measLayout[2]->GetWidth()-19; |
667 | subgroup[0] = measLayout[2]->GetWidth()-19; |
666 | subgroup[1] = (measLayout[2]->GetHeight())/4-4; |
668 | subgroup[1] = (measLayout[2]->GetHeight())/4-4; |
667 | fH1 = new TGCompositeFrame(measLayout[2], subgroup[0], subgroup[1], kFixedWidth | kFixedHeight | kHorizontalFrame); |
669 | fH1 = new TGCompositeFrame(measLayout[2], subgroup[0], subgroup[1], kFixedWidth | kFixedHeight | kHorizontalFrame); |
668 | fG1 = new TGGroupFrame(fH1, "Event/Data file controls"); |
670 | fG1 = new TGGroupFrame(fH1, "Event/Data file controls"); |
669 | 671 | ||
670 | // Number of events |
672 | // Number of events |
671 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *evtNum -> Number entry for set number of events to acquire\n"); |
673 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *evtNum -> Number entry for set number of events to acquire\n"); |
672 | evtNum = new TSubStructure(); |
674 | evtNum = new TSubStructure(); |
673 | for(int i = 0; i < 6; i++) numform[i] = 0; |
675 | for(int i = 0; i < 6; i++) numform[i] = 0; |
674 | numform[0] = 8; numform[2] = 1; |
676 | numform[0] = 8; numform[2] = 1; |
675 | if(evtNum->TGLabelNEntry(fG1, 3*subgroup[0]/4, 30, "Number of events:", 10000, numform, "left")) |
677 | if(evtNum->TGLabelNEntry(fG1, 3*subgroup[0]/4, 30, "Number of events:", 10000, numform, "left")) |
676 | fG1->AddFrame(evtNum->outsidebox, f0leftXpad); |
678 | fG1->AddFrame(evtNum->outsidebox, f0leftXpad); |
677 | 679 | ||
678 | // Time stamp display |
680 | // Time stamp display |
679 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *timeStamp -> Text entry for timestamp\n"); |
681 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *timeStamp -> Text entry for timestamp\n"); |
680 | timeStamp = new TSubStructure(); |
682 | timeStamp = new TSubStructure(); |
681 | if(timeStamp->TGLabelTEntry(fG1, 3*subgroup[0]/4, 30, "Time stamp:", "", "oneline")) |
683 | if(timeStamp->TGLabelTEntry(fG1, 3*subgroup[0]/4, 30, "Time stamp:", "", "oneline")) |
682 | { |
684 | { |
683 | timeStamp->widgetTE->SetState(kFALSE); |
685 | timeStamp->widgetTE->SetState(kFALSE); |
684 | fG1->AddFrame(timeStamp->outsidebox, f1expandXpad); |
686 | fG1->AddFrame(timeStamp->outsidebox, f1expandXpad); |
685 | } |
687 | } |
686 | 688 | ||
687 | // Save to file |
689 | // Save to file |
688 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *fileName -> Text entry for timestamp\n"); |
690 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *fileName -> Text entry for timestamp\n"); |
689 | fileName = new TSubStructure(); |
691 | fileName = new TSubStructure(); |
690 | char *cTemp; |
692 | char *cTemp; |
691 | cTemp = new char[256]; |
693 | cTemp = new char[256]; |
692 | sprintf(cTemp, "%s/results/test%s", rootdir, histext); |
694 | sprintf(cTemp, "%s/results/test%s", rootdir, histext); |
693 | if(fileName->TGLabelTEntryButton(fG1, 3*subgroup[0]/4, 30, "Save to file:", cTemp, "...", "oneline")) |
695 | if(fileName->TGLabelTEntryButton(fG1, 3*subgroup[0]/4, 30, "Save to file:", cTemp, "...", "oneline")) |
694 | { |
696 | { |
695 | fileName->widgetTE->SetState(kFALSE); |
697 | fileName->widgetTE->SetState(kFALSE); |
696 | fG1->AddFrame(fileName->outsidebox, f1expandXpad); |
698 | fG1->AddFrame(fileName->outsidebox, f1expandXpad); |
697 | } |
699 | } |
698 | 700 | ||
699 | fH1->AddFrame(fG1, new TGLayoutHints(kLHintsExpandX,8,2,2,2)); |
701 | fH1->AddFrame(fG1, new TGLayoutHints(kLHintsExpandX,8,2,2,2)); |
700 | // Bottom pane (File controls) |
702 | // Bottom pane (File controls) |
701 | measLayout[2]->AddFrame(fH1, f0leftX); |
703 | measLayout[2]->AddFrame(fH1, f0leftX); |
702 | 704 | ||
703 | // Start acquisition and progress bar |
705 | // Start acquisition and progress bar |
704 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *measProgress -> Button to start acquiring data and horizontal progress bar\n"); |
706 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *measProgress -> Button to start acquiring data and horizontal progress bar\n"); |
705 | measProgress = new TSubStructure(); |
707 | measProgress = new TSubStructure(); |
706 | if(measProgress->TGButtonProgressTEntry(measLayout[2], 3*subgroup[0]/4, 30, "Start acquisition", "Estimated end time: ")) |
708 | if(measProgress->TGButtonProgressTEntry(measLayout[2], 3*subgroup[0]/4, 30, "Start acquisition", "Estimated end time: ")) |
707 | { |
709 | { |
708 | measProgress->widgetTE->SetState(kFALSE); |
710 | measProgress->widgetTE->SetState(kFALSE); |
709 | measLayout[2]->AddFrame(measProgress->outsidebox, f1expandXpad); |
711 | measLayout[2]->AddFrame(measProgress->outsidebox, f1expandXpad); |
710 | } |
712 | } |
- | 713 | ||
- | 714 | Pixel_t pixel_color; |
|
- | 715 | gClient->GetColorByName("white", pixel_color); |
|
- | 716 | posButtons->widgetTB[4]->SetTextColor(pixel_color); |
|
- | 717 | rotButtons->widgetTB[4]->SetTextColor(pixel_color); |
|
- | 718 | gClient->GetColorByName("red", pixel_color); |
|
- | 719 | posButtons->widgetTB[4]->SetBackgroundColor(pixel_color); |
|
- | 720 | rotButtons->widgetTB[4]->SetBackgroundColor(pixel_color); |
|
711 | 721 | ||
712 | // Actions for Main window //TODO |
722 | // Actions for Main window //TODO |
713 | vOutOpt->widgetChBox[0]->Connect("Clicked()", "TGAppMainFrame", this, "NegativePolarity()"); |
723 | vOutOpt->widgetChBox[0]->Connect("Clicked()", "TGAppMainFrame", this, "NegativePolarity()"); |
714 | vOutButtons->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "VoltOut(=0)"); |
724 | vOutButtons->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "VoltOut(=0)"); |
715 | vOutButtons->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "VoltOut(=1)"); |
725 | vOutButtons->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "VoltOut(=1)"); |
716 | vOutButtons->widgetTB[2]->Connect("Clicked()", "TGAppMainFrame", this, "VoltOut(=2)"); |
726 | vOutButtons->widgetTB[2]->Connect("Clicked()", "TGAppMainFrame", this, "VoltOut(=2)"); |
717 | posButtons->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "PositionSet(=0)"); |
727 | posButtons->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "PositionSet(=0)"); |
718 | posButtons->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "PositionSet(=1)"); |
728 | posButtons->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "PositionSet(=1)"); |
719 | posButtons->widgetTB[2]->Connect("Clicked()", "TGAppMainFrame", this, "PositionSet(=2)"); |
729 | posButtons->widgetTB[2]->Connect("Clicked()", "TGAppMainFrame", this, "PositionSet(=2)"); |
720 | posButtons->widgetTB[3]->Connect("Clicked()", "TGAppMainFrame", this, "PositionSet(=3)"); |
730 | posButtons->widgetTB[3]->Connect("Clicked()", "TGAppMainFrame", this, "PositionSet(=3)"); |
- | 731 | posButtons->widgetTB[4]->Connect("Clicked()", "TGAppMainFrame", this, "PositionSet(=4)"); |
|
721 | rotButtons->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "RotationSet(=0)"); |
732 | rotButtons->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "RotationSet(=0)"); |
722 | rotButtons->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "RotationSet(=1)"); |
733 | rotButtons->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "RotationSet(=1)"); |
723 | rotButtons->widgetTB[2]->Connect("Clicked()", "TGAppMainFrame", this, "RotationSet(=2)"); |
734 | rotButtons->widgetTB[2]->Connect("Clicked()", "TGAppMainFrame", this, "RotationSet(=2)"); |
724 | rotButtons->widgetTB[3]->Connect("Clicked()", "TGAppMainFrame", this, "RotationSet(=3)"); |
735 | rotButtons->widgetTB[3]->Connect("Clicked()", "TGAppMainFrame", this, "RotationSet(=3)"); |
- | 736 | rotButtons->widgetTB[4]->Connect("Clicked()", "TGAppMainFrame", this, "RotationSet(=4)"); |
|
725 | fileName->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "SaveFile()"); |
737 | fileName->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "SaveFile()"); |
726 | measProgress->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "StartAcq()"); |
738 | measProgress->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "StartAcq()"); |
727 | // TODO - Save file |
739 | // TODO - Save file |
728 | 740 | ||
729 | // Main window ----------------------------------------------------------------------------- |
741 | // Main window ----------------------------------------------------------------------------- |
730 | 742 | ||
731 | // Display pane ---------------------------------------------------------------------------- |
743 | // Display pane ---------------------------------------------------------------------------- |
732 | measCanvas = new TRootEmbeddedCanvas("measCanvas",measLayout[1],300,300); |
744 | measCanvas = new TRootEmbeddedCanvas("measCanvas",measLayout[1],300,300); |
733 | measLayout[1]->AddFrame(measCanvas, f1expand2d); |
745 | measLayout[1]->AddFrame(measCanvas, f1expand2d); |
734 | // Display pane ---------------------------------------------------------------------------- |
746 | // Display pane ---------------------------------------------------------------------------- |
735 | 747 | ||
736 | // Histogram file selection pane ----------------------------------------------------------- |
748 | // Histogram file selection pane ----------------------------------------------------------- |
737 | subgroup[0] = (analysisLayout[0]->GetWidth())-4; |
749 | subgroup[0] = (analysisLayout[0]->GetWidth())-4; |
738 | 750 | ||
739 | // Open browser for file selection |
751 | // Open browser for file selection |
740 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *selectDir -> Button to open histogram files\n"); |
752 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *selectDir -> Button to open histogram files\n"); |
741 | selectDir = new TSubStructure(); |
753 | selectDir = new TSubStructure(); |
742 | if(selectDir->TGLabelButton(analysisLayout[0], 3*subgroup[0]/4, 30, "File selection:", "...", "left")) |
754 | if(selectDir->TGLabelButton(analysisLayout[0], 3*subgroup[0]/4, 30, "File selection:", "...", "left")) |
743 | analysisLayout[0]->AddFrame(selectDir->outsidebox, f0leftXpad); |
755 | analysisLayout[0]->AddFrame(selectDir->outsidebox, f0leftXpad); |
744 | 756 | ||
745 | // List view of the opened files |
757 | // List view of the opened files |
746 | if(DBGSIG > 1) printf("AppLayout(): Creating TGListBox *fileList -> List box for opened histograms\n"); |
758 | if(DBGSIG > 1) printf("AppLayout(): Creating TGListBox *fileList -> List box for opened histograms\n"); |
747 | fileList = new TGListBox(analysisLayout[0],1); |
759 | fileList = new TGListBox(analysisLayout[0],1); |
748 | fileList->GetVScrollbar(); |
760 | fileList->GetVScrollbar(); |
749 | fileList->Resize(300, (3*analysisLayout[0]->GetHeight()/7)-10 ); |
761 | fileList->Resize(300, (3*analysisLayout[0]->GetHeight()/7)-10 ); |
750 | analysisLayout[0]->AddFrame(fileList, f1expandXpad); |
762 | analysisLayout[0]->AddFrame(fileList, f1expandXpad); |
751 | 763 | ||
752 | fH1 = new TGCompositeFrame(analysisLayout[0], subgroup[0], 30, kHorizontalFrame); |
764 | fH1 = new TGCompositeFrame(analysisLayout[0], subgroup[0], 30, kHorizontalFrame); |
753 | // Multiple file selection toggle |
765 | // Multiple file selection toggle |
754 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *multiSelect -> 2 check buttons (enable multiple select, select everything)\n"); |
766 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *multiSelect -> 2 check buttons (enable multiple select, select everything)\n"); |
755 | multiSelect = new TSubStructure(); |
767 | multiSelect = new TSubStructure(); |
756 | checksel = new int[2]; |
768 | checksel = new int[2]; |
757 | checksel[0] = 0; checksel[1] = 0; |
769 | checksel[0] = 0; checksel[1] = 0; |
758 | selnames[0] = "Multiple file select"; selnames[1] = "Select all listed files"; |
770 | selnames[0] = "Multiple file select"; selnames[1] = "Select all listed files"; |
759 | if(multiSelect->TGCheckList(fH1, subgroup[0]/2, 30, 2, selnames, checksel, "horizontal", "left")) |
771 | if(multiSelect->TGCheckList(fH1, subgroup[0]/2, 30, 2, selnames, checksel, "horizontal", "left")) |
760 | fH1->AddFrame(multiSelect->outsidebox, f0leftX); |
772 | fH1->AddFrame(multiSelect->outsidebox, f0leftX); |
761 | delete[] checksel; |
773 | delete[] checksel; |
762 | 774 | ||
763 | // Previous/next controls, clear list and edit header |
775 | // Previous/next controls, clear list and edit header |
764 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *fileListCtrl -> Multiple buttons for controlling and displaying the histograms in list box\n"); |
776 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *fileListCtrl -> Multiple buttons for controlling and displaying the histograms in list box\n"); |
765 | fileListCtrl = new TSubStructure(); |
777 | fileListCtrl = new TSubStructure(); |
766 | selnames[0] = "<<"; selnames[1] = ">>"; selnames[2] = "Edit header"; selnames[3] = "Clear list"; |
778 | selnames[0] = "<<"; selnames[1] = ">>"; selnames[2] = "Edit header"; selnames[3] = "Clear list"; |
767 | if(fileListCtrl->TGMultiButton(fH1, subgroup[0]/3, 30, 4, selnames, "right")) |
779 | if(fileListCtrl->TGMultiButton(fH1, subgroup[0]/3, 30, 4, selnames, "right")) |
768 | fH1->AddFrame(fileListCtrl->outsidebox, f0rightX); |
780 | fH1->AddFrame(fileListCtrl->outsidebox, f0rightX); |
769 | 781 | ||
770 | analysisLayout[0]->AddFrame(fH1, f1expandXpad); |
782 | analysisLayout[0]->AddFrame(fH1, f1expandXpad); |
771 | 783 | ||
772 | // Header information of opened file |
784 | // Header information of opened file |
773 | fG1 = new TGGroupFrame(analysisLayout[0], "Opened file header information"); |
785 | fG1 = new TGGroupFrame(analysisLayout[0], "Opened file header information"); |
774 | 786 | ||
775 | fH1 = new TGHorizontalFrame(fG1, subgroup[0], 30); |
787 | fH1 = new TGHorizontalFrame(fG1, subgroup[0], 30); |
776 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *dispTime -> Display text Entry for opened histogram (time stamp)\n"); |
788 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *dispTime -> Display text Entry for opened histogram (time stamp)\n"); |
777 | dispTime = new TSubStructure(); |
789 | dispTime = new TSubStructure(); |
778 | if(dispTime->TGLabelTEntry(fH1, 3*subgroup[0]/4-24, 30, "Time:", "", "oneline")) |
790 | if(dispTime->TGLabelTEntry(fH1, 3*subgroup[0]/4-24, 30, "Time:", "", "oneline")) |
779 | fH1->AddFrame(dispTime->outsidebox, f0leftXnoleft); |
791 | fH1->AddFrame(dispTime->outsidebox, f0leftXnoleft); |
780 | dispTime->widgetTE->SetState(kFALSE); |
792 | dispTime->widgetTE->SetState(kFALSE); |
781 | 793 | ||
782 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *dispBias -> Number entry for opened histogram (bias voltage)\n"); |
794 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *dispBias -> Number entry for opened histogram (bias voltage)\n"); |
783 | dispBias = new TSubStructure(); |
795 | dispBias = new TSubStructure(); |
784 | for(int i = 0; i < 6; i++) numform[i] = 0; |
796 | for(int i = 0; i < 6; i++) numform[i] = 0; |
785 | numform[0] = 7; numform[1] = 2; |
797 | numform[0] = 7; numform[1] = 2; |
786 | if(dispBias->TGLabelNEntry(fH1, subgroup[0]/4-24, 30, "Bias voltage:", 0.00, numform, "center")) |
798 | if(dispBias->TGLabelNEntry(fH1, subgroup[0]/4-24, 30, "Bias voltage:", 0.00, numform, "center")) |
787 | fH1->AddFrame(dispBias->outsidebox, f0leftX); |
799 | fH1->AddFrame(dispBias->outsidebox, f0leftX); |
788 | dispBias->widgetNE[0]->SetState(kFALSE); |
800 | dispBias->widgetNE[0]->SetState(kFALSE); |
789 | fG1->AddFrame(fH1, f0leftXpad); |
801 | fG1->AddFrame(fH1, f0leftXpad); |
790 | 802 | ||
791 | fH1 = new TGHorizontalFrame(fG1, subgroup[0], 30); |
803 | fH1 = new TGHorizontalFrame(fG1, subgroup[0], 30); |
792 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *dispPos -> Display text Entry for opened histogram (table position)\n"); |
804 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *dispPos -> Display text Entry for opened histogram (table position)\n"); |
793 | dispPos = new TSubStructure(); |
805 | dispPos = new TSubStructure(); |
794 | if(dispPos->TGLabelTEntry(fH1, subgroup[0]/2-12, 30, "Position:", "", "oneline")) |
806 | if(dispPos->TGLabelTEntry(fH1, subgroup[0]/2-12, 30, "Position:", "", "oneline")) |
795 | fH1->AddFrame(dispPos->outsidebox, f0leftXnoleft); |
807 | fH1->AddFrame(dispPos->outsidebox, f0leftXnoleft); |
796 | dispPos->widgetTE->SetState(kFALSE); |
808 | dispPos->widgetTE->SetState(kFALSE); |
797 | 809 | ||
798 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *dispTemp -> Number entry for opened histogram (temperature)\n"); |
810 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *dispTemp -> Number entry for opened histogram (temperature)\n"); |
799 | dispTemp = new TSubStructure(); |
811 | dispTemp = new TSubStructure(); |
800 | for(int i = 0; i < 6; i++) numform[i] = 0; |
812 | for(int i = 0; i < 6; i++) numform[i] = 0; |
801 | numform[0] = 6; numform[1] = 1; |
813 | numform[0] = 6; numform[1] = 1; |
802 | if(dispTemp->TGLabelNEntry(fH1, subgroup[0]/4-18, 30, "Temperature:", 0.0, numform, "center")) |
814 | if(dispTemp->TGLabelNEntry(fH1, subgroup[0]/4-18, 30, "Temperature:", 0.0, numform, "center")) |
803 | fH1->AddFrame(dispTemp->outsidebox, f0leftX); |
815 | fH1->AddFrame(dispTemp->outsidebox, f0leftX); |
804 | dispTemp->widgetNE[0]->SetState(kFALSE); |
816 | dispTemp->widgetNE[0]->SetState(kFALSE); |
805 | 817 | ||
806 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *dispAngle -> Number entry for opened histogram (incidence angle)\n"); |
818 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *dispAngle -> Number entry for opened histogram (incidence angle)\n"); |
807 | dispAngle = new TSubStructure(); |
819 | dispAngle = new TSubStructure(); |
808 | for(int i = 0; i < 6; i++) numform[i] = 0; |
820 | for(int i = 0; i < 6; i++) numform[i] = 0; |
809 | numform[0] = 7; numform[1] = 2; |
821 | numform[0] = 7; numform[1] = 2; |
810 | if(dispAngle->TGLabelNEntry(fH1, subgroup[0]/4-18, 30, "Angle:", 0.00, numform, "center")) |
822 | if(dispAngle->TGLabelNEntry(fH1, subgroup[0]/4-18, 30, "Angle:", 0.00, numform, "center")) |
811 | fH1->AddFrame(dispAngle->outsidebox, f0leftX); |
823 | fH1->AddFrame(dispAngle->outsidebox, f0leftX); |
812 | dispAngle->widgetNE[0]->SetState(kFALSE); |
824 | dispAngle->widgetNE[0]->SetState(kFALSE); |
813 | fG1->AddFrame(fH1, f0leftXpad); |
825 | fG1->AddFrame(fH1, f0leftXpad); |
814 | 826 | ||
815 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *dispLaser -> Display text Entry for opened histogram (laser and additional info)\n"); |
827 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *dispLaser -> Display text Entry for opened histogram (laser and additional info)\n"); |
816 | dispLaser = new TSubStructure(); |
828 | dispLaser = new TSubStructure(); |
817 | if(dispLaser->TGLabelTEntry(fG1, 3*subgroup[0]/4, 30, "Laser settings:", "", "oneline")) |
829 | if(dispLaser->TGLabelTEntry(fG1, 3*subgroup[0]/4, 30, "Laser settings:", "", "oneline")) |
818 | fG1->AddFrame(dispLaser->outsidebox, f1expandXpad); |
830 | fG1->AddFrame(dispLaser->outsidebox, f1expandXpad); |
819 | dispLaser->widgetTE->SetState(kFALSE); |
831 | dispLaser->widgetTE->SetState(kFALSE); |
820 | 832 | ||
821 | analysisLayout[0]->AddFrame(fG1, f1expandX); |
833 | analysisLayout[0]->AddFrame(fG1, f1expandX); |
822 | 834 | ||
823 | // Actions for histogram file selection pane |
835 | // Actions for histogram file selection pane |
824 | selectDir->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "SelectDirectory()"); |
836 | selectDir->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "SelectDirectory()"); |
825 | multiSelect->widgetChBox[0]->Connect("Clicked()", "TGAppMainFrame", this, "ListMultiSelect(=0)"); |
837 | multiSelect->widgetChBox[0]->Connect("Clicked()", "TGAppMainFrame", this, "ListMultiSelect(=0)"); |
826 | multiSelect->widgetChBox[1]->Connect("Clicked()", "TGAppMainFrame", this, "ListMultiSelect(=1)"); |
838 | multiSelect->widgetChBox[1]->Connect("Clicked()", "TGAppMainFrame", this, "ListMultiSelect(=1)"); |
827 | fileList->Connect("DoubleClicked(Int_t)", "TGAppMainFrame", this, "FileListNavigation(Int_t)"); |
839 | fileList->Connect("DoubleClicked(Int_t)", "TGAppMainFrame", this, "FileListNavigation(Int_t)"); |
828 | fileListCtrl->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "FileListNavigation(=-2)"); |
840 | fileListCtrl->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "FileListNavigation(=-2)"); |
829 | fileListCtrl->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "FileListNavigation(=-3)"); |
841 | fileListCtrl->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "FileListNavigation(=-3)"); |
830 | fileListCtrl->widgetTB[2]->Connect("Clicked()", "TGAppMainFrame", this, "HeaderEdit()"); |
842 | fileListCtrl->widgetTB[2]->Connect("Clicked()", "TGAppMainFrame", this, "HeaderEdit()"); |
831 | fileListCtrl->widgetTB[3]->Connect("Clicked()", "TGAppMainFrame", this, "ClearHistogramList()"); |
843 | fileListCtrl->widgetTB[3]->Connect("Clicked()", "TGAppMainFrame", this, "ClearHistogramList()"); |
832 | 844 | ||
833 | // Histogram file selection pane ----------------------------------------------------------- |
845 | // Histogram file selection pane ----------------------------------------------------------- |
834 | 846 | ||
835 | // Analysis pane --------------------------------------------------------------------------- |
847 | // Analysis pane --------------------------------------------------------------------------- |
836 | fH1 = new TGCompositeFrame(analysisLayout[1], analysisLayout[1]->GetWidth(), 30, kHorizontalFrame); |
848 | fH1 = new TGCompositeFrame(analysisLayout[1], analysisLayout[1]->GetWidth(), 30, kHorizontalFrame); |
837 | 849 | ||
838 | subgroup[0] = (analysisLayout[1]->GetWidth())/2-4; |
850 | subgroup[0] = (analysisLayout[1]->GetWidth())/2-4; |
839 | subgroup[1] = (analysisLayout[1]->GetHeight())-4; |
851 | subgroup[1] = (analysisLayout[1]->GetHeight())-4; |
840 | 852 | ||
841 | analTab = new TGTab(fH1, subgroup[0], subgroup[1]); |
853 | analTab = new TGTab(fH1, subgroup[0], subgroup[1]); |
842 | 854 | ||
843 | // Analysis tabs |
855 | // Analysis tabs |
844 | // Integrate spectrum tab |
856 | // Integrate spectrum tab |
845 | fT1 = analTab->AddTab("Integ. spectrum"); |
857 | fT1 = analTab->AddTab("Integ. spectrum"); |
846 | fV1 = new TGCompositeFrame(fT1, subgroup[0], subgroup[1], kVerticalFrame | kFixedWidth | kFixedHeight); |
858 | fV1 = new TGCompositeFrame(fT1, subgroup[0], subgroup[1], kVerticalFrame | kFixedWidth | kFixedHeight); |
847 | 859 | ||
848 | // Check buttons to toggle direction of integration and normalization |
860 | // Check buttons to toggle direction of integration and normalization |
849 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *intSpect -> 3 check buttons (direction of integration, normalization)\n"); |
861 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *intSpect -> 3 check buttons (direction of integration, normalization)\n"); |
850 | intSpect = new TSubStructure(); |
862 | intSpect = new TSubStructure(); |
851 | checksel = new int[3]; |
863 | checksel = new int[3]; |
852 | checksel[0] = 0; checksel[1] = 0; checksel[2] = 1; |
864 | checksel[0] = 0; checksel[1] = 0; checksel[2] = 1; |
853 | selnames[0] = "X direction (for edge scans)"; |
865 | selnames[0] = "X direction (for edge scans)"; |
854 | selnames[1] = "Y direction (for edge scans)"; |
866 | selnames[1] = "Y direction (for edge scans)"; |
855 | selnames[2] = "Normalize to number of events"; |
867 | selnames[2] = "Normalize to number of events"; |
856 | if(intSpect->TGCheckList(fV1, subgroup[0], 30, 3, selnames, checksel, "vertical", "center")) |
868 | if(intSpect->TGCheckList(fV1, subgroup[0], 30, 3, selnames, checksel, "vertical", "center")) |
857 | fV1->AddFrame(intSpect->outsidebox, f1expandXpad); |
869 | fV1->AddFrame(intSpect->outsidebox, f1expandXpad); |
858 | delete[] checksel; |
870 | delete[] checksel; |
859 | 871 | ||
860 | // Values for 2D plot pixel resolution |
872 | // Values for 2D plot pixel resolution |
861 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *resol2d -> Pixel resolution for 2D plots\n"); |
873 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *resol2d -> Pixel resolution for 2D plots\n"); |
862 | resol2d = new TSubStructure(); |
874 | resol2d = new TSubStructure(); |
863 | for(int i = 0; i < 6; i++) { numform[i] = 0; numform2[i] = 0; } |
875 | for(int i = 0; i < 6; i++) { numform[i] = 0; numform2[i] = 0; } |
864 | numform[0] = 5; numform2[0] = 5; numform[2] = 2; numform2[2] = 2; |
876 | numform[0] = 5; numform2[0] = 5; numform[2] = 2; numform2[2] = 2; |
865 | if(resol2d->TGLabelDoubleNEntry(fV1, subgroup[0], 30, "2D plot pixel resolution (X, Y):", 40, numform, 40, numform2, "center")) |
877 | if(resol2d->TGLabelDoubleNEntry(fV1, subgroup[0], 30, "2D plot pixel resolution (X, Y):", 40, numform, 40, numform2, "center")) |
866 | fV1->AddFrame(resol2d->outsidebox, f1expandX); |
878 | fV1->AddFrame(resol2d->outsidebox, f1expandX); |
867 | 879 | ||
868 | // Start integrating or set its defaults |
880 | // Start integrating or set its defaults |
869 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *intSpectButtons -> 2 buttons for integrating spectra\n"); |
881 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *intSpectButtons -> 2 buttons for integrating spectra\n"); |
870 | intSpectButtons = new TSubStructure(); |
882 | intSpectButtons = new TSubStructure(); |
871 | selnames[0] = "Start"; selnames[1] = "Start and edit"; selnames[2] = "Default values"; |
883 | selnames[0] = "Start"; selnames[1] = "Start and edit"; selnames[2] = "Default values"; |
872 | if(intSpectButtons->TGMultiButton(fV1, subgroup[0], 30, 3, selnames, "center")) |
884 | if(intSpectButtons->TGMultiButton(fV1, subgroup[0], 30, 3, selnames, "center")) |
873 | fV1->AddFrame(intSpectButtons->outsidebox, f1expandX); |
885 | fV1->AddFrame(intSpectButtons->outsidebox, f1expandX); |
874 | 886 | ||
875 | fT1->AddFrame(fV1, f1expandX); |
887 | fT1->AddFrame(fV1, f1expandX); |
876 | 888 | ||
877 | // Relative photon detection efficiency tab (PDE) |
889 | // Relative photon detection efficiency tab (PDE) |
878 | fT1 = analTab->AddTab("Relative PDE"); |
890 | fT1 = analTab->AddTab("Relative PDE"); |
879 | fV1 = new TGCompositeFrame(fT1, subgroup[0], subgroup[1], kVerticalFrame | kFixedWidth | kFixedHeight); |
891 | fV1 = new TGCompositeFrame(fT1, subgroup[0], subgroup[1], kVerticalFrame | kFixedWidth | kFixedHeight); |
880 | 892 | ||
881 | // Check button to toggle normalization |
893 | // Check button to toggle normalization |
882 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *relPde -> 2 check buttons (relative pde, normalization)\n"); |
894 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *relPde -> 2 check buttons (relative pde, normalization)\n"); |
883 | relPde = new TSubStructure(); |
895 | relPde = new TSubStructure(); |
884 | checksel = new int; |
896 | checksel = new int; |
885 | *checksel = 1; |
897 | *checksel = 1; |
886 | selnames[0] = "Normalize to number of events"; |
898 | selnames[0] = "Normalize to number of events"; |
887 | if(relPde->TGCheckList(fV1, subgroup[0], 30, 1, selnames, checksel, "vertical", "center")) |
899 | if(relPde->TGCheckList(fV1, subgroup[0], 30, 1, selnames, checksel, "vertical", "center")) |
888 | fV1->AddFrame(relPde->outsidebox, f1expandXpad); |
900 | fV1->AddFrame(relPde->outsidebox, f1expandXpad); |
889 | delete[] checksel; |
901 | delete[] checksel; |
890 | 902 | ||
891 | // Calculate relative PDE using the middle of the pedestal peak |
903 | // Calculate relative PDE using the middle of the pedestal peak |
892 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *midPeak -> Calculate the relative PDE, by setting the middle of the pedestal peak.\n"); |
904 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *midPeak -> Calculate the relative PDE, by setting the middle of the pedestal peak.\n"); |
893 | midPeak = new TSubStructure(); |
905 | midPeak = new TSubStructure(); |
894 | checksel = new int; |
906 | checksel = new int; |
895 | *checksel = 0; |
907 | *checksel = 0; |
896 | selnames[0] = "Pedestal entries end at middle of ped. peak"; |
908 | selnames[0] = "Pedestal entries end at middle of ped. peak"; |
897 | if(midPeak->TGCheckList(fV1, subgroup[0], 30, 1, selnames, checksel, "vertical", "center")) |
909 | if(midPeak->TGCheckList(fV1, subgroup[0], 30, 1, selnames, checksel, "vertical", "center")) |
898 | fV1->AddFrame(midPeak->outsidebox, f1expandX); |
910 | fV1->AddFrame(midPeak->outsidebox, f1expandX); |
899 | delete checksel; |
911 | delete checksel; |
900 | 912 | ||
901 | // Select the dark run |
913 | // Select the dark run |
902 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *darkRun -> Button to open histogram files of a dark run\n"); |
914 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *darkRun -> Button to open histogram files of a dark run\n"); |
903 | darkRun = new TSubStructure(); |
915 | darkRun = new TSubStructure(); |
904 | if(darkRun->TGLabelTEntryButton(fV1, 3*subgroup[0]/4, 30, "Select dark run histogram:", "", "...", "oneline")) |
916 | if(darkRun->TGLabelTEntryButton(fV1, 3*subgroup[0]/4, 30, "Select dark run histogram:", "", "...", "oneline")) |
905 | { |
917 | { |
906 | darkRun->widgetTE->SetState(kFALSE); |
918 | darkRun->widgetTE->SetState(kFALSE); |
907 | fV1->AddFrame(darkRun->outsidebox, f1expandXpad); |
919 | fV1->AddFrame(darkRun->outsidebox, f1expandXpad); |
908 | } |
920 | } |
909 | 921 | ||
910 | // Select the offset of 0 angle |
922 | // Select the offset of 0 angle |
911 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *zeroAngle -> Set the offset for 0 angle\n"); |
923 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *zeroAngle -> Set the offset for 0 angle\n"); |
912 | zeroAngle = new TSubStructure(); |
924 | zeroAngle = new TSubStructure(); |
913 | for(int i = 0; i < 6; i++) numform[i] = 0; |
925 | for(int i = 0; i < 6; i++) numform[i] = 0; |
914 | numform[0] = 6; numform[1] = 2; |
926 | numform[0] = 6; numform[1] = 2; |
915 | if(zeroAngle->TGLabelNEntry(fV1, 3*subgroup[0]/4, 30, "Offset to zero angle:", 0., numform, "center")) |
927 | if(zeroAngle->TGLabelNEntry(fV1, 3*subgroup[0]/4, 30, "Offset to zero angle:", 0., numform, "center")) |
916 | fV1->AddFrame(zeroAngle->outsidebox, f0centerX); |
928 | fV1->AddFrame(zeroAngle->outsidebox, f0centerX); |
917 | 929 | ||
918 | // Start calculating the PDE or set its defaults |
930 | // Start calculating the PDE or set its defaults |
919 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *relPdeButtons -> 2 buttons for calculating the relative PDE\n"); |
931 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *relPdeButtons -> 2 buttons for calculating the relative PDE\n"); |
920 | relPdeButtons = new TSubStructure(); |
932 | relPdeButtons = new TSubStructure(); |
921 | selnames[0] = "Start"; selnames[1] = "Start and edit"; selnames[2] = "Default values"; |
933 | selnames[0] = "Start"; selnames[1] = "Start and edit"; selnames[2] = "Default values"; |
922 | if(relPdeButtons->TGMultiButton(fV1, subgroup[0], 30, 3, selnames, "center")) |
934 | if(relPdeButtons->TGMultiButton(fV1, subgroup[0], 30, 3, selnames, "center")) |
923 | fV1->AddFrame(relPdeButtons->outsidebox, f1expandX); |
935 | fV1->AddFrame(relPdeButtons->outsidebox, f1expandX); |
924 | 936 | ||
925 | fT1->AddFrame(fV1, f1expandX); |
937 | fT1->AddFrame(fV1, f1expandX); |
926 | 938 | ||
927 | // Breaktown voltage tab |
939 | // Breaktown voltage tab |
928 | fT1 = analTab->AddTab("Breakdown voltage"); |
940 | fT1 = analTab->AddTab("Breakdown voltage"); |
929 | fV1 = new TGCompositeFrame(fT1, subgroup[0], subgroup[1], kVerticalFrame | kFixedWidth | kFixedHeight); |
941 | fV1 = new TGCompositeFrame(fT1, subgroup[0], subgroup[1], kVerticalFrame | kFixedWidth | kFixedHeight); |
930 | 942 | ||
931 | // Select the minumum number of peaks for fitting to be initiated |
943 | // Select the minumum number of peaks for fitting to be initiated |
932 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *minPeak -> Minimum number of peaks to fit for peak fitting\n"); |
944 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *minPeak -> Minimum number of peaks to fit for peak fitting\n"); |
933 | minPeak = new TSubStructure(); |
945 | minPeak = new TSubStructure(); |
934 | for(int i = 0; i < 6; i++) numform[i] = 0; |
946 | for(int i = 0; i < 6; i++) numform[i] = 0; |
935 | numform[0] = 4; numform[2] = 1; numform[3] = 2; numform[4] = 1; numform[5] = 20; |
947 | numform[0] = 4; numform[2] = 1; numform[3] = 2; numform[4] = 1; numform[5] = 20; |
936 | if(minPeak->TGLabelNEntry(fV1, subgroup[0], 30, "Min. nr. of peaks:", 2, numform, "center")) |
948 | if(minPeak->TGLabelNEntry(fV1, subgroup[0], 30, "Min. nr. of peaks:", 2, numform, "center")) |
937 | fV1->AddFrame(minPeak->outsidebox, f0centerX); |
949 | fV1->AddFrame(minPeak->outsidebox, f0centerX); |
938 | 950 | ||
939 | // Select which separation to use |
951 | // Select which separation to use |
940 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *peakSepCalc -> Make the separation between the selected peaks\n"); |
952 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *peakSepCalc -> Make the separation between the selected peaks\n"); |
941 | peakSepCalc = new TSubStructure(); |
953 | peakSepCalc = new TSubStructure(); |
942 | for(int i = 0; i < 6; i++) numform[i] = 0; |
954 | for(int i = 0; i < 6; i++) numform[i] = 0; |
943 | numform[0] = 4; numform[2] = 1; numform[3] = 2; numform[4] = 1; numform[5] = 3; |
955 | numform[0] = 4; numform[2] = 1; numform[3] = 2; numform[4] = 1; numform[5] = 3; |
944 | if(peakSepCalc->TGLabelNEntry(fV1, subgroup[0], 30, "Calculate peak separation between N pe and N+1 pe peaks:", 1, numform, "center")) |
956 | if(peakSepCalc->TGLabelNEntry(fV1, subgroup[0], 30, "Calculate peak separation between N pe and N+1 pe peaks:", 1, numform, "center")) |
945 | fV1->AddFrame(peakSepCalc->outsidebox, f0centerX); |
957 | fV1->AddFrame(peakSepCalc->outsidebox, f0centerX); |
946 | 958 | ||
947 | // Start calculating the breakdown voltage or set its defaults |
959 | // Start calculating the breakdown voltage or set its defaults |
948 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *brDownButtons -> 2 buttons for calculating the breakdown voltage\n"); |
960 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *brDownButtons -> 2 buttons for calculating the breakdown voltage\n"); |
949 | brDownButtons = new TSubStructure(); |
961 | brDownButtons = new TSubStructure(); |
950 | selnames[0] = "Start"; selnames[1] = "Start and edit"; selnames[2] = "Default values"; |
962 | selnames[0] = "Start"; selnames[1] = "Start and edit"; selnames[2] = "Default values"; |
951 | if(brDownButtons->TGMultiButton(fV1, subgroup[0], 30, 3, selnames, "center")) |
963 | if(brDownButtons->TGMultiButton(fV1, subgroup[0], 30, 3, selnames, "center")) |
952 | fV1->AddFrame(brDownButtons->outsidebox, f1expandX); |
964 | fV1->AddFrame(brDownButtons->outsidebox, f1expandX); |
953 | 965 | ||
954 | fT1->AddFrame(fV1, f1expandX); |
966 | fT1->AddFrame(fV1, f1expandX); |
955 | 967 | ||
956 | // Surface scan tab |
968 | // Surface scan tab |
957 | fT1 = analTab->AddTab("Surface scan"); |
969 | fT1 = analTab->AddTab("Surface scan"); |
958 | fV1 = new TGCompositeFrame(fT1, subgroup[0], subgroup[1], kVerticalFrame | kFixedWidth | kFixedHeight); |
970 | fV1 = new TGCompositeFrame(fT1, subgroup[0], subgroup[1], kVerticalFrame | kFixedWidth | kFixedHeight); |
959 | 971 | ||
960 | // Check button to toggle normalization |
972 | // Check button to toggle normalization |
961 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *surfScanOpt -> 2 check buttons (normalization, zero bottom-left corner)\n"); |
973 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *surfScanOpt -> 2 check buttons (normalization, zero bottom-left corner)\n"); |
962 | surfScanOpt = new TSubStructure(); |
974 | surfScanOpt = new TSubStructure(); |
963 | checksel = new int[2]; |
975 | checksel = new int[2]; |
964 | checksel[0] = 1; checksel[1] = 0; |
976 | checksel[0] = 1; checksel[1] = 0; |
965 | selnames[0] = "Normalize to number of events"; selnames[1] = "Zero the bottom left corner"; |
977 | selnames[0] = "Normalize to number of events"; selnames[1] = "Zero the bottom left corner"; |
966 | if(surfScanOpt->TGCheckList(fV1, subgroup[0], 30, 2, selnames, checksel, "vertical", "center")) |
978 | if(surfScanOpt->TGCheckList(fV1, subgroup[0], 30, 2, selnames, checksel, "vertical", "center")) |
967 | fV1->AddFrame(surfScanOpt->outsidebox, f1expandXpad); |
979 | fV1->AddFrame(surfScanOpt->outsidebox, f1expandXpad); |
968 | delete[] checksel; |
980 | delete[] checksel; |
969 | 981 | ||
970 | // Values for 2D plot pixel resolution |
982 | // Values for 2D plot pixel resolution |
971 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *resolSurf -> Pixel resolution for surface plots\n"); |
983 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *resolSurf -> Pixel resolution for surface plots\n"); |
972 | resolSurf = new TSubStructure(); |
984 | resolSurf = new TSubStructure(); |
973 | for(int i = 0; i < 6; i++) { numform[i] = 0; numform2[i] = 0; } |
985 | for(int i = 0; i < 6; i++) { numform[i] = 0; numform2[i] = 0; } |
974 | numform[0] = 5; numform2[0] = 5; numform[2] = 2; numform2[2] = 2; |
986 | numform[0] = 5; numform2[0] = 5; numform[2] = 2; numform2[2] = 2; |
975 | if(resolSurf->TGLabelDoubleNEntry(fV1, subgroup[0], 30, "Surface plot pixel resolution (X, Y):", 40, numform, 40, numform2, "center")) |
987 | if(resolSurf->TGLabelDoubleNEntry(fV1, subgroup[0], 30, "Surface plot pixel resolution (X, Y):", 40, numform, 40, numform2, "center")) |
976 | fV1->AddFrame(resolSurf->outsidebox, f1expandX); |
988 | fV1->AddFrame(resolSurf->outsidebox, f1expandX); |
977 | 989 | ||
978 | // Start calculating the breakdown voltage or set its defaults |
990 | // Start calculating the breakdown voltage or set its defaults |
979 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *surfButtons -> 2 buttons for calculating the surface scan\n"); |
991 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *surfButtons -> 2 buttons for calculating the surface scan\n"); |
980 | surfButtons = new TSubStructure(); |
992 | surfButtons = new TSubStructure(); |
981 | selnames[0] = "Start"; selnames[1] = "Start and edit"; selnames[2] = "Default values"; |
993 | selnames[0] = "Start"; selnames[1] = "Start and edit"; selnames[2] = "Default values"; |
982 | if(surfButtons->TGMultiButton(fV1, subgroup[0], 30, 3, selnames, "center")) |
994 | if(surfButtons->TGMultiButton(fV1, subgroup[0], 30, 3, selnames, "center")) |
983 | fV1->AddFrame(surfButtons->outsidebox, f1expandX); |
995 | fV1->AddFrame(surfButtons->outsidebox, f1expandX); |
984 | 996 | ||
985 | fT1->AddFrame(fV1, f1expandX); |
997 | fT1->AddFrame(fV1, f1expandX); |
986 | 998 | ||
987 | // Timing tab |
999 | // Timing tab |
988 | fT1 = analTab->AddTab("Timing"); |
1000 | fT1 = analTab->AddTab("Timing"); |
989 | fV1 = new TGCompositeFrame(fT1, subgroup[0], subgroup[1], kVerticalFrame | kFixedWidth | kFixedHeight); |
1001 | fV1 = new TGCompositeFrame(fT1, subgroup[0], subgroup[1], kVerticalFrame | kFixedWidth | kFixedHeight); |
990 | 1002 | ||
991 | fT1->AddFrame(fV1, f1expandX); |
1003 | fT1->AddFrame(fV1, f1expandX); |
992 | 1004 | ||
993 | // Analysis tabs |
1005 | // Analysis tabs |
994 | fH1->AddFrame(analTab, /*f1expandX*/f0leftX); |
1006 | fH1->AddFrame(analTab, /*f1expandX*/f0leftX); |
995 | 1007 | ||
996 | // Peak fitting settings |
1008 | // Peak fitting settings |
997 | fV1 = new TGCompositeFrame(fH1, subgroup[0], 30, kVerticalFrame); |
1009 | fV1 = new TGCompositeFrame(fH1, subgroup[0], 30, kVerticalFrame); |
998 | 1010 | ||
999 | fH2 = new TGCompositeFrame(fV1, subgroup[0], 30, kHorizontalFrame); |
1011 | fH2 = new TGCompositeFrame(fV1, subgroup[0], 30, kHorizontalFrame); |
1000 | // Select the sigma for peak fitting |
1012 | // Select the sigma for peak fitting |
1001 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *fitSigma -> Sigma for peak fitting\n"); |
1013 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *fitSigma -> Sigma for peak fitting\n"); |
1002 | fitSigma = new TSubStructure(); |
1014 | fitSigma = new TSubStructure(); |
1003 | for(int i = 0; i < 6; i++) numform[i] = 0; |
1015 | for(int i = 0; i < 6; i++) numform[i] = 0; |
1004 | numform[0] = 6; numform[1] = 3; numform[2] = 2; |
1016 | numform[0] = 6; numform[1] = 3; numform[2] = 2; |
1005 | if(fitSigma->TGLabelNEntry(fH2, subgroup[0]/2, 30, "Peak sigma:", 1.2, numform, "center")) |
1017 | if(fitSigma->TGLabelNEntry(fH2, subgroup[0]/2, 30, "Peak sigma:", 1.2, numform, "center")) |
1006 | fH2->AddFrame(fitSigma->outsidebox, f0centerX); |
1018 | fH2->AddFrame(fitSigma->outsidebox, f0centerX); |
1007 | // Select the signal to noise treshold for peak fitting |
1019 | // Select the signal to noise treshold for peak fitting |
1008 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *fitTresh -> S/N ratio for peak fitting\n"); |
1020 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *fitTresh -> S/N ratio for peak fitting\n"); |
1009 | fitTresh = new TSubStructure(); |
1021 | fitTresh = new TSubStructure(); |
1010 | for(int i = 0; i < 6; i++) numform[i] = 0; |
1022 | for(int i = 0; i < 6; i++) numform[i] = 0; |
1011 | numform[0] = 6; numform[1] = 3; numform[2] = 2; |
1023 | numform[0] = 6; numform[1] = 3; numform[2] = 2; |
1012 | if(fitTresh->TGLabelNEntry(fH2, subgroup[0]/2, 30, "S/N ratio:", 0.005, numform, "center")) |
1024 | if(fitTresh->TGLabelNEntry(fH2, subgroup[0]/2, 30, "S/N ratio:", 0.005, numform, "center")) |
1013 | fH2->AddFrame(fitTresh->outsidebox, f0centerX); |
1025 | fH2->AddFrame(fitTresh->outsidebox, f0centerX); |
1014 | fV1->AddFrame(fH2, f1expandXpad); |
1026 | fV1->AddFrame(fH2, f1expandXpad); |
1015 | 1027 | ||
1016 | // Select the background interpolation for peak fitting |
1028 | // Select the background interpolation for peak fitting |
1017 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *fitInter -> Background interpolation for peak fitting\n"); |
1029 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *fitInter -> Background interpolation for peak fitting\n"); |
1018 | fitInter = new TSubStructure(); |
1030 | fitInter = new TSubStructure(); |
1019 | for(int i = 0; i < 6; i++) numform[i] = 0; |
1031 | for(int i = 0; i < 6; i++) numform[i] = 0; |
1020 | numform[0] = 5; numform[2] = 1; |
1032 | numform[0] = 5; numform[2] = 1; |
1021 | if(fitInter->TGLabelNEntry(fV1, subgroup[0], 30, "Back. interpolation:", 7, numform, "center")) |
1033 | if(fitInter->TGLabelNEntry(fV1, subgroup[0], 30, "Back. interpolation:", 7, numform, "center")) |
1022 | fV1->AddFrame(fitInter->outsidebox, f0centerX); |
1034 | fV1->AddFrame(fitInter->outsidebox, f0centerX); |
1023 | 1035 | ||
1024 | // Select the ADC offset |
1036 | // Select the ADC offset |
1025 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *adcOffset -> Select the offset for all ADC spectra\n"); |
1037 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *adcOffset -> Select the offset for all ADC spectra\n"); |
1026 | adcOffset = new TSubStructure(); |
1038 | adcOffset = new TSubStructure(); |
1027 | for(int i = 0; i < 6; i++) numform[i] = 0; |
1039 | for(int i = 0; i < 6; i++) numform[i] = 0; |
1028 | numform[0] = 6; numform[1] = 2; |
1040 | numform[0] = 6; numform[1] = 2; |
1029 | if(adcOffset->TGLabelNEntry(fV1, subgroup[0], 30, "ADC spectrum offset:", 0.00, numform, "center")) |
1041 | if(adcOffset->TGLabelNEntry(fV1, subgroup[0], 30, "ADC spectrum offset:", 0.00, numform, "center")) |
1030 | fV1->AddFrame(adcOffset->outsidebox, f0centerX); |
1042 | fV1->AddFrame(adcOffset->outsidebox, f0centerX); |
1031 | 1043 | ||
1032 | // Select the acceptable error for peak fitting |
1044 | // Select the acceptable error for peak fitting |
1033 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *accError -> Acceptable peak fitting error for peak fitting\n"); |
1045 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *accError -> Acceptable peak fitting error for peak fitting\n"); |
1034 | accError = new TSubStructure(); |
1046 | accError = new TSubStructure(); |
1035 | for(int i = 0; i < 6; i++) numform[i] = 0; |
1047 | for(int i = 0; i < 6; i++) numform[i] = 0; |
1036 | numform[0] = 6; numform[1] = 2; numform[2] = 1; |
1048 | numform[0] = 6; numform[1] = 2; numform[2] = 1; |
1037 | if(accError->TGLabelNEntry(fV1, subgroup[0], 30, "Max. peak fit error:", 0.15, numform, "center")) |
1049 | if(accError->TGLabelNEntry(fV1, subgroup[0], 30, "Max. peak fit error:", 0.15, numform, "center")) |
1038 | fV1->AddFrame(accError->outsidebox, f0centerX); |
1050 | fV1->AddFrame(accError->outsidebox, f0centerX); |
1039 | 1051 | ||
1040 | // Select the pedestal lower limit for peak fitting |
1052 | // Select the pedestal lower limit for peak fitting |
1041 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *pedesLow -> Lower ADC limit of pedestal peak for peak fitting\n"); |
1053 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *pedesLow -> Lower ADC limit of pedestal peak for peak fitting\n"); |
1042 | pedesLow = new TSubStructure(); |
1054 | pedesLow = new TSubStructure(); |
1043 | for(int i = 0; i < 6; i++) numform[i] = 0; |
1055 | for(int i = 0; i < 6; i++) numform[i] = 0; |
1044 | numform[0] = 6; numform[1] = 1; numform[2] = 2; |
1056 | numform[0] = 6; numform[1] = 1; numform[2] = 2; |
1045 | if(pedesLow->TGLabelNEntry(fV1, subgroup[0], 30, "Pedestal low limit:", 0.0, numform, "center")) |
1057 | if(pedesLow->TGLabelNEntry(fV1, subgroup[0], 30, "Pedestal low limit:", 0.0, numform, "center")) |
1046 | fV1->AddFrame(pedesLow->outsidebox, f0centerX); |
1058 | fV1->AddFrame(pedesLow->outsidebox, f0centerX); |
1047 | 1059 | ||
1048 | // Check buttons to toggle subtracting the background and exporting the fitted spectra |
1060 | // Check buttons to toggle subtracting the background and exporting the fitted spectra |
1049 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *fitChecks -> 2 check buttons (substracting background, exporting fitted spectra)\n"); |
1061 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *fitChecks -> 2 check buttons (substracting background, exporting fitted spectra)\n"); |
1050 | fitChecks = new TSubStructure(); |
1062 | fitChecks = new TSubStructure(); |
1051 | checksel = new int[2]; |
1063 | checksel = new int[2]; |
1052 | checksel[0] = 1; checksel[1] = 0; |
1064 | checksel[0] = 1; checksel[1] = 0; |
1053 | selnames[0] = "Backround subtraction ON/OFF"; |
1065 | selnames[0] = "Backround subtraction ON/OFF"; |
1054 | selnames[1] = "Export fitted spectra ON/OFF"; |
1066 | selnames[1] = "Export fitted spectra ON/OFF"; |
1055 | if(fitChecks->TGCheckList(fV1, subgroup[0], 30, 2, selnames, checksel, "vertical", "center")) |
1067 | if(fitChecks->TGCheckList(fV1, subgroup[0], 30, 2, selnames, checksel, "vertical", "center")) |
1056 | fV1->AddFrame(fitChecks->outsidebox, f1expandXpad); |
1068 | fV1->AddFrame(fitChecks->outsidebox, f1expandXpad); |
1057 | delete[] checksel; |
1069 | delete[] checksel; |
1058 | 1070 | ||
1059 | // Analysis progress bar |
1071 | // Analysis progress bar |
1060 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *analysisProgress -> Horizontal progress bar for analysis\n"); |
1072 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *analysisProgress -> Horizontal progress bar for analysis\n"); |
1061 | analysisProgress = new TSubStructure(); |
1073 | analysisProgress = new TSubStructure(); |
1062 | if(analysisProgress->TGLabelProgress(fV1, subgroup[0], 30, "Current analysis:")) |
1074 | if(analysisProgress->TGLabelProgress(fV1, subgroup[0], 30, "Current analysis:")) |
1063 | fV1->AddFrame(analysisProgress->outsidebox, f1expandXpad); |
1075 | fV1->AddFrame(analysisProgress->outsidebox, f1expandXpad); |
1064 | 1076 | ||
1065 | fH1->AddFrame(fV1, f1expandX); |
1077 | fH1->AddFrame(fV1, f1expandX); |
1066 | 1078 | ||
1067 | analysisLayout[1]->AddFrame(fH1, f1expandXpad); |
1079 | analysisLayout[1]->AddFrame(fH1, f1expandXpad); |
1068 | 1080 | ||
1069 | // Actions for analysis pane |
1081 | // Actions for analysis pane |
1070 | intSpectButtons->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisHandle(=0)"); |
1082 | intSpectButtons->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisHandle(=0)"); |
1071 | intSpectButtons->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisHandle(=1)"); |
1083 | intSpectButtons->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisHandle(=1)"); |
1072 | intSpectButtons->widgetTB[2]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisDefaults()"); |
1084 | intSpectButtons->widgetTB[2]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisDefaults()"); |
1073 | 1085 | ||
1074 | relPdeButtons->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisHandle(=0)"); |
1086 | relPdeButtons->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisHandle(=0)"); |
1075 | relPdeButtons->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisHandle(=1)"); |
1087 | relPdeButtons->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisHandle(=1)"); |
1076 | relPdeButtons->widgetTB[2]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisDefaults()"); |
1088 | relPdeButtons->widgetTB[2]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisDefaults()"); |
1077 | darkRun->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "SelectDarkHist()"); |
1089 | darkRun->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "SelectDarkHist()"); |
1078 | 1090 | ||
1079 | brDownButtons->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisHandle(=0)"); |
1091 | brDownButtons->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisHandle(=0)"); |
1080 | brDownButtons->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisHandle(=1)"); |
1092 | brDownButtons->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisHandle(=1)"); |
1081 | brDownButtons->widgetTB[2]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisDefaults()"); |
1093 | brDownButtons->widgetTB[2]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisDefaults()"); |
1082 | 1094 | ||
1083 | surfButtons->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisHandle(=0)"); |
1095 | surfButtons->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisHandle(=0)"); |
1084 | surfButtons->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisHandle(=1)"); |
1096 | surfButtons->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisHandle(=1)"); |
1085 | surfButtons->widgetTB[2]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisDefaults()"); |
1097 | surfButtons->widgetTB[2]->Connect("Clicked()", "TGAppMainFrame", this, "AnalysisDefaults()"); |
1086 | // Analysis pane --------------------------------------------------------------------------- |
1098 | // Analysis pane --------------------------------------------------------------------------- |
1087 | 1099 | ||
1088 | // Histogram pane -------------------------------------------------------------------------- |
1100 | // Histogram pane -------------------------------------------------------------------------- |
1089 | analysisCanvas = new TRootEmbeddedCanvas("analysisCanvas",analysisLayout[2],300,300); |
1101 | analysisCanvas = new TRootEmbeddedCanvas("analysisCanvas",analysisLayout[2],300,300); |
1090 | analysisLayout[2]->AddFrame(analysisCanvas, f1expand2d); |
1102 | analysisLayout[2]->AddFrame(analysisCanvas, f1expand2d); |
1091 | analysisCanvas->GetCanvas()->SetGrid(); |
1103 | analysisCanvas->GetCanvas()->SetGrid(); |
1092 | // Histogram pane -------------------------------------------------------------------------- |
1104 | // Histogram pane -------------------------------------------------------------------------- |
1093 | 1105 | ||
1094 | // Histogram controls pane ----------------------------------------------------------------- |
1106 | // Histogram controls pane ----------------------------------------------------------------- |
1095 | subgroup[0] = (analysisLayout[3]->GetWidth())-4; |
1107 | subgroup[0] = (analysisLayout[3]->GetWidth())-4; |
1096 | 1108 | ||
1097 | // Control for histogram X range |
1109 | // Control for histogram X range |
1098 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *adcRange -> Range for ADC histogram\n"); |
1110 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *adcRange -> Range for ADC histogram\n"); |
1099 | adcRange = new TSubStructure(); |
1111 | adcRange = new TSubStructure(); |
1100 | for(int i = 0; i < 6; i++) { numform[i] = 0; numform2[i] = 0; } |
1112 | for(int i = 0; i < 6; i++) { numform[i] = 0; numform2[i] = 0; } |
1101 | numform[0] = 6; numform2[0] = 6; |
1113 | numform[0] = 6; numform2[0] = 6; |
1102 | if(adcRange->TGLabelDoubleNEntry(analysisLayout[3], subgroup[0], 30, "ADC range (min, max):", 0, numform, 0, numform2, "center")) |
1114 | if(adcRange->TGLabelDoubleNEntry(analysisLayout[3], subgroup[0], 30, "ADC range (min, max):", 0, numform, 0, numform2, "center")) |
1103 | analysisLayout[3]->AddFrame(adcRange->outsidebox, f1expandXpad); |
1115 | analysisLayout[3]->AddFrame(adcRange->outsidebox, f1expandXpad); |
1104 | 1116 | ||
1105 | // TDC window for getting data |
1117 | // TDC window for getting data |
1106 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *tdcRange -> Range for TDC histogram\n"); |
1118 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *tdcRange -> Range for TDC histogram\n"); |
1107 | tdcRange = new TSubStructure(); |
1119 | tdcRange = new TSubStructure(); |
1108 | for(int i = 0; i < 6; i++) { numform[i] = 0; numform2[i] = 0; } |
1120 | for(int i = 0; i < 6; i++) { numform[i] = 0; numform2[i] = 0; } |
1109 | numform[0] = 8; numform[1] = 2; numform2[0] = 8; numform2[1] = 2; |
1121 | numform[0] = 8; numform[1] = 2; numform2[0] = 8; numform2[1] = 2; |
1110 | if(tdcRange->TGLabelDoubleNEntry(analysisLayout[3], subgroup[0], 30, "TDC range (min, max):", -0.5, numform, 221.8, numform2, "center")) |
1122 | if(tdcRange->TGLabelDoubleNEntry(analysisLayout[3], subgroup[0], 30, "TDC range (min, max):", -0.5, numform, 221.8, numform2, "center")) |
1111 | analysisLayout[3]->AddFrame(tdcRange->outsidebox, f1expandXpad); |
1123 | analysisLayout[3]->AddFrame(tdcRange->outsidebox, f1expandXpad); |
1112 | 1124 | ||
1113 | // Y axis range settings |
1125 | // Y axis range settings |
1114 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *yRange -> Y axis range\n"); |
1126 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *yRange -> Y axis range\n"); |
1115 | yRange = new TSubStructure(); |
1127 | yRange = new TSubStructure(); |
1116 | for(int i = 0; i < 6; i++) { numform[i] = 0; numform2[i] = 0; } |
1128 | for(int i = 0; i < 6; i++) { numform[i] = 0; numform2[i] = 0; } |
1117 | numform[0] = 8; numform[1] = 1; numform2[0] = 8; numform2[1] = 1; |
1129 | numform[0] = 8; numform[1] = 1; numform2[0] = 8; numform2[1] = 1; |
1118 | if(yRange->TGLabelDoubleNEntry(analysisLayout[3], subgroup[0], 30, "Y range (min, max):", 0, numform, 0, numform2, "center")) |
1130 | if(yRange->TGLabelDoubleNEntry(analysisLayout[3], subgroup[0], 30, "Y range (min, max):", 0, numform, 0, numform2, "center")) |
1119 | analysisLayout[3]->AddFrame(yRange->outsidebox, f1expandXpad); |
1131 | analysisLayout[3]->AddFrame(yRange->outsidebox, f1expandXpad); |
1120 | 1132 | ||
1121 | fH1 = new TGHorizontalFrame(analysisLayout[3], subgroup[0], 30); |
1133 | fH1 = new TGHorizontalFrame(analysisLayout[3], subgroup[0], 30); |
1122 | // Select the channel to display |
1134 | // Select the channel to display |
1123 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *selectCh -> Channel to display\n"); |
1135 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *selectCh -> Channel to display\n"); |
1124 | selectCh = new TSubStructure(); |
1136 | selectCh = new TSubStructure(); |
1125 | for(int i = 0; i < 6; i++) numform[i] = 0; |
1137 | for(int i = 0; i < 6; i++) numform[i] = 0; |
1126 | numform[0] = 3; numform[2] = 2; numform[3] = 2; numform[4] = 0; numform[5] = 7; // TODO - ko odprem file, nastavi zgornjo limito |
1138 | numform[0] = 3; numform[2] = 2; numform[3] = 2; numform[4] = 0; numform[5] = 7; // TODO - ko odprem file, nastavi zgornjo limito |
1127 | if(selectCh->TGLabelNEntry(fH1, subgroup[0]/2-24, 30, "Display channel:", 0, numform, "center")) |
1139 | if(selectCh->TGLabelNEntry(fH1, subgroup[0]/2-24, 30, "Display channel:", 0, numform, "center")) |
1128 | fH1->AddFrame(selectCh->outsidebox, f0leftX); |
1140 | fH1->AddFrame(selectCh->outsidebox, f0leftX); |
1129 | selChannel = -1; |
1141 | selChannel = -1; |
1130 | 1142 | ||
1131 | // Change plot type |
1143 | // Change plot type |
1132 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *plotType -> 3 buttons for selecting the plot type (ADC, TDC, ADC/TDC)\n"); |
1144 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *plotType -> 3 buttons for selecting the plot type (ADC, TDC, ADC/TDC)\n"); |
1133 | plotType = new TSubStructure(); |
1145 | plotType = new TSubStructure(); |
1134 | selnames[0] = "ADC"; selnames[1] = "TDC"; selnames[2] = "ADC/TDC"; |
1146 | selnames[0] = "ADC"; selnames[1] = "TDC"; selnames[2] = "ADC/TDC"; |
1135 | if(plotType->TGMultiButton(fH1, subgroup[0]/2-24, 30, 3, selnames, "center")) |
1147 | if(plotType->TGMultiButton(fH1, subgroup[0]/2-24, 30, 3, selnames, "center")) |
1136 | fH1->AddFrame(plotType->outsidebox, f1expandX); |
1148 | fH1->AddFrame(plotType->outsidebox, f1expandX); |
1137 | analysisLayout[3]->AddFrame(fH1, f1expandXpad); |
1149 | analysisLayout[3]->AddFrame(fH1, f1expandXpad); |
1138 | 1150 | ||
1139 | // Check button to toggle logarithmic scale |
1151 | // Check button to toggle logarithmic scale |
1140 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *histOpt -> 2 check buttons (histogram logarithmic scale, clean plots)\n"); |
1152 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *histOpt -> 2 check buttons (histogram logarithmic scale, clean plots)\n"); |
1141 | histOpt = new TSubStructure(); |
1153 | histOpt = new TSubStructure(); |
1142 | checksel = new int[2]; |
1154 | checksel = new int[2]; |
1143 | checksel[0] = 0; checksel[1] = 1; |
1155 | checksel[0] = 0; checksel[1] = 1; |
1144 | selnames[0] = "Logarithmic scale ON/OFF"; |
1156 | selnames[0] = "Logarithmic scale ON/OFF"; |
1145 | selnames[1] = "Clean plots ON/OFF"; |
1157 | selnames[1] = "Clean plots ON/OFF"; |
1146 | if(histOpt->TGCheckList(analysisLayout[3], subgroup[0], 30, 2, selnames, checksel, "vertical", "center")) |
1158 | if(histOpt->TGCheckList(analysisLayout[3], subgroup[0], 30, 2, selnames, checksel, "vertical", "center")) |
1147 | analysisLayout[3]->AddFrame(histOpt->outsidebox, f1expandXpad); |
1159 | analysisLayout[3]->AddFrame(histOpt->outsidebox, f1expandXpad); |
1148 | delete[] checksel; |
1160 | delete[] checksel; |
1149 | 1161 | ||
1150 | // Export the selected files |
1162 | // Export the selected files |
1151 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *exportHist -> Button to export current histogram\n"); |
1163 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *exportHist -> Button to export current histogram\n"); |
1152 | exportHist = new TSubStructure(); |
1164 | exportHist = new TSubStructure(); |
1153 | if(exportHist->TGLabelButton(analysisLayout[3], subgroup[0], 30, "Export selected histograms:", "Export", "center")) |
1165 | if(exportHist->TGLabelButton(analysisLayout[3], subgroup[0], 30, "Export selected histograms:", "Export", "center")) |
1154 | analysisLayout[3]->AddFrame(exportHist->outsidebox, f1expandXpad); |
1166 | analysisLayout[3]->AddFrame(exportHist->outsidebox, f1expandXpad); |
1155 | 1167 | ||
1156 | // Edit the selected histograms |
1168 | // Edit the selected histograms |
1157 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *editSelHist -> Button to additionally edit the selected histograms (make a canvas clone in a new tab)\n"); |
1169 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *editSelHist -> Button to additionally edit the selected histograms (make a canvas clone in a new tab)\n"); |
1158 | editSelHist = new TSubStructure(); |
1170 | editSelHist = new TSubStructure(); |
1159 | if(editSelHist->TGLabelButton(analysisLayout[3], subgroup[0], 30, "Edit selected histograms:", "Edit", "center")) |
1171 | if(editSelHist->TGLabelButton(analysisLayout[3], subgroup[0], 30, "Edit selected histograms:", "Edit", "center")) |
1160 | analysisLayout[3]->AddFrame(editSelHist->outsidebox, f1expandXpad); |
1172 | analysisLayout[3]->AddFrame(editSelHist->outsidebox, f1expandXpad); |
1161 | 1173 | ||
1162 | // Select position units to use for ploting (micrometer, table position units) |
1174 | // Select position units to use for ploting (micrometer, table position units) |
1163 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *posUnitsPlot -> Dropdown menu for selecting the position units for ploting\n"); |
1175 | if(DBGSIG > 1) printf("AppLayout(): Creating TSubStructure *posUnitsPlot -> Dropdown menu for selecting the position units for ploting\n"); |
1164 | posUnitsPlot = new TSubStructure(); |
1176 | posUnitsPlot = new TSubStructure(); |
1165 | selnames[0] = "table units"; selnames[1] = "micrometers"; |
1177 | selnames[0] = "table units"; selnames[1] = "micrometers"; |
1166 | sprintf(selected, "table units"); |
1178 | sprintf(selected, "table units"); |
1167 | if(posUnitsPlot->TGLabelDrop(analysisLayout[3], 2.*subgroup[0]/3., 30, "Position units for plots:", 2, selnames, selected)) |
1179 | if(posUnitsPlot->TGLabelDrop(analysisLayout[3], 2.*subgroup[0]/3., 30, "Position units for plots:", 2, selnames, selected)) |
1168 | analysisLayout[3]->AddFrame(posUnitsPlot->outsidebox, f0centerX); |
1180 | analysisLayout[3]->AddFrame(posUnitsPlot->outsidebox, f0centerX); |
1169 | 1181 | ||
1170 | // Actions for histogram controls pane //TODO |
1182 | // Actions for histogram controls pane //TODO |
1171 | for(int i = 0; i < 2; i++) |
1183 | for(int i = 0; i < 2; i++) |
1172 | { |
1184 | { |
1173 | adcRange->widgetNE[i]->Connect("ValueSet(Long_t)", "TGAppMainFrame", this, "UpdateHistogram(=0)"); |
1185 | adcRange->widgetNE[i]->Connect("ValueSet(Long_t)", "TGAppMainFrame", this, "UpdateHistogram(=0)"); |
1174 | // (adcRange->widgetNE[i]->GetNumberEntry())->Connect("ReturnPressed()", "TGAppMainFrame", this, "UpdateHistogram(=0)"); |
1186 | // (adcRange->widgetNE[i]->GetNumberEntry())->Connect("ReturnPressed()", "TGAppMainFrame", this, "UpdateHistogram(=0)"); |
1175 | tdcRange->widgetNE[i]->Connect("ValueSet(Long_t)", "TGAppMainFrame", this, "UpdateHistogram(=0)"); |
1187 | tdcRange->widgetNE[i]->Connect("ValueSet(Long_t)", "TGAppMainFrame", this, "UpdateHistogram(=0)"); |
1176 | // (tdcRange->widgetNE[i]->GetNumberEntry())->Connect("ReturnPressed()", "TGAppMainFrame", this, "UpdateHistogram(=0)"); |
1188 | // (tdcRange->widgetNE[i]->GetNumberEntry())->Connect("ReturnPressed()", "TGAppMainFrame", this, "UpdateHistogram(=0)"); |
1177 | yRange->widgetNE[i]->Connect("ValueSet(Long_t)", "TGAppMainFrame", this, "UpdateHistogram(=0)"); |
1189 | yRange->widgetNE[i]->Connect("ValueSet(Long_t)", "TGAppMainFrame", this, "UpdateHistogram(=0)"); |
1178 | // (yRange->widgetNE[i]->GetNumberEntry())->Connect("ReturnPressed()", "TGAppMainFrame", this, "UpdateHistogram(=0)"); |
1190 | // (yRange->widgetNE[i]->GetNumberEntry())->Connect("ReturnPressed()", "TGAppMainFrame", this, "UpdateHistogram(=0)"); |
1179 | } |
1191 | } |
1180 | plotType->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "ChangeHisttype(=0)"); |
1192 | plotType->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "ChangeHisttype(=0)"); |
1181 | plotType->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "ChangeHisttype(=1)"); |
1193 | plotType->widgetTB[1]->Connect("Clicked()", "TGAppMainFrame", this, "ChangeHisttype(=1)"); |
1182 | plotType->widgetTB[2]->Connect("Clicked()", "TGAppMainFrame", this, "ChangeHisttype(=2)"); |
1194 | plotType->widgetTB[2]->Connect("Clicked()", "TGAppMainFrame", this, "ChangeHisttype(=2)"); |
1183 | selectCh->widgetNE[0]->Connect("ValueSet(Long_t)", "TGAppMainFrame", this, "UpdateHistogram(=2)"); |
1195 | selectCh->widgetNE[0]->Connect("ValueSet(Long_t)", "TGAppMainFrame", this, "UpdateHistogram(=2)"); |
1184 | selectCh->widgetNE[0]->Connect("ValueChanged(Long_t)", "TGAppMainFrame", this, "UpdateHistogram(=2)"); |
1196 | selectCh->widgetNE[0]->Connect("ValueChanged(Long_t)", "TGAppMainFrame", this, "UpdateHistogram(=2)"); |
1185 | (selectCh->widgetNE[0]->GetNumberEntry())->Connect("ReturnPressed()", "TGAppMainFrame", this, "UpdateHistogram(=2)"); |
1197 | (selectCh->widgetNE[0]->GetNumberEntry())->Connect("ReturnPressed()", "TGAppMainFrame", this, "UpdateHistogram(=2)"); |
1186 | histOpt->widgetChBox[0]->Connect("Clicked()", "TGAppMainFrame", this, "HistogramOptions(=0)"); |
1198 | histOpt->widgetChBox[0]->Connect("Clicked()", "TGAppMainFrame", this, "HistogramOptions(=0)"); |
1187 | histOpt->widgetChBox[1]->Connect("Clicked()", "TGAppMainFrame", this, "HistogramOptions(=1)"); |
1199 | histOpt->widgetChBox[1]->Connect("Clicked()", "TGAppMainFrame", this, "HistogramOptions(=1)"); |
1188 | exportHist->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "UpdateHistogram(=1)"); |
1200 | exportHist->widgetTB[0]->Connect("Clicked()", "TGAppMainFrame", this, "UpdateHistogram(=1)"); |
1189 | 1201 | ||
1190 | // Histogram controls pane ----------------------------------------------------------------- |
1202 | // Histogram controls pane ----------------------------------------------------------------- |
1191 | } |
1203 | } |
1192 | 1204 | ||
1193 | // ------------------------------------------------------------------- |
1205 | // ------------------------------------------------------------------- |
1194 | 1206 | ||
1195 | // Closing main window and checking about information ---------------- |
1207 | // Closing main window and checking about information ---------------- |
1196 | 1208 | ||
1197 | void TGAppMainFrame::CloseWindow() |
1209 | void TGAppMainFrame::CloseWindow() |
1198 | { |
1210 | { |
1199 | gApplication->Terminate(0); |
1211 | gApplication->Terminate(0); |
1200 | } |
1212 | } |
1201 | 1213 | ||
1202 | Bool_t TGAppMainFrame::About() |
1214 | Bool_t TGAppMainFrame::About() |
1203 | { |
1215 | { |
1204 | int ret = 0; |
1216 | int ret = 0; |
1205 | 1217 | ||
1206 | new TGMsgBox(gClient->GetRoot(), fMain, fMain->GetWindowName(), "Software for SiPM characterization with\nCAMAC, scope, bias voltage and table position support\n\nCreated by Gasper Kukec Mezek (gasper.kukec@ung.si),\nUpdated on July 17th 2015", kMBIconQuestion, kMBClose, &ret); |
1218 | new TGMsgBox(gClient->GetRoot(), fMain, fMain->GetWindowName(), "Software for SiPM characterization with\nCAMAC, scope, bias voltage and table position support\n\nCreated by Gasper Kukec Mezek (gasper.kukec@ung.si),\nUpdated on July 17th 2015", kMBIconQuestion, kMBClose, &ret); |
1207 | 1219 | ||
1208 | return kFALSE; |
1220 | return kFALSE; |
1209 | } |
1221 | } |
1210 | 1222 | ||
1211 | // ------------------------------------------------------------------- |
1223 | // ------------------------------------------------------------------- |
1212 | 1224 | ||
1213 | // Subwindow constructor (+layout) and close subwindow --------------- |
1225 | // Subwindow constructor (+layout) and close subwindow --------------- |
1214 | /* |
1226 | /* |
1215 | TGMdiSubwindow::TGMdiSubwindow(TGMdiMainFrame *main, int w, int h) |
1227 | TGMdiSubwindow::TGMdiSubwindow(TGMdiMainFrame *main, int w, int h) |
1216 | { |
1228 | { |
1217 | // Create a new subwindow |
1229 | // Create a new subwindow |
1218 | fMdiFrame = new TGMdiFrame(main, w, h); |
1230 | fMdiFrame = new TGMdiFrame(main, w, h); |
1219 | fMdiFrame->Connect("CloseWindow()", "TGMdiSubwindow", this, "CloseWindow(=0)"); |
1231 | fMdiFrame->Connect("CloseWindow()", "TGMdiSubwindow", this, "CloseWindow(=0)"); |
1220 | fMdiFrame->DontCallClose(); |
1232 | fMdiFrame->DontCallClose(); |
1221 | } |
1233 | } |
1222 | 1234 | ||
1223 | Bool_t TGMdiSubwindow::CloseWindow(int layoutchange) |
1235 | Bool_t TGMdiSubwindow::CloseWindow(int layoutchange) |
1224 | { |
1236 | { |
1225 | int ret = 0; |
1237 | int ret = 0; |
1226 | 1238 | ||
1227 | if(layoutchange == 0) |
1239 | if(layoutchange == 0) |
1228 | new TGMsgBox(gClient->GetRoot(), fMdiFrame, fMdiFrame->GetWindowName(), "Really want to close the window?", kMBIconExclamation, kMBYes | kMBNo, &ret); |
1240 | new TGMsgBox(gClient->GetRoot(), fMdiFrame, fMdiFrame->GetWindowName(), "Really want to close the window?", kMBIconExclamation, kMBYes | kMBNo, &ret); |
1229 | else if(layoutchange == 1) |
1241 | else if(layoutchange == 1) |
1230 | ret = kMBYes; |
1242 | ret = kMBYes; |
1231 | if(ret == kMBYes) |
1243 | if(ret == kMBYes) |
1232 | { |
1244 | { |
1233 | if(strcmp("Information window", fMdiFrame->GetWindowName()) == 0) |
1245 | if(strcmp("Information window", fMdiFrame->GetWindowName()) == 0) |
1234 | id = -1; |
1246 | id = -1; |
1235 | return fMdiFrame->CloseWindow(); |
1247 | return fMdiFrame->CloseWindow(); |
1236 | } |
1248 | } |
1237 | 1249 | ||
1238 | return kFALSE; |
1250 | return kFALSE; |
1239 | }*/ |
1251 | }*/ |
1240 | 1252 | ||
1241 | // ------------------------------------------------------------------- |
1253 | // ------------------------------------------------------------------- |
1242 | 1254 | ||
1243 | // Main function ----------------------------------------------------- |
1255 | // Main function ----------------------------------------------------- |
1244 | void root_app() |
1256 | void root_app() |
1245 | { |
1257 | { |
1246 | if(DBGSIG > 1) |
1258 | if(DBGSIG > 1) |
1247 | { |
1259 | { |
1248 | printf("root_app(): Starting objects\n"); |
1260 | printf("root_app(): Starting objects\n"); |
1249 | gObjectTable->Print(); |
1261 | gObjectTable->Print(); |
1250 | } |
1262 | } |
1251 | 1263 | ||
1252 | int winWidth = 1240; |
1264 | int winWidth = 1240; |
1253 | int winHeight = 800; |
1265 | int winHeight = 800; |
1254 | layoutMainWindow(&winWidth, &winHeight); |
1266 | layoutMainWindow(&winWidth, &winHeight); |
1255 | 1267 | ||
1256 | new TGAppMainFrame(gClient->GetRoot(), winWidth, winHeight); |
1268 | new TGAppMainFrame(gClient->GetRoot(), winWidth, winHeight); |
1257 | } |
1269 | } |
1258 | 1270 | ||
1259 | int main(int argc, char **argv) |
1271 | int main(int argc, char **argv) |
1260 | { |
1272 | { |
1261 | if(DBGSIG > 1) |
1273 | if(DBGSIG > 1) |
1262 | { |
1274 | { |
1263 | printf("main(): Starting objects\n"); |
1275 | printf("main(): Starting objects\n"); |
1264 | gObjectTable->Print(); |
1276 | gObjectTable->Print(); |
1265 | } |
1277 | } |
1266 | 1278 | ||
1267 | TApplication theApp("MdiTest", &argc, argv); |
1279 | TApplication theApp("MdiTest", &argc, argv); |
1268 | root_app(); |
1280 | root_app(); |
1269 | theApp.Run(); |
1281 | theApp.Run(); |
1270 | 1282 | ||
1271 | return 0; |
1283 | return 0; |
1272 | } |
1284 | } |
1273 | 1285 | ||
1274 | // ------------------------------------------------------------------- |
1286 | // ------------------------------------------------------------------- |
1275 | 1287 |