Skip to content
This repository has been archived by the owner on Jun 22, 2021. It is now read-only.

Commit

Permalink
Added Icon for Radio Gui
Browse files Browse the repository at this point in the history
Added icon and sorted out exe metadata
  • Loading branch information
Ciaran Fisher committed Aug 28, 2015
1 parent d8b83d2 commit e0a30d0
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 66 deletions.
16 changes: 8 additions & 8 deletions RadioGui/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RadioGui")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyTitle("DCS-SimpleRadio")]
[assembly: AssemblyDescription("Radio Status Panel for DCS-SimpleRadio")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RadioGui")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCompany("Ciribob - GitHub.com/Ciribob")]
[assembly: AssemblyProduct("DCS-SimpleRadio")]
[assembly: AssemblyCopyright("Copyright © 2015 - Ciribob")]
[assembly: AssemblyTrademark("Ciribob - GitHub.com/Ciribob")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
Expand Down Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]
9 changes: 9 additions & 0 deletions RadioGui/RadioGui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>gm338_T2E_icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<StartupObject>RadioGui.App</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
Expand Down Expand Up @@ -128,6 +134,9 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Resource Include="gm338_T2E_icon.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
Binary file added RadioGui/gm338_T2E_icon.ico
Binary file not shown.
105 changes: 47 additions & 58 deletions Scripts/DCS-SimpleRadio/SimpleRadioInit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,6 @@ SR.JSON = JSON
UDPSendSocket = socket.udp()
UDPSendSocket:settimeout(0)

SR.frameCount = 0

--Radio Update Object
--RadioUpdate = {}
--RadioUpdate.__index = RadioUpdate
--
--function RadioUpdate.init(_vhf,_uhf,_fm,_current)
-- local _radio = {}
-- setmetatable(_radio,RadioUpdate)
-- _radio.vhf = _vhf
-- _radio.uhf = _uhf
-- _radio.fm = _fm
-- _radio.current = _current
-- return _radio
--end
--
--function RadioUpdate:sendUpdate()
--
-- local _msg = "VHF:"..self.vhf.."\nUHF:"..self.uhf.."\nFM"..self.fm.."\nCURRENT:"..self.current.."\n"
--
-- socket.try(UDPSendSocket:sendto(_msg, "239.255.50.10", 5050))
--end



-- Prev Export functions.
local _prevExport = {}
_prevExport.LuaExportStart = LuaExportStart
Expand Down Expand Up @@ -157,7 +132,7 @@ LuaExportActivityNextEvent = function(tCurrent)
end

socket.try(UDPSendSocket:sendto(SR.JSON:encode(_update).." \n", "239.255.50.10", 5050))
socket.try(UDPSendSocket:sendto(SR.JSON:encode(_update).." \n", "127.0.0.1", 5056))
-- socket.try(UDPSendSocket:sendto(SR.JSON:encode(_update).." \n", "127.0.0.1", 5056))

else

Expand All @@ -180,7 +155,7 @@ LuaExportActivityNextEvent = function(tCurrent)
}

socket.try(UDPSendSocket:sendto(SR.JSON:encode(_update).." \n", "239.255.50.10", 5050))
socket.try(UDPSendSocket:sendto(SR.JSON:encode(_update).." \n", "127.0.0.1", 5056))
-- socket.try(UDPSendSocket:sendto(SR.JSON:encode(_update).." \n", "127.0.0.1", 5056))

end

Expand All @@ -198,15 +173,15 @@ end
function SR.exportRadioUH1H(_data)

_data.radios[1].name = "AN/ARC-51BX - UHF"
_data.radios[1].frequency = SR.round(SR.getRadioFrequency(22), 5000)
_data.radios[1].frequency = SR.getRadioFrequency(22)
_data.radios[1].modulation = 0

_data.radios[2].name = "AN/ARC-134"
_data.radios[2].frequency = SR.round(SR.getRadioFrequency(20), 5000)
_data.radios[2].frequency = SR.getRadioFrequency(20)
_data.radios[2].modulation = 0

_data.radios[3].name = "AN/ARC-131"
_data.radios[3].frequency = SR.round(SR.getRadioFrequency(23), 5000)
_data.radios[3].frequency = SR.getRadioFrequency(23)
_data.radios[3].modulation = 1

_data.volume = {100, 100, 100};
Expand All @@ -232,32 +207,41 @@ end

function SR.exportRadioKA50(_data)

local _panel = GetDevice(0)

_data.radios[1].name = "R-828"
_data.radios[1].frequency = SR.round(SR.getRadioFrequency(49), 50000)
_data.radios[1].name = "R-800L14 VHF/UHF"
_data.radios[1].frequency = SR.getRadioFrequency(48)
_data.radios[1].modulation = 0

_data.radios[2].name = "R-800L14"
_data.radios[2].frequency = SR.round(SR.getRadioFrequency(48), 5000)
-- Get modulation mode
local switch = _panel:get_argument_value(417)
if SR.nearlyEqual(switch, 0.0, 0.03) then
_data.radios[1].modulation = 1
else
_data.radios[1].modulation = 0
end

_data.radios[2].name = "R-828"
_data.radios[2].frequency = SR.getRadioFrequency(49,50000)
_data.radios[2].modulation = 0

_data.radios[3].name = "N/A"
_data.radios[3].frequency = 1
_data.radios[3].modulation = 1
_data.radios[3].modulation = 0

_data.volume = {100, 100, 100};

local _panel = GetDevice(0)

-- Get selected radio from SPU-9

local switch = _panel:get_argument_value(428)

if SR.nearlyEqual(switch, 0.0, 0.03) then
_data.selected = 1
elseif SR.nearlyEqual(switch, 0.1, 0.03) then
_data.selected = 0
elseif SR.nearlyEqual(switch, 0.1, 0.03) then
_data.selected = 1
else
_data.selected = 0
_data.selected = 1
end

return _data
Expand All @@ -266,17 +250,16 @@ end

function SR.exportRadioMI8(_data)


_data.radios[1].name = "R-828"
_data.radios[1].frequency = SR.round(SR.getRadioFrequency(39), 50000)
_data.radios[1].name = "R-863"
_data.radios[1].frequency = SR.getRadioFrequency(38)
_data.radios[1].modulation = 0

_data.radios[2].name = "R-863"
_data.radios[2].frequency = SR.round(SR.getRadioFrequency(38), 5000)
_data.radios[2].name = "R-828"
_data.radios[2].frequency = SR.getRadioFrequency(39,50000)
_data.radios[2].modulation = 0

_data.radios[3].name = "JADRO-1A"
_data.radios[3].frequency = SR.round(SR.getRadioFrequency(37), 5000)
_data.radios[3].frequency = SR.getRadioFrequency(37)
_data.radios[3].modulation = 0

_data.volume = {100, 100, 100};
Expand All @@ -287,11 +270,11 @@ function SR.exportRadioMI8(_data)
local switch = _panel:get_argument_value(550)

if SR.nearlyEqual(switch, 0.0, 0.03) then
_data.selected = 1
_data.selected = 0
elseif SR.nearlyEqual(switch, 0.1, 0.03) then
_data.selected = 2
elseif SR.nearlyEqual(switch, 0.2, 0.03) then
_data.selected = 0
_data.selected = 1
else
_data.selected = 0
end
Expand All @@ -306,15 +289,15 @@ function SR.exportRadioA10C(_data)


_data.radios[1].name = "AN/ARC-186(V)"
_data.radios[1].frequency = SR.round(SR.getRadioFrequency(55), 5000)
_data.radios[1].frequency = SR.getRadioFrequency(55)
_data.radios[1].modulation = 0

_data.radios[2].name = "AN/ARC-164"
_data.radios[2].frequency = SR.round(SR.getRadioFrequency(54), 5000)
_data.radios[2].frequency = SR.getRadioFrequency(54)
_data.radios[2].modulation = 0

_data.radios[3].name = "FM"
_data.radios[3].frequency = SR.round(SR.getRadioFrequency(56), 5000)
_data.radios[3].frequency = SR.getRadioFrequency(56)
_data.radios[3].modulation = 1

_data.volume = {100, 100, 100};
Expand Down Expand Up @@ -343,7 +326,7 @@ end
function SR.exportRadioF86Sabre(_data)

_data.radios[1].name = "AN/ARC-27"
_data.radios[1].frequency = SR.round(SR.getRadioFrequency(26), 5000)
_data.radios[1].frequency = SR.getRadioFrequency(26)
_data.radios[1].modulation = 0

_data.radios[2].name = "N/A"
Expand All @@ -364,7 +347,7 @@ end
function SR.exportRadioMIG15(_data)

_data.radios[1].name = "RSI-6K"
_data.radios[1].frequency = SR.round(SR.getRadioFrequency(30), 5000)
_data.radios[1].frequency = SR.getRadioFrequency(30)
_data.radios[1].modulation = 0

_data.radios[2].name = "N/A"
Expand All @@ -387,7 +370,7 @@ end
function SR.exportRadioMIG21(_data)

_data.radios[1].name = "R-828"
_data.radios[1].frequency = SR.round(SR.getRadioFrequency(22), 5000)
_data.radios[1].frequency = SR.getRadioFrequency(22)
_data.radios[1].modulation = 0

_data.radios[2].name = "N/A"
Expand All @@ -408,7 +391,7 @@ end
function SR.exportRadioP51(_data)

_data.radios[1].name = "SCR522A"
_data.radios[1].frequency = SR.round(SR.getRadioFrequency(24), 5000)
_data.radios[1].frequency = SR.getRadioFrequency(24)
_data.radios[1].modulation = 0

_data.radios[2].name = "N/A"
Expand All @@ -429,7 +412,7 @@ end
function SR.exportRadioFW190(_data)

_data.radios[1].name = "FuG 16ZY"
_data.radios[1].frequency = SR.round(SR.getRadioFrequency(15), 5000)
_data.radios[1].frequency = SR.getRadioFrequency(15)
_data.radios[1].modulation = 0

_data.radios[2].name = "N/A"
Expand All @@ -450,7 +433,7 @@ end
function SR.exportRadioBF109(_data)

_data.radios[1].name = "FuG 16ZY"
_data.radios[1].frequency = SR.round(SR.getRadioFrequency(14), 5000)
_data.radios[1].frequency = SR.getRadioFrequency(14)
_data.radios[1].modulation = 0

_data.radios[2].name = "N/A"
Expand Down Expand Up @@ -479,12 +462,18 @@ function LuaExportBeforeNextFrame()

end

function SR.getRadioFrequency(_deviceId)
function SR.getRadioFrequency(_deviceId, _roundTo)
local _device = GetDevice(_deviceId)

if not _roundTo then
_roundTo = 5000
end


if _device then
if _device:is_on() then
return _device:get_frequency()
-- round as the numbers arent exact
return SR.round(_device:get_frequency(),_roundTo)
end
end
return 1
Expand Down

0 comments on commit e0a30d0

Please sign in to comment.