mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Control radio/TACAN allocation, set flight radios.
Add central registries for allocating TACAN/radio channels to the Operation. These ensure that each channel is allocated uniquely, and removes the caller's need to think about which frequency to use. The registry allocates frequencies based on the radio it is given, which ensures that the allocated frequency will be compatible with the radio that needs it. A mapping from aircraft to the radio used by that aircraft for intra-flight comms (i.e. the F-16 uses the AN/ARC-222) exists for creating infra-flight channels appropriate for the aircraft. Inter-flight channels are allocated by a generic UHF radio. I've moved the inter-flight radio channels from the VHF to UHF range, since that's the most easily allocated band, and inter-flight will be in the highest demand. Intra-flight radios are now generally not shared. For aircraft where the radio type is not known we will still fall back to the shared channel, but that will stop being the case as we gain more data. Tankers have been moved to the Y TACAN band. Not completely needed, but seems typical for most missions and deconflicts the tankers from any unknown airfields (which always use the X band in DCS).
This commit is contained in:
@@ -33,9 +33,11 @@ from tabulate import tabulate
|
||||
from pydcs.dcs.mission import Mission
|
||||
from pydcs.dcs.terrain.terrain import Airport
|
||||
from pydcs.dcs.unittype import FlyingType
|
||||
from .airfields import AIRFIELD_DATA
|
||||
from .flights.flight import Flight
|
||||
from . import units
|
||||
from .airfields import AIRFIELD_DATA
|
||||
from .airsupportgen import AwacsInfo, TankerInfo
|
||||
from .flights.flight import Flight
|
||||
from .radios import RadioFrequency
|
||||
|
||||
|
||||
class KneeboardPageWriter:
|
||||
@@ -116,23 +118,7 @@ class AirfieldInfo:
|
||||
class CommInfo:
|
||||
"""Communications information for the kneeboard."""
|
||||
name: str
|
||||
freq: str
|
||||
|
||||
|
||||
@dataclass
|
||||
class AwacsInfo:
|
||||
"""AWACS information for the kneeboard."""
|
||||
callsign: str
|
||||
freq: str
|
||||
|
||||
|
||||
@dataclass
|
||||
class TankerInfo:
|
||||
"""Tanker information for the kneeboard."""
|
||||
callsign: str
|
||||
variant: str
|
||||
freq: str
|
||||
tacan: str
|
||||
freq: RadioFrequency
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -153,6 +139,10 @@ class BriefingPage(KneeboardPage):
|
||||
self.awacs = awacs
|
||||
self.tankers = tankers
|
||||
self.jtacs = jtacs
|
||||
if self.flight.intra_flight_channel is not None:
|
||||
self.comms.append(
|
||||
CommInfo("Flight", self.flight.intra_flight_channel)
|
||||
)
|
||||
self.departure = flight.from_cp.airport
|
||||
self.arrival = flight.from_cp.airport
|
||||
self.divert: Optional[Airport] = None
|
||||
@@ -245,7 +235,7 @@ class KneeboardGenerator:
|
||||
self.tankers: List[TankerInfo] = []
|
||||
self.jtacs: List[JtacInfo] = []
|
||||
|
||||
def add_comm(self, name: str, freq: str) -> None:
|
||||
def add_comm(self, name: str, freq: RadioFrequency) -> None:
|
||||
"""Adds communications info to the kneeboard.
|
||||
|
||||
Args:
|
||||
@@ -254,26 +244,21 @@ class KneeboardGenerator:
|
||||
"""
|
||||
self.comms.append(CommInfo(name, freq))
|
||||
|
||||
def add_awacs(self, callsign: str, freq: str) -> None:
|
||||
def add_awacs(self, awacs: AwacsInfo) -> None:
|
||||
"""Adds an AWACS/GCI to the kneeboard.
|
||||
|
||||
Args:
|
||||
callsign: Callsign of the AWACS/GCI.
|
||||
freq: Radio frequency used by the AWACS/GCI.
|
||||
awacs: AWACS information.
|
||||
"""
|
||||
self.awacs.append(AwacsInfo(callsign, freq))
|
||||
self.awacs.append(awacs)
|
||||
|
||||
def add_tanker(self, callsign: str, variant: str, freq: str,
|
||||
tacan: str) -> None:
|
||||
def add_tanker(self, tanker: TankerInfo) -> None:
|
||||
"""Adds a tanker to the kneeboard.
|
||||
|
||||
Args:
|
||||
callsign: Callsign of the tanker.
|
||||
variant: Aircraft type.
|
||||
freq: Radio frequency used by the tanker.
|
||||
tacan: TACAN channel of the tanker.
|
||||
tanker: Tanker information.
|
||||
"""
|
||||
self.tankers.append(TankerInfo(callsign, variant, freq, tacan))
|
||||
self.tankers.append(tanker)
|
||||
|
||||
def add_jtac(self, callsign: str, region: str, code: str) -> None:
|
||||
"""Adds a JTAC to the kneeboard.
|
||||
|
||||
Reference in New Issue
Block a user