Changeset 46d210d in sasview


Ignore:
Timestamp:
Apr 10, 2017 12:14:27 PM (6 months ago)
Author:
GitHub <noreply@…>
Branches:
master, py3, release-4.1.1, release-4.1.2, ticket-853-fit-gui-to-calc, ticket-869, ticket-887-reorg, ticket-915, ticket-947-sasmodels-docs, unittest-saveload
Children:
d79feea
Parents:
527a190 (diff), 05b8e01 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jeff Krzywon <krzywon@…> (04/10/17 12:14:27)
git-committer:
GitHub <noreply@…> (04/10/17 12:14:27)
Message:

Merge pull request #83 from rprospero/4_1_issues

Plugin model discovery issues now in 4_1_1 release branch. ref #865

Location:
src/sas/sasgui/perspectives/fitting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/fitpage.py

    rd85f1d8a r7143065  
    12361236            wx.PostEvent(self.parent, new_event) 
    12371237            # update list of plugins if new plugin is available 
    1238             custom_model = CUSTOM_MODEL 
    12391238            mod_cat = self.categorybox.GetStringSelection() 
    1240             if mod_cat == custom_model: 
     1239            if mod_cat == CUSTOM_MODEL: 
     1240                temp_id = self.model.id 
    12411241                temp = self.parent.update_model_list() 
     1242                for v in self.parent.model_dictionary.values(): 
     1243                    if v.id == temp_id: 
     1244                        self.model = v() 
     1245                        break 
    12421246                if temp: 
    12431247                    self.model_list_box = temp 
  • src/sas/sasgui/perspectives/fitting/models.py

    r11b094f r05b8e01  
    1818from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller 
    1919from sasmodels.sasview_model import load_custom_model, load_standard_models 
     20from sas.sasgui.perspectives.fitting.fitpage import CUSTOM_MODEL 
    2021 
    2122 
     
    260261        temp = {} 
    261262        if self.is_changed(): 
    262             return  _findModels(dir) 
     263            temp =  _findModels(dir) 
     264            self.last_time_dir_modified = time.time() 
     265            return temp 
    263266        logging.info("plugin model : %s" % str(temp)) 
    264267        return temp 
     
    307310        if os.path.isdir(plugin_dir): 
    308311            temp = os.path.getmtime(plugin_dir) 
    309             if  self.last_time_dir_modified != temp: 
     312            if  self.last_time_dir_modified < temp: 
    310313                is_modified = True 
    311314                self.last_time_dir_modified = temp 
     
    318321        new models were added else return empty dictionary 
    319322        """ 
     323        self.plugins = [] 
    320324        new_plugins = self.findModels() 
    321         if len(new_plugins) > 0: 
    322             for name, plug in  new_plugins.iteritems(): 
    323                 if name not in self.stored_plugins.keys(): 
    324                     self.stored_plugins[name] = plug 
    325                     self.plugins.append(plug) 
    326                     self.model_dictionary[name] = plug 
    327             self.model_combobox.set_list("Plugin Models", self.plugins) 
     325        if new_plugins: 
     326            for name, plug in  new_plugins.items(): 
     327                self.stored_plugins[name] = plug 
     328                self.plugins.append(plug) 
     329                self.model_dictionary[name] = plug 
     330            self.model_combobox.set_list(CUSTOM_MODEL, self.plugins) 
    328331            return self.model_combobox.get_list() 
    329332        else: 
Note: See TracChangeset for help on using the changeset viewer.