feat: Обновление до нового значения

This commit is contained in:
Леонид Титов 2025-01-28 14:33:07 +03:00
parent a8ebc0a97b
commit 487c55cdbd
4 changed files with 38 additions and 30 deletions

View File

@ -34,7 +34,7 @@
"distance_s_1": [ "distance_s_1": [
0.001, 0.001,
0.001, 0.001,
0.003, 0.001,
0.001, 0.001,
0.001, 0.001,
0.001, 0.001,
@ -64,7 +64,7 @@
0.001 0.001
], ],
"distance_l_1": [ "distance_l_1": [
0.0105, 0.005,
0.005, 0.005,
0.005, 0.005,
0.005, 0.005,
@ -129,7 +129,7 @@
], ],
"object_position": [ "object_position": [
0.02743, 0.02743,
0.016, 0.0249,
0.024, 0.024,
0.02425, 0.02425,
0.0225, 0.0225,
@ -176,27 +176,27 @@
0.0 0.0
], ],
"time_robot_movement": [ "time_robot_movement": [
0.5, 0.283,
0.331, 0.362,
0.356, 0.335,
0.428, 0.444,
0.418, 0.303,
0.454, 0.37,
0.458, 0.375,
0.44, 0.447,
0.49, 0.362,
0.47, 0.433,
0.44, 0.37,
0.425, 0.457,
0.464, 0.487,
0.2 0.5
], ],
"object_thickness": [ "object_thickness": [
0.0045, 0.0045,
0.0045, 0.0045,
0.0045, 0.0045,
0.0045, 0.0045,
0.0085, 0.0045,
0.0045, 0.0045,
0.0045, 0.0045,
0.0045, 0.0045,
@ -213,9 +213,9 @@
5000.0, 5000.0,
5000.0, 5000.0,
5000.0, 5000.0,
7000.0,
5000.0, 5000.0,
2000.0, 5000.0,
5000.0,
5000.0, 5000.0,
5000.0, 5000.0,
5000.0, 5000.0,

View File

@ -6,16 +6,16 @@
1000.0 1000.0
], ],
"a_max_1": [ "a_max_1": [
0.7 7.96
], ],
"v_max_1": [ "v_max_1": [
10.0 0.499
], ],
"a_max_2": [ "a_max_2": [
100.0 35.81
], ],
"v_max_2": [ "v_max_2": [
0.2 0.75
], ],
"mass_1": [ "mass_1": [
270.0 270.0
@ -48,7 +48,7 @@
0.0 0.0
], ],
"k_prop": [ "k_prop": [
0.0075 0.005
], ],
"time_capture": [ "time_capture": [
1000.0 1000.0

View File

@ -45,12 +45,16 @@ class PassportFormer(BasePointPassportFormer):
return_data = [] return_data = []
finally: finally:
self._mediator.notify(self, return_data) self._mediator.notify(self, return_data)
def _get_time_value(self, dataframe: pd.DataFrame):
return dataframe['time'] if 'time' in dataframe else dataframe['Time']
def _build_passports_pocket(self, dataframe: pd.DataFrame) -> list[pd.DataFrame, dict, int]: def _build_passports_pocket(self, dataframe: pd.DataFrame) -> list[pd.DataFrame, dict, int]:
if dataframe is not None: if dataframe is not None:
events, point_quantity = self._filter_events(dataframe["time"], dataframe) events, point_quantity = self._filter_events(self._get_time_value(dataframe), dataframe)
if point_quantity == 0: if point_quantity == 0:
return [] return []
idx_shift = True if events[self._stages[-1]][0][0] == 0 else False idx_shift = True if events[self._stages[-1]][0][0] == 0 else False

View File

@ -31,7 +31,7 @@ class PlotWidget(BasePlotWidget):
""" """
if start_timestamp is not None and finish_timestamp is not None: if start_timestamp is not None and finish_timestamp is not None:
return pg.PlotDataItem( return pg.PlotDataItem(
x=start_timestamp + ideal_data["time"], x=start_timestamp + self._get_time_value(ideal_data),
y=ideal_data[signal["name"]], y=ideal_data[signal["name"]],
pen=signal["pen"] pen=signal["pen"]
) )
@ -142,7 +142,7 @@ class PlotWidget(BasePlotWidget):
dataframe_headers = dataframe.columns.tolist() dataframe_headers = dataframe.columns.tolist()
for signal in real_signals: for signal in real_signals:
if signal["name"] in dataframe_headers: if signal["name"] in dataframe_headers:
plot = plot_item.plot(dataframe["time"], dataframe[signal["name"]], pen=signal["pen"], fast=True) plot = plot_item.plot(self._get_time_value(dataframe), dataframe[signal["name"]], pen=signal["pen"], fast=True)
plot.setZValue(0) plot.setZValue(0)
legend.addItem(plot, signal["name"]) legend.addItem(plot, signal["name"])
curve_items["real"].setdefault(signal["name"], {}) curve_items["real"].setdefault(signal["name"], {})
@ -186,6 +186,10 @@ class PlotWidget(BasePlotWidget):
qt_items["real to ideal performance"] = kdip_label qt_items["real to ideal performance"] = kdip_label
def _get_time_value(self, dataframe: pd.DataFrame):
return dataframe['time'] if 'time' in dataframe else dataframe['Time']
def _build_widget(self, data: list[Any]) -> QWidget: def _build_widget(self, data: list[Any]) -> QWidget:
""" """
Собирает графический виджет для одного набора данных. Собирает графический виджет для одного набора данных.
@ -250,7 +254,7 @@ class PlotWidget(BasePlotWidget):
if False and settings["force compensation FE"] and not dat_is_none: if False and settings["force compensation FE"] and not dat_is_none:
force = useful_p_data["force"] force = useful_p_data["force"]
F_comp = - force/k_hardness F_comp = - force/k_hardness
point_idxs = dataframe[(dataframe["time"] >= point_timeframe[0]) & (dataframe["time"] <= point_timeframe[1])].index point_idxs = dataframe[(self._get_time_value(dataframe) >= point_timeframe[0]) & (self._get_time_value(dataframe) <= point_timeframe[1])].index
dataframe.loc[point_idxs] = self._shift_data("FE", description["Real_signals"], dataframe.loc[point_idxs], F_comp) dataframe.loc[point_idxs] = self._shift_data("FE", description["Real_signals"], dataframe.loc[point_idxs], F_comp)