Changeset 1040
- Timestamp:
- May 19, 2017 2:13:33 PM (6 years ago)
- 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 94 94 #include "V_Transmission" 95 95 96 #include "V_MultipleReduce" 96 97 97 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_RW_Utils.ipf
r1034 r1040 635 635 endif 636 636 637 // this should exist now - if not, I need to see the error638 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) 639 639 640 640 return wOut -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Read.ipf
r1034 r1040 2367 2367 end 2368 2368 2369 // this is a NON NICE entered field 2370 // so I need to catch the error if it's not there 2371 Function/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 2384 end 2369 2385 2370 2386 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Write.ipf
r1039 r1040 6371 6371 6372 6372 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!!! 6374 6374 // -- 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 inW6375 Function V_write_ProtocolWave(fname,inTW) 6376 String fname 6377 Wave/T inTW 6378 6378 6379 6379 // String path = "entry:reduction:absolute_scaling" 6380 6380 6381 Duplicate/O in W wTmpWrite6381 Duplicate/O inTW wTTmpWrite 6382 6382 // then use redimension as needed to cast the wave to write to the specified type 6383 6383 // see WaveType for the proper codes … … 6385 6385 // -- May also need to check the dimension(s) before writing (don't trust the input) 6386 6386 String groupName = "/entry/reduction" 6387 String varName = " trim_wave"6388 6389 variable err 6390 err = V_WriteWaveToHDF(fname, groupName, varName, wT mpWrite)6387 String varName = "protocol" 6388 6389 variable err 6390 err = V_WriteWaveToHDF(fname, groupName, varName, wTTmpWrite) 6391 6391 if(err) 6392 6392 Print "HDF write err = ",err -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Initialize.ipf
r1039 r1040 291 291 Function V_InitFakeProtocols() 292 292 293 //*****as of 0 901, protocols are 8 points long, [6] is used for work.drk, [7] isunused293 //*****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 294 294 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 wave295 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 298 298 //Initialize waves to store values in 299 299 300 300 String/G root:Packages:NIST:VSANS:Globals:Protocols:gProtoStr="" 301 301 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;" 303 303 304 304 String/G root:Packages:NIST:VSANS:Globals:Protocols:gBegPtsStr="" -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MainPanel.ipf
r1039 r1040 100 100 String ctrlName 101 101 102 ReduceMultipleFiles()102 V_ReduceMultipleFiles() 103 103 End 104 104 … … 355 355 Button MainButton_0b,help={"Patch will update incorrect information in raw data headers"} 356 356 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"} 358 358 Button MainButton_0d,pos={15,180},size={130,20},proc=RealTime_MainButtonProc,title="RealTime Display" 359 359 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 50 50 ////////////////////////////////// 51 51 52 Constant kNumProtocolSteps = 12 52 53 53 54 //main entry procedure for initialzing and displaying the protocol panel … … 71 72 //set up the global variables needed for the protocol panel 72 73 //global strings to put in a temporary protocol textwave 73 Variable ii=0 ,nsteps=874 Variable ii=0 74 75 String waveStr="tempProtocol" 75 76 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" = "" 77 78 78 79 String/G root:Packages:NIST:VSANS:Globals:Protocols:gSAM="ask" … … 82 83 String/G root:Packages:NIST:VSANS:Globals:Protocols:gMASK="ask" 83 84 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;" 85 86 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 86 90 87 91 SetDataFolder root: … … 153 157 End 154 158 155 159 // 156 160 //function that actually parses the protocol specified by nameStr 157 161 //which is just the name of the wave, without a datafolder path 162 // 163 // TODO 164 // -- update this for 12 steps 158 165 // 159 166 Function V_ResetToSavedProtocol(nameStr) … … 273 280 // Endif 274 281 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 277 294 //all has been reset, get out 278 295 Return (0) … … 329 346 //current data folder is root:Packages:NIST:VSANS:Globals:Protocols 330 347 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) 332 349 Endif 333 350 … … 343 360 //Wave/T w (input) is an empty text wave of 8 elements for the protocol 344 361 //on output, w[] is filled with the protocol strings as needed from the panel 362 // 363 // TODO 364 // -- update for 12 points 345 365 // 346 366 Function V_MakeProtocolFromPanel(w) … … 482 502 483 503 //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] 484 514 //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 487 523 return(0) 488 524 End … … 522 558 // endif 523 559 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 525 563 Function/S V_GetSAMList() 526 564 … … 961 999 String temp="root:Packages:NIST:VSANS:Globals:Protocols:tempProtocol" 962 1000 Wave/T w=$temp 963 Variable ii=0,num= 81001 Variable ii=0,num=12 964 1002 do 965 1003 w[ii] = "" … … 1019 1057 Window V_ProtocolPanel() 1020 1058 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" 1022 1060 ModifyPanel cbRGB=(56589,50441,50159), fixedSize=1 1023 1061 SetDrawLayer UserBack 1024 DrawLine 2,25,300,251025 DrawLine 2,69,300,691026 DrawLine 2,120,300,1201027 DrawLine 2,169,300,1691028 DrawLine 2,217,300,2171029 DrawLine 2,262,300,2621030 DrawLine 2,357,300,3571031 DrawLine 2,379,300,3791032 DrawLine 2,308,300,3081062 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 1033 1071 1034 1072 // … … 1037 1075 Button button_quest,pos={20,2},size={150,20},proc=V_ProtocolQuestionnaire,title="Questions" 1038 1076 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 1041 1081 PopupMenu popup_sam,mode=1,value= #"V_getSAMList()" 1042 PopupMenu popup_bkg,pos={85, 76},size={51,23},proc=BKGFilePopMenuProc1082 PopupMenu popup_bkg,pos={85,164},size={51,23},proc=BKGFilePopMenuProc 1043 1083 PopupMenu popup_bkg,mode=1,value= #"V_getBGDList()" 1044 PopupMenu popup_emp,pos={85, 125},size={51,23},proc=EMPFilePopMenuProc1084 PopupMenu popup_emp,pos={85,213},size={51,23},proc=EMPFilePopMenuProc 1045 1085 PopupMenu popup_emp,mode=1,value= #"V_getEMPList()" 1046 PopupMenu popup_div,pos={85, 175},size={51,23},proc=DIVFilePopMenuProc1086 PopupMenu popup_div,pos={85,263},size={51,23},proc=DIVFilePopMenuProc 1047 1087 PopupMenu popup_div,mode=1,value= #"V_getDIVList()" 1048 PopupMenu popup_msk,pos={85, 268},size={51,23},proc=MSKFilePopMenuProc1088 PopupMenu popup_msk,pos={85,356},size={51,23},proc=MSKFilePopMenuProc 1049 1089 PopupMenu popup_msk,mode=1,value= #"V_getMSKList()" 1050 1090 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" 1052 1093 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"} 1053 1094 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" 1055 1096 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"} 1056 1097 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" 1058 1099 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"} 1059 1100 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" 1061 1102 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"} 1062 1103 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" 1064 1105 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"} 1065 1106 CheckBox prot_check_4,value= 1 1066 CheckBox prot_check_5,pos={6,3 11},size={56,14},title="Average"1107 CheckBox prot_check_5,pos={6,399},size={56,14},title="Average" 1067 1108 CheckBox prot_check_5,help={"If checked, the specified averaging will be performed at the end of the data reduction."} 1068 1109 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" 1070 1111 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"} 1071 1112 CheckBox prot_check_9,value= 1 … … 1080 1121 // Button pick_DIV,pos={214,173},size={70,20},proc=V_PickDIVButton,title="set DIV" 1081 1122 // 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={2 14,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" 1083 1124 Button pick_ABS,help={"This button will prompt the user for absolute scaling parameters"} 1084 1125 // Button pick_MASK,pos={214,266},size={70,20},proc=V_PickMASKButton,title="set MASK" … … 1086 1127 1087 1128 1088 Button pick_AVE,pos={1 08,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" 1089 1130 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:" 1092 1138 SetVariable samStr,help={"Filename of the sample file(s) to be used in the data reduction"} 1093 1139 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:" 1095 1141 SetVariable bgdStr,help={"Filename of the background file(s) to be used in the data reduction"} 1096 1142 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:" 1098 1144 SetVariable empStr,help={"Filename of the empty cell file(s) to be used in the data reduction"} 1099 1145 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:" 1101 1147 SetVariable divStr,help={"Filename of the detector sensitivity file to be used in the data reduction"} 1102 1148 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:" 1104 1150 SetVariable maskStr,help={"Filename of the mask file to be used in the data reduction"} 1105 1151 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:" 1107 1153 SetVariable absStr,help={"Keyword-string of values necessary for absolute scaling of data. Remaining parameters are taken from the sample file."} 1108 1154 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:" 1110 1156 SetVariable aveStr,help={"Keyword-string of choices used for averaging and saving the 1-D data files"} 1111 1157 SetVariable aveStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gAVE 1112 1158 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 1117 1165 1118 1166 … … 1127 1175 // SetVariable drkStr,limits={-Inf,Inf,0},value= root:Packages:NIST:VSANS:Globals:Protocols:gDRK 1128 1176 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" 1134 1183 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" 1136 1185 Button del_protocol,help={"Use this to delete a previously saved protocol."} 1137 Button done_protocol,pos={2 25,428},size={45,20},proc=V_DoneProtocolButton,title="Done"1186 Button done_protocol,pos={285,562},size={45,20},proc=V_DoneProtocolButton,title="Done" 1138 1187 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" 1140 1189 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" 1142 1191 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"} 1143 1192 1144 1193 EndMacro 1194 1195 1196 1197 1145 1198 1146 1199 Function SAMFilePopMenuProc(pa) : PopupMenuControl … … 1408 1461 //the popup is presented as a missing parameter dialog (called with empty parameter list) 1409 1462 // 1463 // MAXROWS is present to exclude the PanelNameW from appearing as a protocol 1410 1464 Proc V_PickAProtocol(protocol) 1411 1465 String Protocol 1412 Prompt Protocol "Pick A Protocol",popup, WaveList("*",";","TEXT:1 ")1466 Prompt Protocol "Pick A Protocol",popup, WaveList("*",";","TEXT:1,MAXROWS:13") 1413 1467 1414 1468 String/G root:Packages:NIST:VSANS:Globals:Protocols:gProtoStr = protocol … … 1424 1478 1425 1479 Function/S V_DeletableProtocols() 1426 String list=WaveList("*",";","TEXT:1 ")1480 String list=WaveList("*",";","TEXT:1,MAXROWS:13") 1427 1481 1428 1482 list= RemoveFromList("Base", list , ";") … … 1437 1491 End 1438 1492 1439 //missing param ater dialog to solicit user for a waveStr for the protocol1493 //missing parameter dialog to solicit user for a waveStr for the protocol 1440 1494 //about to be created 1441 1495 //name is passed back as a global string and calling procedure is responsible for … … 1484 1538 //Print "protocol questionnaire is "+newProtocol 1485 1539 1486 //make a new text wave ( 8points) and fill it in, in response to questions1540 //make a new text wave (12 points) and fill it in, in response to questions 1487 1541 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) 1489 1543 Wave/T newProtocol = $("root:Packages:NIST:VSANS:Globals:Protocols:" + newProtoStr) 1544 newProtocol = "" 1490 1545 1491 1546 //ask the questions … … 1895 1950 //5 - average params 1896 1951 //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 1898 1957 1899 1958 // for VSANS, DIV is used on each data file as it is converted to WORK, so it needs to be … … 2396 2455 // -- currently hard-wired 2397 2456 // --do I need to define these "per-panel"? 2398 Variable nBeg = 3, nEnd = 102399 2457 2400 2458 PathInfo/S catPathName … … 2441 2499 2442 2500 if(cmpstr(saveType,"Yes - Concatenate")==0) 2443 V_Trim1DDataStr(activeType,binType, "","") // TODO -- passing null strings uses global or default trim values2501 V_Trim1DDataStr(activeType,binType,prot[7],prot[8]) // TODO -- passing null strings uses global or default trim values 2444 2502 // V_Trim1DData(activeType,binType,nBeg,nEnd) 2445 2503 V_ConcatenateForSave("root:Packages:NIST:VSANS:",activeType,"",binType) // this removes q=0 point, concatenates, sorts … … 2698 2756 2699 2757 2758 Function V_TrimDataProtoButton(ctrlName) :buttonControl 2759 String ctrlName 2760 2761 Execute "V_CombineDataGraph()" 2762 return(0) 2763 end 2764 2765 // 2766 // export protocol to a data file 2767 // 2768 // 2769 Function 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 2794 End 2795 2796 // 2797 // imports a protocol from a file on disk into the protocols folder 2798 // 2799 // 2800 Function 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) 2829 end 2830 2831 2832 // currently not used - and not updated to 12 point protocols (5/2017) 2833 // 2700 2834 //save the protocol as an IGOR text wave (.itx) 2701 2835 // … … 2747 2881 End 2748 2882 2883 2884 // currently not used - and not updated to 12 point protocols (5/2017) 2749 2885 //imports a protocol from disk into the protocols folder 2750 2886 //
Note: See TracChangeset
for help on using the changeset viewer.