source: sans/SANSReduction/trunk/Put in User Procedures/SANS_Reduction_v5.00/MainPanel.ipf @ 41

Last change on this file since 41 was 41, checked in by srkline, 16 years ago

change to UNIX line endings

File size: 17.8 KB
Line 
1#pragma rtGlobals=1             // Use modern global access method.
2#pragma version=5.0
3#pragma IgorVersion=4.0
4
5//*********************
6// Vers 1.2 091901
7//
8//draws main panel of buttons for all data reduction operations
9//panel can't be killed (without really trying)
10// initialize() from the SANS menu will redraw the panel
11//panel simply dispatches to previously written procedures (not functions)
12//
13// **function names are really self-explanatory...see the called function for the real details
14//
15//**********************
16
17Proc PickPath_MainButtonProc(ctrlName) : ButtonControl
18        String ctrlName
19       
20        PickPath()
21End
22
23Proc DrawMask_MainButtonProc(ctrlName) : ButtonControl
24        String ctrlName
25       
26        DrawMask()
27End
28
29Proc DisplayMainButtonProc(ctrlName) : ButtonControl
30        String ctrlName
31
32        LoadSANSData()
33End
34
35Proc PatchMainButtonProc(ctrlName) : ButtonControl
36        String ctrlName
37
38        PatchFiles()
39End
40
41Proc TransMainButtonProc(ctrlName) : ButtonControl
42        String ctrlName
43
44         CalcTrans()
45End
46
47Proc BuildProtocol_MainButtonProc(ctrlName) : ButtonControl
48        String ctrlName
49
50        ReductionProtocolPanel()
51End
52
53Proc ReduceAFile_MainButtonProc(ctrlName) : ButtonControl
54        String ctrlName
55
56        ReduceAFile()
57End
58
59Proc ReduceMultiple_MainButtonProc(ctrlName) : ButtonControl
60        String ctrlName
61
62        ReduceMultipleFiles()
63End
64
65Proc Plot1D_MainButtonProc(ctrlName) : ButtonControl
66        String ctrlName
67
68        //LoadOneDData()
69        Show_Plot_Manager()
70End
71
72Proc Sort1D_MainButtonProc(ctrlName) : ButtonControl
73        String ctrlName
74
75        ShowNSORTPanel()
76End
77
78Proc Fit1D_MainButtonProc(ctrlName) : ButtonControl
79        String ctrlName
80
81        OpenFITPanel()
82End
83
84Proc FitRPA_MainButtonProc(ctrlName) : ButtonControl
85        String ctrlName
86
87        OpenFITRPAPanel()
88End
89
90Proc Subtract1D_MainButtonProc(ctrlName) : ButtonControl
91        String ctrlName
92
93        OpenSubtract1DPanel()
94End
95
96Proc DisplayInterm_MainButtonProc(ctrlName) : ButtonControl
97        String ctrlName
98
99        ChangeDisplay()
100End
101
102Proc ReadMask_MainButtonProc(ctrlName) : ButtonControl
103        String ctrlName
104
105        ReadMask()
106End
107
108Proc Draw3D_MainButtonProc(ctrlName) : ButtonControl
109        String ctrlName
110
111        Plot3DSurface()
112End
113
114//on Misc Ops tab, generates a notebook
115Proc CatShort_MainButtonProc(ctrlName) : ButtonControl
116        String ctrlName
117
118        BuildCatShortNotebook()
119End
120
121//button is labeled "File Catalog"
122Proc CatVShort_MainButtonProc(ctrlName) : ButtonControl
123        String ctrlName
124
125        //BuildCatVeryShortNotebook()
126        BuildCatVeryShortTable()
127End
128
129Proc ShowCatShort_MainButtonProc(ctrlName) : ButtonControl
130        String ctrlName
131
132        ShowCATWindow()
133End
134
135Proc ShowSchematic_MainButtonProc(ctrlName) : ButtonControl
136        String ctrlName
137       
138        if(root:myGlobals:isDemoVersion == 1)
139                //      comment out in DEMO_MODIFIED version, and show the alert
140                DoAlert 0,"This operation is not available in the Demo version of IGOR"
141        else
142                ShowSchematic()
143        endif
144End
145
146Proc ShowAvePanel_MainButtonProc(ctrlName) : ButtonControl
147        String ctrlName
148
149        ShowAveragePanel()
150End
151
152Proc HelpMainButtonProc(ctrlName) : ButtonControl
153        String ctrlName
154        DisplayHelpTopic/K=1 "SANS Data Reduction Tutorial"
155End
156
157Proc ShowTilePanel_MainButtonProc(ctrlName) : ButtonControl
158        String ctrlName
159       
160        if(root:myGlobals:isDemoVersion == 1)
161                //      comment out in DEMO_MODIFIED version, and show the alert
162                DoAlert 0,"This operation is not available in the Demo version of IGOR"
163        else
164                Show_Tile_2D_Panel()
165        endif
166End
167
168Proc NG1TransConv_MainButtonProc(ctrlName) : ButtonControl
169        String ctrlName
170
171        TransformToTransFile()
172End
173
174Proc CopyWork_MainButtonProc(ctrlName) : ButtonControl
175        String ctrlName
176
177        CopyWorkFolder()                //will put up missing param dialog
178End
179
180Proc PRODIV_MainButtonProc(ctrlName) : ButtonControl
181        String ctrlName
182
183        MakeDIVFile("","")                     
184End
185
186
187Proc WorkMath_MainButtonProc(ctrlName) : ButtonControl
188        String ctrlName
189
190        Show_WorkMath_Panel()
191End
192
193Proc Raw2ASCII_MainButtonProc(ctrlName) : ButtonControl
194        String ctrlName
195
196        Export_RAW_Ascii_Panel()
197End
198
199Proc RealTime_MainButtonProc(ctrlName) : ButtonControl
200        String ctrlName
201
202        if(root:myGlobals:isDemoVersion == 1)
203                //      comment out in DEMO_MODIFIED version, and show the alert
204                DoAlert 0,"This operation is not available in the Demo version of IGOR"
205        else
206                Show_RealTime_Panel()
207        endif
208End
209
210Proc Preferences_MainButtonProc(ctrlName) : ButtonControl
211        String ctrlName
212
213        Show_Preferences_Panel()
214End
215////////////////////////////////////////////////
216//************* NEW version of Main control Panel *****************
217//
218// button management for the different tabs is handled by consistent
219// naming of each button with its tab number as documented below
220// then MainTabProc() can enable/disable the appropriate buttons for the
221// tab that is displayed
222//
223// panel must be killed and redrawn for new buttons to appear
224//
225Window Main_Panel()
226        PauseUpdate; Silent 1           // building window...
227        NewPanel /W=(500,60,924,320) /K=2 as "SANS Reduction Controls"
228        ModifyPanel cbRGB=(65535,58981,27524)
229        ModifyPanel fixedSize=1
230//////
231//on main portion of panel
232        Button MainButtonA,pos={8,8},size={80,20},title="Pick Path",proc=PickPath_MainButtonProc
233        Button MainButtonA,help={"Pick the local data folder that contains the SANS data"}
234        Button MainButtonB,pos={100,8},size={90,20},proc=CatVShort_MainButtonProc,title="File Catalog"
235        Button MainButtonB,help={"This will generate a condensed CATalog table of all files in a specified local folder"}
236        Button MainButtonC,pos={250,8},size={50,20},proc=HelpMainButtonProc,title="Help"
237        Button MainButtonC,help={"Display the help file"}
238       
239        TabControl MainTab,pos={7,49},size={410,202},tabLabel(0)="Raw Data",proc=MainTabProc
240        TabControl MainTab,tabLabel(1)="Reduction",tabLabel(2)="1-D Ops",tabLabel(3)="2-D Ops",tabLabel(4)="Misc Ops"
241        TabControl MainTab,value=0
242       
243//on tab(0) - Raw Data - initially visible
244        Button MainButton_0a,pos={15,90},size={130,20},proc=DisplayMainButtonProc,title="Display Raw Data"
245        Button MainButton_0a,help={"Display will load and plot a single 2-D raw data file"}
246        Button MainButton_0b,pos={15,120},size={70,20},proc=PatchMainButtonProc,title="Patch"
247        Button MainButton_0b,help={"Patch will update incorrect information in raw data headers"}
248        Button MainButton_0c,pos={15,150},size={110,20},proc=TransMainButtonProc,title="Transmission"
249        Button MainButton_0c,help={"Shows the \"Patch\" panel which allows calculation of sample transmissions and entering these values into raw data headers"}
250        Button MainButton_0d,pos={15,180},size={130,20},proc=RealTime_MainButtonProc,title="RealTime Display"
251        Button MainButton_0d,help={"Shows the panel for control of the RealTime data display. Only used during data collection"}
252
253//on tab(1) - Reduction
254        Button MainButton_1a,pos={15,90},size={110,20},proc=BuildProtocol_MainButtonProc,title="Build Protocol"
255        Button MainButton_1a,help={"Shows a panel where the CATalog window is used as input for creating a protocol. Can also be used for standard reductions"}
256        Button MainButton_1b,pos={15,120},size={110,20},proc=ReduceAFile_MainButtonProc,title="Reduce a File"
257        Button MainButton_1b,help={"Presents a questionnare for creating a reduction protocol, then reduces a single file"}
258        Button MainButton_1c,pos={15,150},size={160,20},proc=ReduceMultiple_MainButtonProc,title="Reduce Multiple Files"
259        Button MainButton_1c,help={"Use for reducing multiple raw datasets after protocol(s) have been created"}
260        Button MainButton_1d,pos={15,180},size={110,20},proc=ShowCatShort_MainButtonProc,title="Show CAT Table"
261        Button MainButton_1d,help={"This button will bring the CATalog window to the front, if it exists"}
262        Button MainButton_1a,disable=1
263        Button MainButton_1b,disable=1
264        Button MainButton_1c,disable=1
265        Button MainButton_1d,disable=1
266
267//on tab(2) - 1-D operations
268        Button MainButton_2a,pos={15,90},size={60,20},proc=Plot1D_MainButtonProc,title="Plot"
269        Button MainButton_2a,help={"Loads and plots a 1-D dataset in the format expected by \"FIT\""}
270        Button MainButton_2b,pos={15,120},size={60,20},proc=Sort1D_MainButtonProc,title="Sort"
271        Button MainButton_2b,help={"Sorts and combines 2 or 3 separate 1-D datasets into a single file. Use \"Plot\" button to import 1-D data files"}
272        Button MainButton_2c,pos={15,150},size={60,20},proc=Fit1D_MainButtonProc,title="FIT"
273        Button MainButton_2c,help={"Shows panel for performing a variety of linearized fits to 1-D data files. Use \"Plot\" button to import 1-D data files"}
274        Button MainButton_2d,pos={15,180},size={60,20},proc=FITRPA_MainButtonProc,title="FIT/RPA"
275        Button MainButton_2d,help={"Shows panel for performing a fit to a polymer standard."}
276        Button MainButton_2e,pos={120,90},size={90,20},proc=Subtract1D_MainButtonProc,title="Subtract 1D"
277        Button MainButton_2e,help={"Shows panel for subtracting two 1-D data sets"}
278        Button MainButton_2a,disable=1
279        Button MainButton_2b,disable=1
280        Button MainButton_2c,disable=1
281        Button MainButton_2d,disable=1
282        Button MainButton_2e,disable=1
283
284//on tab(3) - 2-D Operations
285        Button MainButton_3a,pos={15,90},size={90,20},proc=DisplayInterm_MainButtonProc,title="Display 2D"
286        Button MainButton_3a,help={"Display will plot a 2-D work data file that has previously been created during data reduction"}
287        Button MainButton_3b,pos={15,120},size={90,20},title="Draw Mask",proc=DrawMask_MainButtonProc
288        Button MainButton_3b,help={"Draw a mask file and save it."}
289        Button MainButton_3c,pos={15,150},size={90,20},proc=ReadMask_MainButtonProc,title="Read Mask"
290        Button MainButton_3c,help={"Reads a mask file into the proper work folder, and displays a small image of the mask. Yellow areas will be excluded from the data"}
291        Button MainButton_3d,pos={15,180},size={100,20},title="Tile RAW 2D",proc=ShowTilePanel_MainButtonProc
292        Button MainButton_3d,help={"Adds selected RAW data files to a layout."}
293        Button MainButton_3e,pos={150,90},size={100,20},title="Copy Work",proc=CopyWork_MainButtonProc
294        Button MainButton_3e,help={"Copies WORK data from specified folder to destination folder."}
295        Button MainButton_3f,pos={150,120},size={110,20},title="WorkFile Math",proc=WorkMath_MainButtonProc
296        Button MainButton_3f,help={"Perfom simple math operations on workfile data"}
297       
298        Button MainButton_3a,disable=1
299        Button MainButton_3b,disable=1
300        Button MainButton_3c,disable=1
301        Button MainButton_3d,disable=1
302        Button MainButton_3e,disable=1
303        Button MainButton_3f,disable=1
304
305//on tab(4) - Miscellaneous operations
306        Button MainButton_4a,pos={15,90},size={80,20},proc=Draw3D_MainButtonProc,title="3D Display"
307        Button MainButton_4a,help={"Plots a 3-D surface of the selected file type"}
308        Button MainButton_4b,pos={15,120},size={120,20},proc=ShowSchematic_MainButtonProc,title="Show Schematic"
309        Button MainButton_4b,help={"Use this to show a schematic of the data reduction process for a selected sample file and reduction protocol"}
310        Button MainButton_4c,pos={15,150},size={80,20},proc=ShowAvePanel_MainButtonProc,title="Average"
311        Button MainButton_4c,help={"Shows a panel for interactive selection of the 1-D averaging step"}
312        Button MainButton_4d,pos={15,180},size={110,20},proc=CatShort_MainButtonProc,title="CAT/Notebook"
313        Button MainButton_4d,help={"This will generate a CATalog notebook of all files in a specified local folder"}
314        Button MainButton_4e,pos={180,90},size={130,20},proc=NG1TransConv_MainButtonProc,title="NG1 Files to Trans"
315        Button MainButton_4e,help={"Converts NG1 transmission data files to be interpreted as such"}
316        Button MainButton_4f,pos={180,120},size={130,20},proc=PRODIV_MainButtonProc,title="Make DIV file"
317        Button MainButton_4f,help={"Merges two stored workfiles (CORrected) into a DIV file, and saves the result"}
318        Button MainButton_4g,pos={180,150},size={130,20},proc=Raw2ASCII_MainButtonProc,title="RAW ASCII Export"
319        Button MainButton_4g,help={"Exports selected RAW (2D) data file(s) as ASCII, either as pixel values or I(Qx,Qy)"}
320        Button MainButton_4h,pos={180,180},size={130,20},proc=Preferences_MainButtonProc,title="Preferences"
321        Button MainButton_4h,help={"Sets user preferences for selected parameters"}
322       
323        Button MainButton_4a,disable=1
324        Button MainButton_4b,disable=1
325        Button MainButton_4c,disable=1
326        Button MainButton_4d,disable=1
327        Button MainButton_4e,disable=1
328        Button MainButton_4f,disable=1
329        Button MainButton_4g,disable=1
330        Button MainButton_4h,disable=1
331//     
332EndMacro
333
334// function to control the drawing of buttons in the TabControl on the main panel
335// Naming scheme for the buttons MUST be strictly adhered to... else buttons will
336// appear in odd places...
337// all buttons are named MainButton_NA where N is the tab number and A is the letter denoting
338// the button's position on that particular tab.
339// in this way, buttons will always be drawn correctly..
340//
341Function MainTabProc(name,tab)
342        String name
343        Variable tab
344       
345//      Print "name,number",name,tab
346        String ctrlList = ControlNameList("",";"),item="",nameStr=""
347        Variable num = ItemsinList(ctrlList,";"),ii,onTab
348        for(ii=0;ii<num;ii+=1)
349                //items all start w/"MainButton_"
350                item=StringFromList(ii, ctrlList ,";")
351                nameStr=item[0,10]
352                if(cmpstr(nameStr,"MainButton_")==0)
353                        onTab = str2num(item[11])
354                        Button $item,disable=(tab!=onTab)
355                endif
356        endfor
357End
358
359
360//********************************
361//************* OLD version of Main Panel *************
362//Window Main_Panel()
363Window Main_Panel_OLD()
364        PauseUpdate; Silent 1           // building window...
365        NewPanel /K=2 /W=(630,75,938,408) as "SANS Reduction Controls"
366        ModifyPanel cbRGB=(52428,52425,1)
367        ModifyPanel fixedSize=1
368        SetDrawLayer UserBack
369        SetDrawEnv fillfgc= (24672,51914,36494)
370        DrawRect 2,250,303,325
371        SetDrawEnv fillfgc= (24672,51914,36494)
372        DrawRect 2,243,186,194
373        SetDrawEnv fillfgc= (24672,51914,36494)
374        DrawRect 2,140,303,189
375        SetDrawEnv fillfgc= (24672,51914,36494)
376        DrawRect 2,59,303,133
377        SetDrawEnv fillfgc= (24672,51914,36494)
378        DrawRect 2,2,303,53
379        SetDrawEnv fstyle= 5
380        DrawText 6,20,"Raw Data Operations"
381        SetDrawEnv fstyle= 5
382        DrawText 6,79,"Data Reduction Operations"
383        SetDrawEnv fstyle= 5
384        DrawText 6,158,"1-D Data Operations"
385        SetDrawEnv fstyle= 5
386        DrawText 6,212,"Intermediate 2-D Files"
387        SetDrawEnv fstyle= 5
388        DrawText 6,268,"Miscellaneous"
389        SetDrawEnv fillfgc= (24672,51914,36494)
390        DrawRect 190,194,303,242
391        SetDrawEnv fstyle= 5
392        DrawText 200,211,"Data Folder"
393        Button MainButton_0,pos={6,25},size={70,20},proc=DisplayMainButtonProc,title="Display"
394        Button MainButton_0,help={"Display will load and plot a single 2-D raw data file"}
395        Button MainButton_1,pos={86,25},size={70,20},proc=PatchMainButtonProc,title="Patch"
396        Button MainButton_1,help={"Patch will update incorrect information in raw data headers"}
397        Button MainButton_2,pos={166,25},size={110,20},proc=TransMainButtonProc,title="Transmission"
398        Button MainButton_2,help={"Shows the \"Patch\" panel which allows calculation of sample transmissions and entering these values into raw data headers"}
399        Button MainButton_3,pos={6,82},size={110,20},proc=BuildProtocol_MainButtonProc,title="Build Protocol"
400        Button MainButton_3,help={"Shows a panel where the CATalog window is used as input for creating a protocol. Can also be used for standard reductions"}
401        Button MainButton_4,pos={147,82},size={110,20},proc=ReduceAFile_MainButtonProc,title="Reduce a File"
402        Button MainButton_4,help={"Presents a questionnare for creating a reduction protocol, then reduces a single file"}
403        Button MainButton_5,pos={6,107},size={160,20},proc=ReduceMultiple_MainButtonProc,title="Reduce Multiple Files"
404        Button MainButton_5,help={"Use for reducing multiple raw datasets after protocol(s) have been created"}
405
406        Button MainButton_19,pos={175,107},size={80,20},title="Draw Mask",proc=DrawMask_MainButtonProc
407        Button MainButton_19,help={"Draw a mask file and save it."}
408       
409        Button MainButton_6,pos={6,162},size={60,20},proc=Plot1D_MainButtonProc,title="Plot"
410        Button MainButton_6,help={"Loads and plots a 1-D dataset in the format expected by \"Sort\" and \"FIT\""}
411        Button MainButton_7,pos={77,162},size={60,20},proc=Sort1D_MainButtonProc,title="Sort"
412        Button MainButton_7,help={"Sorts and combines 2 or 3 separate 1-D datasets into a single file. Use \"Plot\" button to import 1-D data files"}
413        Button MainButton_8,pos={147,162},size={60,20},proc=Fit1D_MainButtonProc,title="FIT"
414        Button MainButton_8,help={"Shows panel for performing a variety of linearized fits to 1-D data files. Use \"Plot\" button to import 1-D data files"}
415
416        Button MainButton_17,pos={217,162},size={60,20},proc=FITRPA_MainButtonProc,title="FIT/RPA"
417        Button MainButton_17,help={"Shows panel for performing a fit to a polymer standard."}
418
419        Button MainButton_9,pos={6,216},size={70,20},proc=DisplayInterm_MainButtonProc,title="Display"
420        Button MainButton_9,help={"Display will plot a 2-D work data file that has previously been created during data reduction"}
421        Button MainButton_10,pos={89,216},size={90,20},proc=ReadMask_MainButtonProc,title="Read Mask"
422        Button MainButton_10,help={"Reads a mask file into the proper work folder, and displays a small image of the mask. Yellow areas will be excluded from the data"}
423        Button MainButton_11,pos={6,298},size={80,20},proc=Draw3D_MainButtonProc,title="3D Display"
424        Button MainButton_11,help={"Plots a 3-D surface of the selected file type"}
425        Button MainButton_12,pos={6,273},size={90,20},proc=CatShort_MainButtonProc,title="CAT/SHORT"
426        Button MainButton_12,help={"This will generate a CATalog window of all files in a specified local folder"}
427
428        Button MainButton_18,pos={106,273},size={90,20},proc=CatVShort_MainButtonProc,title="CAT/VShort"
429        Button MainButton_18,help={"This will generate a condensed CATalog table of all files in a specified local folder"}
430
431        Button MainButton_13,pos={206,273},size={90,20},proc=ShowCatShort_MainButtonProc,title="Show CAT"
432        Button MainButton_13,help={"This button will bring the CATalog window to the front, if it exists"}
433        Button MainButton_14,pos={96,298},size={110,20},proc=ShowSchematic_MainButtonProc,title="Show Schematic"
434        Button MainButton_14,help={"Use this to show a schematic of the data reduction process for a selected sample file and reduction protocol"}
435        Button MainButton_15,pos={216,298},size={80,20},proc=ShowAvePanel_MainButtonProc,title="Average"
436        Button MainButton_15,help={"Shows a panel for interactive selection of the 1-D averaging step"}
437        Button MainButton_16,pos={200,214},size={80,20},title="Pick Path",proc=PickPath_MainButtonProc
438        Button MainButton_16,help={"Pick the local data folder that contains the SANS data"}
439       
440EndMacro
441//****************above is OLD********************
Note: See TracBrowser for help on using the repository browser.