source: sans/SANSReduction/branches/kline_29MAR07/Put in User Procedures/SANS_Reduction_v5.00/SANSPreferences.ipf @ 72

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

Initial file shuffling, partially done.
Created 3 new files:
SANS_Utilities
NCNR_Utils
NCNR_DataReadWrite

(SANS_Utilites may eventually become NCNR-specific, but I'm not sure)

File size: 3.2 KB
Line 
1#pragma rtGlobals=1             // Use modern global access method.
2#pragma version=5.0
3#pragma IgorVersion=4.0
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 PrefDoneButtonProc(ctrlName) : ButtonControl
57        String ctrlName
58       
59        DoWindow/K pref_panel
60End
61
62// draws the panel
63// each checkbox should actively change a global value
64Proc Pref_Panel()
65        PauseUpdate; Silent 1           // building window...
66        NewPanel /K=2 /W=(607,158,899,360) as "SANS Preference Panel"
67        DoWindow/C pref_panel
68        ModifyPanel cbRGB=(49694,61514,27679)
69        CheckBox check0,pos={10,10},size={186,14},proc=LogScalePrefCheck,title="Use Log scaling for 2D data display"
70        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."}
71        CheckBox check0,value= root:myGlobals:gLogScalingAsDefault
72        CheckBox check1,pos={10,30},size={184,14},proc=DRKProtocolPref,title="Allow DRK correction in protocols"
73        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."}
74        CheckBox check1,value= root:myGlobals:gAllowDRK
75        CheckBox check2,pos={10,50},size={184,14},proc=UnityTransPref,title="Check for Transmission = 1"
76        CheckBox check2,help={"Checking this will check for SAM or EMP Trans = 1 during data correction"}
77        CheckBox check2,value= root:myGlobals:gDoTransCheck
78        Button button0,pos={226,168},size={50,20},proc=PrefDoneButtonProc,title="Done"
79        SetVariable setvar0,pos={10,80},size={200,15},title="Averaging Bin Width (pixels)"
80        SetVariable setvar0,limits={1,100,1},value= root:myGlobals:gBinWidth
81        SetVariable setvar1,pos={10,105},size={200,15},title="# Phi Steps (annular avg)"
82        SetVariable setvar1,limits={1,360,1},value= root:myGlobals:gNPhiSteps
83        //keep these hidden for now so that nobody can accidentally change them from
84        //the default values set in Initialize.ipf (128x128)
85//      SetVariable setvar2,pos={10,125},size={200,15},title="Detector Pixels (X)"
86//      SetVariable setvar2,limits={1,2000,1},value= root:myGlobals:gNPixelsX
87//      SetVariable setvar3,pos={10,145},size={200,15},title="Detector Pixels (Y)"
88//      SetVariable setvar3,limits={1,2000,1},value= root:myGlobals:gNPixelsY
89
90End
91
Note: See TracBrowser for help on using the repository browser.