Changeset 46d210d in sasview


Ignore:
Timestamp:
Apr 10, 2017 10:14:27 AM (8 years ago)
Author:
GitHub <noreply@…>
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, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, 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 10:14:27)
git-committer:
GitHub <noreply@…> (04/10/17 10: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.