-
Notifications
You must be signed in to change notification settings - Fork 117
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
Racked radio speakers #481
base: master
Are you sure you want to change the base?
Changes from all commits
05965fd
df73459
0a8fa26
e5876eb
c03283c
0868bcb
679b8f2
b28f344
e6c0591
7a747ed
a92855e
248b290
f648539
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -40,5 +40,6 @@ HASH_SET(_radioData,"volume",1); | |||||||||||||||||
HASH_SET(_radioData,"currentChannel",0); | ||||||||||||||||||
HASH_SET(_radioData,"radioOn", 1); | ||||||||||||||||||
HASH_SET(_radioData,"pressedButton", -1); | ||||||||||||||||||
HASH_SET(_radioData,"powerSource", "BAT"); | ||||||||||||||||||
HASH_SET(_radioData,"powerSource","BAT"); | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Our macro definition has spaces
Suggested change
|
||||||||||||||||||
HASH_SET(_radioData,"pgm_pa_mode", "ON"); | ||||||||||||||||||
HASH_SET(_radioData,"audioPath","HEADSET"); |
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -41,5 +41,5 @@ for "_i" from 0 to (count _channels)-1 do { | |||||||||||||
HASH_SET(_radioData,"volume",1); | ||||||||||||||
HASH_SET(_radioData,"currentChannel",0); | ||||||||||||||
HASH_SET(_radioData,"radioOn",1); | ||||||||||||||
HASH_SET(_radioData,"audioPath", "TOPAUDIO"); | ||||||||||||||
HASH_SET(_radioData,"audioPath","TOPAUDIO"); | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above:
Suggested change
|
||||||||||||||
HASH_SET(_radioData,"powerSource","BAT"); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,20 @@ | |
* Public: No | ||
*/ | ||
|
||
[0,0,0]; | ||
params ["_radioId", "_event", "_eventData", "_radioData"]; | ||
|
||
private _obj = [_radioId] call EFUNC(sys_radio,getRadioObject); | ||
private _pos = getPosASL _obj; | ||
|
||
private _rackId = [_radioId] call EFUNC(sys_rack,getRackFromRadio); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is all same for all radios, with just 2 cases based on handheld or rack radio. An outside function with arguments for that would probably be a good idea. |
||
if (_rackId isEqualTo "") then { | ||
_pos = [0,0,0]; | ||
} else { | ||
private _vehicle = [_radioId] call EFUNC(sys_rack,getVehicleFromRack); | ||
private _position = [_rackId, _vehicle] call EFUNC(sys_rack,getRackPosition); | ||
if !(_position isEqualTo [0, 0, 0]) then { | ||
_pos = ATLtoASL (_vehicle modelToWorld _position); | ||
}; | ||
}; | ||
|
||
_pos |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,15 +71,16 @@ HASH_SET(_radioData,"radioOn",1); //0 - OFF, 1 - ON | |
HASH_SET(_radioData,"band",_band); //{0,1} | ||
HASH_SET(_radioData,"currentPreset",[ARR_2(_knobPositions,_secondPresetKnobPositions)]); //Array of Presetarrays (KnobPositions) | ||
HASH_SET(_radioData,"currentChannel",_knobPositions); | ||
HASH_SET(_radioData,"powerSource", "BAT"); | ||
HASH_SET(_radioData,"powerSource","BAT"); | ||
HASH_SET(_radioData,"audioPath","HEADSET"); | ||
|
||
//Common Channel Settings | ||
HASH_SET(_radioData,"frequencyTX",_frequencyTx); | ||
HASH_SET(_radioData,"frequencyRX",_frequencyTx); | ||
HASH_SET(_radioData,"power",3500); | ||
HASH_SET(_radioData,"mode","singleChannel"); | ||
HASH_SET(_radioData,"CTCSSTx", 150); | ||
HASH_SET(_radioData,"CTCSSRx", 150); | ||
HASH_SET(_radioData,"CTCSSTx",150); | ||
HASH_SET(_radioData,"CTCSSRx",150); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
HASH_SET(_radioData,"modulation","FM"); | ||
HASH_SET(_radioData,"encryption",0); | ||
HASH_SET(_radioData,"TEK",""); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,6 @@ | |
* Public: No | ||
*/ | ||
|
||
false; | ||
params ["_radioId", "_event", "_eventData", "_radioData"]; | ||
|
||
(HASH_GET(_radioData, "audioPath") == "RACKSPEAKER") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need for outer parentheses. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "script_component.hpp" | ||
/* | ||
* Author: ACRE2Team | ||
* Sets the mounted radio external audio to ON/OFF. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
* | ||
* Arguments: | ||
* 0: Radio Unique ID <STRING> | ||
* 1: External audio on/off <BOOL> | ||
* 1: Rack Unique ID <STRING><OPTIONAL> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* ["ACRE_PRC152_ID_1", true] call acre_sys_rack_fnc_activateRackSpeaker | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_radioId", "_active", ["_rackId",""]]; | ||
|
||
// TODO: For version 2.7. Implement check if rack has an external speaker | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do it!? :D |
||
|
||
[_radioId, "setState", ["audioPath", "RACKSPEAKER"]] call EFUNC(sys_data,dataEvent); |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -13,13 +13,13 @@ | |||||||||||||||||||||
* None | ||||||||||||||||||||||
* | ||||||||||||||||||||||
* Example: | ||||||||||||||||||||||
* ["ACRE_VRC110_ID_1","initializeRack",["ACRE_VRC110_ID_1","Dash",true,["inside"],[["cargo", 1],["ffv", [2]]],false,[],vehicle1],(acre_sys_data_radioData getVariable "ACRE_VRC110_ID_1")] call acre_sys_rack_fnc_initializeRack | ||||||||||||||||||||||
* ["ACRE_VRC110_ID_1","initializeRack",["ACRE_VRC110_ID_1","Dash",true,["inside"],[["cargo", 1],["ffv", [2]]],false,[],[0,0,0],vehicle1],(acre_sys_data_radioData getVariable "ACRE_VRC110_ID_1")] call acre_sys_rack_fnc_initializeRack | ||||||||||||||||||||||
* | ||||||||||||||||||||||
* Public: No | ||||||||||||||||||||||
*/ | ||||||||||||||||||||||
|
||||||||||||||||||||||
params ["_rackId", "", "_eventData", "_rackData"]; | ||||||||||||||||||||||
_eventData params ["_componentName", "_displayName", "_shortName", "_isRadioRemovable", "_allowed", "_disabled", "_mountedRadio", "_defaultComponents", "_intercoms", "_vehicle"]; | ||||||||||||||||||||||
_eventData params ["_componentName", "_displayName", "_shortName", "_isRadioRemovable", "_allowed", "_disabled", "_mountedRadio", "_defaultComponents", "_intercoms", "_rackPosition", "_vehicle"]; | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
||||||||||||||||||||||
HASH_SET(_rackData,"name",_displayName); | ||||||||||||||||||||||
|
@@ -29,6 +29,7 @@ HASH_SET(_rackData,"disabled",_disabled); | |||||||||||||||||||||
HASH_SET(_rackData,"mountedRadio",_mountedRadio); | ||||||||||||||||||||||
HASH_SET(_rackData,"isRadioRemovable",_isRadioRemovable); | ||||||||||||||||||||||
HASH_SET(_rackData,"wiredIntercoms",_intercoms); | ||||||||||||||||||||||
HASH_SET(_rackData,"rackPosition",_rackPosition); | ||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above:
Suggested change
|
||||||||||||||||||||||
HASH_SET(_rackData,"vehicle",_vehicle); | ||||||||||||||||||||||
|
||||||||||||||||||||||
//Only run on server as initializeRack is called globally. | ||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -183,5 +183,11 @@ | |
<Spanish>Dejar de usar todas</Spanish> | ||
<French>Arrêter de tout utiliser</French> | ||
</Key> | ||
<Key ID="STR_ACRE_sys_rack_turnOnSpeaker"> | ||
<English>Turn On Speaker</English> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does maybe |
||
</Key> | ||
<Key ID="STR_ACRE_sys_rack_turnOffSpeaker"> | ||
<English>Turn Off Speaker</English> | ||
</Key> | ||
</Package> | ||
</Project> |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -83,4 +83,4 @@ HASH_SET(_radioData,"channelKnobPosition", 2); // Channel 1 (after on/off option | |||||||||||||||||||
HASH_SET(_radioData,"volumeKnobPosition", 0);// mid-way | ||||||||||||||||||||
HASH_SET(_radioData,"programmingStep", 0); | ||||||||||||||||||||
HASH_SET(_radioData,"lastActiveChannel",0); | ||||||||||||||||||||
HASH_SET(_radioData,"audioPath", "HEADSET"); | ||||||||||||||||||||
HASH_SET(_radioData,"audioPath","HEADSET"); | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QGVAR
?