dev: добавлена возможность учета компенсации прогибов в отображении позиции FE
This commit is contained in:
parent
511325071b
commit
2294869130
@ -80,7 +80,7 @@
|
||||
0.02
|
||||
],
|
||||
"distance_l_2": [
|
||||
0.04,
|
||||
0.0275,
|
||||
0.03,
|
||||
0.033,
|
||||
0.033,
|
||||
|
||||
@ -57,6 +57,6 @@
|
||||
1000.0
|
||||
],
|
||||
"Range ME, mm": [
|
||||
250
|
||||
115.0
|
||||
]
|
||||
}
|
||||
Binary file not shown.
@ -41,9 +41,12 @@ class PassportFormer(BasePointPassportFormer):
|
||||
return []
|
||||
|
||||
system_settings = {key: value[0] for key, value in self._params[1].items()}
|
||||
Range = system_settings["Range ME, mm"]
|
||||
|
||||
tesla_time = sum(self._params[0].get("Tesla summary time", []))
|
||||
useful_data = {"tesla_time": tesla_time, "range_ME": Range}
|
||||
useful_data = {"tesla_time": tesla_time,
|
||||
"range_ME": system_settings["Range ME, mm"],
|
||||
"k_prop": system_settings["k_prop"]
|
||||
}
|
||||
|
||||
points_pocket = []
|
||||
|
||||
@ -70,7 +73,9 @@ class PassportFormer(BasePointPassportFormer):
|
||||
idx = i+1 if idx_shift else i
|
||||
point_timeframe = [events[self._stages[0]][0][i], events[self._stages[-1]][1][idx]]
|
||||
point_events = {key: [value[0][i], value[1][i]] for key, value in events.items()}
|
||||
useful_p_data = {"thickness": operator_settings["object_thickness"], "L2": operator_settings["distance_l_2"]}
|
||||
useful_p_data = {"thickness": operator_settings["object_thickness"],
|
||||
"L2": operator_settings["distance_l_2"],
|
||||
"force": operator_settings["force_target"]}
|
||||
|
||||
points_pocket.append([point_timeframe, ideal_data, point_events, useful_p_data])
|
||||
return dataframe, points_pocket, useful_data
|
||||
|
||||
Binary file not shown.
@ -204,6 +204,17 @@ class PlotWidget(BasePlotWidget):
|
||||
dataframe[signal["name"]] = dataframe[signal["name"]].apply(lambda x: shift-x)
|
||||
return dataframe
|
||||
|
||||
def _shift_data(self,
|
||||
valid_str: str,
|
||||
signals: list[dict],
|
||||
dataframe: pd.DataFrame,
|
||||
shift: float) -> pd.DataFrame:
|
||||
keys = dataframe.keys()
|
||||
for signal in signals:
|
||||
if valid_str in signal["name"] and signal["name"] in keys:
|
||||
dataframe[signal["name"]] = dataframe[signal["name"]].apply(lambda x: x + shift)
|
||||
return dataframe
|
||||
|
||||
|
||||
def _build_widget(self, data: list[Any]) -> QWidget:
|
||||
"""
|
||||
@ -216,6 +227,7 @@ class PlotWidget(BasePlotWidget):
|
||||
dataframe, points_pocket, useful_data = data
|
||||
tesla_time = useful_data["tesla_time"]
|
||||
range_ME = useful_data["range_ME"]
|
||||
k_prop = useful_data["k_prop"]
|
||||
dataframe_headers = dataframe.columns.tolist()
|
||||
|
||||
for widget_num, (channel, description) in enumerate(self._plt_channels.items()):
|
||||
@ -226,6 +238,7 @@ class PlotWidget(BasePlotWidget):
|
||||
ideal_time = 0.0
|
||||
worst_perf = 2
|
||||
|
||||
# TODO: рассчитать корректный параметр range
|
||||
if settings["mirror ME"]:
|
||||
dataframe = self._mirror_shift_data("ME", description["Real_signals"], dataframe, range_ME)
|
||||
|
||||
@ -235,6 +248,14 @@ class PlotWidget(BasePlotWidget):
|
||||
point_timeframe, ideal_dat, point_events, useful_p_data = point_data
|
||||
ideal_data = copy.deepcopy(ideal_dat)
|
||||
|
||||
# TODO: проверить корректность расчетов
|
||||
if settings["force compensation FE"]:
|
||||
force = useful_p_data["force"]
|
||||
F_comp = - force*k_prop/1000
|
||||
point_idxs = dataframe[(dataframe["time"] >= point_timeframe[0]) & (dataframe["time"] <= point_timeframe[1])].index
|
||||
|
||||
dataframe.loc[point_idxs] = self._shift_data("FE", description["Real_signals"], dataframe.loc[point_idxs], F_comp)
|
||||
|
||||
# Модифицируем данные для отображения гарфика
|
||||
if settings["ideals"] and settings["mirror ME"]:
|
||||
for stage in point_events.keys():
|
||||
@ -244,11 +265,13 @@ class PlotWidget(BasePlotWidget):
|
||||
if settings["stages"]:
|
||||
self._add_stage_regions(plot_widget, point_events, dataframe_headers, 75)
|
||||
|
||||
# TODO: подобрать не вырвеглазные цвета, возможно ограничить зону
|
||||
if settings["workpiece"]:
|
||||
x1 = point_timeframe[0]
|
||||
dx = point_timeframe[1] - x1
|
||||
y1 = useful_p_data["L2"]*1000
|
||||
dy = useful_p_data["thickness"]*1000
|
||||
|
||||
rect_item = QGraphicsRectItem(x1, y1, dx, dy)
|
||||
rect_item.setBrush(pg.mkBrush('blue'))
|
||||
rect_item.setPen(pg.mkPen('red', width=2))
|
||||
|
||||
Binary file not shown.
@ -127,7 +127,8 @@ class BasePlotWidget:
|
||||
"performance": True,
|
||||
"ideals": True,
|
||||
"mirror ME": False,
|
||||
"workpiece": False
|
||||
"workpiece": False,
|
||||
"force compensation FE": False
|
||||
},
|
||||
"Real_signals": [
|
||||
{
|
||||
@ -157,7 +158,8 @@ class BasePlotWidget:
|
||||
"performance": False,
|
||||
"ideals": True,
|
||||
"mirror ME": True,
|
||||
"workpiece": True
|
||||
"workpiece": True,
|
||||
"force compensation FE": True
|
||||
},
|
||||
"Real_signals": [
|
||||
{
|
||||
@ -187,7 +189,8 @@ class BasePlotWidget:
|
||||
"performance": False,
|
||||
"ideals": True,
|
||||
"mirror ME": False,
|
||||
"workpiece": False
|
||||
"workpiece": False,
|
||||
"force compensation FE": False
|
||||
},
|
||||
"Real_signals": [
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user