Commit 12005824 authored by Georgios Dagkakis's avatar Georgios Dagkakis

clean up

parent 398d6f25
...@@ -277,15 +277,10 @@ def createObjects(): ...@@ -277,15 +277,10 @@ def createObjects():
for k in ('element_id', 'top', 'left'): for k in ('element_id', 'top', 'left'):
element.pop(k, None) element.pop(k, None)
objClass = element.pop('_class') objClass = element.pop('_class')
objectType=Globals.getClassFromName(objClass)
if objClass in ['Dream.Machine', 'Dream.BatchScrapMachine', 'Dream.M3', 'Dream.MachineJobShop', from CoreObject import CoreObject
'Dream.MachineManagedJob', 'Dream.MouldAssembly', 'Dream.Exit', 'Dream.ExitJobShop', if issubclass(objectType, CoreObject):
'Dream.Queue', 'Dream.RoutingQueue', 'Dream.QueueJobShop', 'Dream.QueueManagedJob', # remove data that has to do with wip or object interruption. CoreObjects do not need it
'Dream.Assembly', 'Dream.Dismantle', 'Dream.Source', 'Dream.Conveyer',
'Dream.BatchDecomposition', 'Dream.BatchReassembly', 'Dream.LineClearance',
'Dream.BatchSource', 'Dream.OrderDecomposition', 'Dream.MouldAssemblyBuffer',
'Dream.ConditionalBuffer', 'Dream.BatchDecompositionStartTime', 'Dream.ConditionalBuffer',
'Dream.CapacityStation','Dream.CapacityStationBuffer','Dream.CapacityStationExit']:
inputDict=dict(element) inputDict=dict(element)
if 'wip' in inputDict: if 'wip' in inputDict:
del inputDict['wip'] del inputDict['wip']
...@@ -295,13 +290,16 @@ def createObjects(): ...@@ -295,13 +290,16 @@ def createObjects():
del inputDict['shift'] del inputDict['shift']
if 'scheduledMaintenance' in inputDict: if 'scheduledMaintenance' in inputDict:
del inputDict['scheduledMaintenance'] del inputDict['scheduledMaintenance']
objectType=Globals.getClassFromName(objClass)
# create the CoreObject
coreObject=objectType(**inputDict) coreObject=objectType(**inputDict)
# update the nextIDs list of the object
coreObject.nextIds=getSuccessorList(element['id'])
# (Below is only for Dismantle for now)
# get the successorList for the 'Parts' # get the successorList for the 'Parts'
coreObject.nextPartIds=getSuccessorList(element['id'], lambda source, destination, edge_data: edge_data.get('entity') == 'Part') coreObject.nextPartIds=getSuccessorList(element['id'], lambda source, destination, edge_data: edge_data.get('entity') == 'Part')
# get the successorList for the 'Frames' # get the successorList for the 'Frames'
coreObject.nextFrameIds=getSuccessorList(element['id'], lambda source, destination, edge_data: edge_data.get('entity') == 'Frame') coreObject.nextFrameIds=getSuccessorList(element['id'], lambda source, destination, edge_data: edge_data.get('entity') == 'Frame')
coreObject.nextIds=getSuccessorList(element['id']) # update the nextIDs list of the object
# ----------------------------------------------------------------------- # -----------------------------------------------------------------------
# loop through all the nodes to # loop through all the nodes to
......
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