Commit 53c66f3f authored by Georgios Dagkakis's avatar Georgios Dagkakis

SubBatches can now be set as wip

parent b96b5d5f
......@@ -181,7 +181,7 @@ def setWIP(entityList):
# for all the entities in the entityList
for entity in entityList:
# if the entity is of type Part
if entity.type=='Part' or entity.type=='Batch':
if entity.type=='Part' or entity.type=='Batch' or entity.type=='SubBatch':
object=entity.currentStation #identify the object
object.getActiveObjectQueue().append(entity) #append the entity to its Queue
entity.schedule.append([object,now()]) #append the time to schedule so that it can be read in the result
......
......@@ -906,6 +906,7 @@ def createWIP():
G.OrderList=[]
G.MouldList=[]
G.BatchList=[]
G.SubBatchList=[]
# entities that just finished processing in a station
# and have to enter the next machine
G.pendingEntities=[]
......@@ -1092,6 +1093,33 @@ def createWIP():
G.EntityList.append(B)
object=Globals.findObjectById(element['id'])
B.currentStation=object
elif entityClass=='Dream.SubBatch':
id=entity.get('id', 'not found')
name=entity.get('name', 'not found')
numberOfUnits=int(entity.get('numberOfUnits', '4'))
parentBatchId=entity.get('parentBatchId', 'not found')
parentBatchName=entity.get('parentBatchName', 'not found')
# check if the parent batch is already created. If not, then create it
batch=None
for entity in G.BatchList:
if entity.id==parentBatchId:
batch=entity
if batch: #if the parent batch was found create add the number of units of current sub-batch
batch.numberOfUnits+=numberOfUnits
else: #if the parent batch was not found create it
batch=Batch(parentBatchId,parentBatchName, numberOfUnits)
G.BatchList.append(B)
G.WipList.append(B)
G.EntityList.append(B)
SB=SubBatch(id,name, numberOfUnits=numberOfUnits, parentBatch=batch)
G.SubBatchList.append(SB)
G.WipList.append(SB)
G.EntityList.append(SB)
object=Globals.findObjectById(element['id'])
SB.currentStation=object
if entityClass=='Dream.Order':
id=entity.get('id', '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