Compare commits

...

10 Commits

Author SHA1 Message Date
3237f20994 submodule 2023-07-14 21:48:55 +02:00
Sven Czarnian
6426aa2bd4 send the IAFs as well 2021-12-26 10:41:55 +01:00
Sven Czarnian
716c1090f3 add a comment 2021-12-26 10:41:37 +01:00
Sven Czarnian
fdf38b46dd fix a renaming issue 2021-12-26 10:41:06 +01:00
Sven Czarnian
c9937d39c2 fix sporadic system crashes 2021-12-25 22:37:20 +01:00
Sven Czarnian
357f6e7b11 do not minimize the TTG 2021-12-25 09:00:13 +01:00
Sven Czarnian
2fdb73e32e do not ignore inbounds that respawned inside the freezed time 2021-12-25 08:59:59 +01:00
Sven Czarnian
bf6417c66c add a flag that inidicates if the flight has all relevant information 2021-12-25 08:58:12 +01:00
Sven Czarnian
5ef3d4e40a fix a race condition crash 2021-12-23 17:49:10 +01:00
Sven Czarnian
8ac4977c08 initialize all required information to avoid race conditions between in plugins and the web interface 2021-12-23 16:29:25 +01:00
6 changed files with 46 additions and 8 deletions

2
.gitmodules vendored
View File

@@ -1,4 +1,4 @@
[submodule "src/protobuf"]
path = src/protobuf
url = git@git.vatsim-germany.org:nav/aman-com.git
url = git@git.ascarion.org:vatger/aman-com.git
branch = feature/protobuf

View File

@@ -105,6 +105,7 @@ def configuration(icao):
if None == airport:
return Response('{}', status=404, mimetype='application/json')
# get the current runway configuration
config = airport.SequencingConfiguration
dependencies = []
for dependency in config.RunwayDependencies:
@@ -127,13 +128,26 @@ def configuration(icao):
for runway in runways:
availableRunways.append(runway.Name);
# get all IAFs of the airport
iafs = []
for runway in airport.Configuration.GngData.ArrivalRoutes:
for route in airport.Configuration.GngData.ArrivalRoutes[runway]:
found = False
for iaf in iafs:
if iaf['name'] == route.Iaf.Name:
found = True
break
if False == found:
iafs.append({ 'name' : route.Iaf.Name, 'lat' : route.Iaf.Coordinate[0], 'lon' : route.Iaf.Coordinate[1] })
dictionary = {
'airport' : airport.Icao,
'useShallShouldMay' : config.UseShallShouldMay,
'availableRunways' : availableRunways,
'activeRunways' : config.ActiveArrivalRunways,
'dependentRunways' : dependencies,
'iafColorization' : airport.Configuration.IafColorization
'iafColorization' : airport.Configuration.IafColorization,
'iafs' : iafs
}
data = json.dumps(dictionary, ensure_ascii=True, cls=RunwaySequencingEncoder)
return Response(data, status=200, mimetype='application/json')

View File

@@ -115,6 +115,7 @@ class RecedingHorizonControl:
sequenced.PlannedTrackmiles = inbound.PlannedTrackmiles
sequenced.AssignmentMode = inbound.AssignmentMode
sequenced.ExpectedRunway = inbound.ExpectedRunway
sequenced.HasValidSequence = True
# resort the inbound
if sequenced.PlannedArrivalTime < self.Windows[index].StartTime or sequenced.PlannedArrivalTime >= self.Windows[index].EndTime:
@@ -174,12 +175,29 @@ class RecedingHorizonControl:
return runwayInbounds, iafInbounds
def optimizationRelevantInbounds(self):
# no new inbounds
if len(self.Windows) <= self.FreezedIndex + 1:
if 0 == len(self.Windows):
return None, None
inbounds = []
earliestArrivalTime = self.Windows[self.FreezedIndex + 1].StartTime
if self.FreezedIndex + 1 >= len(self.Windows):
earliestArrivalTime = dt.utcfromtimestamp(int(time.time())).replace(tzinfo = pytz.UTC)
earliestArrivalTime += self.Configuration.FixedBeforeArrival
else:
earliestArrivalTime = self.Windows[self.FreezedIndex + 1].StartTime
# check if we have a reconnect in the freezed blocks (VATSIM specific behavior)
for i in range(0, min(len(self.Windows), self.FreezedIndex + 1)):
for inbound in self.Windows[i].Inbounds:
if False == inbound.HasValidSequence:
inbounds.sort(key = lambda x: x.PlannedArrivalTime if None != x.PlannedArrivalTime else x.EnrouteArrivalTime)
inbounds.append(copy.deepcopy(inbound))
# no new inbounds
if len(self.Windows) <= self.FreezedIndex + 1:
if 0 == len(inbounds):
return None, None
else:
return inbounds, earliestArrivalTime
# check the overlapping windows
for i in range(self.FreezedIndex + 1, len(self.Windows)):
@@ -201,7 +219,8 @@ class RecedingHorizonControl:
for i in range(0, len(self.Windows)):
for inbound in self.Windows[i].Inbounds:
inbounds.append(inbound)
if True == inbound.HasValidSequence:
inbounds.append(inbound)
return inbounds

View File

@@ -209,8 +209,11 @@ class Node:
ttg = timedelta(seconds = timeUntilIAF.total_seconds() * ttgRatio)
if (ttg.total_seconds() > ttgMax):
ttg = timedelta(seconds = ttgMax)
if None == self.Inbound.MaximumTimeToGain or ttg > self.Inbound.MaximumTimeToGain:
self.Inbound.MaximumTimeToGain = ttg
ita = self.Inbound.ReportTime + flightTime
earliest = ita - ttg
earliest = ita - self.Inbound.MaximumTimeToGain
self.ArrivalCandidates[identifier.Runway.Name] = ArrivalData(star = star, ita = earliest, route = arrivalRoute,
trackmiles = trackmiles)

View File

@@ -8,4 +8,4 @@ class ArrivalRoute:
self.Route = waypoints
def __str__(self):
return 'Name: ' + self.Name + ', IAF: ' + self.Iaf.name + ', RWY: ' + self.Runway
return 'Name: ' + self.Name + ', IAF: ' + self.Iaf.Name + ', RWY: ' + self.Runway

View File

@@ -17,6 +17,7 @@ class Inbound:
self.EnrouteArrivalTime = None
self.InitialArrivalTime = None
self.RequestedRunway = None
self.MaximumTimeToGain = None
self.PlannedArrivalTime = None
self.PlannedRunway = None
self.PlannedStar = None
@@ -25,6 +26,7 @@ class Inbound:
self.FixedSequence = False
self.ExpectedRunway = None
self.AssignmentMode = None
self.HasValidSequence = False
self.WTC = None
# analyze the WTC