dev: добавил возможность отрисовывать заготовку как прямоугольник
This commit is contained in:
parent
f8c07e18fc
commit
511325071b
@ -80,8 +80,8 @@
|
|||||||
0.02
|
0.02
|
||||||
],
|
],
|
||||||
"distance_l_2": [
|
"distance_l_2": [
|
||||||
0.033,
|
0.04,
|
||||||
0.033,
|
0.03,
|
||||||
0.033,
|
0.033,
|
||||||
0.033,
|
0.033,
|
||||||
0.033,
|
0.033,
|
||||||
@ -176,7 +176,7 @@
|
|||||||
0.5
|
0.5
|
||||||
],
|
],
|
||||||
"object_thickness": [
|
"object_thickness": [
|
||||||
0.0,
|
0.0045,
|
||||||
0.0045,
|
0.0045,
|
||||||
0.0045,
|
0.0045,
|
||||||
0.0045,
|
0.0045,
|
||||||
|
|||||||
Binary file not shown.
@ -70,8 +70,9 @@ class PassportFormer(BasePointPassportFormer):
|
|||||||
idx = i+1 if idx_shift else i
|
idx = i+1 if idx_shift else i
|
||||||
point_timeframe = [events[self._stages[0]][0][i], events[self._stages[-1]][1][idx]]
|
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()}
|
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"]}
|
||||||
|
|
||||||
points_pocket.append([point_timeframe, ideal_data, point_events])
|
points_pocket.append([point_timeframe, ideal_data, point_events, useful_p_data])
|
||||||
return dataframe, points_pocket, useful_data
|
return dataframe, points_pocket, useful_data
|
||||||
|
|
||||||
def update_settings(self, params: list[dict, dict]):
|
def update_settings(self, params: list[dict, dict]):
|
||||||
|
|||||||
Binary file not shown.
@ -1,5 +1,5 @@
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel
|
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QLabel, QGraphicsRectItem
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
|
|
||||||
@ -229,22 +229,31 @@ class PlotWidget(BasePlotWidget):
|
|||||||
if settings["mirror ME"]:
|
if settings["mirror ME"]:
|
||||||
dataframe = self._mirror_shift_data("ME", description["Real_signals"], dataframe, range_ME)
|
dataframe = self._mirror_shift_data("ME", description["Real_signals"], dataframe, range_ME)
|
||||||
|
|
||||||
|
|
||||||
# Итерация по точкам
|
# Итерация по точкам
|
||||||
for cur_point, point_data in enumerate(points_pocket):
|
for cur_point, point_data in enumerate(points_pocket):
|
||||||
# point_data структура: [point_timeframe, ideal_data, point_events]
|
# point_data структура: [point_timeframe, ideal_data, point_events]
|
||||||
point_timeframe, ideal_dat, point_events = point_data
|
point_timeframe, ideal_dat, point_events, useful_p_data = point_data
|
||||||
ideal_data = copy.deepcopy(ideal_dat)
|
ideal_data = copy.deepcopy(ideal_dat)
|
||||||
|
|
||||||
# Модифицируем данные для отображения гарфика
|
# Модифицируем данные для отображения гарфика
|
||||||
if settings["ideals"] and settings["mirror ME"]:
|
if settings["ideals"] and settings["mirror ME"]:
|
||||||
for stage in point_events.keys():
|
for stage in point_events.keys():
|
||||||
ideal_data[stage] = self._mirror_shift_data("ME", description["Ideal_signals"], ideal_data[stage], range_ME)
|
ideal_data[stage] = self._mirror_shift_data("ME", description["Ideal_signals"], ideal_data[stage], range_ME)
|
||||||
|
|
||||||
|
|
||||||
# Добавляем реальные стадии
|
# Добавляем реальные стадии
|
||||||
if settings["stages"]:
|
if settings["stages"]:
|
||||||
self._add_stage_regions(plot_widget, point_events, dataframe_headers, 75)
|
self._add_stage_regions(plot_widget, point_events, dataframe_headers, 75)
|
||||||
|
|
||||||
|
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))
|
||||||
|
plot_widget.addItem(rect_item)
|
||||||
|
|
||||||
# Добавляем идеальные стадии и идеальные сигналы
|
# Добавляем идеальные стадии и идеальные сигналы
|
||||||
if settings["ideals"]:
|
if settings["ideals"]:
|
||||||
self._add_ideal_stage_regions(plot_widget, ideal_data, point_events, 100)
|
self._add_ideal_stage_regions(plot_widget, ideal_data, point_events, 100)
|
||||||
|
|||||||
Binary file not shown.
@ -126,7 +126,8 @@ class BasePlotWidget:
|
|||||||
"stages": True,
|
"stages": True,
|
||||||
"performance": True,
|
"performance": True,
|
||||||
"ideals": True,
|
"ideals": True,
|
||||||
"mirror ME": False
|
"mirror ME": False,
|
||||||
|
"workpiece": False
|
||||||
},
|
},
|
||||||
"Real_signals": [
|
"Real_signals": [
|
||||||
{
|
{
|
||||||
@ -155,7 +156,8 @@ class BasePlotWidget:
|
|||||||
"stages": True,
|
"stages": True,
|
||||||
"performance": False,
|
"performance": False,
|
||||||
"ideals": True,
|
"ideals": True,
|
||||||
"mirror ME": True
|
"mirror ME": True,
|
||||||
|
"workpiece": True
|
||||||
},
|
},
|
||||||
"Real_signals": [
|
"Real_signals": [
|
||||||
{
|
{
|
||||||
@ -184,7 +186,8 @@ class BasePlotWidget:
|
|||||||
"stages": True,
|
"stages": True,
|
||||||
"performance": False,
|
"performance": False,
|
||||||
"ideals": True,
|
"ideals": True,
|
||||||
"mirror ME": False
|
"mirror ME": False,
|
||||||
|
"workpiece": False
|
||||||
},
|
},
|
||||||
"Real_signals": [
|
"Real_signals": [
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user