Commit 8db91ce3 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

on initialize of Jobs, currentStation check and remainingRoute update

parent b1f8a4a6
...@@ -105,6 +105,16 @@ class Job(Entity): # inherits from the Entity c ...@@ -105,6 +105,16 @@ class Job(Entity): # inherits from the Entity c
# initializes all the Entity for a new simulation replication # initializes all the Entity for a new simulation replication
# ======================================================================= # =======================================================================
def initialize(self): def initialize(self):
if self.currentStation:
for step in self.route:
stepObjectIds=step.get('stationIdsList',[])
if self.currentStation.id in stepObjectIds:
ind=self.route.index(step)
self.remainingRoute = self.route[ind:]
break
else:
# has to be re-initialized each time a new Job is added # has to be re-initialized each time a new Job is added
self.remainingRoute=list(self.route) self.remainingRoute=list(self.route)
# check the number of stations in the stationIdsList for the current step (0) # check the number of stations in the stationIdsList for the current step (0)
......
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