minor corrections and key names update

parent c7bcf7a4
...@@ -63,7 +63,7 @@ class InsertQueues(plugin.InputPreparationPlugin): ...@@ -63,7 +63,7 @@ class InsertQueues(plugin.InputPreparationPlugin):
""" inserts buffers before the corresponding stations """ inserts buffers before the corresponding stations
""" """
self.data = copy(data) self.data = copy(data)
orders = self.data["input"]["BOM"]["orders"] orders = self.data["input"]["BOM"]["productionOrders"]
nodes = self.data["graph"]["node"] nodes = self.data["graph"]["node"]
for order in orders: for order in orders:
orderComponents = order.get("componentsList", []) orderComponents = order.get("componentsList", [])
......
...@@ -16,7 +16,7 @@ class MergeSteps(plugin.InputPreparationPlugin): ...@@ -16,7 +16,7 @@ class MergeSteps(plugin.InputPreparationPlugin):
def preprocess(self, data): def preprocess(self, data):
""" merge the steps that constitute one single technology step """ merge the steps that constitute one single technology step
""" """
orders = data["input"]["BOM"]['orders'] orders = data["input"]["BOM"]["productionOrders"]
# for all the orders # for all the orders
for order in orders: for order in orders:
orderComponents = order.get("componentsList", []) orderComponents = order.get("componentsList", [])
......
...@@ -18,7 +18,7 @@ class ReadJSCompleted(plugin.InputPreparationPlugin): ...@@ -18,7 +18,7 @@ class ReadJSCompleted(plugin.InputPreparationPlugin):
""" inserts the retrieved order components and the related information (routing) to the BOM echelon """ inserts the retrieved order components and the related information (routing) to the BOM echelon
""" """
self.data=data self.data=data
orders = data["input"]["BOM"].get("orders",{}) orders = data["input"]["BOM"].get("productionOrders",{})
wip = data["input"]["BOM"].get("WIP", {}) wip = data["input"]["BOM"].get("WIP", {})
for order in orders: for order in orders:
components = order.get("componentsList", []) components = order.get("componentsList", [])
...@@ -30,11 +30,11 @@ class ReadJSCompleted(plugin.InputPreparationPlugin): ...@@ -30,11 +30,11 @@ class ReadJSCompleted(plugin.InputPreparationPlugin):
if completed == "No" or completed == "": if completed == "No" or completed == "":
routeConcluded = False routeConcluded = False
# check the WIP and see if the current part already resides there # check the WIP and see if the current part already resides there
if not component["componentID"] in wip.keys(): if not component["id"] in wip.keys():
# if there is a previous task # if there is a previous task
if index: if index:
previousStep = route[index-1] previousStep = route[index-1]
wip[component["componentID"]] = { wip[component["id"]] = {
"task_id": previousStep["task_id"], "task_id": previousStep["task_id"],
"station": previousStep["technology"], "station": previousStep["technology"],
"remainingProcessingTime": 0, "remainingProcessingTime": 0,
...@@ -42,7 +42,7 @@ class ReadJSCompleted(plugin.InputPreparationPlugin): ...@@ -42,7 +42,7 @@ class ReadJSCompleted(plugin.InputPreparationPlugin):
} }
break break
if routeConcluded: if routeConcluded:
wip[component["componentID"]] = { wip[component["id"]] = {
"task_id": step["task_id"], "task_id": step["task_id"],
"station": step["technology"], "station": step["technology"],
"remainingProcessingTime": 0, "remainingProcessingTime": 0,
......
...@@ -15,14 +15,14 @@ class ReadJSWorkPlan(plugin.InputPreparationPlugin): ...@@ -15,14 +15,14 @@ class ReadJSWorkPlan(plugin.InputPreparationPlugin):
def findEntityByID(self, ID): def findEntityByID(self, ID):
"""search within the BOM and find the entity (order or component)""" """search within the BOM and find the entity (order or component)"""
orders = self.data["input"]["BOM"].get("orders", {}) orders = self.data["input"]["BOM"].get("productionOrders", {})
for order in orders: for order in orders:
# check if the id corresponds to an order # check if the id corresponds to an order
if ID == order["orderID"]: if ID == order["id"]:
return order return order
components = order.get("componentsList", []) components = order.get("componentsList", [])
for component in components: for component in components:
if ID == component["componentID"]: if ID == component["id"]:
return component return component
return {} return {}
...@@ -47,8 +47,8 @@ class ReadJSWorkPlan(plugin.InputPreparationPlugin): ...@@ -47,8 +47,8 @@ class ReadJSWorkPlan(plugin.InputPreparationPlugin):
components = order.get("componentsList",[]) components = order.get("componentsList",[])
# the part is brand new # the part is brand new
part = { part = {
"componentID": partID, "id": partID,
"componentName": partName "name": partName
} }
components.append(part) components.append(part)
order["componentsList"] = components order["componentsList"] = components
......
...@@ -18,8 +18,7 @@ class SplitRoute(plugin.InputPreparationPlugin): ...@@ -18,8 +18,7 @@ class SplitRoute(plugin.InputPreparationPlugin):
def preprocess(self, data): def preprocess(self, data):
""" splits the routes of mould parts (design + mould) """ splits the routes of mould parts (design + mould)
""" """
orders = data["input"]["BOM"]["orders"] orders = data["input"]["BOM"]["productionOrders"]
# stations = data["input"]["BOM"]["stations"]
for order in orders: for order in orders:
orderComponents = order.get("componentsList", []) orderComponents = order.get("componentsList", [])
componentsToAdd = [] componentsToAdd = []
...@@ -38,8 +37,8 @@ class SplitRoute(plugin.InputPreparationPlugin): ...@@ -38,8 +37,8 @@ class SplitRoute(plugin.InputPreparationPlugin):
else: else:
i+=1 i+=1
if design_step_list: if design_step_list:
design = {"componentName": component.get("componentName","")+"_Design", design = {"name": component.get("name","")+"_Design",
"componentID": component.get("componentID","")+"_D", "id": component.get("id","")+"_D",
"quantity": component.get("quantity", 1), "quantity": component.get("quantity", 1),
"route": design_step_list} "route": design_step_list}
componentsToAdd.append(design) componentsToAdd.append(design)
......
...@@ -43,7 +43,7 @@ class UpdateStationList(plugin.InputPreparationPlugin): ...@@ -43,7 +43,7 @@ class UpdateStationList(plugin.InputPreparationPlugin):
""" substitutes the technology information with stationIDs lists """ substitutes the technology information with stationIDs lists
""" """
self.data = data self.data = data
orders = data["input"]["BOM"]['orders'] orders = data["input"]["BOM"]["productionOrders"]
try: try:
stations = data["input"]["BOM"]['stations'] stations = data["input"]["BOM"]['stations']
except: except:
......
...@@ -20,7 +20,7 @@ class UpdateWIP(plugin.InputPreparationPlugin): ...@@ -20,7 +20,7 @@ class UpdateWIP(plugin.InputPreparationPlugin):
""" updates the Work in Process according to what is provided by the BOM, i.e. if a design just exited the last step of it's sequence """ updates the Work in Process according to what is provided by the BOM, i.e. if a design just exited the last step of it's sequence
""" """
self.data = copy(data) self.data = copy(data)
orders = self.data["input"]["BOM"]["orders"] orders = self.data["input"]["BOM"]["productionOrders"]
nodes = self.data["graph"]["node"] nodes = self.data["graph"]["node"]
wip = self.data["input"]["BOM"].get("WIP", {}) wip = self.data["input"]["BOM"].get("WIP", {})
...@@ -35,7 +35,7 @@ class UpdateWIP(plugin.InputPreparationPlugin): ...@@ -35,7 +35,7 @@ class UpdateWIP(plugin.InputPreparationPlugin):
completedComponents = [] # list to hold the componentIDs that are concluded completedComponents = [] # list to hold the componentIDs that are concluded
# # find all the components # # find all the components
for component in orderComponents: for component in orderComponents:
componentID = component["componentID"] componentID = component["id"]
route = component["route"] route = component["route"]
# # figure out if they are defined in the WIP # # figure out if they are defined in the WIP
if componentID in self.getWIPIds(): if componentID in self.getWIPIds():
...@@ -79,7 +79,7 @@ class UpdateWIP(plugin.InputPreparationPlugin): ...@@ -79,7 +79,7 @@ class UpdateWIP(plugin.InputPreparationPlugin):
# if the entity is not recognized within the current WIP then check if it should be created # if the entity is not recognized within the current WIP then check if it should be created
# first the flag designComplete and the completedComponents list must be updated # first the flag designComplete and the completedComponents list must be updated
for component in orderComponents: for component in orderComponents:
componentID = component["componentID"] componentID = component["id"]
route = component["route"] route = component["route"]
if not componentID in self.getWIPIds(): if not componentID in self.getWIPIds():
insertWIPitem = False insertWIPitem = False
...@@ -100,6 +100,8 @@ class UpdateWIP(plugin.InputPreparationPlugin): ...@@ -100,6 +100,8 @@ class UpdateWIP(plugin.InputPreparationPlugin):
insertWIPitem = True insertWIPitem = True
if insertWIPitem: if insertWIPitem:
if not wip.get(componentID, {}):
wip[componentID] = {}
wip[componentID]["station"] = route[0]["stationIdsList"][0] wip[componentID]["station"] = route[0]["stationIdsList"][0]
wip[componentID]["sequence"] = route[0]["sequence"] wip[componentID]["sequence"] = route[0]["sequence"]
wip[componentID]["task_id"] = route[0]["task_id"] wip[componentID]["task_id"] = route[0]["task_id"]
......
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