Changeset 4387385 in sasview for src/sas/sasgui/perspectives


Ignore:
Timestamp:
Feb 21, 2017 3:40:52 PM (8 years ago)
Author:
krzywon
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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
ef2cdb3, 7a5aedd
Parents:
11b094f
Message:

Save states with 'Customized Models' category now load as 'Plugin Models' and created constants for both strings.

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

Legend:

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

    r11b094f r4387385  
    5252    FONT_VARIANT = 1 
    5353    ON_MAC = True 
     54 
     55CUSTOM_MODEL = 'Plugin Models' 
     56CUSTOM_MODEL_OLD = 'Customized Models' 
    5457 
    5558class BasicPage(ScrolledPanel, PanelBase): 
     
    11561159        # select the current model 
    11571160        state._convert_to_sasmodels() 
     1161        if state.categorycombobox == CUSTOM_MODEL_OLD: 
     1162            state.categorycombobox = CUSTOM_MODEL 
    11581163        state.categorycombobox = unicode(state.categorycombobox) 
    11591164        if state.categorycombobox in self.categorybox.Items: 
     
    11671172        self._show_combox(None) 
    11681173        from models import PLUGIN_NAME_BASE 
    1169         if self.categorybox.GetValue() == 'Customized Models' \ 
     1174        if self.categorybox.GetValue() == CUSTOM_MODEL \ 
    11701175                and PLUGIN_NAME_BASE not in state.formfactorcombobox: 
    11711176            state.formfactorcombobox = \ 
     
    17981803        Fill panel's combo box according to the type of model selected 
    17991804        """ 
    1800         custom_model = 'Plugin Models' 
     1805 
    18011806        mod_cat = self.categorybox.GetStringSelection() 
    18021807        self.structurebox.SetSelection(0) 
     
    18071812        m_list = [] 
    18081813        try: 
    1809             if mod_cat == custom_model: 
     1814            if mod_cat == CUSTOM_MODEL: 
    18101815                for model in self.model_list_box[mod_cat]: 
    18111816                    m_list.append(self.model_dict[model.name]) 
  • src/sas/sasgui/perspectives/fitting/fitpage.py

    ra6fccd7 r4387385  
    3131SMEAR_SIZE_L = 0.00 
    3232SMEAR_SIZE_H = 0.00 
    33  
     33CUSTOM_MODEL = 'Plugin Models' 
    3434 
    3535class FitPage(BasicPage): 
     
    12491249            wx.PostEvent(self.parent, new_event) 
    12501250            # update list of plugins if new plugin is available 
    1251             custom_model = 'Customized Models' 
     1251            custom_model = CUSTOM_MODEL 
    12521252            mod_cat = self.categorybox.GetStringSelection() 
    12531253            if mod_cat == custom_model: 
  • src/sas/sasgui/perspectives/fitting/pagestate.py

    r6d2b50b r4387385  
    3333from sas.sascalc.dataloader.data_info import Data2D, Collimation, Detector 
    3434from sas.sascalc.dataloader.data_info import Process, Aperture 
     35 
    3536# Information to read/write state as xml 
    3637FITTING_NODE_NAME = 'fitting_plug_in' 
    3738CANSAS_NS = "cansas1d/1.0" 
     39 
     40CUSTOM_MODEL = 'Plugin Models' 
     41CUSTOM_MODEL_OLD = 'Customized Models' 
    3842 
    3943LIST_OF_DATA_ATTRIBUTES = [["is_data", "is_data", "bool"], 
     
    378382                'Sphere' : 'adsorbed_layer', 
    379383                'Structure Factor' : 'hardsphere', 
    380                 'Customized Models' : '' 
     384                CUSTOM_MODEL_OLD : '', 
     385                CUSTOM_MODEL : '' 
    381386            } 
    382387            if self.categorycombobox == '': 
Note: See TracChangeset for help on using the changeset viewer.