the matching between stations and technologies is updated. Assembly stations...

the matching between stations and technologies is updated. Assembly stations are seperate the workbenches for the moment. CAD1 and CAD2 are different as far as ENG is concerned
parent c11f5b19
...@@ -12,16 +12,21 @@ class UpdateStationList(plugin.InputPreparationPlugin): ...@@ -12,16 +12,21 @@ class UpdateStationList(plugin.InputPreparationPlugin):
""" Input preparation """ Input preparation
reads the data from external data base and substitutes the technology information with stationIDs lists reads the data from external data base and substitutes the technology information with stationIDs lists
""" """
# XXX hard-coded allowed station classes
STATION_CLASS_SET = set(["Dream.MouldAssembly","Dream.MachineJobShop"])
# XXX hardcoded values for CAD1 and CAD2 stations
@staticmethod @staticmethod
def getStationTechnologies(): def getStationTechnologies():
'''returns the technologies that can be processed on the stations''' '''returns the technologies that can be processed on the stations'''
return {"CAD": ["ENG", "CAD"], return {"CAD1": ["ENG", "CAD"], # XXX CAD1 is considered different than CAD2, they are not equivalent
"CAD2": ["CAD"],
"CAM": ["CAM"], "CAM": ["CAM"],
"MILL": ["MILL"], "MILL": ["MILL"],
"TURN": ["TURN"], "TURN": ["TURN"],
"DRILL": ["DRILL"], "DRILL": ["DRILL"],
"EDM": ["EDM"], "EDM": ["EDM"],
"WORK": ["QUAL", "ASSM", "MAN"], "WORK": ["QUAL", "MAN"], # XXX currently we consider different stations for QUAL/MAN and ASSM
"ASSM": ["ASSM"],
"INJM": ["INJM"]} "INJM": ["INJM"]}
def getStationInitials(self,technology): def getStationInitials(self,technology):
...@@ -49,7 +54,6 @@ class UpdateStationList(plugin.InputPreparationPlugin): ...@@ -49,7 +54,6 @@ class UpdateStationList(plugin.InputPreparationPlugin):
except: except:
stations = self.getStationNames() stations = self.getStationNames()
nodes = data["graph"]["node"] nodes = data["graph"]["node"]
for order in orders: for order in orders:
orderComponents = order.get("componentsList", []) orderComponents = order.get("componentsList", [])
for component in orderComponents: for component in orderComponents:
...@@ -61,7 +65,8 @@ class UpdateStationList(plugin.InputPreparationPlugin): ...@@ -61,7 +65,8 @@ class UpdateStationList(plugin.InputPreparationPlugin):
step["technology"] = technology step["technology"] = technology
technologyStations = [] technologyStations = []
for station in stations: for station in stations:
if station.startswith(self.getStationInitials(technology)): if station.startswith(self.getStationInitials(technology))\
and data["graph"]["node"][station]["_class"] in self.STATION_CLASS_SET:
found = False # check that the id of the station provided by the db BOM exist in the nodes of the graph found = False # check that the id of the station provided by the db BOM exist in the nodes of the graph
for node in nodes.keys(): for node in nodes.keys():
if node == station: if node == station:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment