修改数据格式和双面板优化
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user