If the operationType is only Load, the Machine clears the activeCallersList of...

If the operationType is only Load, the Machine clears the activeCallersList of the operator when the operator is released. Otherwise the activeCallersList is cleared byt getEntity of Machine regardles of the type of the Machine.
parent 987e5ccd
......@@ -239,11 +239,23 @@ class CoreObject(Process):
self.receiver.preempt()
self.receiver.timeLastEntityEnded=now() #required to count blockage correctly in the preemptied station
# activeCallersList of an operator holds the CoreObjects that have called him
# when an Entity is obtained that has the operator as manager we need to reset this list
if activeEntity.manager and (self.type=='MachineManagedJob' or self.type=='MFStation'):
if activeEntity.manager.activeCallersList:
activeEntity.manager.activeCallersList=[]
# TODO have to clear the activeCallersList of the operator to start working in the machine
# consider the case where the operator is already released after loading, the getEntity is invoked after that
# if the object receiving an entity has an OperatorPool
try:
if self.operatorPool!='None' and any(type=='Load' for type in self.multOperationTypeList):
if self.currentOperator:
self.currentOperator.activeCallersList=[]
except:
pass
# # activeCallersList of an operator holds the CoreObjects that have called him
# # when an Entity is obtained that has the operator as manager we need to reset this list
# if activeEntity.manager and (self.type=='MachineManagedJob' or self.type=='MFStation'):
# if activeEntity.manager.activeCallersList:
# activeEntity.manager.activeCallersList=[]
self.outputTrace(activeEntity.name, "got into "+self.objName)
# TODO: if the successor of the object is a machine that is operated with operationType 'Load'
# then the flag hot of the activeEntity must be set to True
......
......@@ -736,6 +736,13 @@ class Machine(CoreObject):
self.outputTrace(self.currentOperator.objName, "released from "+ self.objName)
# set the flag operatorAssignedTo to None
self.currentOperator.operatorAssignedTo=None
# if the operationType is just Load and not Setup or Proceessing
# then clear the activeCallersList of the currentOperator
if any(type=='Load' for type in self.multOperationTypeList)\
and not (any(type=='Setup' for type in self.multOperationTypeList)\
or any(type=='Processing' for type in self.multOperationTypeList)):
self.currentOperator.activeCallersList=[]
self.broker.invokeBroker()
self.toBeOperated = False
......
......@@ -66,6 +66,7 @@ class Router(ObjectInterruption):
# # TESTING
# print now(), self.type, ' entities finished moving'
#===================================================================
# update the objects to be served list (pendingObjects)
for object in G.MachineList:
if object.inPositionToGet:
......@@ -76,6 +77,7 @@ class Router(ObjectInterruption):
# for entity in self.pendingObjects:
# print ' ', entity.id
#===================================================================
# update the called operators list
for operator in G.OperatorsList:
if len(operator.activeCallersList):
......@@ -86,6 +88,7 @@ class Router(ObjectInterruption):
# for operator in self.calledOperators:
# print ' ', operator.id
# #===================================================================
# for all the called operators find those available
# sort the objects for each one of them
# and assign the operator to those with the highest priority
......
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