signalReceiver corrected. Controls if the receiver has to be loaded or setup...

signalReceiver corrected. Controls if the receiver has to be loaded or setup before signalling the router
parent b28b531f
......@@ -351,6 +351,7 @@ class CoreObject(Process):
# if an operator is not assigned to the receiver then do not signal the receiver but the Router
try:
if not receiver.assignedOperator:
if any(type=='Load' or type=='Setup' for type in receiver.multOperationTypeList):
from Globals import G
if not G.RoutersList[0].invoked:
#===================================================================
......
......@@ -65,6 +65,7 @@ class Broker(ObjectInterruption):
# =======================================================================
# the run method
# TODO: have to signal Router that broker is asking operator, and wait till the Router decides
# =======================================================================
def run(self):
while 1:
......
......@@ -334,7 +334,6 @@ class Router(ObjectInterruption):
self.managed=True
#=======================================================================
# # testing
# if self.managed:
# print 'found pending entities'
# print [entity.id for entity in self.pending if not entity.type=='Part']
#=======================================================================
......
......@@ -136,11 +136,12 @@ class QueueManagedJob(QueueJobShop):
# TODO: identifyEntityToGet needs giver defined but here is not yet defined for Machines and machineJobShops
try:
if receiver.identifyEntityToGet().manager:
if any(type=='Load' or type=='Setup' for type in receiver.multOperationTypeList):
if receiver.identifyEntityToGet().manager.isAssignedTo()!=receiver:
from Globals import G
if not G.RoutersList[0].invoked:
#===================================================================
# # # TESTING
# # TESTING
# print now(), self.id,' '*50, 'signalling router'
#===================================================================
G.RoutersList[0].invoked=True
......
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