Skip to content

Commit 00ec157

Browse files
committed
block TOO LOW - TERRAIN when taking off outside departure area
Signed-off-by: Octol1ttle <[email protected]>
1 parent cfd2b9f commit 00ec157

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/main/kotlin/ru/octol1ttle/flightassistant/impl/alert/gpws/TooLowTerrainAlert.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@ class TooLowTerrainAlert(computers: ComputerBus) : Alert(computers), CenteredAle
2626
return false
2727
}
2828

29-
val altitudeAboveGround = computers.data.altitude - (computers.data.groundY ?: return false)
29+
if (!computers.data.flying) {
30+
maxRadarAltitude = 0.0
31+
return false
32+
}
33+
val altitudeAboveGround = computers.data.altitude - (computers.gpws.groundY ?: return false)
3034
maxRadarAltitude = max(maxRadarAltitude, altitudeAboveGround)
31-
if (maxRadarAltitude < 15) {
35+
if (maxRadarAltitude < 15.0) {
3236
return false
3337
}
3438

@@ -40,7 +44,7 @@ class TooLowTerrainAlert(computers: ComputerBus) : Alert(computers), CenteredAle
4044
FlightPlanComputer.FlightPhase.CRUISE,
4145
FlightPlanComputer.FlightPhase.DESCEND,
4246
FlightPlanComputer.FlightPhase.APPROACH -> {
43-
altitudeAboveGround < 15
47+
altitudeAboveGround < 15.0
4448
}
4549
FlightPlanComputer.FlightPhase.LANDING -> {
4650
val glideSlopeDeviation = computers.plan.getCurrentGlideSlopeTarget()!! - computers.data.altitude

src/main/resources/assets/flightassistant/lang/en_us.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ config.flightassistant:
215215
enabled: Alert about altitude loss during takeoff/go around
216216
alert_method: Altitude loss during takeoff/go around alert method
217217
unsafe_terrain_clearance:
218-
enabled: Alert about unsafe terrain clearance when on a flight plan
218+
enabled: Alert about unsafe terrain clearance when enroute
219219
alert_method: Unsafe terrain clearance alert method
220220
below_glide_slope:
221221
alert_mode: Below glide slope alert mode

src/main/resources/assets/flightassistant/lang/ru_ru.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ config.flightassistant:
219219
enabled: Предупреждать о потере высоты при взлёте/уходе на второй круг
220220
alert_method: Способ предупреждения о потере высоте при взлёте/уходе на второй круг
221221
unsafe_terrain_clearance:
222-
enabled: Предупреждать об опасной близости к земли при полёте под планом
222+
enabled: Предупреждать об опасной близости к земли при полёте по маршруту
223223
alert_method: Способ предупреждения об опасной близости к земле
224224
below_glide_slope:
225225
alert_mode: Режим предупреждения о снижении ниже глиссады

0 commit comments

Comments
 (0)