Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • software_public/passoft/sohstationviewer
1 result
Show changes
Commits on Source (6)
...@@ -107,9 +107,6 @@ TPS_RIGHT_NORMALIZE = 0.05 ...@@ -107,9 +107,6 @@ TPS_RIGHT_NORMALIZE = 0.05
PLOT_WIDTH_NORMALIZE = 1 - (PLOT_LEFT_NORMALIZE + PLOT_RIGHT_NORMALIZE) PLOT_WIDTH_NORMALIZE = 1 - (PLOT_LEFT_NORMALIZE + PLOT_RIGHT_NORMALIZE)
TPS_WIDTH_NORMALIZE = 1 - (TPS_LEFT_NORMALIZE + TPS_RIGHT_NORMALIZE) TPS_WIDTH_NORMALIZE = 1 - (TPS_LEFT_NORMALIZE + TPS_RIGHT_NORMALIZE)
# Basic width in pixels to calculate ratio_w for items that use pixel unit
WIDTH_BASE_PX = 1546.
# Order to show plotting items on top of each other. The higher value, the # Order to show plotting items on top of each other. The higher value, the
# the higher priority # the higher priority
Z_ORDER = {'AXIS_SPINES': 0, 'CENTER_LINE': 1, 'LINE': 2, 'GAP': 3, 'DOT': 3} Z_ORDER = {'AXIS_SPINES': 0, 'CENTER_LINE': 1, 'LINE': 2, 'GAP': 3, 'DOT': 3}
......
...@@ -291,7 +291,7 @@ def get_data_type_from_file( ...@@ -291,7 +291,7 @@ def get_data_type_from_file(
return 'RT130', False return 'RT130', False
return None return None
if is_multiplex is None: if is_multiplex in [None, False]:
chans_in_stream.add(chan) chans_in_stream.add(chan)
if len(chans_in_stream) > 1: if len(chans_in_stream) > 1:
is_multiplex = True is_multiplex = True
......
...@@ -6,7 +6,6 @@ import math ...@@ -6,7 +6,6 @@ import math
import numpy as np import numpy as np
import matplotlib.text import matplotlib.text
from matplotlib import pyplot as pl from matplotlib import pyplot as pl
from matplotlib.transforms import Bbox
from PySide6.QtCore import QTimer, Qt from PySide6.QtCore import QTimer, Qt
from PySide6 import QtCore, QtWidgets from PySide6 import QtCore, QtWidgets
...@@ -67,12 +66,6 @@ class PlottingWidget(QtWidgets.QScrollArea): ...@@ -67,12 +66,6 @@ class PlottingWidget(QtWidgets.QScrollArea):
self.min_x = 0 self.min_x = 0
self.max_x = 0 self.max_x = 0
""" """
ratio_w: float - the ratio for plotting_w. This value changed when the
width of the scroll area changed or user choose a different
scaling ratio
"""
self.ratio_w = 1.
"""
plotting_bot: float - bottom of a current plot, decrease by plot_h plotting_bot: float - bottom of a current plot, decrease by plot_h
return from self.get_height() whenever a new plot is added return from self.get_height() whenever a new plot is added
""" """
...@@ -237,8 +230,6 @@ class PlottingWidget(QtWidgets.QScrollArea): ...@@ -237,8 +230,6 @@ class PlottingWidget(QtWidgets.QScrollArea):
Set figure's width and main widget's width to fit the width of the Set figure's width and main widget's width to fit the width of the
view port of the scroll area. view port of the scroll area.
Recalculate ratio_w to adjust size of object that use pixel for sizing.
When there is no channels, height will be set to the height of the When there is no channels, height will be set to the height of the
viewport to cover the whole viewport. viewport to cover the whole viewport.
...@@ -255,7 +246,6 @@ class PlottingWidget(QtWidgets.QScrollArea): ...@@ -255,7 +246,6 @@ class PlottingWidget(QtWidgets.QScrollArea):
# set view size fit with the scroll's viewport size # set view size fit with the scroll's viewport size
self.main_widget.setFixedWidth(view_port_size.width()) self.main_widget.setFixedWidth(view_port_size.width())
self.ratio_w = view_port_size.width() / const.WIDTH_BASE_PX
if self.plot_total == 0: if self.plot_total == 0:
view_port_height = view_port_size.height() view_port_height = view_port_size.height()
self.main_widget.setFixedHeight(view_port_height) self.main_widget.setFixedHeight(view_port_height)
...@@ -747,12 +737,11 @@ class PlottingWidget(QtWidgets.QScrollArea): ...@@ -747,12 +737,11 @@ class PlottingWidget(QtWidgets.QScrollArea):
if save_file_path is None: if save_file_path is None:
return return
dpi = save_plot_dlg.dpi dpi = save_plot_dlg.dpi
self.plotting_axes.fig.savefig( self.plotting_axes.fig.savefig(
save_file_path, save_file_path,
bbox_inches=Bbox([[0, self.plotting_bot*100], bbox_inches='tight',
[self.ratio_w*15.5, 100]]), dpi=dpi,
dpi=dpi facecolor=self.display_color['background']
) )
msg = f"Graph is saved at {save_file_path}" msg = f"Graph is saved at {save_file_path}"
display_tracking_info(self.tracking_box, msg) display_tracking_info(self.tracking_box, msg)
......
...@@ -239,12 +239,13 @@ class TimePowerSquaredWidget(plotting_widget.PlottingWidget): ...@@ -239,12 +239,13 @@ class TimePowerSquaredWidget(plotting_widget.PlottingWidget):
:param chan_id: channel name in str or None if no data, '' if stop :param chan_id: channel name in str or None if no data, '' if stop
""" """
if chan_id is None: if chan_id is None:
self.done() msg = f'{self.get_plot_name()} has no data.'
msg = None
elif chan_id == '': elif chan_id == '':
msg = f'{self.get_plot_name()} stopped.' msg = f'{self.get_plot_name()} stopped.'
else: else:
msg = f'{self.get_plot_name()} finished.' msg = f'{self.get_plot_name()} finished.'
self.done()
if msg: if msg:
self.parent.processing_log_msg += msg + "\n" self.parent.processing_log_msg += msg + "\n"
display_tracking_info( display_tracking_info(
......