Changeset 31c5b58 in sasview for src/sas/qtgui/DataExplorer.py
- Timestamp:
- Nov 25, 2016 8:56:41 AM (8 years ago)
- Branches:
- 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
- Children:
- 3968752
- Parents:
- 14d9c7b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/DataExplorer.py
r14d9c7b r31c5b58 18 18 from sas.sasgui.guiframe.dataFitting import Data2D 19 19 20 import GuiUtils21 import PlotHelper22 from Plotter import Plotter23 from Plotter2D import Plotter2D24 from DroppableDataLoadWidget import DroppableDataLoadWidget20 import sas.qtgui.GuiUtils as GuiUtils 21 import sas.qtgui.PlotHelper as PlotHelper 22 from sas.qtgui.Plotter import Plotter 23 from sas.qtgui.Plotter2D import Plotter2D 24 from sas.qtgui.DroppableDataLoadWidget import DroppableDataLoadWidget 25 25 26 26 # This is how to get data1/2D from the model item … … 117 117 Show the "Loading data" section of help 118 118 """ 119 _TreeLocation = "html/user/sasgui/guiframe/data_explorer_help.html" 120 self._helpView.load(QtCore.QUrl(_TreeLocation)) 119 tree_location = self.parent.HELP_DIRECTORY_LOCATION +\ 120 "/user/sasgui/guiframe/data_explorer_help.html" 121 self._helpView.load(QtCore.QUrl(tree_location)) 121 122 self._helpView.show() 122 123 … … 392 393 393 394 # Call show on requested plots 395 # All same-type charts in one plot 396 new_plot = Plotter(self) 394 397 for plot_set in plots: 395 new_plot = None396 398 if isinstance(plot_set, Data1D): 397 new_plot = Plotter(self) 399 new_plot.data = plot_set 400 new_plot.plot() 398 401 elif isinstance(plot_set, Data2D): 399 new_plot = Plotter2D(self) 402 # Separate 2D plot 403 plot2D = Plotter2D(self) 404 plot2D.data = plot_set 405 plot2D.plot() 406 self.plotAdd(plot2D) 400 407 else: 401 408 msg = "Incorrect data type passed to Plotting" 402 409 raise AttributeError, msg 403 410 404 new_plot.data(plot_set) 405 new_plot.plot() 406 407 # Update the global plot counter 408 title = "Graph"+str(PlotHelper.idOfPlot(new_plot)) 409 new_plot.setWindowTitle(title) 410 411 # Add the plot to the workspace 412 self.parent.workspace().addWindow(new_plot) 413 414 # Show the plot 415 new_plot.show() 416 417 # Update the active chart list 418 self.active_plots.append(title) 411 if plots and \ 412 hasattr(new_plot, 'data') and \ 413 len(new_plot.data.x) > 0: 414 self.plotAdd(new_plot) 415 416 def plotAdd(self, new_plot): 417 """ 418 Helper method for plot bookkeeping 419 """ 420 # Update the global plot counter 421 title = "Graph"+str(PlotHelper.idOfPlot(new_plot)) 422 new_plot.setWindowTitle(title) 423 424 # Add the plot to the workspace 425 self.parent.workspace().addWindow(new_plot) 426 427 # Show the plot 428 new_plot.show() 429 430 # Update the active chart list 431 self.active_plots.append(title) 419 432 420 433 def appendPlot(self): … … 438 451 for plot_set in new_plots: 439 452 if type(plot_set) is type(old_plot._data): 440 old_plot.data (plot_set)453 old_plot.data = plot_set 441 454 old_plot.plot() 442 455
Note: See TracChangeset
for help on using the changeset viewer.