Ignore:
Timestamp:
Feb 6, 2007 2:09:25 PM (16 years ago)
Author:
ajj
Message:

Added checkbox to enable/disable current data set checking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/USANSReduction/trunk/Put in User Procedures Folder/USANS Procedures v2.20/Main_USANS.ipf

    r35 r43  
    7373        //Text filter for data files AJJ Sept 06 
    7474        String/G FilterStr 
     75        Variable/G gUseCurrentData = 0 
    7576         
    7677        SetDataFolder root: 
     
    155156        Button USANSHelpButton,pos={341,6},size={50,20},proc=USANSHelpButtonProc,title="Help" 
    156157        Button USANSHelpButton,help={"Show the USANS reduction help file"} 
    157         Button RefreshCurrent,pos={298,310},size={95,20},proc=RefreshCurrentButtonProc,title="Refresh" 
     158        Button RefreshCurrent,pos={298,310},size={95,20},proc=RefreshCurrentButtonProc,title="Refresh",disable=2 
    158159        Button RefreshCurrent,help={"Updates data files on Charlotte and gets current data file name"} 
    159         Button AddCurrToSAM,pos={264,55},size={25,90},proc=CurtoSamListButtonProc,title="<-S" 
    160         Button AddCurrToSAM,help={"Adds the current data file to the list of sample scans"} 
    161         Button AddCurrToEMP,pos={265,194},size={25,90},proc=CurtoEmptyListButtonProc,title="<-E" 
    162         Button AddCurrToEMP,help={"Adds the current data file to the list of empty scans"} 
    163         ListBox CurFileBox,pos={295,55},size={100,230},proc=FileListBoxProc 
     160        Button AddCurToSAM,pos={264,55},size={25,90},proc=CurtoSamListButtonProc,title="<-S",disable=2 
     161        Button AddCurToSAM,help={"Adds the current data file to the list of sample scans"} 
     162        Button AddCurToEMP,pos={265,194},size={25,90},proc=CurtoEmptyListButtonProc,title="<-E",disable=2 
     163        Button AddCurToEMP,help={"Adds the current data file to the list of empty scans"} 
     164        ListBox CurFileBox,pos={295,55},size={100,230},proc=FileListBoxProc,disable=1 
    164165        ListBox CurFileBox,listWave=root:Globals:MainPanel:curWave,mode=1 
    165166        SetVariable FilterSetVar,pos={8,289},size={106,18},title="Filter",fSize=12 
    166167        SetVariable FilterSetVar,value= root:Globals:MainPanel:FilterStr 
     168        CheckBox UseCurrentData,pos={298,290},size={10,10},proc=UseCurrentDataProc,title="Enable Current Data" 
     169        CheckBox UseCurrentData,value=0 
    167170EndMacro 
    168171 
     
    495498Function PickBT5Path() 
    496499         
     500        NVAR isChecked = root:Globals:MainPanel:gUseCurrentData 
     501         
    497502        //set the global string to the selected pathname 
    498503        NewPath/O/M="pick the BT5 data folder" bt5PathName 
     
    500505        String dum = S_path 
    501506        if (V_flag == 0) 
     507                //Path does not exist 
    502508                return(1) 
    503509        else 
    504                 NewPath/O bt5CurPathName, getCurrentPath(S_Path) 
    505                 return(0)               //no error 
     510                if (isChecked == 1) 
     511                        NewPath/O/M="Select Current Data" bt5CurPathName, getCurrentPath(S_Path) 
     512                        return(0)               //no error 
     513                Endif 
    506514        endif 
    507515End 
     
    11301138End 
    11311139 
     1140Function UseCurrentDataProc(ctrlName,checked) : CheckBoxControl 
     1141        String ctrlName 
     1142        Variable checked 
     1143         
     1144        NVAR isChecked = root:Globals:MainPanel:gUseCurrentData 
     1145         
     1146        if (checked == 1) 
     1147                DoAlert 1, "Enabling Current Data requires access to the NCNR Network.\rDo you wish to continue?"  
     1148                if(V_flag == 1) 
     1149                        ModifyControl/Z CurFileBox, disable=0 
     1150                        ModifyControl/Z AddCurToSAM, disable=0 
     1151                        ModifyControl/Z AddCurToEMP, disable=0 
     1152                        ModifyControl/Z RefreshCurrent,disable=0 
     1153                        isChecked = 1 
     1154                endif 
     1155        else 
     1156                ModifyControl/Z CurFileBox, disable=1 
     1157                ModifyControl/Z AddCurToSAM, disable=2 
     1158                ModifyControl/Z AddCurToEMP, disable=2 
     1159                ModifyControl/Z RefreshCurrent,disable=2         
     1160                isChecked = 0 
     1161        endif 
     1162 
     1163End 
     1164 
    11321165//Function to get path for Current file 
    11331166Function/S getCurrentPath(inPath) 
     
    11611194         
    11621195End 
     1196 
     1197 
Note: See TracChangeset for help on using the changeset viewer.