Commit 289bba8d authored by Georgios Dagkakis's avatar Georgios Dagkakis

Fix situation where skilled router could get stuck expecting messages

parent b92b8b78
......@@ -1226,14 +1226,15 @@ class Machine(CoreObject):
operator.unAssign() # set the flag operatorAssignedTo to None
operator.workingStation=None
self.outputTrace(operator.name, "released from "+ self.objName)
# if the Router is expecting for signal send it
from Globals import G
from SkilledOperatorRouter import SkilledRouter
self.toBeOperated = False
if G.RouterList[0].__class__ is SkilledRouter:
if G.RouterList[0].expectedFinishSignals:
if self.id in G.RouterList[0].expectedFinishSignalsDict:
signal=G.RouterList[0].expectedFinishSignalsDict[self.id]
# if the Router is expecting for signal send it
from Globals import G
from SkilledOperatorRouter import SkilledRouter
if G.RouterList[0].__class__ is SkilledRouter:
if G.RouterList[0].expectedFinishSignals:
if self.id in G.RouterList[0].expectedFinishSignalsDict:
signal=G.RouterList[0].expectedFinishSignalsDict[self.id]
if not signal.triggered:
self.sendSignal(receiver=G.RouterList[0], signal=signal)
self.broker.invokeType='release'
self.broker.invoke()
......
......@@ -444,7 +444,7 @@ class SkilledRouter(Router):
station=findObjectById(solution[id])
signal=True
# signal only the stations in the original list
if station not in self.toBeSignalled:
if station not in self.toBeSignalled or (not operator.onShift) or operator.onBreak:
signal=False
# signal only if the operator is free
if operator.workingStation:
......@@ -454,8 +454,7 @@ class SkilledRouter(Router):
if signal:
# signal the station so that it gets the operator
self.signalStation(station, operator)
#===================================================================
# default behaviour
#===================================================================
......
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