修改数据格式和双面板优化

This commit is contained in:
2025-12-09 09:29:10 +08:00
parent 96e4b3d856
commit d627cf9f6e
8 changed files with 125 additions and 118 deletions

View File

@@ -49,15 +49,18 @@ def load_data(filename: str):
except:
part_data = pd.DataFrame(columns=part_col)
for _, data in step_data.iterrows():
if data.part not in part_data.part.values:
raise Exception("unregistered component: " + data.part)
if coordinate == "UPPER RIGHT" or coordinate == "LOWER RIGHT":
data.x = -data.x
if coordinate == "UPPER LEFT" or coordinate == "UPPER RIGHT":
data.y = data.y
data.x, data.y = data.x + origin.x, data.y + origin.y
if coordinate == "UPPER RIGHT" or coordinate == "LOWER RIGHT":
step_data['x'] = -step_data['x']
if coordinate == "UPPER LEFT" or coordinate == "UPPER RIGHT":
step_data['y'] = -step_data['y']
step_data['x'] += origin.x
step_data['y'] += origin.y
return part_data, step_data

View File

@@ -28,6 +28,7 @@ class MachineConfig:
class OptResult:
def __init__(self):
self.part = []
self.layer = []
self.cycle = []
self.slot = []
self.point = []
@@ -35,6 +36,7 @@ class OptResult:
def __add__(self, other):
self.part.extend(other.part)
self.layer.extend(other.layer)
self.cycle.extend(other.cycle)
self.slot.extend(other.slot)
self.point.extend(other.point)