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