Tomcat and M2000 radios support

This commit is contained in:
Khopa 2020-09-06 15:43:44 +02:00
parent 14fe68eb54
commit 98d75bc721
3 changed files with 34 additions and 7 deletions

View File

@ -326,7 +326,7 @@ class Operation:
last_channel = flight.num_radio_channels(radio_id)
channel_alloc = iter(range(first_channel, last_channel + 1))
flight.assign_channel(radio_id, next(channel_alloc),flight.departure.atc)
flight.assign_channel(radio_id, next(channel_alloc), flight.departure.atc)
# TODO: If there ever are multiple AWACS, limit to mission relevant.
for awacs in self.airsupportgen.air_support.awacs:

View File

@ -49,8 +49,8 @@ UHF_FALLBACK_CHANNEL = MHz(251)
class AircraftData:
"""Additional aircraft data not exposed by pydcs."""
#: The type of radio used for intra-flight communications.
intra_flight_radio: Radio
#: The type of radios used by this plane
radios: List[Radio]
#: Index of the radio used for intra-flight communications. Matches the
#: index of the panel_radio field of the pydcs.dcs.planes object.
@ -60,25 +60,33 @@ class AircraftData:
#: index of the panel_radio field of the pydcs.dcs.planes object.
intra_flight_radio_index: Optional[int]
@property
def intra_flight_radio(self):
return self.radios[self.intra_flight_radio_index-1]
@property
def inter_flight_radio(self):
return self.radios[self.inter_flight_radio_index-1]
# Indexed by the id field of the pydcs PlaneType.
AIRCRAFT_DATA: Dict[str, AircraftData] = {
"A-10C": AircraftData(
get_radio("AN/ARC-186(V) AM"),
[get_radio("AN/ARC-186(V) AM")],
# The A-10's radio works differently than most aircraft. Doesn't seem to
# be a way to set these from the mission editor, let alone pydcs.
inter_flight_radio_index=None,
intra_flight_radio_index=None
),
"F-16C_50": AircraftData(
get_radio("AN/ARC-222"),
[get_radio("AN/ARC-164"), get_radio("AN/ARC-222")],
# COM2 is the AN/ARC-222, which is the VHF radio we want to use for
# intra-flight communication to leave COM1 open for UHF inter-flight.
inter_flight_radio_index=1,
intra_flight_radio_index=2
),
"FA-18C_hornet": AircraftData(
get_radio("AN/ARC-210"),
[get_radio("AN/ARC-210"), get_radio("AN/ARC-210")],
# DCS will clobber channel 1 of the first radio compatible with the
# flight's assigned frequency. Since the F/A-18's two radios are both
# AN/ARC-210s, radio 1 will be compatible regardless of which frequency
@ -86,6 +94,18 @@ AIRCRAFT_DATA: Dict[str, AircraftData] = {
inter_flight_radio_index=2,
intra_flight_radio_index=1
),
"M-2000C": AircraftData(
[get_radio("TRT ERA 7000 V/UHF"), get_radio("TRT ERA 7200 UHF")],
inter_flight_radio_index=1,
intra_flight_radio_index=2
),
"F-14B": AircraftData(
[get_radio("AN/ARC-159"), get_radio("AN/ARC-182")],
inter_flight_radio_index=1,
intra_flight_radio_index=2
)
}

View File

@ -104,7 +104,14 @@ RADIOS: List[Radio] = [
# Note : The M2000C V/UHF radio has a gap between 149.970 and 225.000Mhz
Radio("TRT ERA 7000 V/UHF", MHz(118), MHz(400), step=MHz(1)),
Radio("TRT ERA 7200 UHF", MHz(225), MHz(400), step=MHz(1))
Radio("TRT ERA 7200 UHF", MHz(225), MHz(400), step=MHz(1)),
# Tomcat radios
# # https://www.heatblur.se/F-14Manual/general.html#an-arc-159-uhf-1-radio
Radio("AN/ARC-159", MHz(225), MHz(399, 975), step=MHz(1)),
# AN/ARC-182, can operate : 30 to 88, 108 to 156, 156 to 174, and 225 to 399.975 MHz
# https://www.heatblur.se/F-14Manual/general.html#an-arc-182-v-uhf-2-radio
Radio("AN/ARC-182", MHz(108), MHz(399, 975), step=MHz(1))
]