source: sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/SANSPreferences.ipf @ 601

Last change on this file since 601 was 601, checked in by ajj, 13 years ago
  • Added global variable and preference to set output format as XML
File size: 3.6 KB
Line 
1#pragma rtGlobals=1             // Use modern global access method.
2#pragma version=5.0
3#pragma IgorVersion=6.1
4
5
6///////////////////////////
7// user preferences
8//
9// globals are created in initialize.ipf
10//
11// this panel allows for user modification
12///////////////////////////
13Proc Show_Preferences_Panel()
14
15        DoWindow/F Pref_Panel
16        if(V_flag==0)
17                Init_Pref()
18                Pref_Panel()
19        Endif
20//      Print "Preferences Panel stub"
21End
22
23Proc init_pref()
24        // all creation of global values for the pref panel
25        // should be done in the experiment initialization
26        // since all these globals will be in active use
27        // even if the preferences are never actively set
28end
29
30Function LogScalePrefCheck(ctrlName,checked) : CheckBoxControl
31        String ctrlName
32        Variable checked
33       
34        NVAR gLog = root:myGlobals:gLogScalingAsDefault
35        glog=checked
36        //print "log pref checked = ",checked
37End
38
39Function DRKProtocolPref(ctrlName,checked) : CheckBoxControl
40        String ctrlName
41        Variable checked
42       
43        NVAR gDRK = root:myGlobals:gAllowDRK
44        gDRK = checked
45        //Print "DRK preference = ",checked
46End
47
48Function UnityTransPref(ctrlName,checked) : CheckBoxControl
49        String ctrlName
50        Variable checked
51       
52        NVAR gVal = root:myGlobals:gDoTransCheck
53        gVal = checked
54End
55
56Function XMLWritePref(ctrlName,checked) : CheckBoxControl
57        String ctrlName
58        Variable checked
59       
60        NVAR gVal = root:Packages:NIST:gXML_Write
61        gVal = checked
62End
63
64Function PrefDoneButtonProc(ctrlName) : ButtonControl
65        String ctrlName
66       
67        DoWindow/K pref_panel
68End
69
70// draws the panel
71// each checkbox should actively change a global value
72Proc Pref_Panel()
73        PauseUpdate; Silent 1           // building window...
74        NewPanel /K=2 /W=(607,158,899,360) as "SANS Preference Panel"
75        DoWindow/C pref_panel
76        ModifyPanel cbRGB=(49694,61514,27679)
77        CheckBox check0,pos={10,10},size={186,14},proc=LogScalePrefCheck,title="Use Log scaling for 2D data display"
78        CheckBox check0,help={"Checking this will display 2D SANS data with a logarithmic color scale of neutron counts. If not checked, the color mapping will be linear."}
79        CheckBox check0,value= root:myGlobals:gLogScalingAsDefault
80        CheckBox check1,pos={10,30},size={184,14},proc=DRKProtocolPref,title="Allow DRK correction in protocols"
81        CheckBox check1,help={"Checking this will allow DRK correction to be used in reduction protocols. You will need to re-draw the protocol panel for this change to be visible."}
82        CheckBox check1,value= root:myGlobals:gAllowDRK
83        CheckBox check2,pos={10,50},size={184,14},proc=UnityTransPref,title="Check for Transmission = 1"
84        CheckBox check2,help={"Checking this will check for SAM or EMP Trans = 1 during data correction"}
85        CheckBox check2,value= root:myGlobals:gDoTransCheck
86        Button button0,pos={226,168},size={50,20},proc=PrefDoneButtonProc,title="Done"
87        SetVariable setvar0,pos={10,80},size={200,15},title="Averaging Bin Width (pixels)"
88        SetVariable setvar0,limits={1,100,1},value= root:myGlobals:gBinWidth
89        SetVariable setvar1,pos={10,105},size={200,15},title="# Phi Steps (annular avg)"
90        SetVariable setvar1,limits={1,360,1},value= root:myGlobals:gNPhiSteps
91        CheckBox check3,pos={10,130},size={184,14},proc=XMLWritePref,title="Use canSAS XML Output"
92        CheckBox check3,help={"Checking this will set the default output format to be canSAS XML rather than NIST 6 column"}
93        CheckBox check3,value=root:Packages:NIST:gXML_Write
94        //keep these hidden for now so that nobody can accidentally change them from
95        //the default values set in Initialize.ipf (128x128)
96//      SetVariable setvar2,pos={10,125},size={200,15},title="Detector Pixels (X)"
97//      SetVariable setvar2,limits={1,2000,1},value= root:myGlobals:gNPixelsX
98//      SetVariable setvar3,pos={10,145},size={200,15},title="Detector Pixels (Y)"
99//      SetVariable setvar3,limits={1,2000,1},value= root:myGlobals:gNPixelsY
100
101End
Note: See TracBrowser for help on using the repository browser.