From 80a7d7da2dcd404d6840cc0954fb7382c2fd7550 Mon Sep 17 00:00:00 2001 From: Raffson Date: Sat, 18 Feb 2023 17:50:12 +0100 Subject: [PATCH] Add wind, cloud base and BRC info to kneeboard --- game/missiongenerator/kneeboard.py | 15 ++++++++++++++- game/missiongenerator/tgogenerator.py | 3 +-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/game/missiongenerator/kneeboard.py b/game/missiongenerator/kneeboard.py index cbce253f..7f4cd88d 100644 --- a/game/missiongenerator/kneeboard.py +++ b/game/missiongenerator/kneeboard.py @@ -43,7 +43,7 @@ from game.radio.radios import RadioFrequency from game.runways import RunwayData from game.theater import TheaterGroundObject, TheaterUnit from game.theater.bullseye import Bullseye -from game.utils import Distance, UnitSystem, meters, mps, pounds +from game.utils import Distance, UnitSystem, meters, mps, pounds, knots, feet from game.weather import Weather from .aircraft.flightdata import FlightData from .missiondata import AwacsInfo, TankerInfo @@ -402,6 +402,19 @@ class BriefingPage(KneeboardPage): writer.text( f"Turbulence: {round(self.weather.atmospheric.turbulence_per_10cm)} per 10cm at ground level." ) + writer.text( + f"Wind: {self.weather.wind.at_0m.direction}°" + f" / {round(mps(self.weather.wind.at_0m.speed).knots)}kts (0ft)" + f" ; {self.weather.wind.at_2000m.direction}°" + f" / {round(mps(self.weather.wind.at_2000m.speed).knots)}kts (~6500ft)" + f" ; {self.weather.wind.at_8000m.direction}°" + f" / {round(mps(self.weather.wind.at_8000m.speed).knots)}kts (~26000ft)" + ) + c = self.weather.clouds + writer.text( + f'Cloud base: {f"{int(round(meters(c.base).feet, -2))}ft" if c else "CAVOK"}' + f'{f", {c.preset.ui_name[:-2]}" if c and c.preset else ""}' + ) fl = self.flight diff --git a/game/missiongenerator/tgogenerator.py b/game/missiongenerator/tgogenerator.py index f47d5768..9a6b50f0 100644 --- a/game/missiongenerator/tgogenerator.py +++ b/game/missiongenerator/tgogenerator.py @@ -522,7 +522,6 @@ class GenericCarrierGenerator(GroundObjectGenerator): callsign: str, icls: Optional[int], ) -> None: - # TODO: Make unit name usable. # This relies on one control point mapping exactly # to one LHA, carrier, or other usable "runway". # This isn't wholly true, since the DD escorts of @@ -533,7 +532,7 @@ class GenericCarrierGenerator(GroundObjectGenerator): self.runways[self.control_point.name] = RunwayData( self.control_point.name, brc, - "N/A", + f"{brc.degrees:03}", atc=atc, tacan=tacan, tacan_callsign=callsign,