Changeset 172


Ignore:
Timestamp:
Oct 1, 2007 11:16:20 AM (15 years ago)
Author:
srkline
Message:

Tweaks to the template to open the file loader and fit wrapper, and to re-arrange the SANS Models menu.

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  
    11#pragma rtGlobals=1             // Use modern global access method. 
    2 #pragma IgorVersion=4.0 
     2#pragma IgorVersion=6.0 
    33#pragma version=3.00 
    44 
     
    213213 
    214214 
    215 Function MakeMenu_ButtonProc(ctrlName) : ButtonControl 
    216         String ctrlName 
    217  
    218         RefreshMenu() 
    219 End 
     215//Function MakeMenu_ButtonProc(ctrlName) : ButtonControl 
     216//      String ctrlName 
     217 
     218//      RefreshMenu() 
     219//End 
    220220 
    221221//procedure for drawing the simple panel to pick and compile selected models 
     
    223223Proc Procedure_List() 
    224224        PauseUpdate; Silent 1           // building window... 
    225         NewPanel /W=(582,44,920,263) /K=2 
     225        NewPanel/W=(1115,44,1453,263)/K=2 
    226226        DoWindow/C Procedure_List 
    227227        ModifyPanel fixedSize=1 
     
    240240        Button button1,help={"If you need help understanding what a help button does, you really need help"} 
    241241EndMacro 
     242 
    242243 
    243244//button function to prompt user to select path where procedures are located 
     
    434435        String list = allFiles 
    435436//      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+ compatible 
     437        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 
    438439//      Print err 
    439440        if(err == -1) 
     
    487488                ii-=1 
    488489        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 " 
    490492         
    491493        sel=0           //clear the selections 
     
    522524                ii-=1 
    523525        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 " 
    525528         
    526529        sel=0 
     
    566569//my menu, seemingly one item, but really a long string for each submenu 
    567570// 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         End 
    573         SubMenu "Smeared Models" 
    574                 StrVarOrDefault("root:myGlobals:FileList:MenuItemStr2","ModelPicker_Panel") 
    575         End 
     571//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 
    576579//      SubMenu "Models 3" 
    577580//              StrVarOrDefault("root:MenuItemStr3","ModelPicker_Panel") 
    578581//      End 
    579 End 
     582//End 
    580583 
    581584//wrapper to use the A_ prepended file loader from the dynamically defined menu 
    582 Proc LoadSANSorUSANSData() 
    583         A_LoadOneDData() 
    584 End 
    585  
    586 // tweaked to find RPA model which has an extra parameter in the declaration 
    587 Function RefreshMenu() 
    588  
    589         String list="",sep=";" 
    590          
    591         //list = "Refresh Menu"+sep+"ModelPicker_Panel"+sep+"-"+sep 
    592         list = "ModelPicker_Panel"+sep+"-"+sep 
    593 //      list += MacroList("LoadO*",sep,"KIND:1,NPARAMS:0")              //data loader 
    594         list += "Load SANS or USANS Data;"              //use the wrapper above to get the right loader 
    595 //      list += "Reset Resolution Waves;"               // resets the resolution waves used for the calculations 
    596 //      list += "Freeze Model;"                                         // freeze a model to compare plots on the same graph 
    597         list += MacroList("WriteM*",sep,"KIND:1,NPARAMS:4")             //data writer 
    598         list += "-"+sep 
    599         String/G root:myGlobals:FileList:MenuItemStr_def = TrimListTo255(list) 
    600          
    601         list = "" 
    602         list += MacroList("*",sep,"KIND:1,NPARAMS:3")                           //unsmeared plot procedures 
    603         list += MacroList("Plot*",sep,"KIND:1,NPARAMS:4")                               //RPA has 4 parameters 
    604         list = RemoveFromList("FreezeModel", list ,";")                 // remove FreezeModel, it's not a model 
    605         //      list += "-"+sep 
    606         String/G root:myGlobals:FileList:MenuItemStr1 = TrimListTo255(list) 
    607  
    608         list="" 
    609         list += MacroList("PlotSmea*",sep,"KIND:1,NPARAMS:1")                   //smeared plot procedures 
    610         list += MacroList("PlotSmea*",sep,"KIND:1,NPARAMS:2")                   //smeared RPA has 2 parameters 
    611         String/G root:myGlobals:FileList:MenuItemStr2 = TrimListTo255(list) 
    612  
    613         BuildMenu "SANS Models" 
    614          
    615         return(0) 
    616 End 
     585//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 
    617620 
    618621//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  
    88// 
    99 
    10 Macro OpenWrapperPanel() 
    11         Init_WrapperPanel() 
    12 End 
     10//Macro OpenWrapperPanel() 
     11//      Init_WrapperPanel() 
     12//End 
    1313 
    1414Function Init_WrapperPanel() 
     
    3838        PauseUpdate; Silent 1           // building window... 
    3939        NewPanel /W=(459,44,1113,499)/N=wrapperPanel/K=1 as "Curve Fit Setup" 
     40        ModifyPanel fixedSize=1 
    4041         
    4142        GroupBox grpBox_0,pos={18,11},size={350,113} 
     
    5657        CheckBox check_1,pos={400,42},size={74,14},title="Use Epsilon?",value= 0 
    5758        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= 0 
     59//      CheckBox check_3,pos={544,18},size={72,14},title="From target",value= 0 
    5960        CheckBox check_4,pos={400,85},size={72,14},title="Report?",value= 0 
    6061        CheckBox check_5,pos={414,103},size={72,14},title="Save it?",value= 0 
     
    7677                                DoWindow/F $topGraph                    //so that the panel is not on top 
    7778                        endif 
    78                         Execute "LoadSANSorUSANSData()" 
     79                        Execute "A_LoadOneDData()" 
    7980                        break 
    8081        endswitch 
    8182 
     83        ControlUpdate/W=WrapperPanel popup_0 
    8284        return 0 
    8385End 
     
    8991        String str=GetAList(4),tmp="",onTargetStr="" 
    9092        Variable ii 
    91         ControlInfo/W=WrapperPanel check_3 
    92         if(V_Value==1)          //if "from target" checked 
    93                 //ther must be a better way to do this 
    94                 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 listing 
    99                         endif 
    100                 endfor 
    101                 return(tmp) 
    102         endif 
     93//      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 
    103105 
    104106        if(strlen(str)==0) 
     
    249251                         
    250252                        if(cmpstr(popStr,"Please plot the function")==0) 
    251                                 Print "function not plotted" 
     253//                              Print "function not plotted" 
    252254                                return(0) 
    253255                        endif 
  • sans/Analysis/branches/ajj_23APR07/IGOR_Package_Files/Put in User Procedures/SANS_Models_v3.00/PlotManager.ipf

    r171 r172  
    1515// 
    1616////////////////////////////////////////// 
    17 Macro Show_Plot_Manager() 
     17Proc Show_Plot_Manager() 
    1818        A_Init_OneDLoader() 
    1919        DoWindow/F Plot_Manager 
     
    2828        NewPanel /W=(658,347,1018,737)/N=Plot_Manager/K=1 as "Plot Manager" 
    2929        ModifyPanel cbRGB=(37265,65535,32896) 
    30  
     30        ModifyPanel fixedSize=1 
     31         
    3132        Button button0,pos={165,353},size={50,20},proc=A_PlotManager_Done,title="Done" 
    3233        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  
    1818#include "Wrapper" 
    1919 
    20 Menu "Macros" 
     20Menu "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        "-" 
    2125        Submenu "Packages" 
    22                 "Model Picker",Execute/P "INSERTINCLUDE \"SANSModelPicker\"";Execute/P "COMPILEPROCEDURES ";Execute/P "ModelPicker_Panel()" 
    23                 "-" 
    2426                "Sum Two Models",Execute/P "INSERTINCLUDE \"SumSANSModels\"";Execute/P "COMPILEPROCEDURES ";Execute/P "Init_SumModelPanel()" 
    2527                "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.