Changeset 1040


Ignore:
Timestamp:
May 19, 2017 2:13:33 PM (5 years ago)
Author:
srkline
Message:

Added procedures to increase the number of elements in a reduction protocol, to allow the trimming points to be added directly to the protocol.

The protocol can also now be written directly to the reduction block of the data file. This can serve as a record of what was used, and also for multiple reduction.

Although the protocol is not a NICE -generated block in the HDF file, there does not appear to be any issues with writing out this new wave to the data set, as long as I handle the error if I try to read it (since i't not there to begin with).

Protocol panel is now aware of this change, and the multiple reduce panel has been updated and added to the Inlcudes list.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
Files:
1 added
7 edited

Legend:

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

    r1033 r1040  
    9494#include "V_Transmission" 
    9595 
     96#include "V_MultipleReduce" 
    9697 
    97  
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_RW_Utils.ipf

    r1034 r1040  
    635635        endif 
    636636 
    637 // this should exist now - if not, I need to see the error 
    638         Wave/T wOut = $(ksBaseDFPath+folderStr+":"+path) 
     637// this should exist now - if not, I will see the error in the calling function 
     638        Wave/T/Z wOut = $(ksBaseDFPath+folderStr+":"+path) 
    639639         
    640640        return wOut 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Read.ipf

    r1034 r1040  
    23672367end 
    23682368 
     2369// this is a NON NICE entered field 
     2370// so I need to catch the error if it's not there 
     2371Function/WAVE V_getReductionProtocolWave(fname) 
     2372        String fname 
     2373         
     2374        String path = "entry:reduction:protocol"         
     2375        WAVE/T/Z tw = V_getTextWaveFromHDF5(fname,path) 
     2376         
     2377        if(waveExists(tw)) 
     2378                return tw 
     2379        else 
     2380                Make/O/T/N=0 nullTextWave 
     2381                return nullTextWave 
     2382        endif 
     2383         
     2384end 
    23692385         
    23702386 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Write.ipf

    r1039 r1040  
    63716371 
    63726372 
    6373 // TODO -- needs to be a WAVE, and of the proper size and type!!! 
     6373// TODO -- needs to be a Text WAVE, and of the proper size and type!!! 
    63746374//  -- this is a test where I write a wave to a field that does not exist... 
    6375 Function V_write_TrimWave(fname,inW) 
    6376         String fname 
    6377         Wave inW 
     6375Function V_write_ProtocolWave(fname,inTW) 
     6376        String fname 
     6377        Wave/T inTW 
    63786378         
    63796379//      String path = "entry:reduction:absolute_scaling" 
    63806380         
    6381         Duplicate/O inW wTmpWrite        
     6381        Duplicate/O inTW wTTmpWrite      
    63826382// then use redimension as needed to cast the wave to write to the specified type 
    63836383// see WaveType for the proper codes  
     
    63856385// -- May also need to check the dimension(s) before writing (don't trust the input) 
    63866386        String groupName = "/entry/reduction"    
    6387         String varName = "trim_wave" 
    6388  
    6389         variable err 
    6390         err = V_WriteWaveToHDF(fname, groupName, varName, wTmpWrite) 
     6387        String varName = "protocol" 
     6388 
     6389        variable err 
     6390        err = V_WriteWaveToHDF(fname, groupName, varName, wTTmpWrite) 
    63916391        if(err) 
    63926392                Print "HDF write err = ",err 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Initialize.ipf

    r1039 r1040  
    291291Function V_InitFakeProtocols() 
    292292         
    293         //*****as of 0901, protocols are 8 points long, [6] is used for work.drk, [7] is unused  
     293        //*****as of 05_2017, protocols are 12 points long, [6] is used for work.drk, [7,8] are for trimmig points, and [9,11] are currently unused  
    294294        NewDataFolder/O root:Packages:NIST:VSANS:Globals:Protocols 
    295         Make/O/T $"root:Packages:NIST:VSANS:Globals:Protocols:Base"={"none","none","ask","ask","none","AVTYPE=Circular;SAVE=Yes;NAME=Manual;PLOT=Yes","DRK=none,DRKMODE=0,",""} 
    296         Make/O/T $"root:Packages:NIST:VSANS:Globals:Protocols:DoAll"={"ask","ask","ask","ask","ask","AVTYPE=Circular;SAVE=Yes;NAME=Manual;PLOT=Yes","DRK=none,DRKMODE=0,",""} 
    297         Make/O/T/N=8 $"root:Packages:NIST:VSANS:Globals:Protocols:CreateNew"                    //null wave 
     295        Make/O/T $"root:Packages:NIST:VSANS:Globals:Protocols:Base"={"none","none","ask","ask","none","AVTYPE=Circular;SAVE=Yes;NAME=Manual;PLOT=Yes","DRK=none,DRKMODE=0,","","","","",""} 
     296        Make/O/T $"root:Packages:NIST:VSANS:Globals:Protocols:DoAll"={"ask","ask","ask","ask","ask","AVTYPE=Circular;SAVE=Yes;NAME=Manual;PLOT=Yes","DRK=none,DRKMODE=0,","","","","",""} 
     297        Make/O/T/N=(kNumProtocolSteps) $"root:Packages:NIST:VSANS:Globals:Protocols:CreateNew"                  //null wave 
    298298        //Initialize waves to store values in 
    299299         
    300300        String/G root:Packages:NIST:VSANS:Globals:Protocols:gProtoStr="" 
    301301        String/G root:Packages:NIST:VSANS:Globals:Protocols:gNewStr="" 
    302         String/G root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr = "AVTYPE=Circular;SAVE=Yes;NAME=Auto;PLOT=Yes;" 
     302        String/G root:Packages:NIST:VSANS:Globals:Protocols:gAvgInfoStr = "AVTYPE=Circular;SAVE=Yes;NAME=Auto;PLOT=Yes;BINTYPE=One;" 
    303303         
    304304        String/G root:Packages:NIST:VSANS:Globals:Protocols:gBegPtsStr="" 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MainPanel.ipf

    r1039 r1040  
    100100        String ctrlName 
    101101 
    102         ReduceMultipleFiles() 
     102        V_ReduceMultipleFiles() 
    103103End 
    104104 
     
    355355        Button MainButton_0b,help={"Patch will update incorrect information in raw data headers"} 
    356356        Button MainButton_0c,pos={15,150},size={110,20},proc=TransMainButtonProc,title="Transmission" 
    357         Button MainButton_0c,help={"Shows the \"Patch\" panel which allows calculation of sample transmissions and entering these values into raw data headers"} 
     357        Button MainButton_0c,help={"Shows the panel which allows calculation of sample transmissions and entering these values into raw data headers"} 
    358358        Button MainButton_0d,pos={15,180},size={130,20},proc=RealTime_MainButtonProc,title="RealTime Display" 
    359359        Button MainButton_0d,help={"Shows the panel for control of the RealTime data display. Only used during data collection"} 
  • sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Protocol_Reduction.ipf

    r1039 r1040  
    5050////////////////////////////////// 
    5151 
     52Constant kNumProtocolSteps = 12 
    5253 
    5354//main entry procedure for initialzing and displaying the protocol panel 
     
    7172        //set up the global variables needed for the protocol panel 
    7273        //global strings to put in a temporary protocol textwave 
    73         Variable ii=0,nsteps=8 
     74        Variable ii=0 
    7475        String waveStr="tempProtocol" 
    7576        SetDataFolder root:Packages:NIST:VSANS:Globals:Protocols 
    76         Make/O/T/N=(nsteps) $"root:Packages:NIST:VSANS:Globals:Protocols:tempProtocol" = "" 
     77        Make/O/T/N=(kNumProtocolSteps) $"root:Packages:NIST:VSANS:Globals:Protocols:tempProtocol" = "" 
    7778 
    7879        String/G root:Packages:NIST:VSANS:Globals:Protocols:gSAM="ask" 
     
    8283        String/G root:Packages:NIST:VSANS:Globals:Protocols:gMASK="ask" 
    8384        String/G root:Packages:NIST:VSANS:Globals:Protocols:gAbsStr="ask" 
    84         String/G root:Packages:NIST:VSANS:Globals:Protocols:gAVE="AVTYPE=Circular;SAVE=Yes - Concatenate;NAME=Auto;PLOT=Yes;" 
     85        String/G root:Packages:NIST:VSANS:Globals:Protocols:gAVE="AVTYPE=Circular;SAVE=Yes - Concatenate;NAME=Auto;PLOT=No;BINTYPE=One;" 
    8586        String/G root:Packages:NIST:VSANS:Globals:Protocols:gDRK="DRK=none,DRKMODE=0," 
     87         
     88        // global strings for trimming data are initialized in the main VSANS initilization 
     89        //  in case the trimming is done before the protocol panel is opened 
    8690         
    8791        SetDataFolder root: 
     
    153157End 
    154158 
    155  
     159// 
    156160//function that actually parses the protocol specified by nameStr 
    157161//which is just the name of the wave, without a datafolder path 
     162// 
     163// TODO 
     164//  -- update this for 12 steps 
    158165// 
    159166Function V_ResetToSavedProtocol(nameStr) 
     
    273280//      Endif 
    274281         
    275         //7 = unused 
    276          
     282        //7 = beginning trim points 
     283        SVAR gBegPtsStr=root:Packages:NIST:VSANS:Globals:Protocols:gBegPtsStr 
     284        gBegPtsStr = w[7] 
     285        //8 = end trim points 
     286        SVAR gEndPtsStr=root:Packages:NIST:VSANS:Globals:Protocols:gEndPtsStr 
     287        gEndPtsStr = w[8] 
     288         
     289        //9 = unused 
     290        //10 = unused 
     291        //11 = unused 
     292 
     293 
    277294        //all has been reset, get out 
    278295        Return (0) 
     
    329346        //current data folder is  root:Packages:NIST:VSANS:Globals:Protocols 
    330347        if(newProto) 
    331                 Make/O/T/N=8 $("root:Packages:NIST:VSANS:Globals:Protocols:" + newProtocol) 
     348                Make/O/T/N=(kNumProtocolSteps) $("root:Packages:NIST:VSANS:Globals:Protocols:" + newProtocol) 
    332349        Endif 
    333350         
     
    343360//Wave/T w (input) is an empty text wave of 8 elements for the protocol 
    344361//on output, w[] is filled with the protocol strings as needed from the panel  
     362// 
     363// TODO 
     364// -- update for 12 points 
    345365// 
    346366Function V_MakeProtocolFromPanel(w) 
     
    482502         
    483503        //w[7] 
     504        // beginning trim points 
     505        SVAR gBegPtsStr=root:Packages:NIST:VSANS:Globals:Protocols:gBegPtsStr 
     506        w[7] = gBegPtsStr 
     507         
     508        //w[8] 
     509        // End trim points 
     510        SVAR gEndPtsStr=root:Packages:NIST:VSANS:Globals:Protocols:gEndPtsStr    
     511        w[8] = gEndPtsStr 
     512         
     513        //w[9] 
    484514        //currently unused 
    485         w[7] = "" 
    486          
     515        w[9] = "" 
     516        //w[10] 
     517        //currently unused 
     518        w[10] = "" 
     519        //w[11] 
     520        //currently unused 
     521        w[11] = "" 
     522                 
    487523        return(0) 
    488524End 
     
    522558//      endif 
    523559 
    524  
     560// match is the string to look for in the search 
     561// 0 is a flag to tell it to look in the file catalog (the fastest method) 
     562// Other options are to grep, or to read the intent field in every file 
    525563Function/S V_GetSAMList() 
    526564 
     
    961999        String temp="root:Packages:NIST:VSANS:Globals:Protocols:tempProtocol" 
    9621000        Wave/T w=$temp 
    963         Variable ii=0,num=8 
     1001        Variable ii=0,num=12 
    9641002        do 
    9651003                w[ii] = "" 
     
    10191057Window V_ProtocolPanel() 
    10201058        PauseUpdate; Silent 1           // building window... 
    1021         NewPanel /W=(553,48,851,500) /K=1 as "VSANS Reduction Protocol" 
     1059        NewPanel /W=(1280,332,1630,932) /K=1 as "VSANS Reduction Protocol" 
    10221060        ModifyPanel cbRGB=(56589,50441,50159), fixedSize=1 
    10231061        SetDrawLayer UserBack 
    1024         DrawLine 2,25,300,25 
    1025         DrawLine 2,69,300,69 
    1026         DrawLine 2,120,300,120 
    1027         DrawLine 2,169,300,169 
    1028         DrawLine 2,217,300,217 
    1029         DrawLine 2,262,300,262 
    1030         DrawLine 2,357,300,357 
    1031         DrawLine 2,379,300,379 
    1032         DrawLine 2,308,300,308 
     1062        DrawLine 3,65,301,65 
     1063        DrawLine 3,157,301,157 
     1064        DrawLine 3,208,301,208 
     1065        DrawLine 3,257,301,257 
     1066        DrawLine 3,305,301,305 
     1067        DrawLine 3,350,301,350 
     1068        DrawLine 3,445,301,445 
     1069        DrawLine 3,513,303,513 
     1070        DrawLine 3,396,301,396 
    10331071 
    10341072// 
     
    10371075        Button button_quest,pos={20,2},size={150,20},proc=V_ProtocolQuestionnaire,title="Questions" 
    10381076        Button button_quest,help={"Run through the questionnaire for setting up a reduction protocol"} 
    1039  
    1040         PopupMenu popup_sam,pos={85,28},size={51,23},proc=SAMFilePopMenuProc 
     1077        Button button_quest,disable=2 
     1078 
     1079 
     1080        PopupMenu popup_sam,pos={85,68},size={51,23},proc=SAMFilePopMenuProc 
    10411081        PopupMenu popup_sam,mode=1,value= #"V_getSAMList()"      
    1042         PopupMenu popup_bkg,pos={85,76},size={51,23},proc=BKGFilePopMenuProc 
     1082        PopupMenu popup_bkg,pos={85,164},size={51,23},proc=BKGFilePopMenuProc 
    10431083        PopupMenu popup_bkg,mode=1,value= #"V_getBGDList()" 
    1044         PopupMenu popup_emp,pos={85,125},size={51,23},proc=EMPFilePopMenuProc 
     1084        PopupMenu popup_emp,pos={85,213},size={51,23},proc=EMPFilePopMenuProc 
    10451085        PopupMenu popup_emp,mode=1,value= #"V_getEMPList()" 
    1046         PopupMenu popup_div,pos={85,175},size={51,23},proc=DIVFilePopMenuProc 
     1086        PopupMenu popup_div,pos={85,263},size={51,23},proc=DIVFilePopMenuProc 
    10471087        PopupMenu popup_div,mode=1,value= #"V_getDIVList()" 
    1048         PopupMenu popup_msk,pos={85,268},size={51,23},proc=MSKFilePopMenuProc 
     1088        PopupMenu popup_msk,pos={85,356},size={51,23},proc=MSKFilePopMenuProc 
    10491089        PopupMenu popup_msk,mode=1,value= #"V_getMSKList()"      
    10501090                 
    1051         CheckBox prot_check,pos={5,75},size={74,14},title="Background" 
     1091                 
     1092        CheckBox prot_check,pos={6,163},size={74,14},title="Background" 
    10521093        CheckBox prot_check,help={"If checked, the specified background file will be included in the data reduction. If the file name is \"ask\", then the user will be prompted for the file"} 
    10531094        CheckBox prot_check,value= 1 
    1054         CheckBox prot_check_1,pos={5,127},size={71,14},title="Empty Cell" 
     1095        CheckBox prot_check_1,pos={6,215},size={71,14},title="Empty Cell" 
    10551096        CheckBox prot_check_1,help={"If checked, the specified empty cell file will be included in the data reduction. If the file name is \"ask\", then the user will be prompted for the file"} 
    10561097        CheckBox prot_check_1,value= 1 
    1057         CheckBox prot_check_2,pos={6,175},size={72,14},title="Sensitivity" 
     1098        CheckBox prot_check_2,pos={6,263},size={72,14},title="Sensitivity" 
    10581099        CheckBox prot_check_2,help={"If checked, the specified detector sensitivity file will be included in the data reduction. If the file name is \"ask\", then the user will be prompted for the file"} 
    10591100        CheckBox prot_check_2,value= 1 
    1060         CheckBox prot_check_3,pos={9,268},size={43,14},title="Mask" 
     1101        CheckBox prot_check_3,pos={6,356},size={43,14},title="Mask" 
    10611102        CheckBox prot_check_3,help={"If checked, the specified mask file will be included in the data reduction. If the file name is \"ask\", then the user will be prompted for the file"} 
    10621103        CheckBox prot_check_3,value= 1 
    1063         CheckBox prot_check_4,pos={5,30},size={53,14},title="Sample" 
     1104        CheckBox prot_check_4,pos={6,70},size={53,14},title="Sample" 
    10641105        CheckBox prot_check_4,help={"If checked, the specified sample file will be included in the data reduction. If the file name is \"ask\", then the user will be prompted for the file"} 
    10651106        CheckBox prot_check_4,value= 1 
    1066         CheckBox prot_check_5,pos={6,311},size={56,14},title="Average" 
     1107        CheckBox prot_check_5,pos={6,399},size={56,14},title="Average" 
    10671108        CheckBox prot_check_5,help={"If checked, the specified averaging will be performed at the end of the data reduction."} 
    10681109        CheckBox prot_check_5,value= 1   
    1069         CheckBox prot_check_9,pos={7,222},size={59,14},title="Absolute" 
     1110        CheckBox prot_check_9,pos={6,310},size={59,14},title="Absolute" 
    10701111        CheckBox prot_check_9,help={"If checked, absolute calibration will be included in the data reduction. If the parameter list is \"ask\", then the user will be prompted for absolue parameters"} 
    10711112        CheckBox prot_check_9,value= 1 
     
    10801121//      Button pick_DIV,pos={214,173},size={70,20},proc=V_PickDIVButton,title="set DIV" 
    10811122//      Button pick_DIV,help={"This button will set the file selected in the File Catalog table to be the sensitivity file."} 
    1082         Button pick_ABS,pos={214,220},size={70,20},proc=V_SetABSParamsButton,title="set ABS" 
     1123        Button pick_ABS,pos={264,308},size={70,20},proc=V_SetABSParamsButton,title="set ABS" 
    10831124        Button pick_ABS,help={"This button will prompt the user for absolute scaling parameters"}        
    10841125//      Button pick_MASK,pos={214,266},size={70,20},proc=V_PickMASKButton,title="set MASK" 
     
    10861127 
    10871128 
    1088         Button pick_AVE,pos={108,313},size={150,20},proc=V_SetAverageParamsButtonProc,title="set AVERAGE params" 
     1129        Button pick_AVE,pos={188,401},size={150,20},proc=V_SetAverageParamsButtonProc,title="set AVERAGE params" 
    10891130        Button pick_AVE,help={"Prompts the user for the type of 1-D averaging to perform, as well as saving options"} 
    1090          
    1091         SetVariable samStr,pos={6,50},size={250,15},title="file:" 
     1131 
     1132         
     1133        Button pick_trim,pos={264,454},size={70,20},proc=V_TrimDataProtoButton,title="Trim" 
     1134        Button pick_trim,help={"This button will prompt the user for trimming parameters"}       
     1135         
     1136         
     1137        SetVariable samStr,pos={6,90},size={250,15},title="file:" 
    10921138        SetVariable samStr,help={"Filename of the sample file(s) to be used in the data reduction"} 
    10931139        SetVariable samStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gSAM            
    1094         SetVariable bgdStr,pos={7,98},size={250,15},title="file:" 
     1140        SetVariable bgdStr,pos={7,186},size={250,15},title="file:" 
    10951141        SetVariable bgdStr,help={"Filename of the background file(s) to be used in the data reduction"} 
    10961142        SetVariable bgdStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gBGD 
    1097         SetVariable empStr,pos={8,148},size={250,15},title="file:" 
     1143        SetVariable empStr,pos={8,236},size={250,15},title="file:" 
    10981144        SetVariable empStr,help={"Filename of the empty cell file(s) to be used in the data reduction"} 
    10991145        SetVariable empStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gEMP 
    1100         SetVariable divStr,pos={9,197},size={250,15},title="file:" 
     1146        SetVariable divStr,pos={9,285},size={250,15},title="file:" 
    11011147        SetVariable divStr,help={"Filename of the detector sensitivity file to be used in the data reduction"} 
    11021148        SetVariable divStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gDIV 
    1103         SetVariable maskStr,pos={9,289},size={250,15},title="file:" 
     1149        SetVariable maskStr,pos={9,377},size={250,15},title="file:" 
    11041150        SetVariable maskStr,help={"Filename of the mask file to be used in the data reduction"} 
    11051151        SetVariable maskStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gMASK 
    1106         SetVariable absStr,pos={7,243},size={250,15},title="parameters:" 
     1152        SetVariable absStr,pos={7,331},size={250,15},title="parameters:" 
    11071153        SetVariable absStr,help={"Keyword-string of values necessary for absolute scaling of data. Remaining parameters are taken from the sample file."} 
    11081154        SetVariable absStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gAbsStr 
    1109         SetVariable aveStr,pos={9,336},size={250,15},title="parameters:" 
     1155        SetVariable aveStr,pos={9,424},size={250,15},title="parameters:" 
    11101156        SetVariable aveStr,help={"Keyword-string of choices used for averaging and saving the 1-D data files"} 
    11111157        SetVariable aveStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gAVE 
    11121158 
    1113  
    1114  
    1115  
    1116  
     1159        SetVariable begStr,pos={9,464},size={250,15},title="Beg Trim:" 
     1160        SetVariable begStr,help={"Keyword-string of choices used for averaging and saving the 1-D data files"} 
     1161        SetVariable begStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gBegPtsStr 
     1162        SetVariable endStr,pos={9,484},size={250,15},title="End Trim:" 
     1163        SetVariable endStr,help={"Keyword-string of choices used for averaging and saving the 1-D data files"} 
     1164        SetVariable endStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gEndPtsStr 
    11171165 
    11181166 
     
    11271175//      SetVariable drkStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gDRK 
    11281176 
    1129         Button export_button, size={60,20},pos={125,384},title="Export",proc=V_ExportProtocol 
    1130         Button export_button, help={"Exports the protocol to disk for Importing into another experiment"} 
    1131         Button import_button, size={60,20},pos={125,406},title="Import",proc=V_ImportProtocol 
    1132         Button import_button,help={"Imports a protocol from disk for use in this experiment"} 
    1133         Button recallProt,pos={7,406},size={107,20},proc=V_RecallProtocolButton,title="Recall Protocol" 
     1177 
     1178        Button export_button, size={120,20},pos={125,540},title="Export to Data",proc=V_ExportFileProtocol 
     1179        Button export_button, help={"Exports the protocol to data file on disk for Importing into another experiment"} 
     1180        Button import_button, size={120,20},pos={125,562},title="Import from Data",proc=V_ImportFileProtocol 
     1181        Button import_button,help={"Imports a protocol from a data file on disk for use in this experiment"} 
     1182        Button recallProt,pos={7,540},size={107,20},proc=V_RecallProtocolButton,title="Recall Protocol" 
    11341183        Button recallProt,help={"Resets the panel to the file choices in  a previously saved protocol"} 
    1135         Button del_protocol,pos={7,428},size={110,20},proc=V_DeleteProtocolButton,title="Delete Protocol" 
     1184        Button del_protocol,pos={7,562},size={110,20},proc=V_DeleteProtocolButton,title="Delete Protocol" 
    11361185        Button del_protocol,help={"Use this to delete a previously saved protocol."} 
    1137         Button done_protocol,pos={225,428},size={45,20},proc=V_DoneProtocolButton,title="Done" 
     1186        Button done_protocol,pos={285,562},size={45,20},proc=V_DoneProtocolButton,title="Done" 
    11381187        Button done_protocol,help={"This button will close the panel. The panel can be recalled at any time from the SANS menu."} 
    1139         Button saveProtocol,pos={7,384},size={100,20},proc=V_SaveProtocolButton,title="Save Protocol" 
     1188        Button saveProtocol,pos={7,518},size={100,20},proc=V_SaveProtocolButton,title="Save Protocol" 
    11401189        Button saveProtocol,help={"Saves the cerrent selections in the panel to a protocol which can be later recalled"} 
    1141         Button ReduceOne,pos={194,384},size={100,20},proc=V_ReduceOneButton,title="Reduce A File" 
     1190        Button ReduceOne,pos={240,518},size={100,20},proc=V_ReduceOneButton,title="Reduce A File" 
    11421191        Button ReduceOne,help={"Using the panel selections, the specified sample file will be reduced. If none is specified, the user will be prompted for a sample file"} 
    11431192 
    11441193EndMacro 
     1194 
     1195 
     1196 
     1197 
    11451198 
    11461199Function SAMFilePopMenuProc(pa) : PopupMenuControl 
     
    14081461//the popup is presented as a missing parameter dialog (called with empty parameter list) 
    14091462// 
     1463// MAXROWS is present to exclude the PanelNameW from appearing as a protocol 
    14101464Proc V_PickAProtocol(protocol) 
    14111465        String Protocol 
    1412         Prompt Protocol "Pick A Protocol",popup, WaveList("*",";","TEXT:1") 
     1466        Prompt Protocol "Pick A Protocol",popup, WaveList("*",";","TEXT:1,MAXROWS:13") 
    14131467         
    14141468        String/G  root:Packages:NIST:VSANS:Globals:Protocols:gProtoStr = protocol 
     
    14241478 
    14251479Function/S V_DeletableProtocols() 
    1426         String list=WaveList("*",";","TEXT:1") 
     1480        String list=WaveList("*",";","TEXT:1,MAXROWS:13") 
    14271481 
    14281482        list= RemoveFromList("Base", list  , ";") 
     
    14371491End 
    14381492 
    1439 //missing paramater dialog to solicit user for a waveStr for the protocol  
     1493//missing parameter dialog to solicit user for a waveStr for the protocol  
    14401494//about to be created 
    14411495//name is passed back as a global string and calling procedure is responsible for 
     
    14841538        //Print "protocol questionnaire is "+newProtocol 
    14851539         
    1486         //make a new text wave (8 points) and fill it in, in response to questions 
     1540        //make a new text wave (12 points) and fill it in, in response to questions 
    14871541        SetDataFolder root:Packages:NIST:VSANS:Globals:Protocols //(redundant - full wave specs are used) 
    1488         Make/O/T/N=8 $("root:Packages:NIST:VSANS:Globals:Protocols:" + newProtoStr) 
     1542        Make/O/T/N=(kNumProtocolSteps) $("root:Packages:NIST:VSANS:Globals:Protocols:" + newProtoStr) 
    14891543        Wave/T newProtocol = $("root:Packages:NIST:VSANS:Globals:Protocols:" + newProtoStr) 
     1544        newProtocol = "" 
    14901545         
    14911546        //ask the questions  
     
    18951950        //5 - average params 
    18961951        //6 = DRK file (**out of sequence) 
    1897         //7 = unused 
     1952        //7 = beginning trim points 
     1953        //8 = end trim points 
     1954        //9 = unused 
     1955        //10 = unused 
     1956        //11 = unused 
    18981957 
    18991958// for VSANS, DIV is used on each data file as it is converted to WORK, so it needs to be 
     
    23962455// -- currently hard-wired 
    23972456// --do I need to define these "per-panel"?              
    2398                 Variable nBeg = 3, nEnd = 10 
    23992457                 
    24002458                PathInfo/S catPathName 
     
    24412499 
    24422500                                if(cmpstr(saveType,"Yes - Concatenate")==0) 
    2443                                         V_Trim1DDataStr(activeType,binType,"","")                       // TODO -- passing null strings uses global or default trim values 
     2501                                        V_Trim1DDataStr(activeType,binType,prot[7],prot[8])                     // TODO -- passing null strings uses global or default trim values 
    24442502//                                      V_Trim1DData(activeType,binType,nBeg,nEnd) 
    24452503                                        V_ConcatenateForSave("root:Packages:NIST:VSANS:",activeType,"",binType)         // this removes q=0 point, concatenates, sorts 
     
    26982756 
    26992757 
     2758Function V_TrimDataProtoButton(ctrlName) :buttonControl 
     2759        String ctrlName 
     2760         
     2761        Execute "V_CombineDataGraph()" 
     2762        return(0) 
     2763end 
     2764 
     2765// 
     2766// export protocol to a data file 
     2767// 
     2768// 
     2769Function V_ExportFileProtocol(ctrlName) : ButtonControl 
     2770        String ctrlName 
     2771// get a list of protocols 
     2772        String Protocol="" 
     2773        SetDataFolder root:Packages:NIST:VSANS:Globals:Protocols 
     2774        Prompt Protocol "Pick A Protocol",popup, WaveList("*",";","") 
     2775        DoPrompt "Pick A Protocol to Export",Protocol 
     2776        if(V_flag==1) 
     2777                //Print "user cancel" 
     2778                SetDatafolder root: 
     2779                return(1) 
     2780        endif 
     2781 
     2782        String fileName = V_DoSaveFileDialog("pick the file to write to") 
     2783        print fileName 
     2784//       
     2785        if(strlen(fileName) == 0) 
     2786                return(0) 
     2787        endif 
     2788 
     2789        V_write_ProtocolWave(fileName,$("root:Packages:NIST:VSANS:Globals:Protocols:"+Protocol) ) 
     2790 
     2791        setDataFolder root: 
     2792        return(0) 
     2793 
     2794End 
     2795 
     2796// 
     2797// imports a protocol from a file on disk into the protocols folder 
     2798// 
     2799// 
     2800Function V_ImportFileProtocol(ctrlName) : ButtonControl 
     2801        String ctrlName 
     2802 
     2803//      SetDataFolder root:Packages:NIST:VSANS:Globals:Protocols 
     2804 
     2805        String fullPath,fileName 
     2806        fullPath = DoOpenFileDialog("Import Protocol from file") 
     2807        print fullPath 
     2808//       
     2809        if(strlen(fullPath) == 0) 
     2810                return(0) 
     2811        endif 
     2812         
     2813        fileName = ParseFilePath(0, fullPath, ":", 1, 0)                        //just the file name at the end of the full path 
     2814         
     2815        Wave/T tmpW = V_getReductionProtocolWave(fileName) 
     2816        if(numpnts(tmpW) == 0) 
     2817                DoAlert 0,"No protocol wave has been saved to this data file" 
     2818                return(0) 
     2819        endif 
     2820         
     2821        SetDataFolder root:Packages:NIST:VSANS:Globals:Protocols 
     2822        String newName 
     2823        newName = CleanupName(fileName,0) + "_proto" 
     2824        duplicate/o tmpw $newName 
     2825         
     2826         
     2827        SetDataFolder root: 
     2828        return(0) 
     2829end 
     2830 
     2831 
     2832// currently not used - and not updated to 12 point protocols (5/2017) 
     2833// 
    27002834//save the protocol as an IGOR text wave (.itx) 
    27012835// 
     
    27472881End 
    27482882 
     2883 
     2884// currently not used - and not updated to 12 point protocols (5/2017) 
    27492885//imports a protocol from disk into the protocols folder 
    27502886// 
Note: See TracChangeset for help on using the changeset viewer.