Changes in src/sas/sasgui/perspectives/fitting/basepage.py [1a8e13f0:b301db9] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/basepage.py
r1a8e13f0 rb301db9 53 53 ON_MAC = True 54 54 55 CUSTOM_MODEL = 'Plugin Models' 56 55 57 class BasicPage(ScrolledPanel, PanelBase): 56 58 """ 57 This class provide general structure of fitpanel page59 This class provide general structure of the fitpanel page 58 60 """ 59 61 # Internal name for the AUI manager … … 118 120 self.dxw = None 119 121 # pinhole smear 120 self.dx_min = None 121 self.dx_max = None 122 self.dx_percent = None 122 123 # smear attrbs 123 124 self.enable_smearer = None … … 677 678 def _copy_info(self, flag): 678 679 """ 679 Send event d pemding on flag680 681 : Param flag: flag that distinguish event680 Send event depending on flag 681 682 : Param flag: flag that distinguishes the event 682 683 """ 683 684 # messages depending on the flag … … 847 848 self.state.pinhole_smearer = \ 848 849 copy.deepcopy(self.pinhole_smearer.GetValue()) 849 self.state.dx_max = copy.deepcopy(self.dx_max) 850 self.state.dx_min = copy.deepcopy(self.dx_min) 850 self.state.dx_percent = copy.deepcopy(self.dx_percent) 851 851 self.state.dxl = copy.deepcopy(self.dxl) 852 852 self.state.dxw = copy.deepcopy(self.dxw) … … 1119 1119 :precondition: the page is already drawn or created 1120 1120 1121 :postcondition: the state of the underlying data change as well as the1121 :postcondition: the state of the underlying data changes as well as the 1122 1122 state of the graphic interface 1123 1123 """ … … 1167 1167 self._show_combox(None) 1168 1168 from models import PLUGIN_NAME_BASE 1169 if self.categorybox.GetValue() == 'Customized Models'\1169 if self.categorybox.GetValue() == CUSTOM_MODEL \ 1170 1170 and PLUGIN_NAME_BASE not in state.formfactorcombobox: 1171 1171 state.formfactorcombobox = \ … … 1245 1245 # we have two more options for smearing 1246 1246 if self.pinhole_smearer.GetValue(): 1247 self.dx_min = state.dx_min 1248 self.dx_max = state.dx_max 1249 if self.dx_min is not None: 1250 self.smear_pinhole_min.SetValue(str(self.dx_min)) 1251 if self.dx_max is not None: 1252 self.smear_pinhole_max.SetValue(str(self.dx_max)) 1247 self.dx_percent = state.dx_percent 1248 if self.dx_percent is not None: 1249 if state.dx_old: 1250 self.dx_percent = 100 * (self.dx_percent / self.data.x[0]) 1251 self.smear_pinhole_percent.SetValue("%.2f" % self.dx_percent) 1253 1252 self.onPinholeSmear(event=None) 1254 1253 elif self.slit_smearer.GetValue(): … … 1335 1334 def _selectDlg(self): 1336 1335 """ 1337 open a dialog file to select ed the customized dispersity1336 open a dialog file to select the customized polydispersity function 1338 1337 """ 1339 1338 if self.parent is not None: … … 1450 1449 self.state_change = True 1451 1450 self._draw_model() 1451 # Time delay has been introduced to prevent _handle error 1452 # on Windows 1453 # This part of code is executed when model is selected and 1454 # it's parameters are changed (with respect to previously 1455 # selected model). There are two Iq evaluations occuring one 1456 # after another and therefore there may be compilation error 1457 # if model is calculated for the first time. 1458 # This seems to be Windows only issue - haven't tested on Linux 1459 # though.The proper solution (other than time delay) requires 1460 # more fundemental code refatoring 1461 # Wojtek P. Nov 7, 2016 1462 if not ON_MAC: 1463 time.sleep(0.1) 1452 1464 self.Refresh() 1453 1465 … … 1747 1759 def _set_multfactor_combobox(self, multiplicity=10): 1748 1760 """ 1749 Set comboBox for mu itfactor of CoreMultiShellModel1761 Set comboBox for multitfactor of CoreMultiShellModel 1750 1762 :param multiplicit: no. of multi-functionality 1751 1763 """ … … 1785 1797 Fill panel's combo box according to the type of model selected 1786 1798 """ 1787 custom_model = 'Customized Models' 1799 1788 1800 mod_cat = self.categorybox.GetStringSelection() 1789 1801 self.structurebox.SetSelection(0) … … 1794 1806 m_list = [] 1795 1807 try: 1796 if mod_cat == custom_model:1808 if mod_cat == CUSTOM_MODEL: 1797 1809 for model in self.model_list_box[mod_cat]: 1798 1810 m_list.append(self.model_dict[model.name]) … … 2597 2609 Layout is called after fitting. 2598 2610 """ 2611 self._sleep4sec() 2599 2612 self.Layout() 2600 2613 return 2614 2615 def _sleep4sec(self): 2616 """ 2617 sleep for 1 sec only applied on Mac 2618 Note: This 1sec helps for Mac not to crash on self. 2619 Layout after self._draw_model 2620 """ 2621 if ON_MAC: 2622 time.sleep(1) 2601 2623 2602 2624 def _find_polyfunc_selection(self, disp_func=None): … … 3430 3452 fills out the category list box 3431 3453 """ 3432 uncat_str = ' CustomizedModels'3454 uncat_str = 'Plugin Models' 3433 3455 self._read_category_info() 3434 3456 … … 3459 3481 self.model_box.Clear() 3460 3482 3461 if category == ' CustomizedModels':3483 if category == 'Plugin Models': 3462 3484 for model in self.model_list_box[category]: 3463 3485 str_m = str(model).split(".")[0]
Note: See TracChangeset
for help on using the changeset viewer.