Changeset 2f189dc in sasview for sansview/perspectives/fitting/fitting.py
- Timestamp:
- Mar 26, 2010 2:41:45 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:
- 509af3d
- Parents:
- da87bce
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitting.py
r837a043 r2f189dc 510 510 else: 511 511 time.sleep(0.4) 512 513 512 513 def remove_plot(self, page, theory=False): 514 """ 515 remove model plot when a fit page is closed 516 """ 517 fitproblem = self.page_finder[page] 518 data = fitproblem.get_fit_data() 519 model = fitproblem.get_model() 520 if model is not None: 521 name = model.name 522 new_plot = Theory1D(x=[], y=[], dy=None) 523 new_plot.name = name 524 new_plot.xaxis(data._xaxis, data._xunit) 525 new_plot.yaxis(data._yaxis, data._yunit) 526 new_plot.group_id = data.group_id 527 new_plot.id = data.id + name 528 wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title=data.name)) 529 if theory: 530 new_plot_data = Data1D(x=[], y=[], dx=None, dy=None) 531 new_plot_data.name = data.name 532 new_plot_data.xaxis(data._xaxis, data._xunit) 533 new_plot_data.yaxis(data._yaxis, data._yunit) 534 new_plot_data.group_id = data.group_id 535 new_plot_data.id = data.id 536 wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot_data, 537 title=data.name)) 538 514 539 def _onEVT_SLICER_PANEL(self, event): 515 540 """ … … 531 556 from the plot 532 557 """ 533 self.fit_panel. _close_fitpage(event.data)558 self.fit_panel.close_page_with_data(event.data) 534 559 535 560 def _add_page_onmenu(self, name,fitproblem=None): … … 626 651 for plottable in self.panel.graph.plottables: 627 652 if plottable.name == self.panel.graph.selected_plottable: 628 #if not hasattr(plottable, "is_data"):629 630 653 if plottable.__class__.__name__=="Theory1D": 631 654 dy=numpy.zeros(len(plottable.y)) … … 633 656 dy= copy.deepcopy(plottable.dy) 634 657 635 item = self.copy_data(plottable, dy)658 item = self.copy_data(plottable, dy) 636 659 item.group_id += "data1D" 637 660 item.id +="data1D" 638 item.is_data = False661 item.is_data = False 639 662 title = item.name 640 wx.PostEvent(self.parent, NewPlotEvent(plot=item, title=str(title))) 663 title = 'Data created from Theory' 664 wx.PostEvent(self.parent, NewPlotEvent(plot=item, 665 title=str(title), 666 reset=True)) 641 667 else: 642 668 item= self.copy_data(plottable, plottable.dy) … … 698 724 wx.PostEvent(self.parent, StatusEvent(status="Page was already Created")) 699 725 except: 700 wx.PostEvent(self.parent, StatusEvent(status="Creating Fit page: %s"\ 701 %sys.exc_value)) 726 raise 727 #wx.PostEvent(self.parent, StatusEvent(status="Creating Fit page: %s"\ 728 #%sys.exc_value)) 702 729 return 703 730
Note: See TracChangeset
for help on using the changeset viewer.