Changeset 1a2dc10 in sasview
- Timestamp:
- Jan 21, 2010 5:21:12 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:
- 1702180
- Parents:
- 91db958
- Location:
- sansview/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitting.py
r662da312 r1a2dc10 524 524 self.parent._mgr.Update() 525 525 526 526 527 def _compute_invariant(self, event): 527 528 """ … … 537 538 print "_compute_invariant" ,data._yunit 538 539 from invariant_panel import InvariantWindow 539 frame = InvariantWindow(base=self.parent, data=plottable )540 frame = InvariantWindow(base=self.parent, data=plottable, graph=self.panel.graph) 540 541 frame.Show(True) 541 542 #from invariant_panel import InvariantDialog -
sansview/perspectives/fitting/invariant_panel.py
rdeeba75 r1a2dc10 49 49 ## Flag to tell the AUI manager to put this panel in the center pane 50 50 CENTER_PANE = True 51 def __init__(self, parent, data=None, base=None):51 def __init__(self, parent, graph, data=None, base=None): 52 52 wx.ScrolledWindow.__init__(self, parent, style= wx.FULL_REPAINT_ON_RESIZE ) 53 53 #Font size … … 55 55 #Object that receive status event 56 56 self.parent = base 57 57 self.graph = graph 58 58 #Default power value 59 59 self.power_law_exponant = 4 … … 83 83 background=float(background), 84 84 scale=float(scale)) 85 86 low_q = self.enable_low_cbox.GetValue()87 high_q = self.enable_high_cbox.GetValue()88 85 89 86 #Get the number of points to extrapolated … … 112 109 #check the type of extrapolation 113 110 extrapolation = None 111 low_q = self.enable_low_cbox.GetValue() 112 high_q = self.enable_high_cbox.GetValue() 114 113 if low_q and not high_q: 115 114 extrapolation = "low" … … 138 137 #Compute qstar extrapolated to low q range 139 138 #Clear the previous extrapolated plot 140 self._plot_data( name=self.data.name+" Extra_low_Q") 141 self._plot_data( name=self.data.name+" Extra_high_Q") 139 142 140 if low_q: 143 141 try: … … 214 212 return 215 213 216 def _plot_data(self, data =None, name="Unknown"):214 def _plot_data(self, data, name="Unknown"): 217 215 """ 218 216 Receive a data and post a NewPlotEvent to parent … … 220 218 @param name: Data's name to use for the legend 221 219 """ 220 plottable = self.graph.get_plottable(name=name) 221 if plottable is not None: 222 self.graph.delete(plottable) 222 223 # Create a plottable data 223 224 new_plot = Data1D(x=[], y=[], dx=None, dy=None) 224 if data is not None: 225 new_plot.copy_from_datainfo(data) 226 data.clone_without_data(clone=new_plot) 225 new_plot.copy_from_datainfo(data) 226 data.clone_without_data(clone=new_plot) 227 227 228 228 new_plot.name = name … … 241 241 @param name: Data's name to use for the legend 242 242 """ 243 plottable = self.graph.get_plottable(name=name) 244 if plottable is not None: 245 self.graph.delete(plottable) 243 246 # Create a plottable data 244 247 new_plot = Theory1D(x=[], y=[], dy=None) 245 if data is not None: 246 new_plot.copy_from_datainfo(data) 247 data.clone_without_data(clone=new_plot) 248 new_plot.copy_from_datainfo(data) 249 data.clone_without_data(clone=new_plot) 248 250 249 251 new_plot.name = name … … 637 639 638 640 class InvariantDialog(wx.Dialog): 639 def __init__(self, parent=None, id=1,data=None, title="Invariant",base=None): 641 def __init__(self, parent=None, id=1,graph=None, 642 data=None, title="Invariant",base=None): 640 643 wx.Dialog.__init__(self, parent, id, title, size=( PANEL_WIDTH, 641 644 PANEL_HEIGHT)) 642 self.panel = InvariantPanel(self, data=data, base=base)645 self.panel = InvariantPanel(self,graph=graph, data=data, base=base) 643 646 self.Centre() 644 647 self.Show(True) 645 648 646 649 class InvariantWindow(wx.Frame): 647 def __init__(self, parent=None, id=1,data=None, title="Invariant",base=None): 650 def __init__(self, parent=None, id=1,graph=None, 651 data=None, title="Invariant",base=None): 652 648 653 wx.Frame.__init__(self, parent, id, title, size=( PANEL_WIDTH, 649 654 PANEL_HEIGHT)) 650 655 651 self.panel = InvariantPanel(self, data=data, base=base)656 self.panel = InvariantPanel(self,graph=graph, data=data, base=base) 652 657 self.Centre() 653 658 self.Show(True)
Note: See TracChangeset
for help on using the changeset viewer.