Support for the AH-64D radios

- Support for the AH-64D radios
- Mention missing Radio preset support for AH-64D
This commit is contained in:
RndName
2022-03-23 17:16:24 +01:00
committed by GitHub
parent 4014a4e250
commit 437fdd6d12
4 changed files with 37 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ from game.data.units import UnitClass
from game.dcs.unitproperty import UnitProperty
from game.dcs.unittype import UnitType
from game.radio.channels import (
ApacheChannelNamer,
ChannelNamer,
CommonRadioChannelAllocator,
FarmerRadioChannelAllocator,
@@ -100,6 +101,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."""