Changeset 53fc5ad9 in sasview for fittingview/src/sans
- Timestamp:
- Oct 13, 2011 6:00:42 PM (13 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:
- 3576dd0
- Parents:
- 7124300
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fittingview/src/sans/perspectives/fitting/simfitpage.py
r1aa6145 r53fc5ad9 69 69 ## number of constraint 70 70 self.nb_constraint= 0 71 self.model_cbox_left = None 72 self.model_cbox_right = None 71 73 self.uid = wx.NewId() 72 74 ## draw page … … 187 189 self._store_model() 188 190 ## display constraint fields 189 if self.show_constraint.GetValue(): 191 if self.show_constraint.GetValue() and\ 192 len(self.constraints_list)==0: 190 193 self._show_all_constraint() 191 194 self._show_constraint() 192 return193 195 else: 194 196 for item in self.model_list: … … 198 200 ##constraint info 199 201 self._hide_constraint() 202 203 self._update_easy_setup_cb() 200 204 201 205 def check_model_name(self,event): … … 204 208 """ 205 209 self.model_toFit=[] 210 cbox = event.GetEventObject() 206 211 for item in self.model_list: 207 212 if item[0].GetValue()==True: … … 213 218 214 219 ## display constraint fields 215 if len(self.model_toFit) ==1:220 if len(self.model_toFit)>=1: 216 221 self._store_model() 217 222 if self.show_constraint.GetValue() and\ … … 219 224 self._show_all_constraint() 220 225 self._show_constraint() 226 221 227 elif len(self.model_toFit)< 1: 222 228 ##constraint info 223 self._hide_constraint() 224 229 self._hide_constraint() 230 231 self._update_easy_setup_cb() 225 232 ## set the value of the main check button 226 233 if len(self.model_list)==len(self.model_toFit): … … 229 236 else: 230 237 self.cb1.SetValue(False) 238 239 def _update_easy_setup_cb(self): 240 """ 241 Update easy setup combobox on selecting a model 242 """ 243 if self.model_cbox_left != None and self.model_cbox_right != None: 244 self.model_cbox_left.Clear() 245 self.model_cbox_right.Clear() 246 #for id, model in self.constraint_dict.iteritems(): 247 for item in self.model_toFit: 248 model = item[3] 249 ## check if all parameters have been selected for constraint 250 ## then do not allow add constraint on parameters 251 if str(model.name) not in self.model_cbox_left.GetItems(): 252 self.model_cbox_left.Append(str(model.name), model) 253 if str(model.name) not in self.model_cbox_right.GetItems(): 254 self.model_cbox_right.Append(str(model.name), model) 255 self.model_cbox_left.SetSelection(0) 256 self.sizer2.Layout() 257 self.sizer3.Layout() 231 258 232 259 def draw_page(self): … … 522 549 self.btAdd.Hide() 523 550 self._store_model() 551 if self.model_cbox_left != None: 552 self.model_cbox_left.Clear() 553 self.model_cbox_left = None 554 if self.model_cbox_right != None: 555 self.model_cbox_right.Clear() 556 self.model_cbox_right = None 524 557 self.constraints_list = [] 525 558 self.sizer_all_constraints.Clear(True) … … 535 568 fill combox box with list of parameters 536 569 """ 570 param_list = [] 537 571 ##This way PC/MAC both work, instead of using event.GetClientData(). 538 572 n = self.model_cbox.GetCurrentSelection() … … 541 575 if model == dic_model: 542 576 param_list = self.page_finder[id].get_param2fit() 543 break577 #break 544 578 #param_list= get_fittableParam(model) 545 579 length = len(self.constraints_list) … … 551 585 for param in param_list: 552 586 param_cbox.Append( str(param), model) 553 587 554 588 param_cbox.Show(True) 555 589 self.btRemove.Show(True) … … 770 804 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 771 805 for id, value in self.page_finder.iteritems(): 806 if id not in self.parent.opened_pages: 807 continue 772 808 try: 773 809 ix = 0
Note: See TracChangeset
for help on using the changeset viewer.