Changeset b324aa9 in sasview
- Timestamp:
- Feb 26, 2010 5:15:24 PM (15 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:
- 4d6cce0
- Parents:
- 3562fbc
- Location:
- sansview/perspectives/fitting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/basepage.py
rfcd8887d rb324aa9 457 457 if path is None: 458 458 self.disp_cb_dict[p].SetValue(False) 459 self.noDisper_rbox.SetValue(True) 459 460 return 460 461 try: -
sansview/perspectives/fitting/fitpage.py
rfcd8887d rb324aa9 551 551 self.orientation_params_disp.append([None,name3, Tct2 552 552 ,None,None, None, None,None]) 553 """ 554 #Display units text on panel 555 for item in self.model.dispersion.keys(): 556 name = item +".width" 557 """ 553 554 558 555 self.state.disp_cb_dict = copy.deepcopy(self.disp_cb_dict) 559 556 … … 570 567 wx.PostEvent(self.parent, StatusEvent(status=\ 571 568 " Selected Distribution: Gaussian")) 572 ix =0573 iy +=1574 569 #Fill the list of fittable parameters 570 self.select_all_param(event=None) 571 575 572 self.Layout() 576 573 … … 1223 1220 item[0].SetValue(True) 1224 1221 self.param_toFit.append(item ) 1225 if len(self.fittable_param)>0: 1226 for item in self.fittable_param: 1227 if self.data.__class__.__name__=="Data2D": 1222 #if len(self.fittable_param)>0: 1223 for item in self.fittable_param: 1224 if self.data.__class__.__name__=="Data2D": 1225 item[0].SetValue(True) 1226 self.param_toFit.append(item ) 1227 else: 1228 ## for 1D all parameters except orientation 1229 if not item in self.orientation_params_disp: 1228 1230 item[0].SetValue(True) 1229 1231 self.param_toFit.append(item ) 1230 else:1231 ## for 1D all parameters except orientation1232 if not item in self.orientation_params_disp:1233 item[0].SetValue(True)1234 self.param_toFit.append(item )1235 1232 else: 1236 1233 for item in self.parameters: … … 1241 1238 1242 1239 self.save_current_state_fit() 1240 1243 1241 if event !=None: 1244 1242 #self._undo.Enable(True) … … 1341 1339 iy = 0 1342 1340 ix = 0 1343 self.cb1 = wx.CheckBox(self, -1,"Select all", (10, 10)) 1341 select_text = "Uncheck all to fix" 1342 self.cb1 = wx.CheckBox(self, -1,str(select_text), (10, 10)) 1344 1343 wx.EVT_CHECKBOX(self, self.cb1.GetId(), self.select_all_param) 1345 self.cb1.SetValue( False)1344 self.cb1.SetValue(True) 1346 1345 1347 1346 sizer.Add(self.cb1,(iy, ix),(1,1),\ … … 1386 1385 ## add parameters name with checkbox for selecting to fit 1387 1386 cb = wx.CheckBox(self, -1, item ) 1388 cb.SetValue( False)1387 cb.SetValue(True) 1389 1388 wx.EVT_CHECKBOX(self, cb.GetId(), self.select_param) 1390 1389 sizer.Add( cb,( iy, ix),(1,1), … … 1516 1515 sizer.Add(ctl3, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 1517 1516 ctl3.Hide() 1518 #if self.data.__class__.__name__ =="Data2D": 1519 # ctl3.Show(True) 1520 1521 #else: 1522 # ctl3.Hide() 1523 1517 1524 1518 ix += 1 1525 1519 ctl4 = self.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER, … … 1560 1554 if self.model.details.has_key(item): 1561 1555 self.text2_4.Show() 1562 1563 #self.state.cb1 = self.cb1.GetValue() 1564 #self._copy_parameters_state(self.orientation_params, 1565 # self.state.orientation_params) 1566 #self._copy_parameters_state(self.orientation_params_disp, 1567 # self.state.orientation_params_disp) 1568 #self._copy_parameters_state(self.parameters, self.state.parameters) 1569 #self._copy_parameters_state(self.fittable_param, self.state.fittable_param) 1570 #self._copy_parameters_state(self.fixed_param, self.state.fixed_param) 1571 1556 #Fill the list of fittable parameters 1557 self.select_all_param(event=None) 1558 1572 1559 self.save_current_state_fit() 1573 1560 boxsizer1.Add(sizer) -
sansview/perspectives/fitting/fitting.py
r25f766a rb324aa9 185 185 fit_option = "Select data for fitting" 186 186 fit_hint = "Dialog with fitting parameters " 187 invariant_option = "Compute Invariant" 188 invariant_hint = "A dialog will appears for further computation" 187 189 188 for item in graph.plottables: 190 189 if item.__class__.__name__ is "Data2D": … … 205 204 if item.is_data: 206 205 return [[fit_option, fit_hint, 207 self._onSelect], 208 [invariant_option, 209 invariant_hint, self._compute_invariant]] 206 self._onSelect]] 210 207 else: 211 208 return [] 212 209 else: 213 return [[fit_option, fit_hint, self._onSelect], 214 [invariant_option, 215 invariant_hint, self._compute_invariant]] 210 return [[fit_option, fit_hint, self._onSelect]] 216 211 return [] 217 212 … … 524 519 and panel_name to find the slicer 's panel concerned. 525 520 """ 526 527 521 for item in self.parent.panels: 528 522 if self.parent.panels[item].window_caption.startswith(event.panel_name): … … 530 524 531 525 self.parent._mgr.Update() 532 533 def _compute_invariant(self, event): 534 """ 535 Open the invariant panel to invariant computation 536 """ 537 self.panel = event.GetEventObject() 538 Plugin.on_perspective(self,event=event) 539 for plottable in self.panel.graph.plottables: 540 if plottable.name == self.panel.graph.selected_plottable: 541 data = self.copy_data(item= plottable, dy=plottable.dy) 542 543 from invariant_panel import InvariantWindow 544 frame = InvariantWindow(base=self.parent, data=plottable, graph=self.panel.graph) 545 frame.Show(True) 526 546 527 547 528 def _closed_fitpage(self, event): … … 665 646 ## before sending them to the fit engine 666 647 if len(self.err_dy)>0: 648 dy = item.dy 667 649 if item.name in self.err_dy.iterkeys(): 668 dy= self.err_dy[item.name] 669 data= self.copy_data(item, dy) 670 data.is_data= item.is_data 671 else: 672 data= self.copy_data(item, item.dy) 673 data.is_data= item.is_data 674 675 650 dy = self.err_dy[item.name] 651 data = self.copy_data(item, dy) 652 data.is_data= item.is_data 653 676 654 else: 677 655 if item.dy==None: … … 1143 1121 their errors of y coordinates for 1Data hide and show error 1144 1122 """ 1145 self.err_dy = event.err_dy1123 self.err_dy = event.err_dy 1146 1124 1147 1125
Note: See TracChangeset
for help on using the changeset viewer.