Changeset 132 for sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Packages/ModelPicker
- Timestamp:
- Jul 26, 2007 1:33:58 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Packages/ModelPicker/SANSModelPicker.ipf
r130 r132 52 52 // the list box in the panel 53 53 Proc Init_FileList() 54 //create the data folder 55 if(!DataFolderExists("root:FileList")) 56 NewDataFolder/O/S root:FileList 54 //create the data folders and globals 55 NewDataFolder/O root:myGlobals //others will need this...make it just in case 56 57 if(!DataFolderExists("root:myGlobals:FileList")) 58 NewDataFolder/O/S root:myGlobals:FileList 57 59 //create the waves 58 60 Make/O/T/N=0 fileWave,includedFileWave … … 65 67 // a switch for me to turn off file checking 66 68 Variable/G checkForFiles=1 //set to true initially 69 checkForFiles = !(stringmatch(ParseFilePath(0,SpecialDirPath("Desktop",0,0,0),":",1,1),"s*ine")) //zero for me 67 70 68 71 //fill the list of procedures … … 75 78 FileList_InsertButtonProc("") 76 79 77 NewDataFolder/O root:myGlobals //others will need this...make it just in case 80 78 81 79 82 SetDataFolder root: … … 86 89 // if the wave SANS_Model_List does not exist 87 90 Proc ReadNewProcList() 88 KillWaves/Z root: FileList:SANS_Model_List //kill the old list91 KillWaves/Z root:myGlobals:FileList:SANS_Model_List //kill the old list 89 92 FileList_GetListButtonProc("") 90 93 End … … 101 104 // 102 105 Proc TypeNewModelList() 103 variable ii=0,num=numpnts(root: FileList:SANS_Model_List)106 variable ii=0,num=numpnts(root:myGlobals:FileList:SANS_Model_List) 104 107 printf "Make/O/T/N/=%d SANS_Model_List\r\r",num 105 108 do 106 printf "SANS_Model_List[%d] = \"%s\"\r",ii,root: FileList:SANS_Model_List[ii]109 printf "SANS_Model_List[%d] = \"%s\"\r",ii,root:myGlobals:FileList:SANS_Model_List[ii] 107 110 ii+=1 108 111 while(ii<num) … … 110 113 111 114 Proc FileList_BuiltInList() 112 SetDataFolder root: FileList115 SetDataFolder root:myGlobals:FileList 113 116 114 117 ////paste here... after deleting the old make statement and list … … 189 192 String ProcedureName 190 193 191 SetDataFolder root: FileList194 SetDataFolder root:myGlobals:FileList 192 195 Variable num 193 196 num=numpnts(fileWave) … … 206 209 Variable val 207 210 // a switch for me to turn off file checking 208 root: FileList:checkForFiles=val //0==no check, 1=check211 root:myGlobals:FileList:checkForFiles=val //0==no check, 1=check 209 212 End 210 213 … … 223 226 DoWindow/C Procedure_List 224 227 ModifyPanel fixedSize=1 225 ListBox fileList,pos={4,3},size={200,100},listWave=root: FileList:fileWave226 ListBox fileList,selWave=root: FileList:selWave,mode= 4228 ListBox fileList,pos={4,3},size={200,100},listWave=root:myGlobals:FileList:fileWave 229 ListBox fileList,selWave=root:myGlobals:FileList:selWave,mode= 4 227 230 ListBox inclList,pos={4,110},size={200,100} 228 ListBox inclList,listWave=root: FileList:includedFileWave229 ListBox inclList,selWave=root: FileList:selToDelWave,mode= 4231 ListBox inclList,listWave=root:myGlobals:FileList:includedFileWave 232 ListBox inclList,selWave=root:myGlobals:FileList:selToDelWave,mode= 4 230 233 Button button0,pos={212,77},size={110,20},proc=FileList_InsertButtonProc,title="Include File(s)" 231 234 Button button0,help={"Includes the selected procedures, functions appear under the SANS Models menu"} … … 257 260 //loop through the selected files in the list... 258 261 // 259 Wave/T fileWave=$"root: FileList:fileWave"260 Wave sel=$"root: FileList:selWave"262 Wave/T fileWave=$"root:myGlobals:FileList:fileWave" 263 Wave sel=$"root:myGlobals:FileList:selWave" 261 264 262 265 Variable num=numpnts(sel),ii 263 266 String fname="" 264 267 265 // NVAR doCheck=root: FileList:checkForFiles268 // NVAR doCheck=root:myGlobals:FileList:checkForFiles 266 269 ii=num-1 //work bottom-up to not lose the index 267 270 do … … 275 278 //try the list of already-included files 276 279 if(cmpstr(fname,"")==0) 277 Wave/T inclFileWave=$"root: FileList:includedFileWave"278 Wave seltoDel=$"root: FileList:selToDelWave"280 Wave/T inclFileWave=$"root:myGlobals:FileList:includedFileWave" 281 Wave seltoDel=$"root:myGlobals:FileList:selToDelWave" 279 282 num=numpnts(seltoDel) 280 283 ii=num-1 //work bottom-up to not lose the index … … 322 325 String list="" 323 326 324 if(Exists("root: FileList:SANS_Model_List") != 1)325 SetDataFolder root: FileList327 if(Exists("root:myGlobals:FileList:SANS_Model_List") != 1) 328 SetDataFolder root:myGlobals:FileList 326 329 LoadWave/A/T 327 330 WAVE/T w=$(StringFromList(0,S_WaveNames,";")) 328 331 SetDataFolder root: 329 332 else 330 WAVE/T w=$("root: FileList:SANS_Model_List")333 WAVE/T w=$("root:myGlobals:FileList:SANS_Model_List") 331 334 endif 332 335 333 336 // // convert the input wave to a semi-list 334 // SVAR allFiles=root: FileList:allFiles337 // SVAR allFiles=root:myGlobals:FileList:allFiles 335 338 // allFiles=MP_TextWave2SemiList(w) 336 339 list=MP_TextWave2SemiList(w) … … 341 344 342 345 // remove the items that have already been included 343 Wave/T includedFileWave=$"root: FileList:includedFileWave"346 Wave/T includedFileWave=$"root:myGlobals:FileList:includedFileWave" 344 347 Variable numInc=numpnts(includedFileWave) 345 348 for(ii=0;ii<numInc;ii+=1) … … 348 351 list = SortList(list,";",0) 349 352 num=ItemsInList(list,";") 350 WAVE/T fileWave=$"root: FileList:fileWave"351 WAVE selWave=$"root: FileList:selWave"353 WAVE/T fileWave=$"root:myGlobals:FileList:fileWave" 354 WAVE selWave=$"root:myGlobals:FileList:selWave" 352 355 Redimension/N=(num) fileWave //make the waves the proper length 353 356 Redimension/N=(num) selWave … … 381 384 382 385 // new way, to catch all files in all subfolders 383 SVAR allFiles=root: FileList:allFiles386 SVAR allFiles=root:myGlobals:FileList:allFiles 384 387 allFiles="" //clear the list 385 388 … … 400 403 list = RemoveFromList("DemoLoader.ipf",list,";" ) 401 404 // remove the items that have already been included 402 Wave/T includedFileWave=$"root: FileList:includedFileWave"405 Wave/T includedFileWave=$"root:myGlobals:FileList:includedFileWave" 403 406 Variable numInc=numpnts(includedFileWave) 404 407 for(ii=0;ii<numInc;ii+=1) … … 407 410 list = SortList(list,";",0) 408 411 num=ItemsInList(list,";") 409 WAVE/T fileWave=$"root: FileList:fileWave"410 WAVE selWave=$"root: FileList:selWave"412 WAVE/T fileWave=$"root:myGlobals:FileList:fileWave" 413 WAVE selWave=$"root:myGlobals:FileList:selWave" 411 414 Redimension/N=(num) fileWave //make the waves the proper length 412 415 Redimension/N=(num) selWave … … 422 425 423 426 Variable err=0 424 String/G root: FileList:allFiles=""425 SVAR allFiles = root: FileList:allFiles427 String/G root:myGlobals:FileList:allFiles="" 428 SVAR allFiles = root:myGlobals:FileList:allFiles 426 429 427 430 PathInfo Igor … … 446 449 447 450 //loop through the selected files in the list... 448 Wave/T fileWave=$"root: FileList:fileWave"449 Wave sel=$"root: FileList:selWave"451 Wave/T fileWave=$"root:myGlobals:FileList:fileWave" 452 Wave sel=$"root:myGlobals:FileList:selWave" 450 453 //and adjust the included file lists 451 Wave/T includedFileWave=$"root: FileList:includedFileWave"452 Wave selToDel=$"root: FileList:selToDelWave"454 Wave/T includedFileWave=$"root:myGlobals:FileList:includedFileWave" 455 Wave selToDel=$"root:myGlobals:FileList:selToDelWave" 453 456 454 457 Variable numIncl=numpnts(includedFileWave) … … 461 464 Execute/P "INSERTINCLUDE \"WriteModelData\"" 462 465 463 NVAR doCheck=root: FileList:checkForFiles466 NVAR doCheck=root:myGlobals:FileList:checkForFiles 464 467 465 468 ii=num-1 //work bottom-up to not lose the index … … 496 499 497 500 //loop through the selected files in the list... 498 Wave/T includedFileWave=$"root: FileList:includedFileWave"499 Wave selToDel=$"root: FileList:selToDelWave"501 Wave/T includedFileWave=$"root:myGlobals:FileList:includedFileWave" 502 Wave selToDel=$"root:myGlobals:FileList:selToDelWave" 500 503 // and put the unwanted procedures back in the to-add list 501 Wave/T fileWave=$"root: FileList:fileWave"502 Wave sel=$"root: FileList:selWave"504 Wave/T fileWave=$"root:myGlobals:FileList:fileWave" 505 Wave sel=$"root:myGlobals:FileList:selWave" 503 506 504 507 … … 564 567 // if root:MenuItemStr exists 565 568 Menu "SANS Models" 566 StrVarOrDefault("root: FileList:MenuItemStr_def","ModelPicker_Panel")//, RefreshMenu()569 StrVarOrDefault("root:myGlobals:FileList:MenuItemStr_def","ModelPicker_Panel")//, RefreshMenu() 567 570 SubMenu "Unsmeared Models" 568 StrVarOrDefault("root: FileList:MenuItemStr1","ModelPicker_Panel")571 StrVarOrDefault("root:myGlobals:FileList:MenuItemStr1","ModelPicker_Panel") 569 572 End 570 573 SubMenu "Smeared Models" 571 StrVarOrDefault("root: FileList:MenuItemStr2","ModelPicker_Panel")574 StrVarOrDefault("root:myGlobals:FileList:MenuItemStr2","ModelPicker_Panel") 572 575 End 573 576 // SubMenu "Models 3" … … 594 597 list += MacroList("WriteM*",sep,"KIND:1,NPARAMS:4") //data writer 595 598 list += "-"+sep 596 String/G root: FileList:MenuItemStr_def = TrimListTo255(list)599 String/G root:myGlobals:FileList:MenuItemStr_def = TrimListTo255(list) 597 600 598 601 list = "" … … 601 604 list = RemoveFromList("FreezeModel", list ,";") // remove FreezeModel, it's not a model 602 605 // list += "-"+sep 603 String/G root: FileList:MenuItemStr1 = TrimListTo255(list)606 String/G root:myGlobals:FileList:MenuItemStr1 = TrimListTo255(list) 604 607 605 608 list="" 606 609 list += MacroList("PlotSmea*",sep,"KIND:1,NPARAMS:1") //smeared plot procedures 607 610 list += MacroList("PlotSmea*",sep,"KIND:1,NPARAMS:2") //smeared RPA has 2 parameters 608 String/G root: FileList:MenuItemStr2 = TrimListTo255(list)611 String/G root:myGlobals:FileList:MenuItemStr2 = TrimListTo255(list) 609 612 610 613 BuildMenu "SANS Models" … … 664 667 String prefix 665 668 666 SVAR allFiles=root: FileList:allFiles669 SVAR allFiles=root:myGlobals:FileList:allFiles 667 670 // Build a prefix (a number of tabs to indicate the folder level by indentation) 668 671 prefix = ""
Note: See TracChangeset
for help on using the changeset viewer.