Ignore:
Timestamp:
Jan 19, 2016 11:41:53 AM (7 years ago)
Author:
srkline
Message:

minor changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_VSANS_Preferences.ipf

    r971 r973  
    11#pragma rtGlobals=3             // Use modern global access method and strict wave access. 
    2  
    3 // 
    4 // The full version of the preferences panel resides in PlotUtilsMacro_v40.ipf 
    5 // and is common to SANS/USANS reduction and Analysis routines. 
    6 // 
    7 // This version has been specifically pulled out to remove the entanglement. 
    8 // 
    9 // SANSPreferences.ipf file is unused (in SANS folder of SVN) 
    10 // 
    11 // DEC 2015 
    12 // 
    132 
    143 
     
    176// -- update all of the function names to be unique to VSANS so that there are no 
    187//    name clashes with the "duplicate" version that is in PlotUtils.ipf 
     8// 
     9// -- Make this a VSANS-only panel 
     10// -- eliminate the USANS tab 
     11// -- be sure the general tab is either unique, or eliminate it 
     12// -- be sure the Analysis tab is unique, or eliminate it 
    1913// 
    2014// 
     
    3832End 
    3933 
     34 
     35// TODO -- there are more detector specific corrections here that need to be added 
     36// 
     37// create the globals here if they are not already present 
     38// each package initialization should call this to repeat the initialization 
     39// without overwriting what was already set 
    4040Proc Initialize_VSANSPreferences() 
    41         // create the globals here if they are not already present 
    42          
    43         // each package initialization should call this to repeat the initialization 
    44         // without overwriting what was already set 
    4541         
    4642        Variable val 
    47          
     43 
     44        // GENERAL tab 
     45        /// General items for everyone 
     46        val = NumVarOrDefault("root:Packages:NIST:VSANS:Globals:gXML_Write", 0 ) 
     47        Variable/G root:Packages:NIST:VSANS:Globals:gXML_Write = val 
     48         
     49         
     50        // VSANS tab 
    4851        ///// items for VSANS reduction 
    4952        val = NumVarOrDefault("root:Packages:NIST:VSANS:Globals:gLogScalingAsDefault", 1 ) 
    5053        Variable/G root:Packages:NIST:VSANS:Globals:gLogScalingAsDefault=val 
    5154         
    52         val = NumVarOrDefault("root:Packages:NIST:VSANS:Globals:gAllowDRK", 0 ) 
    53         Variable/G root:Packages:NIST:VSANS:Globals:gAllowDRK=val                       //don't show DRK as default 
     55//      val = NumVarOrDefault("root:Packages:NIST:VSANS:Globals:gAllowDRK", 0 ) 
     56//      Variable/G root:Packages:NIST:VSANS:Globals:gAllowDRK=val                       //don't show DRK as default 
    5457         
    5558        val = NumVarOrDefault("root:Packages:NIST:VSANS:Globals:gDoTransCheck", 1 ) 
     
    7073 
    7174// flag to allow adding raw data files with different attenuation (normally not done)    
    72         val = NumVarOrDefault("root:Packages:NIST:VSANS:Globals:gDoAdjustRAW_Atten",0) 
    73         Variable/G root:Packages:NIST:VSANS:Globals:gDoAdjustRAW_Atten=val 
    74          
    75         /// items for SANS Analysis 
    76          
    77          
    78         /// items for USANS Reduction 
    79          
    80          
    81         /// items for everyone 
    82         val = NumVarOrDefault("root:Packages:NIST:VSANS:Globals:gXML_Write", 0 ) 
    83         Variable/G root:Packages:NIST:VSANS:Globals:gXML_Write = val 
     75//      val = NumVarOrDefault("root:Packages:NIST:VSANS:Globals:gDoAdjustRAW_Atten",0) 
     76//      Variable/G root:Packages:NIST:VSANS:Globals:gDoAdjustRAW_Atten=val 
     77         
     78         
     79        // VSANS ANALYSIS tab 
     80        /// items for VSANS Analysis 
    8481         
    8582         
    8683end 
    8784 
    88 Function LogScalePrefCheck(ctrlName,checked) : CheckBoxControl 
     85Function V_LogScalePrefCheck(ctrlName,checked) : CheckBoxControl 
    8986        String ctrlName 
    9087        Variable checked 
     
    9592End 
    9693 
    97 Function DRKProtocolPref(ctrlName,checked) : CheckBoxControl 
    98         String ctrlName 
    99         Variable checked 
    100          
    101         NVAR gDRK = root:Packages:NIST:VSANS:Globals:gAllowDRK 
    102         gDRK = checked 
    103         //Print "DRK preference = ",checked 
    104 End 
    105  
    106 Function UnityTransPref(ctrlName,checked) : CheckBoxControl 
     94//Function DRKProtocolPref(ctrlName,checked) : CheckBoxControl 
     95//      String ctrlName 
     96//      Variable checked 
     97//       
     98//      NVAR gDRK = root:Packages:NIST:VSANS:Globals:gAllowDRK 
     99//      gDRK = checked 
     100//      //Print "DRK preference = ",checked 
     101//End 
     102 
     103Function V_UnityTransPref(ctrlName,checked) : CheckBoxControl 
    107104        String ctrlName 
    108105        Variable checked 
     
    112109End 
    113110 
    114 Function XMLWritePref(ctrlName,checked) : CheckBoxControl 
     111Function V_XMLWritePref(ctrlName,checked) : CheckBoxControl 
    115112        String ctrlName 
    116113        Variable checked 
     
    120117End 
    121118 
    122 Function DoTransCorrPref(ctrlName,checked) : CheckBoxControl 
     119Function V_DoTransCorrPref(ctrlName,checked) : CheckBoxControl 
    123120        String ctrlName 
    124121        Variable checked 
     
    128125End 
    129126 
    130 Function DoEfficiencyCorrPref(ctrlName,checked) : CheckBoxControl 
     127Function V_DoEfficiencyCorrPref(ctrlName,checked) : CheckBoxControl 
    131128        String ctrlName 
    132129        Variable checked 
     
    136133End 
    137134 
    138 Function DoRawAttenAdjPref(ctrlName,checked) : CheckBoxControl 
     135Function V_DoRawAttenAdjPref(ctrlName,checked) : CheckBoxControl 
    139136        String ctrlName 
    140137        Variable checked 
     
    144141End 
    145142 
    146 Function PrefDoneButtonProc(ctrlName) : ButtonControl 
     143Function V_PrefDoneButtonProc(ctrlName) : ButtonControl 
    147144        String ctrlName 
    148145         
     
    152149Proc VSANSPref_Panel() 
    153150        PauseUpdate; Silent 1           // building window... 
    154         NewPanel /W=(646,208,1070,468)/K=2 as "NCNR Preference Panel" 
     151        NewPanel /W=(646,208,1070,468)/K=2 as "VSANS Preference Panel" 
    155152        DoWindow/C VSANSPref_Panel 
    156153        ModifyPanel cbRGB=(49694,61514,27679) 
     
    159156////// 
    160157//on main portion of panel, always visible 
    161         Button PrefPanelButtonA,pos={354,12},size={50,20},proc=PrefDoneButtonProc,title="Done" 
    162  
    163         TabControl PrefTab,pos={7,49},size={410,202},tabLabel(0)="General",proc=PrefTabProc 
    164         TabControl PrefTab,tabLabel(1)="VSANS",tabLabel(2)="USANS",tabLabel(3)="Analysis" 
    165         TabControl PrefTab,value=0 
     158        Button PrefPanelButtonA,pos={354,12},size={50,20},proc=V_PrefDoneButtonProc,title="Done" 
     159 
     160        TabControl PrefTab,pos={7,49},size={410,202},tabLabel(0)="General",proc=V_PrefTabProc 
     161        TabControl PrefTab,tabLabel(1)="VSANS",tabLabel(2)="Analysis" 
     162        TabControl PrefTab,value=1 
    166163        TabControl PrefTab labelBack=(49694,61514,27679) 
    167164         
    168 //on tab(0) - General - initially visible 
    169         CheckBox PrefCtrl_0a,pos={21,96},size={124,14},proc=XMLWritePref,title="Use canSAS XML Output" 
     165//on tab(0) - General 
     166        CheckBox PrefCtrl_0a,pos={21,96},size={124,14},proc=V_XMLWritePref,title="Use canSAS XML Output" 
    170167        CheckBox PrefCtrl_0a,help={"Checking this will set the default output format to be canSAS XML rather than NIST 6 column"} 
    171168        CheckBox PrefCtrl_0a,value= root:Packages:NIST:VSANS:Globals:gXML_Write 
    172169 
    173 //on tab(1) - SANS 
    174         CheckBox PrefCtrl_1a,pos={21,100},size={171,14},proc=LogScalePrefCheck,title="Use Log scaling for 2D data display" 
     170        CheckBox PrefCtrl_0a,disable=1 
     171 
     172 
     173//on tab(1) - VSANS - initially visible 
     174        CheckBox PrefCtrl_1a,pos={21,100},size={171,14},proc=V_LogScalePrefCheck,title="Use Log scaling for 2D data display" 
    175175        CheckBox PrefCtrl_1a,help={"Checking this will display 2D VSANS data with a logarithmic color scale of neutron counts. If not checked, the color mapping will be linear."} 
    176176        CheckBox PrefCtrl_1a,value= root:Packages:NIST:VSANS:Globals:gLogScalingAsDefault 
    177         CheckBox PrefCtrl_1b,pos={21,120},size={163,14},proc=DRKProtocolPref,title="Allow DRK correction in protocols" 
    178         CheckBox PrefCtrl_1b,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."} 
    179         CheckBox PrefCtrl_1b,value= root:Packages:NIST:VSANS:Globals:gAllowDRK 
    180         CheckBox PrefCtrl_1c,pos={21,140},size={137,14},proc=UnityTransPref,title="Check for Transmission = 1" 
     177//      CheckBox PrefCtrl_1b,pos={21,120},size={163,14},proc=V_DRKProtocolPref,title="Allow DRK correction in protocols" 
     178//      CheckBox PrefCtrl_1b,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."} 
     179//      CheckBox PrefCtrl_1b,value= root:Packages:NIST:VSANS:Globals:gAllowDRK 
     180        CheckBox PrefCtrl_1c,pos={21,140},size={137,14},proc=V_UnityTransPref,title="Check for Transmission = 1" 
    181181        CheckBox PrefCtrl_1c,help={"Checking this will check for SAM or EMP Trans = 1 during data correction"} 
    182182        CheckBox PrefCtrl_1c,value= root:Packages:NIST:VSANS:Globals:gDoTransCheck 
     
    185185        SetVariable PrefCtrl_1e,pos={21,195},size={200,15},title="# Phi Steps (annular avg)" 
    186186        SetVariable PrefCtrl_1e,limits={1,360,1},value= root:Packages:NIST:VSANS:Globals:gNPhiSteps 
    187         CheckBox PrefCtrl_1f title="Do Transmssion Correction?",size={140,14},value=root:Packages:NIST:VSANS:Globals:gDoTransmissionCorr,proc=DoTransCorrPref 
     187        CheckBox PrefCtrl_1f title="Do Transmssion Correction?",size={140,14},value=root:Packages:NIST:VSANS:Globals:gDoTransmissionCorr,proc=V_DoTransCorrPref 
    188188        CheckBox PrefCtrl_1f pos={255,100},help={"TURN OFF ONLY FOR DEBUGGING. This corrects the data for angle dependent transmssion."} 
    189         CheckBox PrefCtrl_1g title="Do Efficiency Correction?",size={140,14},proc=DoEfficiencyCorrPref 
     189        CheckBox PrefCtrl_1g title="Do Efficiency Correction?",size={140,14},proc=V_DoEfficiencyCorrPref 
    190190        CheckBox PrefCtrl_1g value=root:Packages:NIST:VSANS:Globals:gDoDetectorEffCorr,pos={255,120},help={"TURN OFF ONLY FOR DEBUGGING. This corrects the data for angle dependent detector efficiency."} 
    191         CheckBox PrefCtrl_1h title="Adjust RAW attenuation?",size={140,14},proc=DoRawAttenAdjPref 
     191        CheckBox PrefCtrl_1h title="Adjust RAW attenuation?",size={140,14},proc=V_DoRawAttenAdjPref 
    192192        CheckBox PrefCtrl_1h value=root:Packages:NIST:VSANS:Globals:gDoAdjustRAW_Atten,pos={255,140},help={"This is normally not done"} 
    193193 
    194         CheckBox PrefCtrl_1a,disable=1 
    195         CheckBox PrefCtrl_1b,disable=1 
    196         CheckBox PrefCtrl_1c,disable=1 
    197         SetVariable PrefCtrl_1d,disable=1 
    198         SetVariable PrefCtrl_1e,disable=1 
    199         CheckBox PrefCtrl_1f,disable=1 
    200         CheckBox PrefCtrl_1g,disable=1 
    201         CheckBox PrefCtrl_1h,disable=1 
    202  
    203 //on tab(2) - USANS 
     194//      CheckBox PrefCtrl_1a,disable=1 
     195//      CheckBox PrefCtrl_1b,disable=1 
     196//      CheckBox PrefCtrl_1c,disable=1 
     197//      SetVariable PrefCtrl_1d,disable=1 
     198//      SetVariable PrefCtrl_1e,disable=1 
     199//      CheckBox PrefCtrl_1f,disable=1 
     200//      CheckBox PrefCtrl_1g,disable=1 
     201//      CheckBox PrefCtrl_1h,disable=1 
     202 
     203//on tab(2) - Analysis 
    204204        GroupBox PrefCtrl_2a pos={21,100},size={1,1},title="nothing to set",fSize=12 
    205  
     205         
    206206        GroupBox PrefCtrl_2a,disable=1 
    207207 
    208  
    209 //on tab(3) - Analysis 
    210         GroupBox PrefCtrl_3a pos={21,100},size={1,1},title="nothing to set",fSize=12 
    211          
    212         GroupBox PrefCtrl_3a,disable=1 
    213  
    214 EndMacro 
     208End 
    215209 
    216210// function to control the drawing of controls in the TabControl on the main panel 
     
    221215// in this way, they will always be drawn correctly.. 
    222216// 
    223 Function PrefTabProc(name,tab) 
     217Function V_PrefTabProc(name,tab) 
    224218        String name 
    225219        Variable tab 
Note: See TracChangeset for help on using the changeset viewer.