Changeset 116e1a7 in sasview


Ignore:
Timestamp:
Apr 26, 2014 4:34:08 PM (10 years ago)
Author:
butler
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
99d2aeb
Parents:
6d7b5dd7
Message:

First phase fix to category code

Location:
src/sans/perspectives/fitting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sans/perspectives/fitting/basepage.py

    r27b7acc r116e1a7  
    172172        self.orientation_params = [] 
    173173        self.orientation_params_disp = [] 
    174         if self.model != None: 
    175             self.disp_list = self.model.getDispParamList() 
     174#       Self.model should ALWAYS be None here.  It was set to none above in  
     175#       this long init setting.  no obvious function call in between setting 
     176#       and this - commenting out on 4/8/2014 by PDB.  Remove once clear  
     177#       it is pointless. 
     178#        if self.model != None: 
     179#            self.disp_list = self.model.getDispParamList() 
    176180        self.temp_multi_functional = False 
    177181        ##enable model 2D draw 
     
    481485        set some page important information at once 
    482486        """ 
     487#       THIS METHOD/FUNCTION NO LONGE APPEARS TO BE CALLED.  Started up program  
     488#       and started new fit window and PR and Invariant and a fit in fitting 
     489#       but never entered this routine which should be an initialization 
     490#       routine.  Leave for a while but probably something to clean up at  
     491#       some point? 
     492# 
     493#       PDB April 13 2014 
     494# 
    483495        ##window_name 
    484496        self.window_name = page_info.window_name 
     
    626638            return 
    627639        if len(self.model_list_box) > 0: 
    628             self._populate_box(self.formfactorbox, 
    629                                self.model_list_box["Shapes"]) 
    630         
    631         if len(self.model_list_box) > 0: 
     640        ## This is obsolete code since form factor box is no longer static. 
     641        ## It is now set dynamically through _show_combox and _show_combos_helper 
     642        ## These are called for first time by formfactor_combo_init 
     643        ## itself called from fitpanel only.  If we find that I'm wrong and 
     644        ## we DO need to initialize somehow here - do it by a call to  
     645        ## formfactor_combo_init  
     646        ## self.formfator_combo_init() 
     647        ## BUT NOT HERE -- make it last line of this  
     648        ## method so that structure box is populated before _show_comboox_helper 
     649        ## is called.  Otherwise wx will complain mightily:-) 
     650        ## 
     651        ## Also change the name to initiatlize_structurebox along with changes 
     652        ## to other combobox methods (_populate_listbox --> _populate_categorybox 
     653        ## etc ) 
     654        ## 
     655        ##     PDB 4/26/2014 
     656#            self._populate_box(self.formfactorbox, 
     657#                               self.model_list_box["Shapes"]) 
    632658            self._populate_box(self.structurebox, 
    633659                                self.model_list_box["Structure Factors"]) 
     
    644670                self.structurebox.Enable() 
    645671                self.text2.Enable() 
     672 
    646673                 
    647674    def set_dispers_sizer(self): 
     
    18361863                              [max_state, max_value], unit]) 
    18371864            
    1838     def _set_model_sizer_selection(self, model): 
    1839         """ 
    1840         Display the sizer according to the type of the current model 
    1841         """ 
    1842         if model == None: 
    1843             return 
    1844         if hasattr(model, "s_model"): 
    1845              
    1846             class_name = model.s_model.__class__ 
    1847             name = model.s_model.name 
    1848             flag = (name != "NoStructure") 
    1849             if flag and \ 
    1850                 (class_name in self.model_list_box["Structure Factors"]): 
    1851                 self.structurebox.Show() 
    1852                 self.text2.Show() 
    1853                 self.structurebox.Enable() 
    1854                 self.text2.Enable() 
    1855                 items = self.structurebox.GetItems() 
    1856                 self.sizer1.Layout() 
    1857                  
    1858                 for i in range(len(items)): 
    1859                     if items[i] == str(name): 
    1860                         self.structurebox.SetSelection(i) 
    1861                         break 
    1862                      
    1863         if hasattr(model, "p_model"): 
    1864             class_name = model.p_model.__class__ 
    1865             name = model.p_model.name 
    1866             self.formfactorbox.Clear() 
    1867              
    1868             for k, list in self.model_list_box.iteritems(): 
    1869                 if k in["P(Q)*S(Q)", "Shapes"] and \ 
    1870                     class_name in self.model_list_box["Shapes"]: 
    1871                     self.shape_rbutton.SetValue(True) 
     1865#    The following funcion seems to be superseded with fillsizer and  
     1866#    init combo box.  certainly it seems not to know about categories and uses  
     1867#    only shapes and shape independent -- tested after commenting out and does 
     1868#    not seem to cause problem.  Leave commented out for now but delete in 
     1869#    a code cleanup once clear it really is no longer used. 
     1870#    PDB  8 April 2014 
     1871 
     1872#    def _set_model_sizer_selection(self, model): 
     1873#        """ 
     1874#        Display the sizer according to the type of the current model 
     1875#        """ 
     1876#        if model == None: 
     1877#            return 
     1878#        if hasattr(model, "s_model"): 
     1879#             
     1880#            class_name = model.s_model.__class__ 
     1881#            name = model.s_model.name 
     1882#            flag = (name != "NoStructure") 
     1883#            if flag and \ 
     1884#                (class_name in self.model_list_box["Structure Factors"]): 
     1885#                self.structurebox.Show() 
     1886#                self.text2.Show() 
     1887#                self.structurebox.Enable() 
     1888#               self.text2.Enable() 
     1889 #               items = self.structurebox.GetItems() 
     1890 #               self.sizer1.Layout() 
     1891 #                
     1892 #               for i in range(len(items)): 
     1893 #                   if items[i] == str(name): 
     1894 #                       self.structurebox.SetSelection(i) 
     1895 #                       break 
     1896 #                    
     1897 #       if hasattr(model, "p_model"): 
     1898 #           class_name = model.p_model.__class__ 
     1899 #           name = model.p_model.name 
     1900 #           self.formfactorbox.Clear() 
     1901 #            
     1902 #           for k, list in self.model_list_box.iteritems(): 
     1903 #               if k in["P(Q)*S(Q)", "Shapes"] and \ 
     1904 #                   class_name in self.model_list_box["Shapes"]: 
     1905 #                   self.shape_rbutton.SetValue(True) 
     1906 #                   ## fill the form factor list with new model 
     1907 #                   self._populate_box(self.formfactorbox, 
     1908 #                                      self.model_list_box["Shapes"]) 
     1909 #                   items = self.formfactorbox.GetItems() 
     1910 #                   ## set comboxbox to the selected item 
     1911 #                   for i in range(len(items)): 
     1912 #                       if items[i] == str(name): 
     1913 #                           self.formfactorbox.SetSelection(i) 
     1914 #                           break 
     1915 #                   return 
     1916 #               elif k == "Shape-Independent": 
     1917 #                   self.shape_indep_rbutton.SetValue(True) 
     1918 #               elif k == "Structure Factors": 
     1919 #                   self.struct_rbutton.SetValue(True) 
     1920 #               elif k == "Multi-Functions": 
     1921 #                   continue 
     1922 #               else: 
     1923 #                   self.plugin_rbutton.SetValue(True) 
     1924 #               
     1925 #               if class_name in list: 
     1926 #                   ## fill the form factor list with new model 
     1927 #                   self._populate_box(self.formfactorbox, list) 
     1928 #                   items = self.formfactorbox.GetItems() 
     1929 #                   ## set comboxbox to the selected item 
     1930 #                   for i in range(len(items)): 
     1931 #                       if items[i] == str(name): 
     1932 #                           self.formfactorbox.SetSelection(i) 
     1933 #                           break 
     1934 #                   break 
     1935 #       else: 
     1936            ## Select the model from the menu 
     1937#            class_name = model.__class__ 
     1938#            name = model.name 
     1939#            self.formfactorbox.Clear() 
     1940#            items = self.formfactorbox.GetItems() 
     1941#     
     1942#            for k, list in self.model_list_box.iteritems(): 
     1943#                if k in["P(Q)*S(Q)", "Shapes"] and \ 
     1944#                    class_name in self.model_list_box["Shapes"]: 
     1945#                    if class_name in self.model_list_box["P(Q)*S(Q)"]: 
     1946#                        self.structurebox.Show() 
     1947#                        self.text2.Show() 
     1948#                       self.structurebox.Enable() 
     1949#                       self.structurebox.SetSelection(0) 
     1950#                       self.text2.Enable() 
     1951#                   else: 
     1952#                        self.structurebox.Hide() 
     1953#                        self.text2.Hide() 
     1954#                        self.structurebox.Disable() 
     1955#                        self.structurebox.SetSelection(0) 
     1956#                        self.text2.Disable() 
     1957#                         
     1958#                    self.shape_rbutton.SetValue(True) 
    18721959                    ## fill the form factor list with new model 
    1873                     self._populate_box(self.formfactorbox, 
    1874                                        self.model_list_box["Shapes"]) 
    1875                     items = self.formfactorbox.GetItems() 
     1960#                    self._populate_box(self.formfactorbox, 
     1961#                                       self.model_list_box["Shapes"]) 
     1962#                    items = self.formfactorbox.GetItems() 
     1963#                    ## set comboxbox to the selected item 
     1964#                    for i in range(len(items)): 
     1965#                        if items[i] == str(name): 
     1966#                            self.formfactorbox.SetSelection(i) 
     1967#                            break 
     1968#                    return 
     1969#                elif k == "Shape-Independent": 
     1970#                    self.shape_indep_rbutton.SetValue(True) 
     1971#                elif k == "Structure Factors": 
     1972#                    self.struct_rbutton.SetValue(True) 
     1973#                elif k == "Multi-Functions": 
     1974#                    continue 
     1975#                else: 
     1976#                    self.plugin_rbutton.SetValue(True) 
     1977#                if class_name in list: 
     1978#                    self.structurebox.SetSelection(0) 
     1979#                    self.structurebox.Disable() 
     1980#                    self.text2.Disable() 
     1981                    ## fill the form factor list with new model 
     1982#                    self._populate_box(self.formfactorbox, list) 
     1983#                    items = self.formfactorbox.GetItems() 
    18761984                    ## set comboxbox to the selected item 
    1877                     for i in range(len(items)): 
    1878                         if items[i] == str(name): 
    1879                             self.formfactorbox.SetSelection(i) 
    1880                             break 
    1881                     return 
    1882                 elif k == "Shape-Independent": 
    1883                     self.shape_indep_rbutton.SetValue(True) 
    1884                 elif k == "Structure Factors": 
    1885                     self.struct_rbutton.SetValue(True) 
    1886                 elif k == "Multi-Functions": 
    1887                     continue 
    1888                 else: 
    1889                     self.plugin_rbutton.SetValue(True) 
    1890                 
    1891                 if class_name in list: 
    1892                     ## fill the form factor list with new model 
    1893                     self._populate_box(self.formfactorbox, list) 
    1894                     items = self.formfactorbox.GetItems() 
    1895                     ## set comboxbox to the selected item 
    1896                     for i in range(len(items)): 
    1897                         if items[i] == str(name): 
    1898                             self.formfactorbox.SetSelection(i) 
    1899                             break 
    1900                     break 
    1901         else: 
    1902             ## Select the model from the menu 
    1903             class_name = model.__class__ 
    1904             name = model.name 
    1905             self.formfactorbox.Clear() 
    1906             items = self.formfactorbox.GetItems() 
    1907      
    1908             for k, list in self.model_list_box.iteritems(): 
    1909                 if k in["P(Q)*S(Q)", "Shapes"] and \ 
    1910                     class_name in self.model_list_box["Shapes"]: 
    1911                     if class_name in self.model_list_box["P(Q)*S(Q)"]: 
    1912                         self.structurebox.Show() 
    1913                         self.text2.Show() 
    1914                         self.structurebox.Enable() 
    1915                         self.structurebox.SetSelection(0) 
    1916                         self.text2.Enable() 
    1917                     else: 
    1918                         self.structurebox.Hide() 
    1919                         self.text2.Hide() 
    1920                         self.structurebox.Disable() 
    1921                         self.structurebox.SetSelection(0) 
    1922                         self.text2.Disable() 
    1923                          
    1924                     self.shape_rbutton.SetValue(True) 
    1925                     ## fill the form factor list with new model 
    1926                     self._populate_box(self.formfactorbox, 
    1927                                        self.model_list_box["Shapes"]) 
    1928                     items = self.formfactorbox.GetItems() 
    1929                     ## set comboxbox to the selected item 
    1930                     for i in range(len(items)): 
    1931                         if items[i] == str(name): 
    1932                             self.formfactorbox.SetSelection(i) 
    1933                             break 
    1934                     return 
    1935                 elif k == "Shape-Independent": 
    1936                     self.shape_indep_rbutton.SetValue(True) 
    1937                 elif k == "Structure Factors": 
    1938                     self.struct_rbutton.SetValue(True) 
    1939                 elif k == "Multi-Functions": 
    1940                     continue 
    1941                 else: 
    1942                     self.plugin_rbutton.SetValue(True) 
    1943                 if class_name in list: 
    1944                     self.structurebox.SetSelection(0) 
    1945                     self.structurebox.Disable() 
    1946                     self.text2.Disable() 
    1947                     ## fill the form factor list with new model 
    1948                     self._populate_box(self.formfactorbox, list) 
    1949                     items = self.formfactorbox.GetItems() 
    1950                     ## set comboxbox to the selected item 
    1951                     for i in range(len(items)): 
    1952                         if items[i] == str(name): 
    1953                             self.formfactorbox.SetSelection(i) 
    1954                             break 
    1955                     break 
     1985#                    for i in range(len(items)): 
     1986#                        if items[i] == str(name): 
     1987#                            self.formfactorbox.SetSelection(i) 
     1988#                            break 
     1989#                    break 
    19561990                 
    19571991    def _draw_model(self, update_chisqr=True, source='model'): 
  • src/sans/perspectives/fitting/models.py

    r201af9f r116e1a7  
    4747     
    4848    """ 
    49     #Check is the plugin is of type Model1DPlugin 
     49    #Check if the plugin is of type Model1DPlugin 
    5050    if not issubclass(model, Model1DPlugin): 
    5151        msg = "Plugin %s must be of type Model1DPlugin \n" % str(name) 
     
    243243    ## external dict for models 
    244244    model_combobox = ModelList() 
    245     ## Dictionary of form models 
     245    ## Dictionary of form factor models 
    246246    form_factor_dict = {} 
    247     ## dictionary of other 
     247    ## dictionary of structure factor models 
    248248    struct_factor_dict = {} 
    249     ##list of form factors 
    250     shape_list = [] 
    251     ## independent shape model list 
    252     shape_indep_list = [] 
     249    ##list of shape models -- this is superseded by categories  
     250#    shape_list = [] 
     251    ## shape independent model list-- this is superseded by categories 
     252#    shape_indep_list = [] 
    253253    ##list of structure factors 
    254254    struct_list = [] 
    255     ##list of model allowing multiplication 
     255    ##list of model allowing multiplication by a structure factor 
    256256    multiplication_factor = [] 
    257     ##list of multifunctional shapes 
     257    ##list of multifunctional shapes (i.e. that have user defined number of levels 
    258258    multi_func_list = [] 
    259     ## list of added models 
     259    ## list of added models -- currently python models found in the plugin dir. 
    260260    plugins = [] 
    261261    ## Event owner (guiframe) 
     
    290290        """ 
    291291 
     292        ## NOTE: as of April 26, 2014, as part of first pass on fixing categories, 
     293        ## all the appends to shape_list or shape_independent_list are  
     294        ## commented out.  They should be possible to remove.  They are in  
     295        ## fact a "category" of model whereas the other list are actually  
     296        ## "attributes" of a model.  In other words is it a structure factor 
     297        ## that can be used against a form factor, is it a form factor that is 
     298        ## knows how to be multiplied by a structure factor, does it have user 
     299        ## defined number of parameters, etc. 
     300        ## 
     301        ## We hope this whole list will be superseded by the new C models 
     302        ## structure where each model will provide a method to interrogate it 
     303        ## about its "attributes" -- then this long list becomes a loop reading 
     304        ## each model in the category list to populate the "attribute"lists.   
     305        ## We should also refactor the whole category vs attribute list  
     306        ## structure when doing this as now the attribute lists think they are 
     307        ## also category lists. 
     308        ## 
     309        ##   -PDB  April 26, 2014 
    292310 
    293311        # regular model names only 
     
    295313        from sans.models.SphereModel import SphereModel 
    296314        self.model_dictionary[SphereModel.__name__] = SphereModel 
    297         self.shape_list.append(SphereModel) 
     315#        self.shape_list.append(SphereModel) 
    298316        self.multiplication_factor.append(SphereModel) 
    299317        self.model_name_list.append(SphereModel.__name__) 
     
    301319        from sans.models.BinaryHSModel import BinaryHSModel 
    302320        self.model_dictionary[BinaryHSModel.__name__] = BinaryHSModel 
    303         self.shape_list.append(BinaryHSModel) 
     321#        self.shape_list.append(BinaryHSModel) 
    304322        self.model_name_list.append(BinaryHSModel.__name__) 
    305323                         
    306324        from sans.models.FuzzySphereModel import FuzzySphereModel 
    307325        self.model_dictionary[FuzzySphereModel.__name__] = FuzzySphereModel 
    308         self.shape_list.append(FuzzySphereModel) 
     326#        self.shape_list.append(FuzzySphereModel) 
    309327        self.multiplication_factor.append(FuzzySphereModel) 
    310328        self.model_name_list.append(FuzzySphereModel.__name__) 
     
    312330        from sans.models.RaspBerryModel import RaspBerryModel 
    313331        self.model_dictionary[RaspBerryModel.__name__] = RaspBerryModel 
    314         self.shape_list.append(RaspBerryModel) 
     332#        self.shape_list.append(RaspBerryModel) 
    315333        self.model_name_list.append(RaspBerryModel.__name__) 
    316334                 
    317335        from sans.models.CoreShellModel import CoreShellModel 
    318336        self.model_dictionary[CoreShellModel.__name__] = CoreShellModel 
    319         self.shape_list.append(CoreShellModel) 
     337#        self.shape_list.append(CoreShellModel) 
    320338        self.multiplication_factor.append(CoreShellModel) 
    321339        self.model_name_list.append(CoreShellModel.__name__) 
     
    323341        from sans.models.Core2ndMomentModel import Core2ndMomentModel 
    324342        self.model_dictionary[Core2ndMomentModel.__name__] = Core2ndMomentModel 
    325         self.shape_list.append(Core2ndMomentModel) 
     343#        self.shape_list.append(Core2ndMomentModel) 
    326344        self.model_name_list.append(Core2ndMomentModel.__name__) 
    327345         
    328346        from sans.models.CoreMultiShellModel import CoreMultiShellModel 
    329347        self.model_dictionary[CoreMultiShellModel.__name__] = CoreMultiShellModel 
    330         self.shape_list.append(CoreMultiShellModel) 
     348#        self.shape_list.append(CoreMultiShellModel) 
    331349        self.multiplication_factor.append(CoreMultiShellModel) 
    332350        self.multi_func_list.append(CoreMultiShellModel) 
     
    334352        from sans.models.VesicleModel import VesicleModel 
    335353        self.model_dictionary[VesicleModel.__name__] = VesicleModel 
    336         self.shape_list.append(VesicleModel) 
     354#        self.shape_list.append(VesicleModel) 
    337355        self.multiplication_factor.append(VesicleModel) 
    338356        self.model_name_list.append(VesicleModel.__name__) 
     
    340358        from sans.models.MultiShellModel import MultiShellModel 
    341359        self.model_dictionary[MultiShellModel.__name__] = MultiShellModel 
    342         self.shape_list.append(MultiShellModel) 
     360#        self.shape_list.append(MultiShellModel) 
    343361        self.multiplication_factor.append(MultiShellModel) 
    344362        self.model_name_list.append(MultiShellModel.__name__) 
     
    346364        from sans.models.OnionExpShellModel import OnionExpShellModel 
    347365        self.model_dictionary[OnionExpShellModel.__name__] = OnionExpShellModel 
    348         self.shape_list.append(OnionExpShellModel) 
     366#        self.shape_list.append(OnionExpShellModel) 
    349367        self.multiplication_factor.append(OnionExpShellModel) 
    350368        self.multi_func_list.append(OnionExpShellModel) 
     
    352370        from sans.models.SphericalSLDModel import SphericalSLDModel 
    353371        self.model_dictionary[SphericalSLDModel.__name__] = SphericalSLDModel 
    354         self.shape_list.append(SphericalSLDModel) 
     372#        self.shape_list.append(SphericalSLDModel) 
    355373        self.multiplication_factor.append(SphericalSLDModel) 
    356374        self.multi_func_list.append(SphericalSLDModel) 
     
    359377        from sans.models.LinearPearlsModel import LinearPearlsModel 
    360378        self.model_dictionary[LinearPearlsModel.__name__] = LinearPearlsModel 
    361         self.shape_list.append(LinearPearlsModel) 
     379#        self.shape_list.append(LinearPearlsModel) 
    362380        self.model_name_list.append(LinearPearlsModel.__name__) 
    363381           
    364382        from sans.models.PearlNecklaceModel import PearlNecklaceModel 
    365383        self.model_dictionary[PearlNecklaceModel.__name__] = PearlNecklaceModel 
    366         self.shape_list.append(PearlNecklaceModel) 
     384#        self.shape_list.append(PearlNecklaceModel) 
    367385        self.model_name_list.append(PearlNecklaceModel.__name__) 
    368386        #self.multiplication_factor.append(PearlNecklaceModel) 
     
    370388        from sans.models.CylinderModel import CylinderModel 
    371389        self.model_dictionary[CylinderModel.__name__] = CylinderModel 
    372         self.shape_list.append(CylinderModel) 
     390#        self.shape_list.append(CylinderModel) 
    373391        self.multiplication_factor.append(CylinderModel) 
    374392        self.model_name_list.append(CylinderModel.__name__) 
     
    376394        from sans.models.CoreShellCylinderModel import CoreShellCylinderModel 
    377395        self.model_dictionary[CoreShellCylinderModel.__name__] = CoreShellCylinderModel 
    378         self.shape_list.append(CoreShellCylinderModel) 
     396#        self.shape_list.append(CoreShellCylinderModel) 
    379397        self.multiplication_factor.append(CoreShellCylinderModel) 
    380398        self.model_name_list.append(CoreShellCylinderModel.__name__) 
     
    382400        from sans.models.CoreShellBicelleModel import CoreShellBicelleModel 
    383401        self.model_dictionary[CoreShellBicelleModel.__name__] = CoreShellBicelleModel 
    384         self.shape_list.append(CoreShellBicelleModel) 
     402#        self.shape_list.append(CoreShellBicelleModel) 
    385403        self.multiplication_factor.append(CoreShellBicelleModel) 
    386404        self.model_name_list.append(CoreShellBicelleModel.__name__) 
     
    388406        from sans.models.HollowCylinderModel import HollowCylinderModel 
    389407        self.model_dictionary[HollowCylinderModel.__name__] = HollowCylinderModel 
    390         self.shape_list.append(HollowCylinderModel) 
     408#        self.shape_list.append(HollowCylinderModel) 
    391409        self.multiplication_factor.append(HollowCylinderModel) 
    392410        self.model_name_list.append(HollowCylinderModel.__name__) 
     
    394412        from sans.models.FlexibleCylinderModel import FlexibleCylinderModel 
    395413        self.model_dictionary[FlexibleCylinderModel.__name__] = FlexibleCylinderModel 
    396         self.shape_list.append(FlexibleCylinderModel) 
     414#        self.shape_list.append(FlexibleCylinderModel) 
    397415        self.model_name_list.append(FlexibleCylinderModel.__name__) 
    398416 
    399417        from sans.models.FlexCylEllipXModel import FlexCylEllipXModel 
    400418        self.model_dictionary[FlexCylEllipXModel.__name__] = FlexCylEllipXModel 
    401         self.shape_list.append(FlexCylEllipXModel) 
     419#        self.shape_list.append(FlexCylEllipXModel) 
    402420        self.model_name_list.append(FlexCylEllipXModel.__name__) 
    403421         
    404422        from sans.models.StackedDisksModel import StackedDisksModel 
    405423        self.model_dictionary[StackedDisksModel.__name__] = StackedDisksModel 
    406         self.shape_list.append(StackedDisksModel) 
     424#        self.shape_list.append(StackedDisksModel) 
    407425        self.multiplication_factor.append(StackedDisksModel) 
    408426        self.model_name_list.append(StackedDisksModel.__name__) 
     
    410428        from sans.models.ParallelepipedModel import ParallelepipedModel 
    411429        self.model_dictionary[ParallelepipedModel.__name__] = ParallelepipedModel 
    412         self.shape_list.append(ParallelepipedModel) 
     430#        self.shape_list.append(ParallelepipedModel) 
    413431        self.multiplication_factor.append(ParallelepipedModel) 
    414432        self.model_name_list.append(ParallelepipedModel.__name__) 
     
    416434        from sans.models.CSParallelepipedModel import CSParallelepipedModel 
    417435        self.model_dictionary[CSParallelepipedModel.__name__] = CSParallelepipedModel 
    418         self.shape_list.append(CSParallelepipedModel) 
     436#        self.shape_list.append(CSParallelepipedModel) 
    419437        self.multiplication_factor.append(CSParallelepipedModel) 
    420438        self.model_name_list.append(CSParallelepipedModel.__name__) 
     
    422440        from sans.models.EllipticalCylinderModel import EllipticalCylinderModel 
    423441        self.model_dictionary[EllipticalCylinderModel.__name__] = EllipticalCylinderModel 
    424         self.shape_list.append(EllipticalCylinderModel) 
     442#        self.shape_list.append(EllipticalCylinderModel) 
    425443        self.multiplication_factor.append(EllipticalCylinderModel) 
    426444        self.model_name_list.append(EllipticalCylinderModel.__name__) 
     
    428446        from sans.models.BarBellModel import BarBellModel 
    429447        self.model_dictionary[BarBellModel.__name__] = BarBellModel 
    430         self.shape_list.append(BarBellModel) 
     448#        self.shape_list.append(BarBellModel) 
    431449        self.model_name_list.append(BarBellModel.__name__) 
    432450        # not implemeted yet! 
     
    435453        from sans.models.CappedCylinderModel import CappedCylinderModel 
    436454        self.model_dictionary[CappedCylinderModel.__name__] = CappedCylinderModel 
    437         self.shape_list.append(CappedCylinderModel) 
     455 #       self.shape_list.append(CappedCylinderModel) 
    438456        self.model_name_list.append(CappedCylinderModel.__name__) 
    439457        # not implemeted yet! 
     
    442460        from sans.models.EllipsoidModel import EllipsoidModel 
    443461        self.model_dictionary[EllipsoidModel.__name__] = EllipsoidModel 
    444         self.shape_list.append(EllipsoidModel) 
     462#        self.shape_list.append(EllipsoidModel) 
    445463        self.multiplication_factor.append(EllipsoidModel) 
    446464        self.model_name_list.append(EllipsoidModel.__name__) 
     
    448466        from sans.models.CoreShellEllipsoidModel import CoreShellEllipsoidModel 
    449467        self.model_dictionary[CoreShellEllipsoidModel.__name__] = CoreShellEllipsoidModel 
    450         self.shape_list.append(CoreShellEllipsoidModel) 
     468#        self.shape_list.append(CoreShellEllipsoidModel) 
    451469        self.multiplication_factor.append(CoreShellEllipsoidModel) 
    452470        self.model_name_list.append(CoreShellEllipsoidModel.__name__) 
     
    454472        from sans.models.TriaxialEllipsoidModel import TriaxialEllipsoidModel 
    455473        self.model_dictionary[TriaxialEllipsoidModel.__name__] = TriaxialEllipsoidModel 
    456         self.shape_list.append(TriaxialEllipsoidModel) 
     474#        self.shape_list.append(TriaxialEllipsoidModel) 
    457475        self.multiplication_factor.append(TriaxialEllipsoidModel) 
    458476        self.model_name_list.append(TriaxialEllipsoidModel.__name__) 
     
    460478        from sans.models.LamellarModel import LamellarModel 
    461479        self.model_dictionary[LamellarModel.__name__] = LamellarModel 
    462         self.shape_list.append(LamellarModel) 
     480#        self.shape_list.append(LamellarModel) 
    463481        self.model_name_list.append(LamellarModel.__name__) 
    464482         
    465483        from sans.models.LamellarFFHGModel import LamellarFFHGModel 
    466484        self.model_dictionary[LamellarFFHGModel.__name__] = LamellarFFHGModel 
    467         self.shape_list.append(LamellarFFHGModel) 
     485#        self.shape_list.append(LamellarFFHGModel) 
    468486        self.model_name_list.append(LamellarFFHGModel.__name__) 
    469487         
    470488        from sans.models.LamellarPSModel import LamellarPSModel 
    471489        self.model_dictionary[LamellarPSModel.__name__] = LamellarPSModel 
    472         self.shape_list.append(LamellarPSModel) 
     490#        self.shape_list.append(LamellarPSModel) 
    473491        self.model_name_list.append(LamellarPSModel.__name__) 
    474492      
    475493        from sans.models.LamellarPSHGModel import LamellarPSHGModel 
    476494        self.model_dictionary[LamellarPSHGModel.__name__] = LamellarPSHGModel 
    477         self.shape_list.append(LamellarPSHGModel) 
     495#        self.shape_list.append(LamellarPSHGModel) 
    478496        self.model_name_list.append(LamellarPSHGModel.__name__) 
    479497         
    480498        from sans.models.LamellarPCrystalModel import LamellarPCrystalModel 
    481499        self.model_dictionary[LamellarPCrystalModel.__name__] = LamellarPCrystalModel 
    482         self.shape_list.append(LamellarPCrystalModel) 
     500#        self.shape_list.append(LamellarPCrystalModel) 
    483501        self.model_name_list.append(LamellarPCrystalModel.__name__) 
    484502         
    485503        from sans.models.SCCrystalModel import SCCrystalModel 
    486504        self.model_dictionary[SCCrystalModel.__name__] = SCCrystalModel 
    487         self.shape_list.append(SCCrystalModel) 
     505#        self.shape_list.append(SCCrystalModel) 
    488506        self.model_name_list.append(SCCrystalModel.__name__) 
    489507         
    490508        from sans.models.FCCrystalModel import FCCrystalModel 
    491509        self.model_dictionary[FCCrystalModel.__name__] = FCCrystalModel 
    492         self.shape_list.append(FCCrystalModel) 
     510#        self.shape_list.append(FCCrystalModel) 
    493511        self.model_name_list.append(FCCrystalModel.__name__) 
    494512         
    495513        from sans.models.BCCrystalModel import BCCrystalModel 
    496514        self.model_dictionary[BCCrystalModel.__name__] = BCCrystalModel 
    497         self.shape_list.append(BCCrystalModel) 
     515#        self.shape_list.append(BCCrystalModel) 
    498516        self.model_name_list.append(BCCrystalModel.__name__) 
    499517       
     
    523541        from sans.models.PowerLawAbsModel import PowerLawAbsModel 
    524542        self.model_dictionary[PowerLawAbsModel.__name__] = PowerLawAbsModel 
    525         self.shape_indep_list.append(PowerLawAbsModel) 
     543#        self.shape_indep_list.append(PowerLawAbsModel) 
    526544        self.model_name_list.append(PowerLawAbsModel.__name__) 
    527545         
    528546        from sans.models.BEPolyelectrolyte import BEPolyelectrolyte 
    529547        self.model_dictionary[BEPolyelectrolyte.__name__] = BEPolyelectrolyte 
    530         self.shape_indep_list.append(BEPolyelectrolyte) 
     548#        self.shape_indep_list.append(BEPolyelectrolyte) 
    531549        self.model_name_list.append(BEPolyelectrolyte.__name__) 
    532550        self.form_factor_dict[str(wx.NewId())] =  [SphereModel] 
     
    534552        from sans.models.BroadPeakModel import BroadPeakModel 
    535553        self.model_dictionary[BroadPeakModel.__name__] = BroadPeakModel 
    536         self.shape_indep_list.append(BroadPeakModel) 
     554#        self.shape_indep_list.append(BroadPeakModel) 
    537555        self.model_name_list.append(BroadPeakModel.__name__) 
    538556         
    539557        from sans.models.CorrLengthModel import CorrLengthModel 
    540558        self.model_dictionary[CorrLengthModel.__name__] = CorrLengthModel 
    541         self.shape_indep_list.append(CorrLengthModel) 
     559#        self.shape_indep_list.append(CorrLengthModel) 
    542560        self.model_name_list.append(CorrLengthModel.__name__) 
    543561         
    544562        from sans.models.DABModel import DABModel 
    545563        self.model_dictionary[DABModel.__name__] = DABModel 
    546         self.shape_indep_list.append(DABModel) 
     564#        self.shape_indep_list.append(DABModel) 
    547565        self.model_name_list.append(DABModel.__name__) 
    548566         
    549567        from sans.models.DebyeModel import DebyeModel 
    550568        self.model_dictionary[DebyeModel.__name__] = DebyeModel 
    551         self.shape_indep_list.append(DebyeModel) 
     569#        self.shape_indep_list.append(DebyeModel) 
    552570        self.model_name_list.append(DebyeModel.__name__) 
    553571         
    554572        from sans.models.FractalModel import FractalModel 
    555573        self.model_dictionary[FractalModel.__name__] = FractalModel 
    556         self.shape_indep_list.append(FractalModel) 
     574#        self.shape_indep_list.append(FractalModel) 
    557575        self.model_name_list.append(FractalModel.__name__) 
    558576         
    559577        from sans.models.FractalCoreShellModel import FractalCoreShellModel 
    560578        self.model_dictionary[FractalCoreShellModel.__name__] = FractalCoreShellModel 
    561         self.shape_indep_list.append(FractalCoreShellModel) 
     579#        self.shape_indep_list.append(FractalCoreShellModel) 
    562580        self.model_name_list.append(FractalCoreShellModel.__name__) 
    563581         
    564582        from sans.models.GaussLorentzGelModel import GaussLorentzGelModel 
    565583        self.model_dictionary[GaussLorentzGelModel.__name__] = GaussLorentzGelModel 
    566         self.shape_indep_list.append(GaussLorentzGelModel) 
     584#        self.shape_indep_list.append(GaussLorentzGelModel) 
    567585        self.model_name_list.append(GaussLorentzGelModel.__name__) 
    568586                 
    569587        from sans.models.GuinierModel import GuinierModel 
    570588        self.model_dictionary[GuinierModel.__name__] = GuinierModel 
    571         self.shape_indep_list.append(GuinierModel) 
     589#        self.shape_indep_list.append(GuinierModel) 
    572590        self.model_name_list.append(GuinierModel.__name__) 
    573591         
    574592        from sans.models.GuinierPorodModel import GuinierPorodModel 
    575593        self.model_dictionary[GuinierPorodModel.__name__] = GuinierPorodModel 
    576         self.shape_indep_list.append(GuinierPorodModel) 
     594#        self.shape_indep_list.append(GuinierPorodModel) 
    577595        self.model_name_list.append(GuinierPorodModel.__name__) 
    578596 
    579597        from sans.models.LorentzModel import LorentzModel 
    580598        self.model_dictionary[LorentzModel.__name__] = LorentzModel 
    581         self.shape_indep_list.append(LorentzModel) 
     599#        self.shape_indep_list.append(LorentzModel) 
    582600        self.model_name_list.append(LorentzModel.__name__) 
    583601 
    584602        from sans.models.MassFractalModel import MassFractalModel 
    585603        self.model_dictionary[MassFractalModel.__name__] = MassFractalModel 
    586         self.shape_indep_list.append(MassFractalModel) 
     604#        self.shape_indep_list.append(MassFractalModel) 
    587605        self.model_name_list.append(MassFractalModel.__name__) 
    588606         
    589607        from sans.models.MassSurfaceFractal import MassSurfaceFractal 
    590608        self.model_dictionary[MassSurfaceFractal.__name__] = MassSurfaceFractal 
    591         self.shape_indep_list.append(MassSurfaceFractal) 
     609#        self.shape_indep_list.append(MassSurfaceFractal) 
    592610        self.model_name_list.append(MassSurfaceFractal.__name__) 
    593611         
    594612        from sans.models.PeakGaussModel import PeakGaussModel 
    595613        self.model_dictionary[PeakGaussModel.__name__] = PeakGaussModel 
    596         self.shape_indep_list.append(PeakGaussModel) 
     614#        self.shape_indep_list.append(PeakGaussModel) 
    597615        self.model_name_list.append(PeakGaussModel.__name__) 
    598616         
    599617        from sans.models.PeakLorentzModel import PeakLorentzModel 
    600618        self.model_dictionary[PeakLorentzModel.__name__] = PeakLorentzModel 
    601         self.shape_indep_list.append(PeakLorentzModel) 
     619#        self.shape_indep_list.append(PeakLorentzModel) 
    602620        self.model_name_list.append(PeakLorentzModel.__name__) 
    603621         
    604622        from sans.models.Poly_GaussCoil import Poly_GaussCoil 
    605623        self.model_dictionary[Poly_GaussCoil.__name__] = Poly_GaussCoil 
    606         self.shape_indep_list.append(Poly_GaussCoil) 
     624#        self.shape_indep_list.append(Poly_GaussCoil) 
    607625        self.model_name_list.append(Poly_GaussCoil.__name__) 
    608626         
    609627        from sans.models.PolymerExclVolume import PolymerExclVolume 
    610628        self.model_dictionary[PolymerExclVolume.__name__] = PolymerExclVolume 
    611         self.shape_indep_list.append(PolymerExclVolume) 
     629#        self.shape_indep_list.append(PolymerExclVolume) 
    612630        self.model_name_list.append(PolymerExclVolume.__name__) 
    613631         
    614632        from sans.models.PorodModel import PorodModel 
    615633        self.model_dictionary[PorodModel.__name__] = PorodModel 
    616         self.shape_indep_list.append(PorodModel) 
     634#        self.shape_indep_list.append(PorodModel) 
    617635        self.model_name_list.append(PorodModel.__name__) 
    618636         
    619637        from sans.models.RPA10Model import RPA10Model 
    620638        self.model_dictionary[RPA10Model.__name__] = RPA10Model 
    621         self.shape_indep_list.append(RPA10Model) 
     639#        self.shape_indep_list.append(RPA10Model) 
    622640        self.multi_func_list.append(RPA10Model) 
    623641 
    624642        from sans.models.StarPolymer import StarPolymer 
    625643        self.model_dictionary[StarPolymer.__name__] = StarPolymer 
    626         self.shape_indep_list.append(StarPolymer) 
     644#        self.shape_indep_list.append(StarPolymer) 
    627645        self.model_name_list.append(StarPolymer.__name__) 
    628646 
    629647        from sans.models.SurfaceFractalModel import SurfaceFractalModel 
    630648        self.model_dictionary[SurfaceFractalModel.__name__] = SurfaceFractalModel 
    631         self.shape_indep_list.append(SurfaceFractalModel) 
     649#        self.shape_indep_list.append(SurfaceFractalModel) 
    632650        self.model_name_list.append(SurfaceFractalModel.__name__) 
    633651         
    634652        from sans.models.TeubnerStreyModel import TeubnerStreyModel 
    635653        self.model_dictionary[TeubnerStreyModel.__name__] = TeubnerStreyModel 
    636         self.shape_indep_list.append(TeubnerStreyModel) 
     654#        self.shape_indep_list.append(TeubnerStreyModel) 
    637655        self.model_name_list.append(TeubnerStreyModel.__name__) 
    638656 
    639657        from sans.models.TwoLorentzianModel import TwoLorentzianModel 
    640658        self.model_dictionary[TwoLorentzianModel.__name__] = TwoLorentzianModel 
    641         self.shape_indep_list.append(TwoLorentzianModel) 
     659#        self.shape_indep_list.append(TwoLorentzianModel) 
    642660        self.model_name_list.append(TwoLorentzianModel.__name__) 
    643661         
    644662        from sans.models.TwoPowerLawModel import TwoPowerLawModel 
    645663        self.model_dictionary[TwoPowerLawModel.__name__] = TwoPowerLawModel 
    646         self.shape_indep_list.append(TwoPowerLawModel) 
     664#        self.shape_indep_list.append(TwoPowerLawModel) 
    647665        self.model_name_list.append(TwoPowerLawModel.__name__) 
    648666         
    649667        from sans.models.UnifiedPowerRgModel import UnifiedPowerRgModel 
    650668        self.model_dictionary[UnifiedPowerRgModel.__name__] = UnifiedPowerRgModel 
    651         self.shape_indep_list.append(UnifiedPowerRgModel) 
     669#        self.shape_indep_list.append(UnifiedPowerRgModel) 
    652670        self.multi_func_list.append(UnifiedPowerRgModel) 
    653671 
    654672        from sans.models.LineModel import LineModel 
    655673        self.model_dictionary[LineModel.__name__] = LineModel 
    656         self.shape_indep_list.append(LineModel) 
     674#        self.shape_indep_list.append(LineModel) 
    657675        self.model_name_list.append(LineModel.__name__) 
    658676         
    659677        from sans.models.ReflectivityModel import ReflectivityModel 
    660678        self.model_dictionary[ReflectivityModel.__name__] = ReflectivityModel 
    661         self.shape_indep_list.append(ReflectivityModel) 
     679#        self.shape_indep_list.append(ReflectivityModel) 
    662680        self.multi_func_list.append(ReflectivityModel) 
    663681         
    664682        from sans.models.ReflectivityIIModel import ReflectivityIIModel 
    665683        self.model_dictionary[ReflectivityIIModel.__name__] = ReflectivityIIModel 
    666         self.shape_indep_list.append(ReflectivityIIModel) 
     684#        self.shape_indep_list.append(ReflectivityIIModel) 
    667685        self.multi_func_list.append(ReflectivityIIModel) 
    668686         
    669687        from sans.models.GelFitModel import GelFitModel 
    670688        self.model_dictionary[GelFitModel.__name__] = GelFitModel 
    671         self.shape_indep_list.append(GelFitModel) 
     689#        self.shape_indep_list.append(GelFitModel) 
    672690        self.model_name_list.append(GelFitModel.__name__) 
    673691 
    674692        from sans.models.PringlesModel import PringlesModel 
    675693        self.model_dictionary[PringlesModel.__name__] = PringlesModel 
    676         self.shape_indep_list.append(PringlesModel) 
     694#        self.shape_indep_list.append(PringlesModel) 
    677695        self.model_name_list.append(PringlesModel.__name__) 
    678696 
    679697        from sans.models.RectangularPrismModel import RectangularPrismModel 
    680698        self.model_dictionary[RectangularPrismModel.__name__] = RectangularPrismModel 
    681         self.shape_list.append(RectangularPrismModel) 
     699#        self.shape_list.append(RectangularPrismModel) 
    682700        self.multiplication_factor.append(RectangularPrismModel) 
    683701        self.model_name_list.append(RectangularPrismModel.__name__) 
     
    685703        from sans.models.RectangularHollowPrismInfThinWallsModel import RectangularHollowPrismInfThinWallsModel 
    686704        self.model_dictionary[RectangularHollowPrismInfThinWallsModel.__name__] = RectangularHollowPrismInfThinWallsModel 
    687         self.shape_list.append(RectangularHollowPrismInfThinWallsModel) 
     705#        self.shape_list.append(RectangularHollowPrismInfThinWallsModel) 
    688706        self.multiplication_factor.append(RectangularHollowPrismInfThinWallsModel) 
    689707        self.model_name_list.append(RectangularHollowPrismInfThinWallsModel.__name__) 
     
    691709        from sans.models.RectangularHollowPrismModel import RectangularHollowPrismModel 
    692710        self.model_dictionary[RectangularHollowPrismModel.__name__] = RectangularHollowPrismModel 
    693         self.shape_list.append(RectangularHollowPrismModel) 
     711#        self.shape_list.append(RectangularHollowPrismModel) 
    694712        self.multiplication_factor.append(RectangularHollowPrismModel) 
    695713        self.model_name_list.append(RectangularHollowPrismModel.__name__) 
     
    761779        return self.model_combobox.get_list() 
    762780        
    763     def populate_menu(self, modelmenu, event_owner): 
    764         """ 
    765         Populate a menu with our models 
    766          
    767         :param id: first menu event ID to use when binding the menu events 
    768         :param modelmenu: wx.Menu object to populate 
    769         :param event_owner: wx object to bind the menu events to 
    770          
    771         :return: the next free event ID following the new menu events 
    772          
    773         """ 
     781##   I believe the next four methods are for the old form factor GUI 
     782##   where the dropdown showed a list of categories which then rolled out 
     783##   in a second dropdown to the side. Some testing shows they indeed no longer 
     784##   seem to be called.  If no problems are found during testing of release we 
     785##   can remove this huge chunck of stuff. 
     786## 
     787##   -PDB  April 26, 2014 
     788 
     789#   def populate_menu(self, modelmenu, event_owner): 
     790#       """ 
     791#       Populate a menu with our models 
     792#        
     793#       :param id: first menu event ID to use when binding the menu events 
     794#       :param modelmenu: wx.Menu object to populate 
     795#       :param event_owner: wx object to bind the menu events to 
     796#        
     797#       :return: the next free event ID following the new menu events 
     798#        
     799#       """ 
     800#  
    774801        ## Fill model lists 
    775         self._getModelList() 
     802#        self._getModelList() 
    776803        ## store reference to model menu of guiframe 
    777         self.modelmenu = modelmenu 
     804#        self.modelmenu = modelmenu 
    778805        ## guiframe reference 
    779         self.event_owner = event_owner 
    780          
    781         shape_submenu = wx.Menu() 
    782         shape_indep_submenu = wx.Menu() 
    783         structure_factor = wx.Menu() 
    784         added_models = wx.Menu() 
    785         multip_models = wx.Menu() 
     806#        self.event_owner = event_owner 
     807         
     808#        shape_submenu = wx.Menu() 
     809#        shape_indep_submenu = wx.Menu() 
     810#        structure_factor = wx.Menu() 
     811#        added_models = wx.Menu() 
     812#        multip_models = wx.Menu() 
    786813        ## create menu with shape 
    787         self._fill_simple_menu(menuinfo=["Shapes", 
    788                                          shape_submenu, 
    789                                          " simple shape"], 
    790                          list1=self.shape_list) 
    791          
    792         self._fill_simple_menu(menuinfo=["Shape-Independent", 
    793                                          shape_indep_submenu, 
    794                                          "List of shape-independent models"], 
    795                          list1=self.shape_indep_list) 
    796          
    797         self._fill_simple_menu(menuinfo=["Structure Factors", 
    798                                          structure_factor, 
    799                                          "List of Structure factors models"], 
    800                                 list1=self.struct_list) 
    801          
    802         self._fill_plugin_menu(menuinfo=["Customized Models", added_models, 
    803                                             "List of additional models"], 
    804                                  list1=self.plugins) 
    805          
    806         self._fill_menu(menuinfo=["P(Q)*S(Q)", multip_models, 
    807                                   "mulplication of 2 models"], 
    808                                    list1=self.multiplication_factor, 
    809                                    list2=self.struct_list) 
    810         return 0 
    811      
    812     def _fill_plugin_menu(self, menuinfo, list1): 
    813         """ 
    814         fill the plugin menu with costumized models 
    815         """ 
    816         if len(list1) == 0: 
    817             id = wx.NewId() 
    818             msg = "No model available check plugins.log for errors to fix problem" 
    819             menuinfo[1].Append(int(id), "Empty", msg) 
    820         self._fill_simple_menu(menuinfo, list1) 
    821          
    822     def _fill_simple_menu(self, menuinfo, list1): 
    823         """ 
    824         Fill the menu with list item 
    825          
    826         :param modelmenu: the menu to fill 
    827         :param menuinfo: submenu item for the first column of this modelmenu 
    828                          with info.Should be a list : 
    829                          [name(string) , menu(wx.menu), help(string)] 
    830         :param list1: contains item (form factor )to fill modelmenu second column 
    831          
    832         """ 
    833         if len(list1) > 0: 
    834             self.model_combobox.set_list(menuinfo[0], list1) 
     814#        self._fill_simple_menu(menuinfo=["Shapes", 
     815#                                         shape_submenu, 
     816#                                         " simple shape"], 
     817#                         list1=self.shape_list) 
     818         
     819#        self._fill_simple_menu(menuinfo=["Shape-Independent", 
     820#                                         shape_indep_submenu, 
     821#                                         "List of shape-independent models"], 
     822#                         list1=self.shape_indep_list) 
     823         
     824#        self._fill_simple_menu(menuinfo=["Structure Factors", 
     825#                                         structure_factor, 
     826#                                         "List of Structure factors models"], 
     827#                                list1=self.struct_list) 
     828         
     829#        self._fill_plugin_menu(menuinfo=["Customized Models", added_models, 
     830#                                            "List of additional models"], 
     831#                                 list1=self.plugins) 
     832         
     833#        self._fill_menu(menuinfo=["P(Q)*S(Q)", multip_models, 
     834#                                  "mulplication of 2 models"], 
     835#                                   list1=self.multiplication_factor, 
     836#                                   list2=self.struct_list) 
     837#        return 0 
     838     
     839#    def _fill_plugin_menu(self, menuinfo, list1): 
     840#        """ 
     841#        fill the plugin menu with costumized models 
     842#        """ 
     843#        print ("got to fill plugin menu") 
     844#        if len(list1) == 0: 
     845#            id = wx.NewId() 
     846#            msg = "No model available check plugins.log for errors to fix problem" 
     847#            menuinfo[1].Append(int(id), "Empty", msg) 
     848#        self._fill_simple_menu(menuinfo, list1) 
     849         
     850#   def _fill_simple_menu(self, menuinfo, list1): 
     851#       """ 
     852#       Fill the menu with list item 
     853#        
     854#       :param modelmenu: the menu to fill 
     855#       :param menuinfo: submenu item for the first column of this modelmenu 
     856#                        with info.Should be a list : 
     857#                        [name(string) , menu(wx.menu), help(string)] 
     858#       :param list1: contains item (form factor )to fill modelmenu second column 
     859#        
     860#       """ 
     861#       if len(list1) > 0: 
     862#           self.model_combobox.set_list(menuinfo[0], list1) 
    835863             
    836             for item in list1: 
    837                 try: 
    838                     id = wx.NewId() 
    839                     struct_factor = item() 
    840                     struct_name = struct_factor.__class__.__name__ 
    841                     if hasattr(struct_factor, "name"): 
    842                         struct_name = struct_factor.name 
    843                          
    844                     menuinfo[1].Append(int(id), struct_name, struct_name) 
    845                     if not  item in self.struct_factor_dict.itervalues(): 
    846                         self.struct_factor_dict[str(id)] = item 
    847                     wx.EVT_MENU(self.event_owner, int(id), self._on_model) 
    848                 except: 
    849                     msg = "Error Occured: %s" % sys.exc_value 
    850                     wx.PostEvent(self.event_owner, StatusEvent(status=msg)) 
    851                  
    852         id = wx.NewId() 
    853         self.modelmenu.AppendMenu(id, menuinfo[0], menuinfo[1], menuinfo[2]) 
    854          
    855     def _fill_menu(self, menuinfo, list1, list2): 
    856         """ 
    857         Fill the menu with list item 
    858          
    859         :param menuinfo: submenu item for the first column of this modelmenu 
    860                          with info.Should be a list : 
    861                          [name(string) , menu(wx.menu), help(string)] 
    862         :param list1: contains item (form factor )to fill modelmenu second column 
    863         :param list2: contains item (Structure factor )to fill modelmenu 
    864                 third column 
    865                  
    866         """ 
    867         if len(list1) > 0: 
    868             self.model_combobox.set_list(menuinfo[0], list1) 
    869              
    870             for item in list1: 
    871                 form_factor = item() 
    872                 form_name = form_factor.__class__.__name__ 
    873                 if hasattr(form_factor, "name"): 
    874                     form_name = form_factor.name 
    875                 ### store form factor to return to other users 
    876                 newmenu = wx.Menu() 
    877                 if len(list2) > 0: 
    878                     for model  in list2: 
    879                         id = wx.NewId() 
    880                         struct_factor = model() 
    881                         name = struct_factor.__class__.__name__ 
    882                         if hasattr(struct_factor, "name"): 
    883                             name = struct_factor.name 
    884                         newmenu.Append(id, name, name) 
    885                         wx.EVT_MENU(self.event_owner, int(id), self._on_model) 
    886                         ## save form_fact and struct_fact 
    887                         self.form_factor_dict[int(id)] = [form_factor, 
    888                                                           struct_factor] 
    889                          
    890                 form_id = wx.NewId() 
    891                 menuinfo[1].AppendMenu(int(form_id), form_name, 
    892                                        newmenu, menuinfo[2]) 
    893         id = wx.NewId() 
    894         self.modelmenu.AppendMenu(id, menuinfo[0], menuinfo[1], menuinfo[2]) 
     864#            for item in list1: 
     865#                try: 
     866#                    id = wx.NewId() 
     867#                    struct_factor = item() 
     868#                    struct_name = struct_factor.__class__.__name__ 
     869#                    if hasattr(struct_factor, "name"): 
     870#                        struct_name = struct_factor.name 
     871#                         
     872#                    menuinfo[1].Append(int(id), struct_name, struct_name) 
     873#                    if not  item in self.struct_factor_dict.itervalues(): 
     874#                        self.struct_factor_dict[str(id)] = item 
     875#                    wx.EVT_MENU(self.event_owner, int(id), self._on_model) 
     876#                except: 
     877#                    msg = "Error Occured: %s" % sys.exc_value 
     878#                    wx.PostEvent(self.event_owner, StatusEvent(status=msg)) 
     879#                 
     880#        id = wx.NewId() 
     881#        self.modelmenu.AppendMenu(id, menuinfo[0], menuinfo[1], menuinfo[2]) 
     882#         
     883#    def _fill_menu(self, menuinfo, list1, list2): 
     884#        """ 
     885#        Fill the menu with list item 
     886#         
     887#        :param menuinfo: submenu item for the first column of this modelmenu 
     888#                         with info.Should be a list : 
     889#                         [name(string) , menu(wx.menu), help(string)] 
     890#        :param list1: contains item (form factor )to fill modelmenu second column 
     891#        :param list2: contains item (Structure factor )to fill modelmenu 
     892#                third column 
     893#                 
     894#        """ 
     895#        if len(list1) > 0: 
     896#            self.model_combobox.set_list(menuinfo[0], list1) 
     897#             
     898#            for item in list1: 
     899#                form_factor = item() 
     900#                form_name = form_factor.__class__.__name__ 
     901#                if hasattr(form_factor, "name"): 
     902#                    form_name = form_factor.name 
     903#                ### store form factor to return to other users 
     904#                newmenu = wx.Menu() 
     905#                if len(list2) > 0: 
     906#                    for model  in list2: 
     907#                        id = wx.NewId() 
     908#                        struct_factor = model() 
     909#                        name = struct_factor.__class__.__name__ 
     910#                        if hasattr(struct_factor, "name"): 
     911#                            name = struct_factor.name 
     912#                        newmenu.Append(id, name, name) 
     913#                        wx.EVT_MENU(self.event_owner, int(id), self._on_model) 
     914#                        ## save form_fact and struct_fact 
     915#                        self.form_factor_dict[int(id)] = [form_factor, 
     916#                                                          struct_factor] 
     917#                         
     918#                form_id = wx.NewId() 
     919#                menuinfo[1].AppendMenu(int(form_id), form_name, 
     920#                                       newmenu, menuinfo[2]) 
     921#        id = wx.NewId() 
     922#        self.modelmenu.AppendMenu(id, menuinfo[0], menuinfo[1], menuinfo[2]) 
    895923         
    896924    def _on_model(self, evt): 
     
    932960         
    933961        """ 
    934         self.model_combobox.set_list("Shapes", self.shape_list) 
    935         self.model_combobox.set_list("Shape-Independent", 
    936                                      self.shape_indep_list) 
     962        ## Model_list now only contains attribute lists not category list. 
     963        ## Eventually this should be in one master list -- read in category 
     964        ## list then pull those models that exist and get attributes then add 
     965        ## to list ..and if model does not exist remove from list as now 
     966        ## and update json file. 
     967        ## 
     968        ## -PDB   April 26, 2014 
     969         
     970#        self.model_combobox.set_list("Shapes", self.shape_list) 
     971#        self.model_combobox.set_list("Shape-Independent", 
     972#                                     self.shape_indep_list) 
    937973        self.model_combobox.set_list("Structure Factors", self.struct_list) 
    938974        self.model_combobox.set_list("Customized Models", self.plugins) 
Note: See TracChangeset for help on using the changeset viewer.