Ignore:
Timestamp:
Apr 21, 2010 4:23:01 PM (14 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
1c271f2
Parents:
d8731ca
Message:

make sure the data is updated when the scale change

File:
1 edited

Legend:

Unmodified
Added
Removed
  • invariantview/perspectives/invariant/invariant.py

    rf29a433 r6d55d81  
    99""" 
    1010import wx 
    11 from copy import deepcopy 
     11 
    1212from sans.invariant import invariant 
    1313 
     
    163163        id = None 
    164164        if hasattr(item,"id"): 
    165             id = deepcopy(item.id) 
     165            id = item.id 
    166166 
    167167        data = Data1D(x=item.x, y=item.y, dx=None, dy=None) 
     
    171171        data.name = item.name 
    172172        ## allow to highlight data when plotted 
    173         data.interactive = deepcopy(item.interactive) 
     173        data.interactive = item.interactive 
    174174        ## when 2 data have the same id override the 1 st plotted 
    175175        data.id = id 
     
    222222        new_plot.id = self.__data.id + name 
    223223        wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title=self.__data.name)) 
    224  
    225  
    226          
     224         
     225    def plot_data(self, data): 
     226        """ 
     227            replot the current data if the user enters a new scale or background 
     228        """ 
     229        new_plot = self.copy_data(item=self.__data, dy=self.__data.dy) 
     230        new_plot.x = data.x 
     231        new_plot.y = data.y 
     232        new_plot.dx = data.dx 
     233        new_plot.dy = data.dy 
     234        wx.PostEvent(self.parent, NewPlotEvent(plot=new_plot, title=new_plot.name)) 
     235         
Note: See TracChangeset for help on using the changeset viewer.