Changeset 172
- Timestamp:
- Oct 1, 2007 11:16:20 AM (15 years ago)
- Location:
- sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files
- Files:
-
- 5 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
r169 r172 1 1 #pragma rtGlobals=1 // Use modern global access method. 2 #pragma IgorVersion= 4.02 #pragma IgorVersion=6.0 3 3 #pragma version=3.00 4 4 … … 213 213 214 214 215 Function MakeMenu_ButtonProc(ctrlName) : ButtonControl216 String ctrlName217 218 RefreshMenu()219 End215 //Function MakeMenu_ButtonProc(ctrlName) : ButtonControl 216 // String ctrlName 217 218 // RefreshMenu() 219 //End 220 220 221 221 //procedure for drawing the simple panel to pick and compile selected models … … 223 223 Proc Procedure_List() 224 224 PauseUpdate; Silent 1 // building window... 225 NewPanel /W=(582,44,920,263)/K=2225 NewPanel/W=(1115,44,1453,263)/K=2 226 226 DoWindow/C Procedure_List 227 227 ModifyPanel fixedSize=1 … … 240 240 Button button1,help={"If you need help understanding what a help button does, you really need help"} 241 241 EndMacro 242 242 243 243 244 //button function to prompt user to select path where procedures are located … … 434 435 String list = allFiles 435 436 // err = FindListItem(fileStr, list ,";" ,0) 436 //err = strsearch(list, fileStr, 0,2) //this is not case-sensitive, but Igor 5!437 err = strsearch(list, fileStr, 0) //this is Igor 4+ compatible437 err = strsearch(list, fileStr, 0,2) //this is not case-sensitive, but Igor 5! 438 // err = strsearch(list, fileStr, 0) //this is Igor 4+ compatible 438 439 // Print err 439 440 if(err == -1) … … 487 488 ii-=1 488 489 while(ii>=0) 489 Execute/P "COMPILEPROCEDURES ";Execute/P/Q/Z "RefreshMenu()" 490 // Execute/P "COMPILEPROCEDURES ";Execute/P/Q/Z "RefreshMenu()" 491 Execute/P "COMPILEPROCEDURES " 490 492 491 493 sel=0 //clear the selections … … 522 524 ii-=1 523 525 while(ii>=0) 524 Execute/P "COMPILEPROCEDURES ";Execute/P/Q/Z "RefreshMenu()" 526 // Execute/P "COMPILEPROCEDURES ";Execute/P/Q/Z "RefreshMenu()" 527 Execute/P "COMPILEPROCEDURES " 525 528 526 529 sel=0 … … 566 569 //my menu, seemingly one item, but really a long string for each submenu 567 570 // if root:MenuItemStr exists 568 Menu "SANS Models"569 StrVarOrDefault("root:myGlobals:FileList:MenuItemStr_def","ModelPicker_Panel")//, RefreshMenu()570 SubMenu "Unsmeared Models"571 StrVarOrDefault("root:myGlobals:FileList:MenuItemStr1","ModelPicker_Panel")572 End573 SubMenu "Smeared Models"574 StrVarOrDefault("root:myGlobals:FileList:MenuItemStr2","ModelPicker_Panel")575 End571 //Menu "SANS Models" 572 // StrVarOrDefault("root:myGlobals:FileList:MenuItemStr_def","ModelPicker_Panel")//, RefreshMenu() 573 // SubMenu "Unsmeared Models" 574 // StrVarOrDefault("root:myGlobals:FileList:MenuItemStr1","ModelPicker_Panel") 575 // End 576 // SubMenu "Smeared Models" 577 // StrVarOrDefault("root:myGlobals:FileList:MenuItemStr2","ModelPicker_Panel") 578 // End 576 579 // SubMenu "Models 3" 577 580 // StrVarOrDefault("root:MenuItemStr3","ModelPicker_Panel") 578 581 // End 579 End582 //End 580 583 581 584 //wrapper to use the A_ prepended file loader from the dynamically defined menu 582 Proc LoadSANSorUSANSData()583 A_LoadOneDData()584 End585 586 // tweaked to find RPA model which has an extra parameter in the declaration587 Function RefreshMenu()588 589 String list="",sep=";"590 591 //list = "Refresh Menu"+sep+"ModelPicker_Panel"+sep+"-"+sep592 list = "ModelPicker_Panel"+sep+"-"+sep593 // list += MacroList("LoadO*",sep,"KIND:1,NPARAMS:0") //data loader594 list += "Load SANS or USANS Data;" //use the wrapper above to get the right loader595 // list += "Reset Resolution Waves;" // resets the resolution waves used for the calculations596 // list += "Freeze Model;" // freeze a model to compare plots on the same graph597 list += MacroList("WriteM*",sep,"KIND:1,NPARAMS:4") //data writer598 list += "-"+sep599 String/G root:myGlobals:FileList:MenuItemStr_def = TrimListTo255(list)600 601 list = ""602 list += MacroList("*",sep,"KIND:1,NPARAMS:3") //unsmeared plot procedures603 list += MacroList("Plot*",sep,"KIND:1,NPARAMS:4") //RPA has 4 parameters604 list = RemoveFromList("FreezeModel", list ,";") // remove FreezeModel, it's not a model605 // list += "-"+sep606 String/G root:myGlobals:FileList:MenuItemStr1 = TrimListTo255(list)607 608 list=""609 list += MacroList("PlotSmea*",sep,"KIND:1,NPARAMS:1") //smeared plot procedures610 list += MacroList("PlotSmea*",sep,"KIND:1,NPARAMS:2") //smeared RPA has 2 parameters611 String/G root:myGlobals:FileList:MenuItemStr2 = TrimListTo255(list)612 613 BuildMenu "SANS Models"614 615 return(0)616 End585 //Proc LoadSANSorUSANSData() 586 // A_LoadOneDData() 587 //End 588 589 //// tweaked to find RPA model which has an extra parameter in the declaration 590 //Function RefreshMenu() 591 // 592 // String list="",sep=";" 593 // 594 // //list = "Refresh Menu"+sep+"ModelPicker_Panel"+sep+"-"+sep 595 // list = "ModelPicker_Panel"+sep+"-"+sep 596 //// list += MacroList("LoadO*",sep,"KIND:1,NPARAMS:0") //data loader 597 // list += "Load SANS or USANS Data;" //use the wrapper above to get the right loader 598 //// list += "Reset Resolution Waves;" // resets the resolution waves used for the calculations 599 //// list += "Freeze Model;" // freeze a model to compare plots on the same graph 600 // list += MacroList("WriteM*",sep,"KIND:1,NPARAMS:4") //data writer 601 // list += "-"+sep 602 // String/G root:myGlobals:FileList:MenuItemStr_def = TrimListTo255(list) 603 // 604 // list = "" 605 // list += MacroList("*",sep,"KIND:1,NPARAMS:3") //unsmeared plot procedures 606 // list += MacroList("Plot*",sep,"KIND:1,NPARAMS:4") //RPA has 4 parameters 607 // list = RemoveFromList("FreezeModel", list ,";") // remove FreezeModel, it's not a model 608 // // list += "-"+sep 609 // String/G root:myGlobals:FileList:MenuItemStr1 = TrimListTo255(list) 610 // 611 // list="" 612 // list += MacroList("PlotSmea*",sep,"KIND:1,NPARAMS:1") //smeared plot procedures 613 // list += MacroList("PlotSmea*",sep,"KIND:1,NPARAMS:2") //smeared RPA has 2 parameters 614 // String/G root:myGlobals:FileList:MenuItemStr2 = TrimListTo255(list) 615 // 616 // BuildMenu "SANS Models" 617 // 618 // return(0) 619 //End 617 620 618 621 //if the length of any of the strings is more than 255, the menu will disappear -
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/Packages/Wrapper.ipf
r171 r172 8 8 // 9 9 10 Macro OpenWrapperPanel()11 Init_WrapperPanel()12 End10 //Macro OpenWrapperPanel() 11 // Init_WrapperPanel() 12 //End 13 13 14 14 Function Init_WrapperPanel() … … 38 38 PauseUpdate; Silent 1 // building window... 39 39 NewPanel /W=(459,44,1113,499)/N=wrapperPanel/K=1 as "Curve Fit Setup" 40 ModifyPanel fixedSize=1 40 41 41 42 GroupBox grpBox_0,pos={18,11},size={350,113} … … 56 57 CheckBox check_1,pos={400,42},size={74,14},title="Use Epsilon?",value= 0 57 58 CheckBox check_2,pos={400,65},size={95,14},title="Use Constraints?",value= 0 58 CheckBox check_3,pos={544,18},size={72,14},title="From target",value= 059 // CheckBox check_3,pos={544,18},size={72,14},title="From target",value= 0 59 60 CheckBox check_4,pos={400,85},size={72,14},title="Report?",value= 0 60 61 CheckBox check_5,pos={414,103},size={72,14},title="Save it?",value= 0 … … 76 77 DoWindow/F $topGraph //so that the panel is not on top 77 78 endif 78 Execute " LoadSANSorUSANSData()"79 Execute "A_LoadOneDData()" 79 80 break 80 81 endswitch 81 82 83 ControlUpdate/W=WrapperPanel popup_0 82 84 return 0 83 85 End … … 89 91 String str=GetAList(4),tmp="",onTargetStr="" 90 92 Variable ii 91 ControlInfo/W=WrapperPanel check_392 if(V_Value==1) //if "from target" checked93 //ther must be a better way to do this94 onTargetStr = TraceNameList("",";",1)95 onTargetStr = ReplaceString("_i",onTargetStr,"") //get rid of the "_i"96 for(ii=0;ii<ItemsInList(onTargetStr);ii+=1)97 if(WhichListItem(StringFromList(ii,onTargetStr,";"), str , ";") != -1)98 tmp = Addlistitem(StringFromList(ii,onTargetStr,";"),tmp) //only keep the matches w/data folder listing99 endif100 endfor101 return(tmp)102 endif93 // ControlInfo/W=WrapperPanel check_3 94 // if(V_Value==1) //if "from target" checked 95 // //ther must be a better way to do this 96 // onTargetStr = TraceNameList("",";",1) 97 // onTargetStr = ReplaceString("_i",onTargetStr,"") //get rid of the "_i" 98 // for(ii=0;ii<ItemsInList(onTargetStr);ii+=1) 99 // if(WhichListItem(StringFromList(ii,onTargetStr,";"), str , ";") != -1) 100 // tmp = Addlistitem(StringFromList(ii,onTargetStr,";"),tmp) //only keep the matches w/data folder listing 101 // endif 102 // endfor 103 // return(tmp) 104 // endif 103 105 104 106 if(strlen(str)==0) … … 249 251 250 252 if(cmpstr(popStr,"Please plot the function")==0) 251 Print "function not plotted"253 // Print "function not plotted" 252 254 return(0) 253 255 endif -
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/PlotManager.ipf
r171 r172 15 15 // 16 16 ////////////////////////////////////////// 17 MacroShow_Plot_Manager()17 Proc Show_Plot_Manager() 18 18 A_Init_OneDLoader() 19 19 DoWindow/F Plot_Manager … … 28 28 NewPanel /W=(658,347,1018,737)/N=Plot_Manager/K=1 as "Plot Manager" 29 29 ModifyPanel cbRGB=(37265,65535,32896) 30 30 ModifyPanel fixedSize=1 31 31 32 Button button0,pos={165,353},size={50,20},proc=A_PlotManager_Done,title="Done" 32 33 PopupMenu popup0,pos={15,225},size={233,20},title="Data in Memory" -
sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/SA_includes_v301.ipf
r171 r172 18 18 #include "Wrapper" 19 19 20 Menu "Macros" 20 Menu "SANS Models" 21 "Fit Manager", Init_WrapperPanel() 22 "Plot Manager", Show_Plot_Manager() 23 "Load Model Functions",Execute/P "INSERTINCLUDE \"SANSModelPicker\"";Execute/P "COMPILEPROCEDURES ";Execute/P "ModelPicker_Panel()" 24 "-" 21 25 Submenu "Packages" 22 "Model Picker",Execute/P "INSERTINCLUDE \"SANSModelPicker\"";Execute/P "COMPILEPROCEDURES ";Execute/P "ModelPicker_Panel()"23 "-"24 26 "Sum Two Models",Execute/P "INSERTINCLUDE \"SumSANSModels\"";Execute/P "COMPILEPROCEDURES ";Execute/P "Init_SumModelPanel()" 25 27 "Global Fitting",Execute/P "INSERTINCLUDE \"GlobalFit2_NCNR\"";Execute/P "COMPILEPROCEDURES ";Execute/P "WM_NewGlobalFit1#InitNewGlobalFitPanel()"
Note: See TracChangeset
for help on using the changeset viewer.