sequence that are empty strings are handled correctly

parent a5f3919f
...@@ -182,8 +182,11 @@ class Job(Entity): # inherits from the Entity c ...@@ -182,8 +182,11 @@ class Job(Entity): # inherits from the Entity c
# find the sequence of the next step in the route of the activeEntity # find the sequence of the next step in the route of the activeEntity
nextSequence=self.nextStepSequence() nextSequence=self.nextStepSequence()
# if no sequence is provided then return true # if no sequence is provided then return true
if nextSequence==None: if nextSequence==None or nextSequence=="":
return True return True
else:
# print nextSequence
nextSequence = int(nextSequence)
# flag that decides if the entity can proceed to the next station in its route # flag that decides if the entity can proceed to the next station in its route
mayProceed=False mayProceed=False
# find the required parts for the next step in the route (if any) # find the required parts for the next step in the route (if any)
...@@ -193,9 +196,11 @@ class Job(Entity): # inherits from the Entity c ...@@ -193,9 +196,11 @@ class Job(Entity): # inherits from the Entity c
# for each requested part # for each requested part
for part in requiredParts: for part in requiredParts:
# retrieve the current step sequence of the requiredPart # retrieve the current step sequence of the requiredPart
partCurrentSeq=part.currentStepSequence() partCurrentSeq=int(part.currentStepSequence())
# retrieve the next step sequence of the requiredParts # retrieve the next step sequence of the requiredParts
partNextSeq=part.nextStepSequence() partNextSeq=part.nextStepSequence()
if partNextSeq:
partNextSeq = int(partNextSeq)
# if there is no next step sequence (route finished) # if there is no next step sequence (route finished)
# it means that the part has exhausted its route # it means that the part has exhausted its route
# if the sequence of the required part next step is smaller than the sequence of activeEntity's next step # if the sequence of the required part next step is smaller than the sequence of activeEntity's next step
......
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