Changeset ab8f936 in sasview
- Timestamp:
- Dec 18, 2008 12:07:37 PM (16 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:
- ef0c170
- Parents:
- 6bcdad1
- Location:
- guiframe
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/data_loader.py
r169460a rab8f936 118 118 new_plot.xaxis(output._xaxis,output._xunit) 119 119 new_plot.yaxis(output._yaxis,output._yunit) 120 new_plot.group_id = filename121 new_plot.id = None120 new_plot.group_id = output.filename 121 new_plot.id = output.filename 122 122 wx.PostEvent(parent, NewPlotEvent(plot=new_plot, title=filename)) 123 123 else: … … 146 146 new_plot.xaxis(item._xaxis,item._xunit) 147 147 new_plot.yaxis(item._yaxis,item._yunit) 148 new_plot.group_id = filename 148 new_plot.group_id = str(item.run[0]) 149 new_plot.id = str(item.run[0]) 150 149 151 wx.PostEvent(parent, NewPlotEvent(plot=new_plot, title=filename)) 150 152 i+=1 -
guiframe/local_perspectives/plotting/Plotter1D.py
r1bf33c1 rab8f936 104 104 105 105 is_new = True 106 #print "model panel name",event.plot.name107 106 if event.plot.name in self.plots.keys(): 108 107 # Check whether the class of plottable changed 109 #print "model panel",event.plot.name,event.plot.__class__110 108 if not event.plot.__class__==self.plots[event.plot.name].__class__: 109 #overwrite a plottable using the same name 111 110 self.graph.delete(self.plots[event.plot.name]) 112 111 else: 112 # plottable is already draw on the panel 113 113 is_new = False 114 114 115 115 116 if is_new: 117 # a new plottable overwrites a plotted one using the same id 118 for plottable in self.plots.itervalues(): 119 if event.plot.id==plottable.id : 120 self.graph.delete(plottable) 121 116 122 self.plots[event.plot.name] = event.plot 117 123 self.graph.add(self.plots[event.plot.name]) 118 124 else: 125 #replot the graph 119 126 self.plots[event.plot.name].x = event.plot.x 120 127 self.plots[event.plot.name].y = event.plot.y -
guiframe/local_perspectives/plotting/Plotter2D.py
r1bf33c1 rab8f936 103 103 """ 104 104 #TODO: Check for existence of plot attribute 105 105 106 # Check whether this is a replot. If we ask for a replot 106 107 # and the plottable no longer exists, ignore the event. … … 108 109 and event.plot.name not in self.plots.keys(): 109 110 return 111 110 112 if hasattr(event, "reset"): 111 113 self._reset() 114 print "model2 d event",event.plot.name, event.plot.id, event.plot.group_id 115 print "plottable list ",self.plots.keys() 116 print self.plots 112 117 is_new = True 113 118 if event.plot.name in self.plots.keys(): 114 119 # Check whether the class of plottable changed 115 120 if not event.plot.__class__==self.plots[event.plot.name].__class__: 121 #overwrite a plottable using the same name 122 print "is deleting the new plottable" 116 123 self.graph.delete(self.plots[event.plot.name]) 117 124 else: 125 # plottable is already draw on the panel 118 126 is_new = False 119 self.plots[event.plot.name] = event.plot 120 #if is_new: 121 self.graph.add(self.plots[event.plot.name]) 122 123 127 128 129 if is_new: 130 # a new plottable overwrites a plotted one using the same id 131 print "went here",self.plots.itervalues() 132 for plottable in self.plots.itervalues(): 133 if event.plot.id==plottable.id : 134 self.graph.delete(plottable) 135 136 self.plots[event.plot.name] = event.plot 137 self.graph.add(self.plots[event.plot.name]) 138 else: 139 #replot the graph 140 self.plots[event.plot.name].x = event.plot.x 141 self.plots[event.plot.name].y = event.plot.y 142 self.plots[event.plot.name].dy = event.plot.dy 143 if hasattr(event.plot, 'dx') and hasattr(self.plots[event.plot.name], 'dx'): 144 self.plots[event.plot.name].dx = event.plot.dx 145 146 124 147 # Check axis labels 125 148 #TODO: Should re-factor this 126 149 #if event.plot._xunit != self.graph.prop["xunit"]: 127 128 150 self.graph.xaxis(event.plot._xaxis, event.plot._xunit) 151 129 152 #if event.plot._yunit != self.graph.prop["yunit"]: 130 153 self.graph.yaxis(event.plot._yaxis, event.plot._yunit) 154 131 155 self.graph.render(self) 132 156 self.subplot.figure.canvas.draw_idle() -
guiframe/local_perspectives/plotting/plotting.py
r1bf33c1 rab8f936 97 97 # Check whether we already have a graph with the same units 98 98 # as the plottable we just received. 99 99 100 is_available = False 100 101 for panel in self.plot_panels:
Note: See TracChangeset
for help on using the changeset viewer.