minor corrections and key names update

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