Only assign TACAN to compatible tankers

This commit is contained in:
Raffson 2023-09-17 14:12:56 +02:00
parent bd3205a442
commit 59871ac36c
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
5 changed files with 9 additions and 9 deletions

View File

@ -201,7 +201,8 @@ class FlightGroupConfigurator:
elif isinstance(
self.flight.flight_plan, TheaterRefuelingFlightPlan
) or isinstance(self.flight.flight_plan, PackageRefuelingFlightPlan):
if self.flight.tacan is None:
tacan = self.flight.tacan
if tacan is None and self.flight.squadron.aircraft.dcs_unit_type.tacan:
tacan = self.tacan_registry.alloc_for_band(
TacanBand.Y, TacanUsage.AirToAir
)

View File

@ -68,9 +68,9 @@ class RaceTrackBuilder(PydcsWaypointBuilder):
def configure_refueling_actions(self, waypoint: MovingPoint) -> None:
waypoint.add_task(Tanker())
if self.flight.unit_type.dcs_unit_type.tacan:
tanker_info = self.mission_data.tankers[-1]
tacan = tanker_info.tacan
tanker_info = self.mission_data.tankers[-1]
tacan = tanker_info.tacan
if self.flight.unit_type.dcs_unit_type.tacan and tacan:
if self.flight.tcn_name is None:
cs = tanker_info.callsign[:-2]
csn = tanker_info.callsign[-1]

View File

@ -602,7 +602,7 @@ class SupportPage(KneeboardPage):
tanker.callsign,
"Tanker",
KneeboardPageWriter.wrap_line(tanker.variant, 21),
str(tanker.tacan),
str(tanker.tacan) if tanker.tacan else "N/A",
self.format_frequency(tanker.freq),
"TOT: " + tot + "\n" + "TOS: " + tos,
]

View File

@ -71,9 +71,8 @@ class LuaGenerator:
tanker_item.add_key_value("callsign", tanker.callsign)
tanker_item.add_key_value("variant", tanker.variant)
tanker_item.add_key_value("radio", str(tanker.freq.mhz))
tanker_item.add_key_value(
"tacan", str(tanker.tacan.number) + tanker.tacan.band.name
)
if tanker.tacan:
tanker_item.add_key_value("tacan", str(tanker.tacan))
awacs_object = lua_data.add_item("AWACs")
for awacs in self.mission_data.awacs:

View File

@ -42,7 +42,7 @@ class TankerInfo(GroupInfo):
"""Tanker information for the kneeboard."""
variant: str
tacan: TacanChannel
tacan: Optional[TacanChannel]
start_time: timedelta
end_time: timedelta