Skip to content

Commit

Permalink
Add support for OH6A
Browse files Browse the repository at this point in the history
  • Loading branch information
ciribob committed May 3, 2024
1 parent 5604fc4 commit ec40bb1
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 1 deletion.
Binary file added DCS-SR-Client/AudioEffects/Ambient/OH6A.wav
Binary file not shown.
126 changes: 125 additions & 1 deletion Scripts/DCS-SRS/Scripts/DCS-SimpleRadioStandalone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function SR.exporter()

_update.iff = {status=0,mode1=0,mode2=-1,mode3=0,mode4=0,control=1,expansion=false,mic=-1}

--SR.log(_update.unit.."\n\n")
-- SR.log(_update.unit.."\n\n")

local aircraftExporter = SR.exporters[_update.unit]

Expand Down Expand Up @@ -2498,6 +2498,129 @@ function SR.exportRadioOH58D(_data)
return _data
end



function SR.exportRadioOH6A(_data)
_data.capabilities = { dcsPtt = false, dcsIFF = false, dcsRadioSwitch = true, intercomHotMic = true, desc = "" }


_data.radios[1].name = "Intercom"
_data.radios[1].freq = 100.0
_data.radios[1].modulation = 2 --Special intercom modulation
_data.radios[1].volMode = 0

_data.radios[2].name = "AN/ARC-54 VHF FM"
_data.radios[2].freq = SR.getRadioFrequency(15)
_data.radios[2].modulation = SR.getRadioModulation(15)
_data.radios[2].volMode = 0

_data.radios[3].name = "AN/ARC-51 UHF"
_data.radios[3].freq = SR.getRadioFrequency(14)
_data.radios[3].modulation = SR.getRadioModulation(14)
_data.radios[3].volMode = 0


local _seat = SR.lastKnownSeat --get_param_handle("SEAT"):get()
local _hotMic = 0
local _selector = 0
_seat =1
if _seat == 0 then

if SR.getButtonPosition(352) > 0.5 then
_data.radios[1].volume = SR.getRadioVolume(0, 354, { -1.0, 1.0 }, false)
else
_data.radios[1].volume = 0
end

if SR.getButtonPosition(349) > 0.5 then
_data.radios[2].volume = SR.getRadioVolume(0, 354, { -1.0, 1.0 }, false) * SR.getRadioVolume(0, 57, { 0.0, 1.0 }, false)
else
_data.radios[2].volume = 0
end

if SR.getButtonPosition(348) > 0.5 then
_data.radios[3].volume = SR.getRadioVolume(0, 354, { -1.0, 1.0 }, false) *SR.getRadioVolume(0, 51, { 0.0, 1.0 }, false)
else
_data.radios[3].volume = 0
end

-- _hotMic = SR.getSelectorPosition(186, 0.1)
_selector = SR.getSelectorPosition(355, 0.165)

else
if SR.getButtonPosition(344) > 0.5 then
_data.radios[1].volume = SR.getRadioVolume(0, 346, { -1.0, 1.0 }, false)
else
_data.radios[1].volume = 0
end


if SR.getButtonPosition(341) > 0.5 then
_data.radios[2].volume = SR.getRadioVolume(0, 346, { -1.0, 1.0 }, false) * SR.getRadioVolume(0, 57, { 0.0, 1.0 }, false)
else
_data.radios[2].volume = 0
end

if SR.getButtonPosition(340) > 0.5 then
_data.radios[3].volume = SR.getRadioVolume(0, 346, { -1.0, 1.0 }, false) *SR.getRadioVolume(0, 51, { 0.0, 1.0 }, false)
else
_data.radios[3].volume = 0
end

_selector = SR.getSelectorPosition(347, 0.165)

end

if _selector == 2 then
_data.selected = 0
elseif _selector == 3 then
_data.selected = 1
elseif _selector == 4 then
_data.selected = 2
else
_data.selected = -1
end

--guard mode for UHF Radio
local uhfModeKnob = SR.getSelectorPosition(56, 0.33)
if uhfModeKnob == 2 and _data.radios[3].freq > 1000 then
_data.radios[3].secFreq = 243.0 * 1000000
end

--guard mode for UHF Radio
local retran = SR.getSelectorPosition(52, 0.33)

SR.log(retran)
if retran == 2 and _data.radios[2].freq > 1000 then
_data.radios[2].rtMode = 0
_data.radios[2].retransmit = true

_data.radios[3].rtMode = 0
_data.radios[3].retransmit = true
end


if SR.getAmbientVolumeEngine() > 10 then
-- engine on

local _door = SR.getButtonPosition(38)

if _door > 0.2 then
_data.ambient = {vol = 0.35, abType = 'oh6a' }
else
_data.ambient = {vol = 0.2, abType = 'oh6a' }
end

else
-- engine off
_data.ambient = {vol = 0, abType = 'oh6a' }
end

_data.control = 1

return _data
end

function SR.exportRadioKA50(_data)

_data.capabilities = { dcsPtt = false, dcsIFF = false, dcsRadioSwitch = true, intercomHotMic = false, desc = "" }
Expand Down Expand Up @@ -6638,6 +6761,7 @@ SR.exporters["SA342L"] = SR.exportRadioSA342
SR.exporters["SA342Mistral"] = SR.exportRadioSA342
SR.exporters["SA342Minigun"] = SR.exportRadioSA342
SR.exporters["OH58D"] = SR.exportRadioOH58D
SR.exporters["OH-6A"] = SR.exportRadioOH6A
SR.exporters["L-39C"] = SR.exportRadioL39
SR.exporters["L-39ZA"] = SR.exportRadioL39
SR.exporters["F-14B"] = SR.exportRadioF14
Expand Down

0 comments on commit ec40bb1

Please sign in to comment.