RecedingHorizonWindow.py 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env python
  2. from aman.types.Inbound import Inbound
  3. class RecedingHorizonWindow:
  4. def __init__(self, startTime, endTime):
  5. self.StartTime = startTime
  6. self.EndTime = endTime
  7. self.Inbounds = []
  8. def isInWindow(self, inbound : Inbound):
  9. for report in self.Inbounds:
  10. if report.Callsign == inbound.Callsign:
  11. return True
  12. return False
  13. def inbound(self, callsign : str):
  14. for report in self.Inbounds:
  15. if report.Callsign == callsign:
  16. return report
  17. return None
  18. def insert(self, inbound : Inbound):
  19. for i in range(0, len(self.Inbounds)):
  20. if self.Inbounds[i].Callsign == inbound.Callsign:
  21. return
  22. self.Inbounds.append(inbound)
  23. def remove(self, callsign : str):
  24. for i in range(0, len(self.Inbounds)):
  25. if self.Inbounds[i].Callsign == callsign:
  26. self.Inbounds.pop(i)
  27. return