Worker.py 869 B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env python
  2. from threading import Thread, Lock
  3. import time
  4. from aman.config.Airport import Airport
  5. class Worker(Thread):
  6. def __init__(self, icao : str, configuration : Airport):
  7. Thread.__init__(self)
  8. self.stopThread = None
  9. self.icao = icao
  10. self.configuration = configuration
  11. self.arrivalRoutes = configuration.gngData.arrivalRoutes
  12. self.updateLock = Lock()
  13. self.reportQueue = {}
  14. def stop(self):
  15. self.stopThread = True
  16. def run(self):
  17. counter = 0
  18. while None == self.stopThread:
  19. time.sleep(1)
  20. counter += 1
  21. if 0 != (counter % 60):
  22. continue
  23. # TODO handle the report queue and update internal information
  24. # TODO execute planning, etc.
  25. continue