Changeset 4523b68 in sasview for theoryview/perspectives
- Timestamp:
- Aug 18, 2010 7:30:03 PM (14 years ago)
- 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, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- a706353b
- Parents:
- 645f9b6
- Location:
- theoryview/perspectives/theory
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
theoryview/perspectives/theory/basepage.py
r74755ff r4523b68 94 94 if self.model != None: 95 95 self.disp_list= self.model.getDispParamList() 96 96 self.multi_factor = None 97 97 ##enable model 2D draw 98 98 self.enable2D= False … … 497 497 ## reset state of checkbox,textcrtl and regular parameters value 498 498 self.reset_page(previous_state) 499 499 500 500 501 def onSave(self, event): … … 505 506 if self.model==None: 506 507 return 508 self.save_current_state() 509 """ 507 510 if hasattr(self,"enable_disp"): 508 511 self.state.enable_disp = copy.deepcopy(self.enable_disp.GetValue()) … … 511 514 512 515 self.state.model.name= self.model.name 513 516 """ 514 517 new_state = self.state.clone() 515 518 new_state.model.name = self.state.model.name … … 697 700 self.structurebox.SetSelection(state.structurecombobox ) 698 701 self.formfactorbox.SetSelection(state.formfactorcombobox) 699 702 if state.multi_factor != None: 703 self.multifactorbox.SetSelection(state.multi_factor-1) 704 #draw the pnael according to the new model parameter 705 self._on_select_model(event=None) 706 700 707 ## enable the view 2d button if this is a modelpage type 701 708 if hasattr(self,"model_view"): … … 1153 1160 else: 1154 1161 boxsizer1 = box_sizer 1155 1162 sizer_buttons = wx.BoxSizer(wx.HORIZONTAL) 1156 1163 #-------------------------------------------------------- 1157 1164 self.shape_rbutton = wx.RadioButton(self, -1, 'Shapes', style=wx.RB_GROUP) … … 1177 1184 sizer_radiobutton.Add(self.struct_rbutton) 1178 1185 1186 sizer_buttons.Add(sizer_radiobutton) 1187 # detail button 1188 if object !=None: 1189 sizer_buttons.Add((50,0)) 1190 sizer_buttons.Add(object) 1191 1179 1192 sizer_selection = wx.BoxSizer(wx.HORIZONTAL) 1180 1193 mutifactor_selection = wx.BoxSizer(wx.HORIZONTAL) 1181 1194 self.text1 = wx.StaticText( self,-1,"" ) 1182 1195 self.text2 = wx.StaticText( self,-1,"P(Q)*S(Q)" ) 1183 1196 self.mutifactor_text = wx.StaticText( self,-1,"No. of Shells: " ) 1184 1197 1185 1198 self.formfactorbox = wx.ComboBox(self, -1,style=wx.CB_READONLY) … … 1189 1202 1190 1203 self.structurebox = wx.ComboBox(self, -1,style=wx.CB_READONLY) 1204 self.multifactorbox = wx.ComboBox(self, -1,style=wx.CB_READONLY) 1191 1205 wx.EVT_COMBOBOX(self.formfactorbox,-1, self._on_select_model) 1192 1206 wx.EVT_COMBOBOX(self.structurebox,-1, self._on_select_model) 1193 1207 wx.EVT_COMBOBOX(self.multifactorbox,-1, self._on_select_model) 1194 1208 1195 1209 ## fill combox box … … 1224 1238 sizer_selection.Add((5,5)) 1225 1239 sizer_selection.Add(self.structurebox) 1226 sizer_selection.Add((5,5)) 1227 1228 boxsizer1.Add( sizer_radiobutton ) 1229 boxsizer1.Add( (20,20)) 1240 #sizer_selection.Add((5,5)) 1241 mutifactor_selection.Add((10,5)) 1242 mutifactor_selection.Add(self.mutifactor_text) 1243 mutifactor_selection.Add(self.multifactorbox) 1244 1245 boxsizer1.Add( sizer_buttons ) 1246 boxsizer1.Add( (15,15)) 1230 1247 boxsizer1.Add( sizer_selection ) 1231 if object !=None: 1232 boxsizer1.Add( (-72,-72)) 1233 boxsizer1.Add( object, 0, wx.ALIGN_RIGHT| wx.RIGHT, 35) 1234 boxsizer1.Add( (60,60)) 1248 boxsizer1.Add( (10,10)) 1249 boxsizer1.Add(mutifactor_selection) 1250 1251 self._set_multfactor_combobox() 1252 1235 1253 #-------------------------------------------------------- 1236 1254 sizer.Add(boxsizer1,0, wx.EXPAND | wx.ALL, 10) … … 1238 1256 self.SetScrollbars(20,20,25,65) 1239 1257 1258 def _set_multfactor_combobox(self): 1259 """ 1260 Set comboBox for muitfactor of CoreMultiShellModel 1261 """ 1262 for idx in range(1,5): 1263 self.multifactorbox.Append(str(idx),int(idx)) 1264 self.multifactorbox.SetSelection(0) 1265 self._hide_multfactor_combobox() 1266 1267 def _show_multfactor_combobox(self): 1268 """ 1269 Show the comboBox of muitfactor of CoreMultiShellModel 1270 """ 1271 if not self.mutifactor_text.IsShown(): 1272 self.mutifactor_text.Show(True) 1273 if not self.multifactorbox.IsShown(): 1274 self.multifactorbox.Show(True) 1275 1276 def _hide_multfactor_combobox(self): 1277 """ 1278 Hide the comboBox of muitfactor of CoreMultiShellModel 1279 """ 1280 if self.mutifactor_text.IsShown(): 1281 self.mutifactor_text.Hide() 1282 if self.multifactorbox.IsShown(): 1283 self.multifactorbox.Hide() 1284 1240 1285 1241 1286 def _show_combox(self, event): … … 1419 1464 self.structurebox.Enable() 1420 1465 self.text2.Enable() 1421 1466 1467 if form_factor != None: 1468 # set multifactor for Mutifunctional models 1469 if form_factor().name == 'CoreMultiShellModel': 1470 self._show_multfactor_combobox() 1471 m_id = self.multifactorbox.GetCurrentSelection() 1472 self.multi_factor = self.multifactorbox.GetClientData(m_id) 1473 if self.multi_factor == None: self.multi_factor =0 1474 form_factor = form_factor(int(self.multi_factor)) 1475 else: 1476 self._hide_multfactor_combobox() 1477 form_factor = form_factor() 1478 self.multi_factor = None 1479 else: 1480 self._hide_multfactor_combobox() 1481 self.multi_factor = None 1482 1422 1483 s_id = self.structurebox.GetCurrentSelection() 1423 1484 struct_factor = self.structurebox.GetClientData( s_id ) … … 1425 1486 if struct_factor !=None: 1426 1487 from sans.models.MultiplicationModel import MultiplicationModel 1427 self.model= MultiplicationModel(form_factor (),struct_factor())1488 self.model= MultiplicationModel(form_factor,struct_factor()) 1428 1489 1429 1490 else: 1430 1491 if form_factor != None: 1431 self.model= form_factor ()1492 self.model= form_factor 1432 1493 else: 1433 1494 self.model = None … … 1437 1498 self.state.parameters =[] 1438 1499 self.state.model =self.model 1500 self.state.qmin = self.qmin_x 1501 self.state.multi_factor = self.multi_factor 1439 1502 self.disp_list =self.model.getDispParamList() 1440 1503 self.state.disp_list = self.disp_list -
theoryview/perspectives/theory/models.py
r74755ff r4523b68 190 190 self.shape_list.append(CoreShellModel) 191 191 self.multiplication_factor.append(CoreShellModel) 192 193 from sans.models.Core FourShellModel import CoreFourShellModel194 self.shape_list.append(Core FourShellModel)195 self.multiplication_factor.append(Core FourShellModel)196 192 193 from sans.models.CoreMultiShellModel import CoreMultiShellModel 194 self.shape_list.append(CoreMultiShellModel) 195 self.multiplication_factor.append(CoreMultiShellModel) 196 197 197 from sans.models.VesicleModel import VesicleModel 198 198 self.shape_list.append(VesicleModel) -
theoryview/perspectives/theory/pagestate.py
r74755ff r4523b68 84 84 self.npts = None 85 85 self.name="" 86 self.multi_factor = None 86 87 ## enable smearering state 87 88 self.enable_smearer = False … … 146 147 obj.qmin = copy.deepcopy(self.qmin) 147 148 obj.qmax = copy.deepcopy(self.qmax) 149 obj.multi_factor = copy.deepcopy(self.multi_factor) 148 150 obj.npts = copy.deepcopy(self.npts ) 149 151 obj.cb1 = copy.deepcopy(self.cb1)
Note: See TracChangeset
for help on using the changeset viewer.