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,15 +351,16 @@ 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:
from Globals import G
if not G.RoutersList[0].invoked:
#===================================================================
# # TESTING
# print now(), self.id,' '*50, 'signalling router'
#===================================================================
G.RoutersList[0].invoked=True
G.RoutersList[0].isCalled.signal(now())
return False
if any(type=='Load' or type=='Setup' for type in receiver.multOperationTypeList):
from Globals import G
if not G.RoutersList[0].invoked:
#===================================================================
# # TESTING
# print now(), self.id,' '*50, 'signalling router'
#===================================================================
G.RoutersList[0].invoked=True
G.RoutersList[0].isCalled.signal(now())
return False
except:
pass
#------------------------------------------------------------------------------
......
......@@ -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']
#=======================================================================
......
......@@ -133,19 +133,20 @@ class QueueManagedJob(QueueJobShop):
break
#------------------------------------------------------------------------------
# if an operator is not assigned to the receiver then do not signal the receiver but the Router
# TODO: identifyEntityToGet needs giver defined but here is not yet defined for Machines and machineJobShops
# TODO: identifyEntityToGet needs giver defined but here is not yet defined for Machines and machineJobShops
try:
if receiver.identifyEntityToGet().manager:
if receiver.identifyEntityToGet().manager.isAssignedTo()!=receiver:
from Globals import G
if not G.RoutersList[0].invoked:
#===================================================================
# # # TESTING
# print now(), self.id,' '*50, 'signalling router'
#===================================================================
G.RoutersList[0].invoked=True
G.RoutersList[0].isCalled.signal(now())
return False
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
# print now(), self.id,' '*50, 'signalling router'
#===================================================================
G.RoutersList[0].invoked=True
G.RoutersList[0].isCalled.signal(now())
return False
except:
pass
activeObject.receiver=receiver
......
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