Add the Maps.lua file to find the map.

Change UDP listener and sender timeout.

Optimize export stop send values.
This commit is contained in:
mcmicha
2017-02-15 23:23:15 +01:00
parent ac522ec636
commit 7b2193e753
+7 -4
View File
@@ -22,6 +22,7 @@ ExportScript.LastDataDAC = {}
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\Config.lua]]) dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\Config.lua]])
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\Tools.lua]]) dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\Tools.lua]])
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\genericRadio.lua]]) dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\genericRadio.lua]])
dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\lib\Maps.lua]])
for i = 1, #ExportScript.Config.DAC, 1 do for i = 1, #ExportScript.Config.DAC, 1 do
ExportScript.PacketSizeDAC[i] = 0 ExportScript.PacketSizeDAC[i] = 0
@@ -54,14 +55,12 @@ function LuaExportStart()
ExportScript.UDPsender = ExportScript.socket.udp() ExportScript.UDPsender = ExportScript.socket.udp()
ExportScript.UDPsender:setsockname("*", 0) ExportScript.UDPsender:setsockname("*", 0)
ExportScript.UDPsender:setoption('broadcast', true) ExportScript.UDPsender:settimeout(.004) -- set the timeout for reading the socket; 250 fps
ExportScript.UDPsender:settimeout(.001) -- set the timeout for reading the socket
if ExportScript.Config.Listener then if ExportScript.Config.Listener then
ExportScript.UDPListener = ExportScript.socket.udp() ExportScript.UDPListener = ExportScript.socket.udp()
ExportScript.UDPListener:setsockname("*", ExportScript.Config.ListenerPort) ExportScript.UDPListener:setsockname("*", ExportScript.Config.ListenerPort)
ExportScript.UDPListener:setoption('broadcast', true) ExportScript.UDPListener:settimeout(.004) -- set the timeout for reading the socket; 250 fps
ExportScript.UDPListener:settimeout(.001) -- set the timeout for reading the socket
end end
--local lrename1, lrename2 = os.rename(ExportScript.Config.LogPath, ExportScript.Config.LogPath..".old") --local lrename1, lrename2 = os.rename(ExportScript.Config.LogPath, ExportScript.Config.LogPath..".old")
@@ -87,13 +86,17 @@ end
function LuaExportStop() function LuaExportStop()
-- Works once just after mission stop. -- Works once just after mission stop.
if ExportScript.Config.DACExport then
ExportScript.Tools.SendDataDAC("DAC", "stop") ExportScript.Tools.SendDataDAC("DAC", "stop")
for i=1, #ExportScript.Config.DAC, 1 do for i=1, #ExportScript.Config.DAC, 1 do
ExportScript.Tools.FlushDataDAC(i) ExportScript.Tools.FlushDataDAC(i)
end end
end
if ExportScript.Config.IkarusExport then
ExportScript.Tools.SendData("Ikarus", "stop") ExportScript.Tools.SendData("Ikarus", "stop")
ExportScript.Tools.FlushData() ExportScript.Tools.FlushData()
end
ExportScript.UDPsender:close() ExportScript.UDPsender:close()
if ExportScript.Config.Listener then if ExportScript.Config.Listener then