Commit f7e33db4 authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Jérome Perrin

small correction in main JSON script

parent 3f3857ee
...@@ -603,7 +603,7 @@ def createObjects(): ...@@ -603,7 +603,7 @@ def createObjects():
elif objClass=='Dream.BatchDecomposition': elif objClass=='Dream.BatchDecomposition':
id=element.get('id', 'not found') id=element.get('id', 'not found')
name=element.get('name', 'not found') name=element.get('name', 'not found')
processingTime=element['processingTime'] processingTime=element.get('processingTime', {})
numberOfSubBatches=int(element.get('numberOfSubBatches') or 0) numberOfSubBatches=int(element.get('numberOfSubBatches') or 0)
BD=BatchDecomposition(id, name, processingTime=processingTime, numberOfSubBatches=numberOfSubBatches) BD=BatchDecomposition(id, name, processingTime=processingTime, numberOfSubBatches=numberOfSubBatches)
BD.nextIds=getSuccessorList(id) BD.nextIds=getSuccessorList(id)
...@@ -905,6 +905,7 @@ def createWIP(): ...@@ -905,6 +905,7 @@ def createWIP():
G.OrderComponentList=[] G.OrderComponentList=[]
G.OrderList=[] G.OrderList=[]
G.MouldList=[] G.MouldList=[]
G.BatchList=[]
# entities that just finished processing in a station # entities that just finished processing in a station
# and have to enter the next machine # and have to enter the next machine
G.pendingEntities=[] G.pendingEntities=[]
...@@ -1081,6 +1082,17 @@ def createWIP(): ...@@ -1081,6 +1082,17 @@ def createWIP():
object=Globals.findObjectById(element['id']) object=Globals.findObjectById(element['id'])
P.currentStation=object P.currentStation=object
elif entityClass=='Dream.Batch':
id=entity.get('id', 'not found')
name=entity.get('name', 'not found')
numberOfUnits=int(entity.get('numberOfUnits', '4'))
B=Batch(id,name, numberOfUnits)
G.BatchList.append(B)
G.WipList.append(B)
G.EntityList.append(B)
object=Globals.findObjectById(element['id'])
B.currentStation=object
if entityClass=='Dream.Order': if entityClass=='Dream.Order':
id=entity.get('id', 'not found') id=entity.get('id', 'not found')
name=entity.get('name', 'not found') name=entity.get('name', 'not found')
......
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