Skip to content
Snippets Groups Projects
Commit 0d391028 authored by Kien Le's avatar Kien Le
Browse files

Waveform plot progress update

parent b3f46d69
No related branches found
No related tags found
1 merge request!85Waveform plot progress update
...@@ -6,8 +6,10 @@ from typing import List ...@@ -6,8 +6,10 @@ from typing import List
from PySide2 import QtCore, QtWidgets from PySide2 import QtCore, QtWidgets
from sohstationviewer.view.plotting.waveform_processor import \ from sohstationviewer.view.plotting.waveform_processor import (
WaveformChannelProcessor WaveformChannelProcessor
)
from sohstationviewer.view.util.enums import LogType from sohstationviewer.view.util.enums import LogType
from sohstationviewer.view.util.plot_func_names import plot_functions from sohstationviewer.view.util.plot_func_names import plot_functions
from sohstationviewer.view.plotting.plotting_widget import plotting_widget from sohstationviewer.view.plotting.plotting_widget import plotting_widget
...@@ -27,6 +29,7 @@ class WaveformWidget(plotting_widget.PlottingWidget): ...@@ -27,6 +29,7 @@ class WaveformWidget(plotting_widget.PlottingWidget):
finished = QtCore.Signal() finished = QtCore.Signal()
stopped = QtCore.Signal() stopped = QtCore.Signal()
notification = QtCore.Signal(str)
def __init__(self, parent, tracking_box, name): def __init__(self, parent, tracking_box, name):
super().__init__(parent, tracking_box, name) super().__init__(parent, tracking_box, name)
...@@ -45,6 +48,9 @@ class WaveformWidget(plotting_widget.PlottingWidget): ...@@ -45,6 +48,9 @@ class WaveformWidget(plotting_widget.PlottingWidget):
# zooming in on the waveform plot. # zooming in on the waveform plot.
self.is_working = False self.is_working = False
self.finished.connect(self.stopped) self.finished.connect(self.stopped)
self.notification.connect(
lambda msg: display_tracking_info(self.tracking_box, msg)
)
def reset_widget(self): def reset_widget(self):
""" """
...@@ -226,11 +232,17 @@ class WaveformWidget(plotting_widget.PlottingWidget): ...@@ -226,11 +232,17 @@ class WaveformWidget(plotting_widget.PlottingWidget):
""" """
if channel_id is not None: if channel_id is not None:
self.data_processors.pop(0) self.data_processors.pop(0)
self.notification.emit(f'Plotting channel {channel_id}...')
self.plot_single_channel(channel_data, channel_id) self.plot_single_channel(channel_data, channel_id)
self.draw()
# QApplication.processEvents()
try: try:
channel_processor = self.data_processors[0] channel_processor = self.data_processors[0]
self.notification.emit(f'Processing channel '
f'{channel_processor.channel_id}...')
self.thread_pool.start(channel_processor) self.thread_pool.start(channel_processor)
except IndexError: except IndexError:
self.notification.emit('Finishing up...')
self.clean_up() self.clean_up()
except Exception as e: except Exception as e:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment