Commit 83b3c602 authored by Georgios Dagkakis's avatar Georgios Dagkakis

part to read in new way

parent e5a772d1
......@@ -34,7 +34,8 @@ import simpy
class Entity(object):
type="Entity"
def __init__(self, id=None, name=None, priority=0, dueDate=None, orderDate=None, isCritical=False):
def __init__(self, id=None, name=None, priority=0, dueDate=None, orderDate=None,
isCritical=False, remainingProcessingTime=0):
self.name=name
self.id=id
# information on the object holding the entity
......@@ -68,6 +69,7 @@ class Entity(object):
self.candidateReceiver=None # the station that is finaly chosen to receive the entity
# alias used for printing the Route
self.alias=None
self.remainingProcessingTime=remainingProcessingTime
# =======================================================================
# outputs results to JSON File
......
......@@ -374,7 +374,7 @@ def createWIP():
inputDict=dict(entity)
inputDict.pop('_class')
if entityClass in ['Dream.CapacityEntity', 'Dream.CapacityProject']:
if entityClass in ['Dream.CapacityEntity', 'Dream.CapacityProject', 'Dream.Part']:
entity=entityType(**inputDict)
G.EntityList.append(entity)
object=Globals.findObjectById(element['id'])
......@@ -531,18 +531,6 @@ def createWIP():
G.WipList.append(J)
G.EntityList.append(J)
elif entityClass=='Dream.Part':
id=entity.get('id', 'not found')
name=entity.get('name', 'not found')
P=Part(id,name)
G.PartList.append(P)
G.WipList.append(P)
G.EntityList.append(P)
object=Globals.findObjectById(element['id'])
P.remainingProcessingTime=entity.get('remainingProcessingTime', {})
P.currentStation=object
elif entityClass=='Dream.Batch':
id=entity.get('id', 'not found')
name=entity.get('name', 'not found')
......
......@@ -30,8 +30,13 @@ models a part entity that flows through the system
from Globals import G
from Entity import Entity
#The part object
class Part(Entity):
type="Part"
def __init__(self, id=None, name=None, remainingProcessingTime=0):
Entity.__init__(self, id, name, remainingProcessingTime=remainingProcessingTime)
from Globals import G
G.PartList.append(self)
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