Commit 6285cfe5 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

checkIfRequiredPartsReady correction

parent c3e7c554
...@@ -142,7 +142,7 @@ class Job(Entity): # inherits from the Entity c ...@@ -142,7 +142,7 @@ class Job(Entity): # inherits from the Entity c
# if there are required parts # if there are required parts
if requiredParts: if requiredParts:
# for each requested part # for each requested part
for part in requiredPartsIDs: for part in requiredParts:
# retrieve the current step sequence of the requiredPart # retrieve the current step sequence of the requiredPart
curStepSeq=part.currentStepSequence() curStepSeq=part.currentStepSequence()
# retrieve the next step sequence of the requiredParts # retrieve the next step sequence of the requiredParts
...@@ -156,10 +156,16 @@ class Job(Entity): # inherits from the Entity c ...@@ -156,10 +156,16 @@ class Job(Entity): # inherits from the Entity c
# required part is currently being processed and thus the activeEntity cannot proceed # required part is currently being processed and thus the activeEntity cannot proceed
if not curStepSeq: if not curStepSeq:
mayProceed=True mayProceed=True
else:
mayProceed=False
break
else:
mayProceed=False
break
# if there are no requestedParts defined, then entity can proceed to the next step of its route # if there are no requestedParts defined, then entity can proceed to the next step of its route
else: else:
mayProceed=True mayProceed=True
# if the local flag canProceed is true then return true # if the local flag mayProceed is true then return true
return mayProceed return mayProceed
#=========================================================================== #===========================================================================
...@@ -168,8 +174,9 @@ class Job(Entity): # inherits from the Entity c ...@@ -168,8 +174,9 @@ class Job(Entity): # inherits from the Entity c
#=========================================================================== #===========================================================================
def getRequiredParts(self): def getRequiredParts(self):
# retrieve the IDs of the required parts in the next step sequence # retrieve the IDs of the required parts in the next step sequence
requiredPartsIDs=self.remainingRoute[0].get('requiredParts',[])
requiredParts=[] requiredParts=[]
if self.remainingRoute:
requiredPartsIDs=self.remainingRoute[0].get('requiredParts',[])
# if there are requested parts # if there are requested parts
if requiredPartsIDs: if requiredPartsIDs:
from Globals import findObjectById from Globals import findObjectById
......
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