Changeset 494
- Timestamp:
- Apr 21, 2009 5:33:27 PM (13 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/Wrapper_v40.ipf
r481 r494 221 221 222 222 // SANS Reduction bits 223 tmp = "ASStandardFunction;Ann_1D_Graph;Avg_1D_Graph;BStandardFunction;CStandardFunction;Draw_Plot1D;MyMat2XYZ;NewDirection;SANSModelAAO_MCproto;Monte_SANS_Threaded;Monte_SANS_NotThreaded;Monte_SANS_W1;Monte_SANS_W2;Monte_SANS; "223 tmp = "ASStandardFunction;Ann_1D_Graph;Avg_1D_Graph;BStandardFunction;CStandardFunction;Draw_Plot1D;MyMat2XYZ;NewDirection;SANSModelAAO_MCproto;Monte_SANS_Threaded;Monte_SANS_NotThreaded;Monte_SANS_W1;Monte_SANS_W2;Monte_SANS;FractionReachingDetector;" 224 224 list = RemoveFromList(tmp, list ,";") 225 225 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/MultScatter_MonteCarlo_2D.ipf
r490 r494 760 760 761 761 // SANS Reduction bits 762 tmp = "ASStandardFunction;Ann_1D_Graph;Avg_1D_Graph;BStandardFunction;CStandardFunction;Draw_Plot1D;MyMat2XYZ;NewDirection;SANSModelAAO_MCproto;Monte_SANS_Threaded;Monte_SANS_NotThreaded;Monte_SANS_W1;Monte_SANS_W2; "762 tmp = "ASStandardFunction;Ann_1D_Graph;Avg_1D_Graph;BStandardFunction;CStandardFunction;Draw_Plot1D;MyMat2XYZ;NewDirection;SANSModelAAO_MCproto;Monte_SANS_Threaded;Monte_SANS_NotThreaded;Monte_SANS_W1;Monte_SANS_W2;FractionReachingDetector;" 763 763 list = RemoveFromList(tmp, list ,";") 764 764 list = RemoveFromList("Monte_SANS", list) … … 919 919 SetVariable cntVar,pos={190,73},size={80,15},proc=CountTimeSetVarProc,title="time(s)" 920 920 SetVariable cntVar,format="%d" 921 SetVariable cntVar,limits={1,60 ,1},value= root:Packages:NIST:SAS:gCntTime921 SetVariable cntVar,limits={1,600,1},value= root:Packages:NIST:SAS:gCntTime 922 922 Button MC_button2,pos={17,234},size={100,20},proc=SaveAsVAXButtonProc,title="Save 2D VAX" 923 923 CheckBox check0,pos={216,180},size={68,14},title="Raw counts",variable = root:Packages:NIST:SAS:gRawCounts -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/PatchFiles.ipf
r412 r494 81 81 Variable/G root:myGlobals:Patch:gPV19 = 0 82 82 Variable/G root:myGlobals:Patch:gTransCts = 0 83 Variable/G root:myGlobals:Patch:gRadioVal = 0 83 84 End 84 85 … … 113 114 //that is semicolon delimited, and is suitable for display in a popup menu 114 115 // 115 Function/S GetValidPatchPopupList()116 Function/S xGetValidPatchPopupList() 116 117 117 118 //make sure that path exists … … 128 129 //trim list to include only selected files 129 130 SVAR match = root:myGlobals:Patch:gPatchMatchStr 131 if(strlen(match) == 0) //if nothing is entered for a match string, return everything, rather than nothing 132 match = "*" 133 endif 134 130 135 newlist = MyMatchList(match,newlist,";") 131 136 … … 134 139 End 135 140 136 141 //returns a list of valid files (raw data, no version numbers, no averaged files) 142 //that is semicolon delimited, and is suitable for display in a popup menu 143 // 144 // Uses Grep to look through the any text in the file, which includes the sample label 145 // can be very slow across the network, as it re-pops the menu on a selection (since some folks don't hit 146 // enter when inputing a filter string) 147 // 148 // - or - 149 // a list or range of run numbers 150 // - or - 151 // a SDD (to within 0.001m) 152 // - or - 153 // * to get everything 154 // 155 // NVAR gRadioVal= root:myGlobals:Patch:gRadioVal 156 // 1== Run # (comma range OK) 157 // 2== Grep the text (SLOW) 158 // 3== filter by SDD (within 0.001 m) 159 Function/S GetValidPatchPopupList() 160 161 //make sure that path exists 162 PathInfo catPathName 163 String path = S_path 164 if (V_flag == 0) 165 Abort "folder path does not exist - use Pick Path button" 166 Endif 167 168 String newList = "" 169 170 newList = GetRawDataFileList() 171 172 //trim list to include only selected files 173 SVAR match = root:myGlobals:Patch:gPatchMatchStr 174 if(strlen(match) == 0 || cmpstr(match,"*")==0) //if nothing or "*" entered for a match string, return everything, rather than nothing 175 match = "*" 176 // old way, with simply a wildcard 177 newlist = MyMatchList(match,newlist,";") 178 newList = SortList(newList,";",0) 179 return(newList) 180 endif 181 182 //loop through all of the files as needed 183 // Grep Note: the \\b sequences limit matches to a word boundary before and after 184 // "boondoggle", so "boondoggles" and "aboondoggle" won't match. 185 186 String list="",item="",fname,runList="",numStr="" 187 Variable ii,num=ItemsInList(newList),val,sdd 188 NVAR gRadioVal= root:myGlobals:Patch:gRadioVal 189 190 191 192 // run number list 193 if(gRadioVal == 1) 194 // list = ParseRunNumberList(match) //slow, file access every time 195 // list = ReplaceString(",", list, ";") 196 // newList = list 197 198 list = ExpandNumRanges(match) //now simply comma delimited 199 num=ItemsInList(list,",") 200 for(ii=0;ii<num;ii+=1) 201 item = StringFromList(ii,list,",") 202 val=str2num(item) 203 //make a three character string of the run number 204 if(val<10) 205 numStr = "00"+num2str(val) 206 else 207 if(val<100) 208 numStr = "0"+num2str(val) 209 else 210 numStr = num2str(val) 211 Endif 212 Endif 213 runList += ListMatch(newList,"*"+numStr+"*",";") 214 215 endfor 216 newlist = runList 217 218 endif 219 220 //grep through what text I can find in the VAX binary 221 if(gRadioVal == 2) 222 for(ii=0;ii<num;ii+=1) 223 item=StringFromList(ii, newList , ";") 224 // Grep/P=catPathName/Q/E=("(?i)\\b"+match+"\\b") item 225 Grep/P=catPathName/Q/E=("(?i)"+match) item 226 if( V_value ) // at least one instance was found 227 // Print "found ", item,ii 228 list += item + ";" 229 endif 230 endfor 231 232 newList = list 233 endif 234 235 // SDD 236 if(gRadioVal == 3) 237 val = str2num(match) 238 // print val 239 for(ii=0;ii<num;ii+=1) 240 item=StringFromList(ii, newList , ";") 241 fname = path + item 242 sdd = getSDD(fname) 243 if(abs(val - sdd) < 0.001 ) //if numerically within 0.001 meter, they're the same 244 list += item + ";" 245 endif 246 endfor 247 248 newList = list 249 endif 250 251 newList = SortList(newList,";",0) 252 Return(newList) 253 End 254 255 256 257 258 // -- no longer refreshes the list - this seems redundant, and can be slow if grepping 259 // 137 260 //updates the popup list when the menu is "popped" so the list is 138 261 //always fresh, then automatically displays the header of the popped file … … 150 273 //this will exclude version numbers, .AVE, .ABS files, etc. from the popup (which can't be patched) 151 274 152 String list = GetValidPatchPopupList()153 154 String/G root:myGlobals:Patch:gPatchList = list155 ControlUpdate PatchPopup275 // String list = GetValidPatchPopupList() 276 277 // String/G root:myGlobals:Patch:gPatchList = list 278 // ControlUpdate PatchPopup 156 279 ShowHeaderButtonProc("SHButton") 157 280 End … … 177 300 String/G root:myGlobals:Patch:gPatchList = list 178 301 ControlUpdate PatchPopup 179 302 PopupMenu PatchPopup,mode=1 180 303 End 181 304 … … 479 602 Proc Patch_Panel() 480 603 PauseUpdate; Silent 1 // building window... 481 NewPanel /W=(519,85,950,608)/K=1 as "Patch Raw SANS Data Files" 604 // NewPanel /W=(519,85,950,608)/K=1 as "Patch Raw SANS Data Files" 605 NewPanel /W=(519,85,950,608) as "Patch Raw SANS Data Files" 482 606 DoWindow/C Patch_Panel 483 607 ModifyPanel cbRGB=(1,39321,19939) … … 499 623 Button helpButton,pos={400,3},size={25,20},proc=ShowPatchHelp,title="?" 500 624 Button helpButton,help={"Show the help file for patching raw data headers"} 501 PopupMenu PatchPopup,pos={4, 40},size={156,19},proc=PatchPopMenuProc,title="File(s) to Patch"625 PopupMenu PatchPopup,pos={4,37},size={156,19},proc=PatchPopMenuProc,title="File(s) to Patch" 502 626 PopupMenu PatchPopup,help={"The displayed file is the one that will be edited. The entire list will be edited if \"Change All..\" is selected. \r If no items, or the wrong items appear, click on the popup to refresh. \r List items are selected from the file based on MatchString"} 503 627 PopupMenu PatchPopup,mode=1,popvalue="none",value= #"root:myGlobals:Patch:gPatchList" 504 Button SHButton,pos={324,37},size={100,20},proc=ShowHeaderButtonProc,title="Show Header"505 Button SHButton,help={"This will display the header of the file indicated in the popup menu."}506 Button CHButton,pos={314, 60},size={110,20},proc=ChangeHeaderButtonProc,title="Change Header"628 // Button SHButton,pos={324,37},size={100,20},proc=ShowHeaderButtonProc,title="Show Header" 629 // Button SHButton,help={"This will display the header of the file indicated in the popup menu."} 630 Button CHButton,pos={314,37},size={110,20},proc=ChangeHeaderButtonProc,title="Change Header" 507 631 Button CHButton,help={"This will change the checked values (ONLY) in the single file selected in the popup."} 508 SetVariable PMStr,pos={6,6 5},size={174,13},proc=SetMatchStrProc,title="Match String"632 SetVariable PMStr,pos={6,63},size={174,13},proc=SetMatchStrProc,title="Match String" 509 633 SetVariable PMStr,help={"Enter the search string to narrow the list of files. \"*\" is the wildcard character. After entering, \"pop\" the menu to refresh the file list."} 510 634 SetVariable PMStr,font="Courier",fSize=10 511 635 SetVariable PMStr,limits={-Inf,Inf,0},value= root:myGlobals:Patch:gPatchMatchStr 512 Button ChAllButton,pos={245, 84},size={180,20},proc=ChAllHeadersButtonProc,title="Change All Headers in List"636 Button ChAllButton,pos={245,60},size={180,20},proc=ChAllHeadersButtonProc,title="Change All Headers in List" 513 637 Button ChAllButton,help={"This will change the checked values (ONLY) in ALL of the files in the popup list, not just the top file. If the \"change\" checkbox for the item is not checked, nothing will be changed for that item."} 514 638 Button DoneButton,pos={310,489},size={110,20},proc=DoneButtonProc,title="Done Patching" … … 621 745 CheckBox checkPV19,pos={18,450},size={20,20},title="",value=0 622 746 CheckBox checkPV19,help={"If checked, the entered value will be written to the data file if either of the \"Change..\" buttons is pressed."},value=0 747 748 CheckBox check0,pos={18,80},size={40,15},title="Run #",value= 1,mode=1,proc=MatchCheckProc 749 CheckBox check1,pos={78,80},size={40,15},title="Text",value= 0,mode=1,proc=MatchCheckProc 750 CheckBox check2,pos={138,80},size={40,15},title="SDD",value= 0,mode=1,proc=MatchCheckProc 751 752 End 753 754 755 Function MatchCheckProc(name,value) 756 String name 757 Variable value 758 759 NVAR gRadioVal= root:myGlobals:Patch:gRadioVal 760 761 strswitch (name) 762 case "check0": 763 gRadioVal= 1 764 break 765 case "check1": 766 gRadioVal= 2 767 break 768 case "check2": 769 gRadioVal= 3 770 break 771 endswitch 772 CheckBox check0,value= gRadioVal==1 773 CheckBox check1,value= gRadioVal==2 774 CheckBox check2,value= gRadioVal==3 623 775 End 624 776
Note: See TracChangeset
for help on using the changeset viewer.