Support for the AH-64D radios

- Support for the AH-64D radios
- Mention missing Radio preset support for AH-64D

cherry-pick from 437fdd6d1246ce6dd0bfb20daa5b0a7614b25d00
This commit is contained in:
RndName 2022-03-23 17:16:24 +01:00
parent c93695ac36
commit 3d5f94db1f
No known key found for this signature in database
GPG Key ID: 5EF516FD9537F7C0
3 changed files with 36 additions and 0 deletions

View File

@ -14,6 +14,7 @@ from dcs.unittype import FlyingType
from game.dcs.unittype import UnitType
from game.radio.channels import (
ApacheChannelNamer,
ChannelNamer,
RadioChannelAllocator,
CommonRadioChannelAllocator,
@ -95,6 +96,7 @@ class RadioConfig:
"tomcat": TomcatChannelNamer,
"viggen": ViggenChannelNamer,
"viper": ViperChannelNamer,
"apache": ApacheChannelNamer,
}[config.get("namer", "default")]

View File

@ -258,6 +258,27 @@ class MirageChannelNamer(ChannelNamer):
return "mirage"
class ApacheChannelNamer(ChannelNamer):
"""Channel namer for the AH-64D Apache"""
@staticmethod
def channel_name(radio_id: int, channel_id: int) -> str:
# From the manual: Radio identifier (“VHF” for ARC-186, “UHF” for ARC-164,
# “FM1” for first ARC-201D, “FM2” for second ARC-201D, or “HF” for ARC-220).
radio_name = [
"VHF", # ARC-186
"UHF", # ARC-164
"FM1", # first ARC-201D
"FM2", # second ARC-201D
"HF", # ARC-220
][radio_id - 1]
return f"{radio_name} Ch {channel_id}"
@classmethod
def name(cls) -> str:
return "apache"
class TomcatChannelNamer(ChannelNamer):
"""Channel namer for the F-14."""

View File

@ -16,3 +16,16 @@ price: 20
role: Attack
variants:
AH-64D Apache Longbow: {}
radios:
# DCS uses the 2nd Radio AN/ARC-164 (UHF) as the main intra flight for the Apache
# so we use this Radio for Intra and Inter Flight for now
# The radio frequencies set in the mission editor are in the current state of Early
# access not used for radio presets. Only the flight frequency is used. Any other
# frequency has to be entered manually atm.
intra_flight: AN/ARC-164
inter_flight: AN/ARC-164
channels:
type: common
namer: apache
intra_flight_radio_index: 2
inter_flight_radio_index: 2