Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Radios - Add a separate "signalModelLR" setting for "Long Range" radios #1272

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions addons/sys_signal/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,25 @@ if (hasInterface) then {
// CBA Settings
#include "initSettings.sqf"

DGVAR(lrAntennas) = []; // array of antenna classname segments that count as long-ranged, i.e: "ACRE_123CM_VHF_TNC" should be "123CM" in the array.
if !(GVAR(signalModel) isEqualTo GVAR(signalModelLR)) then { // start building the array of antenna classname segments based on the current ACRE Signal CBA settings
if (GVAR(radiopacksLR)) then {
GVAR(lrAntennas) append ["SEM70", "AT271", "123CM"];
};

if (GVAR(racksLR)) then {
GVAR(lrAntennas) append ["270CM", "FA80", "AS1729"];
};

if (GVAR(groundSpikeLR) != 0) then {
if (GVAR(groundSpikeLR) == 1) exitWith { // Only GSA with Mast is long-ranged
GVAR(lrAntennas) append ["643CM"];
};
if (GVAR(groundSpikeLR) == 2) exitWith { // Both GSA with and without Masts are long-ranged
GVAR(lrAntennas) append ["243CM", "643CM"];
};
};
INFO_1("Antennas that use signalModelLR: %1", GVAR(lrAntennas));
};

ADDON = true;
18 changes: 13 additions & 5 deletions addons/sys_signal/fnc_getSignalCore.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,24 @@ if (_count == 0) then {
private _rxAntennas = [_receiverClass] call EFUNC(sys_components,findAntenna);
private _txAntennas = [_transmitterClass] call EFUNC(sys_components,findAntenna);

private _model = GVAR(signalModel); // TODO: Change models on the fly if compatible (underwater, better frequency matching)

// Make sure ITWOM is not used for the moment
if (_model > SIGNAL_MODEL_ITWOM || {_model < SIGNAL_MODEL_CASUAL}) then {
_model = SIGNAL_MODEL_LOS_MULTIPATH; // Default to LOS Multipath if the model is out of range
GVAR(signalModel) = _model; // And make sure we do not use an invalid mode next time
};

{
private _txAntenna = _x;
{
private _rxAntenna = _x;
private _model = GVAR(signalModel); // TODO: Change models on the fly if compatible (underwater, better frequency matching)

// Make sure ITWOM is not used for the moment
if (_model > SIGNAL_MODEL_ITWOM || {_model < SIGNAL_MODEL_CASUAL}) then {
_model = SIGNAL_MODEL_LOS_MULTIPATH; // Default to LOS Multipath if the model is out of range
GVAR(signalModel) = _model; // And make sure we do not use an invalid mode next time
// IF the transmitter is using a LR antenna, use signalModelLR
private _txAntennaName = [_txAntenna select 0, "_"] call BIS_fnc_splitString select 1;

if (_txAntennaName in GVAR(lrAntennas)) then {
_model = GVAR(signalModelLR);
};

_count = _count + 1;
Expand Down
53 changes: 53 additions & 0 deletions addons/sys_signal/initSettings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,56 @@
INFO_1("Using radio propagation model: %1",_signalModel);
}
] call CBA_fnc_addSetting;

// Signal model for Backpack Radios
[
QGVAR(signalModelLR),
"LIST",
localize LSTRING(signalModelLR_displayName),
"ACRE2",
[
[SIGNAL_ENUMS],
[SIGNAL_NAMES],
SIGNAL_MODEL_LOS_MULTIPATH // Default
],
true,
{
params ["_value"];
private _signalModelLR = [SIGNAL_NAMES] select _value;
INFO_1("Using Long-Range radio propagation model: %1",_signalModelLR);
}
] call CBA_fnc_addSetting;

// Do backpack radios use signalModelLR
[
QGVAR(radiopacksLR),
"CHECKBOX",
localize LSTRING(radiopacksLR_displayName),
"ACRE2",
true,
true
] call CBA_fnc_addSetting;

// Do vehicle racks use signalModelLR
[
QGVAR(racksLR),
"CHECKBOX",
localize LSTRING(racksLR_displayName),
"ACRE2",
true,
true
] call CBA_fnc_addSetting;

// Does the ground spike antenna use signalModelLR
[
QGVAR(groundSpikeLR),
"LIST",
localize LSTRING(groundSpikeLR_displayName),
"ACRE2",
[
[0, 1, 2],
["None", "Only GSA with Mast", "Both"],
1 // Default
],
true
] call CBA_fnc_addSetting;
28 changes: 28 additions & 0 deletions addons/sys_signal/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,33 @@
<Portuguese>Modelo de propagação de sinal</Portuguese>
<Turkish>Sinyal İletim Modeli</Turkish>
</Key>
<Key ID="STR_ACRE_sys_signal_signalModelLR_displayName">
<English>Signal Propagation Model for Long-Range Radios</English>
<Spanish>Modelo de propagación de señal para radios de largo alcance</Spanish>
<Japanese>信号伝搬モデル</Japanese>
<Chinese>訊號傳遞模型</Chinese>
<German>Signalausbreitungsmodell für Langstreckenfunkgeräte</German>
<Italian>Modello di propagazione del segnale per radio a lunga portata</Italian>
<Russian>Модель распространения сигнала для радиостанций дальнего действия</Russian>
<French>Modèle de propagation des ondes pour les radios longue portée</French>
<Chinesesimp>讯号传递模型</Chinesesimp>
<Portuguese>Modelo de propagação de sinal para rádios de longo alcance</Portuguese>
<Turkish>Uzun menzilli telsizler için sinyal yayılma modeli</Turkish>
</Key>
<Key ID="STR_ACRE_sys_signal_radiopacksLR_displayName">
<English>Should radiopacks count as Long-Ranged</English>
<German>Rucksackfunkgeräte sind langstreckentauglich</German>
<Italian>Radio da zaino sono di lunga portata</Italian>
</Key>
<Key ID="STR_ACRE_sys_signal_racksLR_displayName">
<English>Should Vehicle Racks count as Long-Ranged</English>
<German>Fahrzeugantennen sind langstreckentauglich</German>
<Italian>Racks sui veicoli sono di lunga portata</Italian>
</Key>
<Key ID="STR_ACRE_sys_signal_groundSpikeLR_displayName">
<English>Should Ground Spikes count as Long-Ranged</English>
<German>Bodenbefestigte Antennen sind langstreckentauglich</German>
<Italian>Antenne piazzabili sono di lunga portata</Italian>
</Key>
</Package>
</Project>