implement the RHC mananger

This commit is contained in:
Sven Czarnian
2021-10-12 22:28:50 +02:00
parent 276e50daa3
commit a0b00f7c42
2 changed files with 186 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
#!/usr/bin/env python
from aman.types.Inbound import Inbound
class RecedingHorizonWindow:
def __init__(self, startTime, endTime):
self.StartTime = startTime
self.EndTime = endTime
self.Inbounds = []
def isInWindow(self, inbound : Inbound):
for report in self.Inbounds:
if report.Report.aircraft.callsign == inbound.Report.aircraft.callsign:
return True
return False
def inbound(self, callsign : str):
for report in self.Inbounds:
if report.Report.aircraft.callsign == callsign:
return report
return None
def insert(self, inbound : Inbound):
for i in range(0, len(self.Inbounds)):
if self.Inbounds[i].Report.aircraft.callsign == inbound.Report.aircraft.callsign:
return
self.Inbounds.append(inbound)
def remove(self, callsign : str):
for i in range(0, len(self.Inbounds)):
if self.Inbounds[i].Report.aircraft.callsign == callsign:
self.Inbounds.pop(i)
return