source: sans/Dev/trunk/NCNR_Igor_Procedures/NCNR_Package_Loader.ipf @ 916

Last change on this file since 916 was 912, checked in by srkline, 10 years ago

Added Auto-Fit (Batch fitting) to the Macros menu as a beta item

Updated broken links in Model_Docs

Added Auto-Fit help to the Analysis Help file as a new package

Updated the current version to 7.20, a new release for the web site

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