diff --git a/.gitignore b/.gitignore index 2c89e6a..4d57cce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ **/__pycache__/ -/src/controller/__pycache__ +*.pyc /tck_venv /.venv /.vscode diff --git a/params/operator_params.json b/params/operator_params.json index 7be03f3..6a032bc 100644 --- a/params/operator_params.json +++ b/params/operator_params.json @@ -160,20 +160,20 @@ 0.0 ], "time_robot_movement": [ - 0.314, - 0.331, - 0.356, - 0.428, - 0.418, - 0.454, - 0.458, - 0.44, - 0.49, - 0.47, - 0.44, - 0.425, - 0.464, - 0.5 + 0.516, + 0.492, + 0.636, + 0.492, + 0.42, + 0.54, + 0.444, + 0.66, + 0.521, + 0.557, + 0.51, + 0.51, + 0.534, + 0.0 ], "object_thickness": [ 0.0045, @@ -272,35 +272,35 @@ 1.452 ], "Tesla oncomming_relief": [ - 0.528, - 0.528, - 0.54, - 0.636, - 0.504, - 0.468, + 0.516, 0.492, + 0.636, + 0.492, + 0.42, 0.54, - 0.563, - 0.588, - 0.541, - 0.564, - 0.576, - 0.507 + 0.444, + 0.66, + 0.521, + 0.557, + 0.51, + 0.51, + 0.534, + 0.01 ], "Tesla summary time": [ - 2.34, + 2.748, + 2.676, 2.652, - 2.796, - 2.4, - 2.208, - 2.34, - 2.256, 2.544, + 2.28, + 2.22, + 2.352, + 2.328, + 2.676, + 2.369, 2.405, - 2.405, - 2.358, 2.37, - 2.442, - 1.908 + 2.418, + 2.442 ] } \ No newline at end of file diff --git a/src/base/base.py b/src/base/base.py index a7089f7..29b5c2e 100644 --- a/src/base/base.py +++ b/src/base/base.py @@ -208,10 +208,10 @@ class BasePlotWidget: "name": "Electrode Force, N FE", "pen": 'w', }, - { - "name": "Welding Current ME", - "pen": "y", - } + #{ + # "name": "Welding Current ME", + # "pen": "y", + #} ], "Ideal_signals": [ { diff --git a/src/gui/plotter.py b/src/gui/plotter.py index c7644f0..6fa8ca5 100644 --- a/src/gui/plotter.py +++ b/src/gui/plotter.py @@ -91,7 +91,7 @@ class PlotWidget(BasePlotWidget): tesla_TWC = round((1 - timings.TWC_time/timings.client_time)*100, 2) if timings.client_time else 0.0 tesla_ideal = round((1 - timings.ideal_time/timings.client_time)*100, 2) if timings.client_time else 0.0 TWC_ideal = round((timings.ideal_time/timings.TWC_time)*100, 2) if timings.TWC_time else 0.0 - + print(timings.client_time, timings.TWC_time) label_widget = QWidget() label_layout = QHBoxLayout(label_widget) start_label = QLabel("Сокращение длительности: ") @@ -289,12 +289,12 @@ class PlotItemGenerator: if valid_str in signal["name"] and signal["name"] in keys: dataframe[signal["name"]] = dataframe[signal["name"]].apply(func ) return dataframe - + @staticmethod def _init_plot_item(title: str) -> tuple[pg.PlotItem, pg.LegendItem]: plot_item = pg.PlotItem(title=title) + plot_item.sigXRangeChanged.connect(lambda: PlotItemGenerator._update_plots_downsample(plot_item)) # Оптимизация отображения графиков - plot_item.setDownsampling(auto=True, mode='peak') plot_item.showGrid(x=True, y=True) plot_item.setClipToView(True) legend = plot_item.addLegend(offset=(70, 20)) @@ -417,6 +417,15 @@ class PlotItemGenerator: curve_items["real"].setdefault(signal["name"], {}) curve_items["real"][signal["name"]] = plot + @staticmethod + def _update_plots_downsample(plot_item:pg.PlotItem): + visible_range = plot_item.getViewBox().viewRange()[0] + diapason = visible_range[1] - visible_range[0] + if diapason >= 30: plot_item.setDownsampling(ds=50, auto=True, mode='peak') + elif diapason >= 10: plot_item.setDownsampling(ds=20, auto=True, mode='peak') + elif diapason >=4: plot_item.setDownsampling(ds=10, auto=True, mode='peak') + else: plot_item.setDownsampling(ds=1, auto=True, mode='peak') + def _add_force_accuracy_region(self, event:list, force: float, plot_item:pg.PlotItem) -> None: modifier = 0.05 x1 = event[0] @@ -567,10 +576,11 @@ class NavigatorPlot(pg.PlotItem): self.plot(x_downsampled, y_downsampled, pen=signal_pen, name=curve_name) self.ROI_region = pg.LinearRegionItem(movable=True, brush=pg.mkBrush(0, 0, 255, 100), pen=pg.mkPen(width=4)) - - self.ROI_region.setBounds([0, x[-1]]) + maxBound = 50 + if len(x) !=0: maxBound = x[-1] + self.ROI_region.setBounds([0, maxBound]) self.ROI_region.setRegion(time_region) self.addItem(self.ROI_region) - self.getViewBox().setLimits(xMin=0, xMax=x[-1]) + self.getViewBox().setLimits(xMin=0, xMax=maxBound) \ No newline at end of file diff --git a/src/utils/qt_settings.py b/src/utils/qt_settings.py index c012c6e..2fb3e29 100644 --- a/src/utils/qt_settings.py +++ b/src/utils/qt_settings.py @@ -285,6 +285,10 @@ QTableView { border: 1px solid #424242; selection-background-color: #FFCC00; /* Жёлтый при выделении */ selection-color: #121212; /* Тёмный цвет текста при выделении */ + font-size: 14px; +} +QTableView QLineEdit { + font-size: 14px; } /* Горизонтальный заголовок в таблицах */