1 | #pragma rtGlobals=1 // Use modern global access method. |
---|
2 | #pragma IgorVersion=6.2 |
---|
3 | |
---|
4 | // load/unload courtesy of Jan Ilavsky |
---|
5 | // June 2008 |
---|
6 | // |
---|
7 | // - SRK Oct 2008 |
---|
8 | // rather than deleting the macros, it is preferable to simply hide the appropriate panels. |
---|
9 | // deleting the ipf files will break dependencies, leave panels hanging open without |
---|
10 | // their associated procedures, etc. |
---|
11 | // |
---|
12 | // names of everything have been changed so I won't clash with Jan's code |
---|
13 | // - make this an independent module in case of bad compilation...? |
---|
14 | // |
---|
15 | // |
---|
16 | // a "(" anywhere in the menuItemString will disable that menu item |
---|
17 | // <U underlines, <U bolds (?? maybe use these to show which is actually loaded) |
---|
18 | |
---|
19 | |
---|
20 | |
---|
21 | |
---|
22 | Menu "Macros" |
---|
23 | "-" |
---|
24 | StrVarOrDefault("root:Packages:NCNRItemStr1a","Load NCNR Analysis Macros"), NCNR_AnalysisLoader(StrVarOrDefault("root:Packages:NCNRItemStr1a","Load NCNR Analysis Macros")) |
---|
25 | // StrVarOrDefault("root:Packages:NCNRItemStr1b","-"), NCNR_AnalysisLoader(StrVarOrDefault("root:Packages:NCNRItemStr1b","-")) |
---|
26 | |
---|
27 | Submenu "Load SANS Reduction Macros" |
---|
28 | StrVarOrDefault("root:Packages:NCNRItemStr2a","Load NCNR SANS Reduction Macros"), NCNR_SANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr2a","Load NCNR SANS Reduction Macros")) |
---|
29 | StrVarOrDefault("root:Packages:NCNRItemStr2b","Load QUOKKA SANS Reduction Macros"), NCNR_SANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr2b","Load QUOKKA SANS Reduction Macros")) |
---|
30 | StrVarOrDefault("root:Packages:NCNRItemStr2c","Load ILL SANS Reduction Macros"), NCNR_SANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr2c","Load ILL SANS Reduction Macros")) |
---|
31 | StrVarOrDefault("root:Packages:NCNRItemStr2d","Load HFIR SANS Reduction Macros"), NCNR_SANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr2d","Load HFIR SANS Reduction Macros")) |
---|
32 | StrVarOrDefault("root:Packages:NCNRItemStr2e","Load HANARO SANS Reduction Macros"), NCNR_SANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr2e","Load HANARO SANS Reduction Macros")) |
---|
33 | // StrVarOrDefault("root:Packages:NCNRItemStr2b","-"), NCNR_SANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr2b","-")) |
---|
34 | End |
---|
35 | |
---|
36 | Submenu "Load USANS Reduction Macros" |
---|
37 | StrVarOrDefault("root:Packages:NCNRItemStr3a","Load NCNR USANS Reduction Macros"), NCNR_USANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr3a","Load NCNR USANS Reduction Macros")) |
---|
38 | StrVarOrDefault("root:Packages:NCNRItemStr3b","Load HANARO USANS Reduction Macros"), NCNR_USANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr3b","Load HANARO USANS Reduction Macros")) |
---|
39 | // StrVarOrDefault("root:Packages:NCNRItemStr3b","-"), NCNR_USANSReductionLoader(StrVarOrDefault("root:Packages:NCNRItemStr3b","-")) |
---|
40 | End |
---|
41 | |
---|
42 | StrVarOrDefault("root:Packages:NCNRItemStr4a","Load NCNR SANS Live Data"), NCNR_SANSLiveLoader(StrVarOrDefault("root:Packages:NCNRItemStr4a","Load NCNR SANS Live Data")) |
---|
43 | // StrVarOrDefault("root:Packages:NCNRItemStr4b","-"), NCNR_SANSLiveLoader(StrVarOrDefault("root:Packages:NCNRItemStr4b","-")) |
---|
44 | |
---|
45 | // for testing ONLY |
---|
46 | "-" |
---|
47 | "Load Polarization Reduction - Beta",PolarizationLoader() |
---|
48 | |
---|
49 | // "Load Batch Fitting",Execute/P "INSERTINCLUDE \"Auto_Fit\"";Execute/P "COMPILEPROCEDURES ";Execute/P "InitializeAutoFitPanel()" |
---|
50 | |
---|
51 | "Load Real Space Modeling - Beta",RealSpaceLoader() |
---|
52 | "Event Mode Processing - Beta",EventModeLoader() |
---|
53 | // "-" |
---|
54 | |
---|
55 | end |
---|
56 | |
---|
57 | Function NCNR_AnalysisLoader(itemStr) |
---|
58 | String itemStr |
---|
59 | |
---|
60 | if (str2num(stringByKey("IGORVERS",IgorInfo(0))) < 6.2) |
---|
61 | Abort "Your version of Igor is lower than 6.2, these macros need version 6.2 or higher.... " |
---|
62 | endif |
---|
63 | |
---|
64 | NewDataFolder/O root:Packages //create the folder for string variable |
---|
65 | String/G root:Packages:NCNRItemStr1a = itemStr |
---|
66 | String/G root:Packages:NCNRItemStr1b = itemStr |
---|
67 | SVAR gMenuStr1a = root:Packages:NCNRItemStr1a |
---|
68 | SVAR gMenuStr1b = root:Packages:NCNRItemStr1b |
---|
69 | |
---|
70 | String SANSAna_WinList = "wrapperPanel;Procedure_List;Report;Plot_Manager;A_FitPanel;A_FitWindow;Sum_Model_Panel;" |
---|
71 | SANSAna_WinList += "NewGlobalFitPanel;SimpGFPanel;Invariant_Panel;invariant_graph;" |
---|
72 | strswitch(itemStr) // string switch |
---|
73 | case "Load NCNR Analysis Macros": |
---|
74 | Execute/P "INSERTINCLUDE \"SA_Includes_v410\"" |
---|
75 | Execute/P "COMPILEPROCEDURES " |
---|
76 | Execute/P ("Init_WrapperPanel()") |
---|
77 | Execute/P ("ModelPicker_Panel()") |
---|
78 | Execute/P ("DoIgorMenu \"Control\" \"Retrieve All Windows\"") |
---|
79 | |
---|
80 | gMenuStr1a = "Hide NCNR Analysis Macros" |
---|
81 | // gMenuStr1b = "Unload NCNR Analysis Macros" |
---|
82 | gMenuStr1b = "-" |
---|
83 | BuildMenu "Macros" |
---|
84 | |
---|
85 | break |
---|
86 | case "Unload NCNR Analysis Macros": |
---|
87 | // very dangerous - don't really want to implement this because it will surely crash |
---|
88 | Execute/P "DELETEINCLUDE \"SA_Includes_v410\"" |
---|
89 | Execute/P "COMPILEPROCEDURES " |
---|
90 | DoWindow wrapperPanel |
---|
91 | if(V_Flag) |
---|
92 | DoWindow/K wrapperPanel |
---|
93 | endif |
---|
94 | DoWindow Procedure_List |
---|
95 | If(V_Flag) |
---|
96 | DoWindow/K Procedure_List |
---|
97 | endif |
---|
98 | |
---|
99 | gMenuStr1a = "Load NCNR Analysis Macros" |
---|
100 | gMenuStr1b = "-" |
---|
101 | |
---|
102 | BuildMenu "Macros" |
---|
103 | |
---|
104 | break |
---|
105 | case "Hide NCNR Analysis Macros": |
---|
106 | HideShowWindowsInList(SANSAna_WinList,1) |
---|
107 | |
---|
108 | gMenuStr1a = "Show NCNR Analysis Macros" |
---|
109 | // gMenuStr1b = "Unload NCNR Analysis Macros" |
---|
110 | gMenuStr1b = "-" |
---|
111 | BuildMenu "Macros" |
---|
112 | |
---|
113 | break |
---|
114 | case "Show NCNR Analysis Macros": |
---|
115 | HideShowWindowsInList(SANSAna_WinList,0) |
---|
116 | |
---|
117 | gMenuStr1a = "Hide NCNR Analysis Macros" |
---|
118 | // gMenuStr1b = "Unload NCNR Analysis Macros" |
---|
119 | gMenuStr1b = "-" |
---|
120 | BuildMenu "Macros" |
---|
121 | |
---|
122 | break |
---|
123 | default: |
---|
124 | Abort "Invalid Menu Selection" |
---|
125 | endswitch |
---|
126 | |
---|
127 | end |
---|
128 | |
---|
129 | |
---|
130 | // now add for the SANS Reduction |
---|
131 | // a = NCNR |
---|
132 | // b = QUOKKA |
---|
133 | // c = ILL |
---|
134 | // d = HFIR |
---|
135 | // e = HANARO |
---|
136 | // |
---|
137 | Function NCNR_SANSReductionLoader(itemStr) |
---|
138 | String itemStr |
---|
139 | |
---|
140 | if (str2num(stringByKey("IGORVERS",IgorInfo(0))) < 6.2) |
---|
141 | Abort "Your version of Igor is lower than 6.2, these macros need version 6.2 or higher.... " |
---|
142 | endif |
---|
143 | |
---|
144 | NewDataFolder/O root:Packages //create the folder for string variable |
---|
145 | |
---|
146 | String/G root:Packages:NCNRItemStr2a = "Load NCNR SANS Reduction Macros" |
---|
147 | String/G root:Packages:NCNRItemStr2b = "Load QUOKKA SANS Reduction Macros" |
---|
148 | String/G root:Packages:NCNRItemStr2c = "Load ILL SANS Reduction Macros" |
---|
149 | String/G root:Packages:NCNRItemStr2d = "Load HFIR SANS Reduction Macros" |
---|
150 | String/G root:Packages:NCNRItemStr2e = "Load HANARO SANS Reduction Macros" |
---|
151 | SVAR gMenuStr2a = root:Packages:NCNRItemStr2a |
---|
152 | SVAR gMenuStr2b = root:Packages:NCNRItemStr2b |
---|
153 | SVAR gMenuStr2c = root:Packages:NCNRItemStr2c |
---|
154 | SVAR gMenuStr2d = root:Packages:NCNRItemStr2d |
---|
155 | SVAR gMenuStr2e = root:Packages:NCNRItemStr2e |
---|
156 | |
---|
157 | String SANSRed_WinList = "Main_Panel;CatVSTable;SANS_Data;Plot_Manager;Average_Panel;Plot_1d;CatWin;Surface_3D;FitPanel;FitWindow;" |
---|
158 | SANSRed_WinList += "FitRPAPanel;SANS_Histo;drawMaskWin;Multiple_Reduce_Panel;NSORT_Panel;NSORT_Graph;CombineTable;ToCombine;Patch_Panel;" |
---|
159 | SANSRed_WinList += "ProtocolPanel;Schematic_Layout;Tile_2D;RAW_to_ASCII;Trans_Panel;TransFileTable;ScatterFileTable;Convert_to_Trans;" |
---|
160 | SANSRed_WinList += "WorkFileMath;Pref_Panel;Subtract_1D_Panel;Plot_Sub1D;SASCALC;MC_SASCALC;Saved_Configurations;TISANE;Sim_1D_Panel;" |
---|
161 | SANSRed_WinList += "Trial_Configuration;Saved_Configurations;DataArithmeticPanel;DAPlotPanel;" |
---|
162 | strswitch(itemStr) // string switch |
---|
163 | |
---|
164 | case "Load NCNR SANS Reduction Macros": |
---|
165 | Execute/P "INSERTINCLUDE \"Includes_v520\"" |
---|
166 | Execute/P "COMPILEPROCEDURES " |
---|
167 | Execute/P ("Initialize()") |
---|
168 | Execute/P ("DoIgorMenu \"Control\" \"Retrieve All Windows\"") |
---|
169 | |
---|
170 | // change the facility label, disable the others |
---|
171 | gMenuStr2a = "Hide NCNR SANS Reduction Macros" |
---|
172 | gMenuStr2b += "(" |
---|
173 | gMenuStr2c += "(" |
---|
174 | gMenuStr2d += "(" |
---|
175 | gMenuStr2e += "(" |
---|
176 | |
---|
177 | BuildMenu "Macros" |
---|
178 | break |
---|
179 | |
---|
180 | case "Load QUOKKA SANS Reduction Macros": |
---|
181 | Print "QUOKKA macros not in SVN yet - NCNR macros loaded instead" |
---|
182 | Execute/P "INSERTINCLUDE \"Includes_v520\"" |
---|
183 | // Execute/P "INSERTINCLUDE \"QKK_Includes_ANSTO\"" |
---|
184 | Execute/P "COMPILEPROCEDURES " |
---|
185 | Execute/P ("Initialize()") |
---|
186 | Execute/P ("DoIgorMenu \"Control\" \"Retrieve All Windows\"") |
---|
187 | |
---|
188 | // change the facility label, disable the others |
---|
189 | gMenuStr2a += "(" |
---|
190 | gMenuStr2b = "Hide QUOKKA SANS Reduction Macros" |
---|
191 | gMenuStr2c += "(" |
---|
192 | gMenuStr2d += "(" |
---|
193 | gMenuStr2e += "(" |
---|
194 | |
---|
195 | BuildMenu "Macros" |
---|
196 | break |
---|
197 | |
---|
198 | case "Load ILL SANS Reduction Macros": |
---|
199 | Execute/P "INSERTINCLUDE \"Includes_v520_ILL\"" |
---|
200 | Execute/P "COMPILEPROCEDURES " |
---|
201 | Execute/P ("Initialize()") |
---|
202 | Execute/P ("DoIgorMenu \"Control\" \"Retrieve All Windows\"") |
---|
203 | |
---|
204 | // change the facility label, disable the others |
---|
205 | gMenuStr2a += "(" |
---|
206 | gMenuStr2b += "(" |
---|
207 | gMenuStr2c = "Hide ILL SANS Reduction Macros" |
---|
208 | gMenuStr2d += "(" |
---|
209 | gMenuStr2e += "(" |
---|
210 | |
---|
211 | BuildMenu "Macros" |
---|
212 | break |
---|
213 | |
---|
214 | case "Load HFIR SANS Reduction Macros": |
---|
215 | Execute/P "INSERTINCLUDE \"HFIR_Includes_v520\"" |
---|
216 | Execute/P "COMPILEPROCEDURES " |
---|
217 | Execute/P ("Initialize()") |
---|
218 | Execute/P ("DoIgorMenu \"Control\" \"Retrieve All Windows\"") |
---|
219 | |
---|
220 | // change the facility label, disable the others |
---|
221 | gMenuStr2a += "(" |
---|
222 | gMenuStr2b += "(" |
---|
223 | gMenuStr2c += "(" |
---|
224 | gMenuStr2d = "Hide HFIR SANS Reduction Macros" |
---|
225 | gMenuStr2e += "(" |
---|
226 | |
---|
227 | BuildMenu "Macros" |
---|
228 | break |
---|
229 | |
---|
230 | case "Load HANARO SANS Reduction Macros": |
---|
231 | Print "HANARO not loaded into SVN yet. NCNR is loaded" |
---|
232 | Execute/P "INSERTINCLUDE \"Includes_v520\"" |
---|
233 | Execute/P "COMPILEPROCEDURES " |
---|
234 | Execute/P ("Initialize()") |
---|
235 | Execute/P ("DoIgorMenu \"Control\" \"Retrieve All Windows\"") |
---|
236 | |
---|
237 | // change the facility label, disable the others |
---|
238 | gMenuStr2a += "(" |
---|
239 | gMenuStr2b += "(" |
---|
240 | gMenuStr2c += "(" |
---|
241 | gMenuStr2d += "(" |
---|
242 | gMenuStr2e += "Hide HANARO SANS Reduction Macros" |
---|
243 | |
---|
244 | BuildMenu "Macros" |
---|
245 | break |
---|
246 | |
---|
247 | //////////// |
---|
248 | case "Hide NCNR SANS Reduction Macros": |
---|
249 | HideShowWindowsInList(SANSRed_WinList,1) |
---|
250 | |
---|
251 | // change the facility label, disable the others |
---|
252 | gMenuStr2a = "Show NCNR SANS Reduction Macros" |
---|
253 | gMenuStr2b += "(" |
---|
254 | gMenuStr2c += "(" |
---|
255 | gMenuStr2d += "(" |
---|
256 | gMenuStr2e += "(" |
---|
257 | |
---|
258 | BuildMenu "Macros" |
---|
259 | break |
---|
260 | |
---|
261 | case "Hide QUOKKA SANS Reduction Macros": |
---|
262 | HideShowWindowsInList(SANSRed_WinList,1) |
---|
263 | |
---|
264 | // change the facility label, disable the others |
---|
265 | gMenuStr2a += "(" |
---|
266 | gMenuStr2b = "Show QUOKKA SANS Reduction Macros" |
---|
267 | gMenuStr2c += "(" |
---|
268 | gMenuStr2d += "(" |
---|
269 | gMenuStr2e += "(" |
---|
270 | |
---|
271 | BuildMenu "Macros" |
---|
272 | break |
---|
273 | |
---|
274 | case "Hide ILL SANS Reduction Macros": |
---|
275 | HideShowWindowsInList(SANSRed_WinList,1) |
---|
276 | |
---|
277 | // change the facility label, disable the others |
---|
278 | gMenuStr2a += "(" |
---|
279 | gMenuStr2b += "(" |
---|
280 | gMenuStr2c = "Show ILL SANS Reduction Macros" |
---|
281 | gMenuStr2d += "(" |
---|
282 | gMenuStr2e += "(" |
---|
283 | |
---|
284 | BuildMenu "Macros" |
---|
285 | break |
---|
286 | |
---|
287 | case "Hide HFIR SANS Reduction Macros": |
---|
288 | HideShowWindowsInList(SANSRed_WinList,1) |
---|
289 | |
---|
290 | // change the facility label, disable the others |
---|
291 | gMenuStr2a += "(" |
---|
292 | gMenuStr2b += "(" |
---|
293 | gMenuStr2c += "(" |
---|
294 | gMenuStr2d = "Show HFIR SANS Reduction Macros" |
---|
295 | gMenuStr2e += "(" |
---|
296 | |
---|
297 | BuildMenu "Macros" |
---|
298 | break |
---|
299 | |
---|
300 | case "Hide HANARO SANS Reduction Macros": |
---|
301 | HideShowWindowsInList(SANSRed_WinList,1) |
---|
302 | |
---|
303 | // change the facility label, disable the others |
---|
304 | gMenuStr2a += "(" |
---|
305 | gMenuStr2b += "(" |
---|
306 | gMenuStr2c += "(" |
---|
307 | gMenuStr2d += "(" |
---|
308 | gMenuStr2e = "Show HANARO SANS Reduction Macros" |
---|
309 | |
---|
310 | BuildMenu "Macros" |
---|
311 | break |
---|
312 | |
---|
313 | /////////////// |
---|
314 | case "Show NCNR SANS Reduction Macros": |
---|
315 | HideShowWindowsInList(SANSRed_WinList,0) |
---|
316 | |
---|
317 | // change the facility label, disable the others |
---|
318 | gMenuStr2a = "Hide NCNR SANS Reduction Macros" |
---|
319 | gMenuStr2b += "(" |
---|
320 | gMenuStr2c += "(" |
---|
321 | gMenuStr2d += "(" |
---|
322 | gMenuStr2e += "(" |
---|
323 | |
---|
324 | BuildMenu "Macros" |
---|
325 | break |
---|
326 | |
---|
327 | case "Show QUOKKA SANS Reduction Macros": |
---|
328 | HideShowWindowsInList(SANSRed_WinList,0) |
---|
329 | |
---|
330 | // change the facility label, disable the others |
---|
331 | gMenuStr2a += "(" |
---|
332 | gMenuStr2b = "Hide QUOKKA SANS Reduction Macros" |
---|
333 | gMenuStr2c += "(" |
---|
334 | gMenuStr2d += "(" |
---|
335 | gMenuStr2e += "(" |
---|
336 | |
---|
337 | BuildMenu "Macros" |
---|
338 | break |
---|
339 | |
---|
340 | case "Show ILL SANS Reduction Macros": |
---|
341 | HideShowWindowsInList(SANSRed_WinList,0) |
---|
342 | |
---|
343 | // change the facility label, disable the others |
---|
344 | gMenuStr2a += "(" |
---|
345 | gMenuStr2b += "(" |
---|
346 | gMenuStr2c = "Hide ILL SANS Reduction Macros" |
---|
347 | gMenuStr2d += "(" |
---|
348 | gMenuStr2e += "(" |
---|
349 | |
---|
350 | BuildMenu "Macros" |
---|
351 | break |
---|
352 | |
---|
353 | case "Show HFIR SANS Reduction Macros": |
---|
354 | HideShowWindowsInList(SANSRed_WinList,0) |
---|
355 | |
---|
356 | // change the facility label, disable the others |
---|
357 | gMenuStr2a += "(" |
---|
358 | gMenuStr2b += "(" |
---|
359 | gMenuStr2c += "(" |
---|
360 | gMenuStr2d = "Hide HFIR SANS Reduction Macros" |
---|
361 | gMenuStr2e += "(" |
---|
362 | |
---|
363 | BuildMenu "Macros" |
---|
364 | break |
---|
365 | |
---|
366 | case "Show HANARO SANS Reduction Macros": |
---|
367 | HideShowWindowsInList(SANSRed_WinList,0) |
---|
368 | |
---|
369 | // change the facility label, disable the others |
---|
370 | gMenuStr2a += "(" |
---|
371 | gMenuStr2b += "(" |
---|
372 | gMenuStr2c += "(" |
---|
373 | gMenuStr2d += "(" |
---|
374 | gMenuStr2e = "Hide HANARO SANS Reduction Macros" |
---|
375 | |
---|
376 | BuildMenu "Macros" |
---|
377 | break |
---|
378 | |
---|
379 | |
---|
380 | // case "Unload NCNR SANS Reduction Macros": |
---|
381 | // // very dangerous - don't really want to implement this because it will surely crash |
---|
382 | // Execute/P "DELETEINCLUDE \"Includes_v520\"" |
---|
383 | // Execute/P "COMPILEPROCEDURES " |
---|
384 | // DoWindow Main_Panel |
---|
385 | // if(V_Flag) |
---|
386 | // DoWindow/K Main_Panel |
---|
387 | // endif |
---|
388 | // |
---|
389 | // gMenuStr2a = "Load NCNR SANS Reduction Macros" |
---|
390 | // gMenuStr2b = "-" |
---|
391 | // |
---|
392 | // BuildMenu "Macros" |
---|
393 | // |
---|
394 | // break |
---|
395 | |
---|
396 | default: |
---|
397 | Abort "Invalid Menu Selection" |
---|
398 | endswitch |
---|
399 | |
---|
400 | end |
---|
401 | |
---|
402 | // now add for the USANS Reduction |
---|
403 | // a = NCNR |
---|
404 | // b = HANARO |
---|
405 | Function NCNR_USANSReductionLoader(itemStr) |
---|
406 | String itemStr |
---|
407 | |
---|
408 | if (str2num(stringByKey("IGORVERS",IgorInfo(0))) < 6.2) |
---|
409 | Abort "Your version of Igor is lower than 6.2, these macros need version 6.2 or higher.... " |
---|
410 | endif |
---|
411 | |
---|
412 | NewDataFolder/O root:Packages //create the folder for string variable |
---|
413 | String/G root:Packages:NCNRItemStr3a = "Load NCNR USANS Reduction Macros" |
---|
414 | String/G root:Packages:NCNRItemStr3b = "Load HANARO USANS Reduction Macros" |
---|
415 | SVAR gMenuStr3a = root:Packages:NCNRItemStr3a |
---|
416 | SVAR gMenuStr3b = root:Packages:NCNRItemStr3b |
---|
417 | |
---|
418 | String USANS_WinList = "USANS_Panel;COR_Graph;RawDataWin;Desmear_Graph;USANS_Slope;UCALC;" |
---|
419 | |
---|
420 | strswitch(itemStr) // string switch |
---|
421 | case "Load NCNR USANS Reduction Macros": |
---|
422 | Execute/P "INSERTINCLUDE \"NCNR_USANS_Includes_v230\"" |
---|
423 | Execute/P "COMPILEPROCEDURES " |
---|
424 | Execute/P ("ShowUSANSPanel()") |
---|
425 | Execute/P ("DoIgorMenu \"Control\" \"Retrieve All Windows\"") |
---|
426 | |
---|
427 | // change the facility label, disable the others |
---|
428 | gMenuStr3a = "Hide NCNR USANS Reduction Macros" |
---|
429 | gMenuStr3b += "(" |
---|
430 | |
---|
431 | BuildMenu "Macros" |
---|
432 | break |
---|
433 | |
---|
434 | case "Load HANARO USANS Reduction Macros": |
---|
435 | Execute/P "INSERTINCLUDE \"KIST_USANS_Includes_v230\"" |
---|
436 | Execute/P "COMPILEPROCEDURES " |
---|
437 | Execute/P ("ShowUSANSPanel()") |
---|
438 | Execute/P ("DoIgorMenu \"Control\" \"Retrieve All Windows\"") |
---|
439 | |
---|
440 | // change the facility label, disable the others |
---|
441 | gMenuStr3a += "(" |
---|
442 | gMenuStr3b = "Hide HANARO USANS Reduction Macros" |
---|
443 | |
---|
444 | BuildMenu "Macros" |
---|
445 | break |
---|
446 | |
---|
447 | /////////////////// |
---|
448 | |
---|
449 | case "Hide NCNR USANS Reduction Macros": |
---|
450 | HideShowWindowsInList(USANS_WinList,1) |
---|
451 | |
---|
452 | // change the facility label, disable the others |
---|
453 | gMenuStr3a = "Show NCNR USANS Reduction Macros" |
---|
454 | gMenuStr3b += "(" |
---|
455 | |
---|
456 | BuildMenu "Macros" |
---|
457 | break |
---|
458 | |
---|
459 | case "Hide HANARO USANS Reduction Macros": |
---|
460 | HideShowWindowsInList(USANS_WinList,1) |
---|
461 | |
---|
462 | // change the facility label, disable the others |
---|
463 | gMenuStr3a += "(" |
---|
464 | gMenuStr3b = "Show HANARO USANS Reduction Macros" |
---|
465 | |
---|
466 | BuildMenu "Macros" |
---|
467 | break |
---|
468 | |
---|
469 | /////////////////// |
---|
470 | case "Show NCNR USANS Reduction Macros": |
---|
471 | HideShowWindowsInList(USANS_WinList,0) |
---|
472 | |
---|
473 | // change the facility label, disable the others |
---|
474 | gMenuStr3a = "Hide NCNR USANS Reduction Macros" |
---|
475 | gMenuStr3b += "(" |
---|
476 | |
---|
477 | BuildMenu "Macros" |
---|
478 | break |
---|
479 | |
---|
480 | case "Show HANARO USANS Reduction Macros": |
---|
481 | HideShowWindowsInList(USANS_WinList,0) |
---|
482 | |
---|
483 | // change the facility label, disable the others |
---|
484 | gMenuStr3a += "(" |
---|
485 | gMenuStr3b = "Hide HANARO USANS Reduction Macros" |
---|
486 | |
---|
487 | BuildMenu "Macros" |
---|
488 | break |
---|
489 | |
---|
490 | |
---|
491 | // case "Unload NCNR USANS Reduction Macros": |
---|
492 | // // very dangerous - don't really want to implement this because it will surely crash |
---|
493 | // Execute/P "DELETEINCLUDE \"USANS_Includes_v230\"" |
---|
494 | // Execute/P "COMPILEPROCEDURES " |
---|
495 | // DoWindow USANS_Panel |
---|
496 | // if(V_Flag) |
---|
497 | // DoWindow/K USANS_Panel |
---|
498 | // endif |
---|
499 | // |
---|
500 | // gMenuStr3a = "Load NCNR USANS Reduction Macros" |
---|
501 | // gMenuStr3b = "-" |
---|
502 | // |
---|
503 | // BuildMenu "Macros" |
---|
504 | // |
---|
505 | // break |
---|
506 | default: |
---|
507 | Abort "Invalid Menu Selection" |
---|
508 | endswitch |
---|
509 | |
---|
510 | end |
---|
511 | |
---|
512 | // 1 = hide, 0 = show |
---|
513 | Function HideShowWindowsInList(list,hide) |
---|
514 | String list |
---|
515 | Variable hide |
---|
516 | |
---|
517 | String item |
---|
518 | Variable ii,num=ItemsinList(list) |
---|
519 | for(ii=0;ii<num;ii+=1) |
---|
520 | item = StringFromList(ii, list , ";") |
---|
521 | DoWindow $item |
---|
522 | if(V_Flag) |
---|
523 | DoWindow/HIDE=(hide) $item |
---|
524 | endif |
---|
525 | endfor |
---|
526 | return(0) |
---|
527 | End |
---|
528 | |
---|
529 | // now add for the SANS Live |
---|
530 | Function NCNR_SANSLiveLoader(itemStr) |
---|
531 | String itemStr |
---|
532 | |
---|
533 | if (str2num(stringByKey("IGORVERS",IgorInfo(0))) < 6.2) |
---|
534 | Abort "Your version of Igor is lower than 6.2, these macros need version 6.2 or higher.... " |
---|
535 | endif |
---|
536 | |
---|
537 | NewDataFolder/O root:Packages //create the folder for string variable |
---|
538 | String/G root:Packages:NCNRItemStr4a = itemStr |
---|
539 | String/G root:Packages:NCNRItemStr4b = itemStr |
---|
540 | SVAR gMenuStr4a = root:Packages:NCNRItemStr4a |
---|
541 | SVAR gMenuStr4b = root:Packages:NCNRItemStr4b |
---|
542 | |
---|
543 | String SANSLive_WinList = "RT_Panel;SANS_Data;" |
---|
544 | //SANSLive_WinList += "FitRPAPanel;SANS_Histo;drawMaskWin;Multiple_Reduce_Panel;NSORT_Panel;NSORT_Graph;CombineTable;ToCombine;Patch_Panel;" |
---|
545 | //SANSLive_WinList += "ProtocolPanel;Schematic_Layout;Tile_2D;RAW_to_ASCII;Trans_Panel;TransFileTable;ScatterFileTable;Convert_to_Trans;" |
---|
546 | //SANSLive_WinList += "WorkFileMath;Pref_Panel;Subtract_1D_Panel;Plot_Sub1D;SASCALC;MC_SASCALC;Saved_Configurations;TISANE;" |
---|
547 | strswitch(itemStr) // string switch |
---|
548 | case "Load NCNR SANS Live Data": |
---|
549 | Execute/P "INSERTINCLUDE \"Includes_v520\"" |
---|
550 | Execute/P "COMPILEPROCEDURES " |
---|
551 | Execute/P ("Init_for_RealTime()") |
---|
552 | |
---|
553 | gMenuStr4a = "Hide NCNR SANS Live Data" |
---|
554 | // gMenuStr2b = "Unload NCNR SANS Reduction Macros" |
---|
555 | gMenuStr4b = "-" |
---|
556 | BuildMenu "Macros" |
---|
557 | |
---|
558 | break |
---|
559 | case "Unload NCNR SANS Live Data": |
---|
560 | // very dangerous - don't really want to implement this because it will surely crash |
---|
561 | Execute/P "DELETEINCLUDE \"Includes_v520\"" |
---|
562 | Execute/P "COMPILEPROCEDURES " |
---|
563 | DoWindow Main_Panel |
---|
564 | if(V_Flag) |
---|
565 | DoWindow/K Main_Panel |
---|
566 | endif |
---|
567 | |
---|
568 | gMenuStr4a = "Load NCNR SANS Live Data" |
---|
569 | gMenuStr4b = "-" |
---|
570 | |
---|
571 | BuildMenu "Macros" |
---|
572 | |
---|
573 | break |
---|
574 | case "Hide NCNR SANS Live Data": |
---|
575 | HideShowWindowsInList(SANSLive_WinList,1) |
---|
576 | |
---|
577 | gMenuStr4a = "Show NCNR SANS Reduction Macros" |
---|
578 | // gMenuStr2b = "Unload NCNR SANS Reduction Macros" |
---|
579 | gMenuStr4b = "-" |
---|
580 | BuildMenu "Macros" |
---|
581 | |
---|
582 | break |
---|
583 | case "Show NCNR SANS Reduction Macros": |
---|
584 | HideShowWindowsInList(SANSLive_WinList,0) |
---|
585 | |
---|
586 | gMenuStr4a = "Hide NCNR SANS Reduction Macros" |
---|
587 | // gMenuStr2b = "Unload NCNR SANS Reduction Macros" |
---|
588 | gMenuStr4b = "-" |
---|
589 | BuildMenu "Macros" |
---|
590 | |
---|
591 | break |
---|
592 | default: |
---|
593 | Abort "Invalid Menu Selection" |
---|
594 | endswitch |
---|
595 | |
---|
596 | end |
---|
597 | |
---|
598 | Function WhatSymbolsAreDefined() |
---|
599 | |
---|
600 | #if (exists("QUOKKA")==6) |
---|
601 | print "function QUOKKA defined" |
---|
602 | #else |
---|
603 | print "function QUOKKA NOT defined" |
---|
604 | #endif |
---|
605 | |
---|
606 | #if(exists("HFIR")==6) |
---|
607 | print "function HFIR defined" |
---|
608 | #else |
---|
609 | print "function HFIR NOT defined" |
---|
610 | #endif |
---|
611 | |
---|
612 | #if(exists("ILL_D22")==6) |
---|
613 | print "function ILL_D22 defined" |
---|
614 | #else |
---|
615 | print "function ILL_D22 NOT defined" |
---|
616 | #endif |
---|
617 | |
---|
618 | |
---|
619 | |
---|
620 | // for a lot of reasons, defined symbols do not work |
---|
621 | // mostly, the procedures are compiled before the symbols are |
---|
622 | // defined (or re-defined) |
---|
623 | // another issues is that they are persistent, and don't disappear |
---|
624 | // until Igor is quit. |
---|
625 | |
---|
626 | // SetIgorOption poundDefine=QUOKKA? |
---|
627 | // if(V_flag) |
---|
628 | // print "QUOKKA defined" |
---|
629 | // else |
---|
630 | // print "QUOKKA NOT defined" |
---|
631 | // endif |
---|
632 | // |
---|
633 | // SetIgorOption poundDefine=HFIR? |
---|
634 | // if(V_flag) |
---|
635 | // print "HFIR defined" |
---|
636 | // else |
---|
637 | // print "HFIR NOT defined" |
---|
638 | // endif |
---|
639 | // |
---|
640 | // SetIgorOption poundDefine=ILL_D22? |
---|
641 | // if(V_flag) |
---|
642 | // print "ILL_D22 defined" |
---|
643 | // else |
---|
644 | // print "ILL_D22 NOT defined" |
---|
645 | // endif |
---|
646 | |
---|
647 | return(0) |
---|
648 | End |
---|
649 | |
---|
650 | Proc ClearDefinedSymbols() |
---|
651 | SetIgorOption poundUnDefine=QUOKKA |
---|
652 | SetIgorOption poundUnDefine=HFIR |
---|
653 | SetIgorOption poundUnDefine=ILL_D22 |
---|
654 | End |
---|
655 | |
---|
656 | Function PolarizationLoader() |
---|
657 | |
---|
658 | // be sure that the SANS reduction is loaded and compiles |
---|
659 | NCNR_SANSReductionLoader("Load NCNR SANS Reduction Macros") |
---|
660 | |
---|
661 | // then the polarization |
---|
662 | Execute/P "INSERTINCLUDE \"Include_Polarization\"";Execute/P "COMPILEPROCEDURES " |
---|
663 | BuildMenu "Macros" |
---|
664 | |
---|
665 | return(0) |
---|
666 | End |
---|
667 | |
---|
668 | // loads all of the FFT procedures and the fit functions too |
---|
669 | Function RealSpaceLoader() |
---|
670 | |
---|
671 | // be sure that the SANS Analysis is loaded and compiles |
---|
672 | NCNR_AnalysisLoader("Load NCNR Analysis Macros") |
---|
673 | |
---|
674 | // then the FFT files |
---|
675 | Execute/P "INSERTINCLUDE \"FFT_Cubes_Includes\"" |
---|
676 | Execute/P "INSERTINCLUDE \"FFT_Fit_Includes\"" |
---|
677 | Execute/P "COMPILEPROCEDURES " |
---|
678 | Execute/P "Init_FFT()" |
---|
679 | |
---|
680 | BuildMenu "Macros" |
---|
681 | |
---|
682 | return(0) |
---|
683 | End |
---|
684 | |
---|
685 | Function EventModeLoader() |
---|
686 | |
---|
687 | // be sure that the SANS reduction is loaded and compiles |
---|
688 | NCNR_SANSReductionLoader("Load NCNR SANS Reduction Macros") |
---|
689 | |
---|
690 | // then bring up the Event Mode panel |
---|
691 | Execute/P "Show_Event_Panel()" |
---|
692 | // BuildMenu "Macros" |
---|
693 | |
---|
694 | return(0) |
---|
695 | End |
---|