Commit a0dd0d01b457b9b88e4ab1bcb10043ed2fa65b85

Authored by Etienne Pallier
1 parent c96e5f7e
Exists in dev

update agent sched

Showing 1 changed file with 10 additions and 3 deletions   Show diff stats
src/core/pyros_django/scheduler/AgentScheduler.py
... ... @@ -13,7 +13,8 @@ sys.path.append("../../../..")
13 13 from src.core.pyros_django.agent.Agent import Agent, build_agent, log
14 14  
15 15 # PM 20190416 recycle code
16   -from common.models import *
  16 +#from common.models import *
  17 +from common.models import Sequence
17 18  
18 19 ##log = L.setupLogger("AgentXTaskLogger", "AgentX")
19 20  
... ... @@ -102,13 +103,19 @@ class AgentScheduler(Agent):
102 103 super().do_log()
103 104  
104 105 def replan_sequences(self):
105   - print("start of sequences (re-)planning...")
  106 + print("\n start of sequences (re-)planning...\n")
106 107 time.sleep(5)
107   - print("...end of sequences (re-)planning")
  108 + sequences = Sequence.objects.filter(status="TBP")
  109 + print("List of sequences to be planned :")
  110 + for seq in sequences:
  111 + print('-', seq.name, '('+seq.status+')')
  112 + #print('-- with albums : ', seq.albums)
  113 + print("\n ...end of sequences (re-)planning\n")
108 114  
109 115 # Note : called by _routine_process() in Agent
110 116 # @override
111 117 def routine_process_body(self):
  118 + print("The Observatory configuration :")
112 119 self.show_config()
113 120 log.debug("in routine_process_body()")
114 121 self.replan_sequences()
... ...