Ignore:
Timestamp:
Apr 6, 2010 4:56:48 PM (13 years ago)
Author:
srkline
Message:

Made preferences a common panel (moved to PlotUtilsMacro?.ipf and globals to root:Packages:NIST:) and added menu items for all packages. Many files had to be modified so that the preferences could be properly accessed

File Open dialog now is set to "All files" so that XML can be selected. I think that all open access that doesn't already have the full path go through this common function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/SANSPreferences.ipf

    r601 r665  
    44 
    55 
    6 /////////////////////////// 
    7 // user preferences 
    8 //  
    9 // globals are created in initialize.ipf 
    10 // 
    11 // this panel allows for user modification 
    12 /////////////////////////// 
    13 Proc 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" 
    21 End 
    22  
    23 Proc 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 
    28 end 
    29  
    30 Function 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 
    37 End 
    38  
    39 Function 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 
    46 End 
    47  
    48 Function UnityTransPref(ctrlName,checked) : CheckBoxControl 
    49         String ctrlName 
    50         Variable checked 
    51          
    52         NVAR gVal = root:myGlobals:gDoTransCheck 
    53         gVal = checked 
    54 End 
    55  
    56 Function XMLWritePref(ctrlName,checked) : CheckBoxControl 
    57         String ctrlName 
    58         Variable checked 
    59          
    60         NVAR gVal = root:Packages:NIST:gXML_Write 
    61         gVal = checked 
    62 End 
    63  
    64 Function PrefDoneButtonProc(ctrlName) : ButtonControl 
    65         String ctrlName 
    66          
    67         DoWindow/K pref_panel 
    68 End 
    69  
    70 // draws the panel 
    71 // each checkbox should actively change a global value 
    72 Proc 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  
    101 End 
Note: See TracChangeset for help on using the changeset viewer.