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