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 (2)
No preview for this file type
......@@ -205,10 +205,10 @@ class LogInfo():
return False
return epoch, disk, val
def read_dsp_clock_diff(self, line: str
def read_dps_clock_diff(self, line: str
) -> Union[bool, Tuple[float, float]]:
"""
Read DSP clock difference
Read DPS clock difference
:param line: str - a line of evt message
:return epoch: float - time when info is recorded
:return total: float - total difference time in milliseconds
......@@ -416,11 +416,11 @@ class LogInfo():
if epoch:
self.add_chan_info('Jerks/DSP Sets', epoch, 0, idx)
elif "DSP CLOCK DIFFERENCE" in line:
ret = self.read_dsp_clock_diff(line)
elif "DPS clock diff" in line:
ret = self.read_dps_clock_diff()
if ret:
epoch, total = ret
self.add_chan_info('DSP Clock Diff', epoch, total, idx)
self.add_chan_info('DPS Clock Diff', epoch, total, idx)
elif "ACQUISITION STARTED" in line:
epoch = self.simple_read(line)[1]
......
......@@ -772,6 +772,7 @@ class MainWindow(QtWidgets.QMainWindow, UIMainWindow):
Plot using data from self.data_object with the current options set
from GUI
"""
self.clear_plots()
if self.has_problem:
return
self.is_plotting_soh = True
......
......@@ -100,7 +100,7 @@ class Plotting:
x += points
ax.plot(points, len(points) * [0], linestyle="",
marker='s', markersize=0.5,
marker='s', markersize=2,
zorder=constants.Z_ORDER['DOT'],
color=clr[c], picker=True, pickradius=3)
prev_val = val
......
......@@ -292,9 +292,9 @@ class PlottingAxes:
ax.unit_bw = get_unit_bitweight(
chan_db_info, self.main_window.bit_weight_opt
)
self.set_axes_ylim(ax, min_y, max_y)
self.set_axes_ylim(ax, min_y, max_y, chan_db_info)
def set_axes_ylim(self, ax, min_y, max_y):
def set_axes_ylim(self, ax, org_min_y, org_max_y, chan_db_info):
"""
Limit y range in min_y, max_y.
Set y tick labels at min_y, max_y
......@@ -302,8 +302,16 @@ class PlottingAxes:
:param min_y: float - minimum of y values
:param max_y: float - maximum of y values
"""
min_y = round(min_y, 2)
max_y = round(max_y, 2)
min_y = round(org_min_y, 7)
max_y = round(org_max_y, 7)
if chan_db_info['fixPoint'] == 0 and org_max_y > org_min_y:
# if fixPoint=0, the format uses the save value created
# => try to round to to the point that user can see the differences
for dec in range(2, 8, 1):
min_y = round(org_min_y, dec)
max_y = round(org_max_y, dec)
if max_y > min_y:
break
if max_y > min_y:
# There are different values for y => show yticks for min, max
# separately
......
......@@ -109,8 +109,9 @@ class TestExtractData(unittest.TestCase):
'label': 'LCE-PhaseError',
'fixPoint': 0,
'valueColors': 'L:W|D:Y'}
self.assertDictEqual(get_chan_plot_info('LCE', 'Unknown'),
expected_result)
self.assertDictEqual(
get_chan_plot_info('LCE', 'Unknown'),
expected_result)
def test_get_chan_plot_info_bad_channel_or_data_type(self):
"""
......