[plot] separate plotting of dataarrays and tags
This commit is contained in:
parent
72ff1db2ea
commit
37dbbf00eb
@ -1,4 +1,4 @@
|
||||
from nixview.util.enums import PlotterTypes
|
||||
from nixview.util.enums import NodeType, PlotterTypes
|
||||
from PyQt5.QtWidgets import QGroupBox, QHBoxLayout, QLabel, QPushButton, QSizePolicy, QSlider, QVBoxLayout, QWidget
|
||||
from PyQt5.QtCore import pyqtSignal, Qt
|
||||
import matplotlib
|
||||
@ -11,7 +11,6 @@ try:
|
||||
except ImportError as e:
|
||||
print("cannot import matplotlib, headless mode?", e)
|
||||
from matplotlib.widgets import Slider
|
||||
from IPython import embed
|
||||
|
||||
from nixview.util.file_handler import FileHandler
|
||||
from nixview.util.dataview import DataView
|
||||
@ -554,10 +553,11 @@ class PlotScreen(QWidget):
|
||||
def on_view_changed(self):
|
||||
self._pan_slider.setEnabled(self.plotter.can_pan_horizontally)
|
||||
|
||||
def plot(self, item):
|
||||
def plot_data_array(self, item):
|
||||
try:
|
||||
self._data_view = DataView(item, self._file_handler)
|
||||
except ValueError as e:
|
||||
print("ping!")
|
||||
communicator.plot_error.emit("error in plotscreen.plot %s" % e)
|
||||
return
|
||||
if self._data_view is None:
|
||||
@ -594,3 +594,16 @@ class PlotScreen(QWidget):
|
||||
self.plotter.plot()
|
||||
else:
|
||||
self._container.set_plotter(None)
|
||||
|
||||
def plot_tag(self, item):
|
||||
pass
|
||||
|
||||
def plot(self, item):
|
||||
if item.entity_type == NodeType.DataArray:
|
||||
self.plot_data_array(item)
|
||||
elif item.entity_type == NodeType.MultiTag or item.entity_type == NodeType.Tag:
|
||||
self.plot_tag(item)
|
||||
else:
|
||||
communicator.plot_error.emit("error in plotscreen.plot cannot plot entity of type%s" % item.entity_type)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user