diff --git a/sohstationviewer/database/soh.db b/sohstationviewer/database/soh.db index c3c01eeeb559a14690a70d0fce1428347a54c664..520d7456237a43f37b1bbc4502ad632c09a6e6d4 100755 Binary files a/sohstationviewer/database/soh.db and b/sohstationviewer/database/soh.db differ diff --git a/sohstationviewer/model/reftek/log_info.py b/sohstationviewer/model/reftek/log_info.py index 2ce79fef548c265d8b4c371fe938e4a3b6379c33..54756cdfee58af8b33f9529cd854bc7582b55609 100644 --- a/sohstationviewer/model/reftek/log_info.py +++ b/sohstationviewer/model/reftek/log_info.py @@ -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] diff --git a/sohstationviewer/view/main_window.py b/sohstationviewer/view/main_window.py index c957bb2e07470838708c0a7d64fd3eb636e6a1ba..2e47c78a88eb4a38836764b0267d98cf453b0a92 100755 --- a/sohstationviewer/view/main_window.py +++ b/sohstationviewer/view/main_window.py @@ -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 diff --git a/sohstationviewer/view/plotting/plotting_widget/plotting.py b/sohstationviewer/view/plotting/plotting_widget/plotting.py index 9e28f8d144e50fcd587ae5a7d2a8e41c310709d5..1a9268988a4960b05616b498961e8e3029a54e1a 100644 --- a/sohstationviewer/view/plotting/plotting_widget/plotting.py +++ b/sohstationviewer/view/plotting/plotting_widget/plotting.py @@ -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 diff --git a/sohstationviewer/view/plotting/plotting_widget/plotting_axes.py b/sohstationviewer/view/plotting/plotting_widget/plotting_axes.py index 50d8f93fe9bf18374d20e504607d28372843cb2d..9becc2273e3f20a52939135af500c90785bcf8f0 100644 --- a/sohstationviewer/view/plotting/plotting_widget/plotting_axes.py +++ b/sohstationviewer/view/plotting/plotting_widget/plotting_axes.py @@ -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 diff --git a/tests/test_database/test_extract_data.py b/tests/test_database/test_extract_data.py index 6f8abbb0f4166c7aa1b40a2f27b64bba27fe61d4..a8906f35ae997d558d0bb1644fe5ee461456fb0e 100644 --- a/tests/test_database/test_extract_data.py +++ b/tests/test_database/test_extract_data.py @@ -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): """