Changes in src/sas/sasgui/perspectives/fitting/fitpage.py [48154abb:3bd677b] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/fitpage.py
r48154abb r3bd677b 14 14 from sasmodels.weights import MODELS as POLYDISPERSITY_MODELS 15 15 16 from sas.sascalc.fit.qsmearing import smear_selection 17 16 18 from sas.sasgui.guiframe.events import StatusEvent, NewPlotEvent, \ 17 19 PlotQrangeEvent … … 23 25 from sas.sasgui.perspectives.fitting.basepage import PageInfoEvent as \ 24 26 PageInfoEvent 25 from sas.sascalc.data_util.qsmearing import smear_selection26 27 from .basepage import ModelTextCtrl 27 28 … … 1078 1079 """ 1079 1080 1080 _TreeLocation = "user/sasgui/perspectives/fitting/ sm_help.html"1081 _TreeLocation = "user/sasgui/perspectives/fitting/resolution.html" 1081 1082 _doc_viewer = DocumentationWindow(self, wx.ID_ANY, _TreeLocation, "", 1082 1083 "Instrumental Resolution Smearing \ … … 1142 1143 self.model.name = "M" + str(self.index_model) 1143 1144 1144 def _on_select_model(self, event=None ):1145 def _on_select_model(self, event=None, keep_pars=False): 1145 1146 """ 1146 1147 call back for model selection 1147 1148 """ 1148 1149 self.Show(False) 1149 copy_flag = False1150 is_poly_enabled = None1151 1150 if event is not None: 1152 if (event.GetEventObject() == self.formfactorbox 1153 and self.structurebox.GetLabel() != 'None')\ 1154 or event.GetEventObject() == self.structurebox\ 1155 or event.GetEventObject() == self.multifactorbox: 1156 copy_flag = self.get_copy_params() 1157 is_poly_enabled = self.enable_disp.GetValue() 1151 control = event.GetEventObject() 1152 if ((control == self.formfactorbox 1153 and self.structurebox.GetLabel() != 'None') 1154 or control == self.structurebox 1155 or control == self.multifactorbox): 1156 keep_pars = True 1157 1158 if keep_pars: 1159 saved_pars = self.get_copy_params() 1160 is_poly_enabled = self.enable_disp.GetValue() 1161 else: 1162 saved_pars = None 1163 is_poly_enabled = None 1164 1158 1165 try: 1159 1166 self._on_select_model_helper() … … 1177 1184 try: 1178 1185 self.set_dispers_sizer() 1179 except :1186 except Exception: 1180 1187 pass 1181 1188 self.state.enable_disp = self.enable_disp.GetValue() … … 1238 1245 self.state.model.name = self.model.name 1239 1246 1247 # when select a model only from guictr/button 1248 if is_poly_enabled is not None: 1249 self.enable_disp.SetValue(is_poly_enabled) 1250 self.disable_disp.SetValue(not is_poly_enabled) 1251 self._set_dipers_Param(event=None) 1252 self.state.enable_disp = self.enable_disp.GetValue() 1253 self.state.disable_disp = self.disable_disp.GetValue() 1254 1255 # Keep the previous param values 1256 if saved_pars: 1257 self.get_paste_params(saved_pars) 1258 1240 1259 if event is not None: 1260 # update list of plugins if new plugin is available 1261 # mod_cat = self.categorybox.GetStringSelection() 1262 # if mod_cat == CUSTOM_MODEL: 1263 # temp = self.parent.update_model_list() 1264 # for v in self.parent.model_dictionary.values(): 1265 # if v.id == self.model.id: 1266 # self.model = v() 1267 # break 1268 # if temp: 1269 # self.model_list_box = temp 1270 # current_val = self.formfactorbox.GetLabel() 1271 # pos = self.formfactorbox.GetSelection() 1272 # self._show_combox_helper() 1273 # self.formfactorbox.SetStringSelection(current_val) 1274 # self.formfactorbox.SetValue(current_val) 1241 1275 # post state to fit panel 1242 1276 new_event = PageInfoEvent(page=self) 1243 1277 wx.PostEvent(self.parent, new_event) 1244 # update list of plugins if new plugin is available1245 mod_cat = self.categorybox.GetStringSelection()1246 if mod_cat == CUSTOM_MODEL:1247 temp_id = self.model.id1248 temp = self.parent.update_model_list()1249 for v in self.parent.model_dictionary.values():1250 if v.id == temp_id:1251 self.model = v()1252 break1253 if temp:1254 self.model_list_box = temp1255 current_val = self.formfactorbox.GetLabel()1256 pos = self.formfactorbox.GetSelection()1257 self._show_combox_helper()1258 self.formfactorbox.SetSelection(pos)1259 self.formfactorbox.SetValue(current_val)1260 # when select a model only from guictr/button1261 if is_poly_enabled is not None:1262 self.enable_disp.SetValue(is_poly_enabled)1263 self.disable_disp.SetValue(not is_poly_enabled)1264 self._set_dipers_Param(event=None)1265 self.state.enable_disp = self.enable_disp.GetValue()1266 self.state.disable_disp = self.disable_disp.GetValue()1267 1268 # Keep the previous param values1269 if copy_flag:1270 self.get_paste_params(copy_flag)1271 1278 wx.CallAfter(self._onDraw, None) 1272 1279 … … 1726 1733 ind = 0 1727 1734 while(ind < len(list)): 1728 for key, val in list.ite ritems():1729 if (val == ind):1735 for key, val in list.items(): 1736 if val == ind: 1730 1737 fun_box.Append(key, val) 1731 1738 break
Note: See TracChangeset
for help on using the changeset viewer.