Jump to content

Recommended Posts

Posted (edited)

Hey guys,

I have my CDU in the A-10C Exported to the top right corner of my screen all the time.

Doesn't matter which monitorsetup file i select in options.

I checked to make sure the one i'm using doesn't have the CDU listed.

I have an export.lua which operated as a server for an android app (which has never done this before now) in /savedgames/scripts, which I renamed to Export.lua.bak.

 

This all started when I switched from the monitor setup I had for dual screen, exporting MFCD's and the CDU to a second screen, to the default "stereo" Setup to test a DIY Rift I mocked up using my phone and Kinoni as a test bed.

 

Screen for refence here:

 

qGjDcyE.jpg

 

 

I just can't figure out where It's coming from.

 

Monitor setup code:

 

 

_  = function(p) return p; end;
name = _('Stereo');
Description = 'Stereo render two viewports for left and right eye respectivelly'
Viewports = 
{
    Left = 
    {
         x = 0;
         y = 0;
         width = screen.width * 0.5;
         height = screen.height;
         viewDx = -0.01;
         viewDy = 0;
         aspect = screen.aspect / 2;
	  eye_shift = -0.06;
    },
    Right = 
    {
         x = screen.width * 0.5;
         y = 0;
         width = screen.width * 0.5;
         height = screen.height;
         viewDx = 0.01;
         viewDy = 0;
         aspect = screen.aspect / 2;
	  eye_shift = 0.06;
    }
}

 

 

 

Export.lua Here

 

 

--CDU START--
gExportInterval = 0.067

os.setlocale("ISO-8559-1", "numeric")

function LuaExportStart()
--	default_output_file = io.open(require('lfs').writedir().."Temp\\export.log", "w")
--	default_output_file:write("server start\n")

-- Works once just before mission start.
   -- 2) Setup udp sockets to talk to helios
   package.path  = package.path..";.\\LuaSocket\\?.lua"
   package.cpath = package.cpath..";.\\LuaSocket\\?.dll"

   socket = require("socket")
   
   c = socket.udp()
c:setsockname("*", 0)
c:setoption('broadcast', true)
   c:settimeout(.001) -- set the timeout for reading the socket 
end

function LuaExportBeforeNextFrame()
ProcessInput()
end

function LuaExportAfterNextFrame()	
end

function LuaExportStop()
c:close()
--	if default_output_file then
--		default_output_file:close()
--		default_output_file = nil
--	end
end

function ProcessInput()
   local lInput = c:receive()
   local lCommand, lCommandArgs, lDevice, lArgument, lLastValue

   if lInput then
--    	default_output_file:write(lInput..'\n')
       lCommand = string.sub(lInput,1,1)
      
	if lCommand == "R" then
		ResetChangeValues()
	end

	if (lCommand == "C") then
		lCommandArgs = StrSplit(string.sub(lInput,2),",")
		lDevice = GetDevice(lCommandArgs[1])
		if type(lDevice) == "table" then
			lDevice:performClickableAction(lCommandArgs[2],lCommandArgs[3])	
		end
	end
   end 
end

function LuaExportActivityNextEvent(t)
t = t + gExportInterval
sendCDUData()
return t
end

-- Helper Functions
function StrSplit(str, delim, maxNb)
   -- Eliminate bad cases...
   if string.find(str, delim) == nil then
       return { str }
   end
   if maxNb == nil or maxNb < 1 then
       maxNb = 0    -- No limit
   end
   local result = {}
   local pat = "(.-)" .. delim .. "()"
   local nb = 0
   local lastPos
   for part, pos in string.gfind(str, pat) do
       nb = nb + 1
       result[nb] = part
       lastPos = pos
       if nb == maxNb then break end
   end
   -- Handle the last field
   if nb ~= maxNb then
       result[nb + 1] = string.sub(str, lastPos)
   end
   return result
end



--dofile(require('lfs').writedir().."Scripts\\libCDU.lua")



--////// CDU APP CONFIG //////

function checkPlayerAircraft()
local PlayerPlaneInfo = LoGetObjectById(LoGetPlayerPlaneId());
local playerAircraft
if ( PlayerPlaneInfo ) then
--		default_output_file:write("info1 : "..playerAircraft..'\n')
	if PlayerPlaneInfo.Name == "A-10C" then
--		if playerAircraft then
--			default_output_file:write("info2 : "..playerAircraft..'\n')
--		end
		return 0
	end
end
--	if playerAircraft then
--  		default_output_file:write("info2 : "..playerAircraft..'\n')
--   	end
return 1
end

function sendCDUData()

if checkPlayerAircraft() == 1 then
--	   	default_output_file:write("this plane is not a-10\n")
	return
end
--	   	default_output_file:write("this plane is a-10\n")
getIndicatorData(3)
sendAAP()
sendCDUEcho()
sendCDUMasterCaution()
end

nextCDUEchoTime = 0
function sendCDUEcho()
local curTime = LoGetModelTime()
if curTime >= nextCDUEchoTime then
	nextCDUEchoTime = curTime + 10
	sendCduData("DCSECHO", cduAppHost, cduAppPort)
--		socket.try(c:sendto("DCSECHO", cduAppHost, cduAppPort))
end
end


nextCDUMCTime = 0
nextCDUMVwarn = 0
function sendCDUMasterCaution()
local curTime = LoGetModelTime()
if curTime >= nextCDUMCTime then
	nextCDUMCTime = curTime + 1

	local mwarn = GetDevice(0):get_argument_value(404)
	if nextCDUMVwarn > mwarn or nextCDUMVwarn < mwarn then
		nextCDUMVwarn = mwarn
		sendCduData("404:"..nextCDUMVwarn, cduAppHost, cduAppPort)
--			socket.try(c:sendto("404:"..nextCDUMVwarn, cduAppHost, cduAppPort))
	end
end
end


nextAAPTime = 0
function sendAAP()
local curTime = LoGetModelTime()
if curTime >= nextAAPTime then
	nextAAPTime = curTime + .15
	local mstpt = string.format("%d", string.format("%0.1f", GetDevice(0):get_argument_value(473))*10)
	sendCduData("473:"..mstpt, cduAppHost, cduAppPort)
	local mpage = string.format("%d", string.format("%0.1f", GetDevice(0):get_argument_value(475))*10)
	sendCduData("475:"..mpage, cduAppHost, cduAppPort)
	local cdupw = string.format("%d", GetDevice(0):get_argument_value(476))
	sendCduData("476:"..cdupw, cduAppHost, cduAppPort)
	local egipw = string.format("%d", GetDevice(0):get_argument_value(477))
	sendCduData("477:"..egipw, cduAppHost, cduAppPort)
end
end

nextCDUIndicatorTime = 0
function getIndicatorData(indicator_number)
local pairData = ""
local curTime = LoGetModelTime()
if curTime >= nextCDUIndicatorTime then
	nextCDUIndicatorTime = curTime + .15
	local indicator = list_indication(indicator_number)
	if indicator ~= "" then
		for brace in indicator:gmatch("%b{}") do
			local lines = string.gsub(string.gsub(brace,"[{}]",""),"---+","")
			for data in lines:gmatch("[%w_]+\n[^\n]+") do
				pairData = pairData..string.gsub(data, "\n", "<==>")..'\n'
			end
		end
		sendCduData(pairData, cduAppHost, cduAppPort)
	end
end
end

function sendCduData( message, appIpList, appPort )
if message and appIpList and appPort then
	for appIp in string.gmatch(appIpList, "([0-9]+.[0-9]+.[0-9]+.[0-9]+)") do
		socket.try(c:sendto(message, appIp, appPort))
--	    	default_output_file:write(appIp..":"..appPort..'\n')
	end
end
end;
--////// ANDROID NETWORK CONFIG //////
--multi ip enable example : 192.168.1.128 192.168.1.129 192.168.1.130
cduAppHost = "192.168.1.68"
cduAppPort = 9089

--////// CDU APP CONFIG //////
--////// DCSTAD CONFIG //////
local dcstadlsf=require('lfs');dofile(dcstadlsf.writedir()..'Scripts/dcstad.lua')
local Tacviewlfs=require('lfs');dofile(Tacviewlfs.writedir()..'Scripts/TacviewExportDCS.lua')
dofile(".\\A10VCServer\\Main.lua") --A10VCHook

 

 

 

Any ideas where it might be coming from?

Edited by Wrench
Posted

Im pretty sure that is because you replaced the original indicator luas in order to make a CDU export possible in the first place. Im at work right now so I cant give you the exact file path and name, but it should be in your A10C folder under scripts cockpit instruments or something. Since you apparently use the CDU app for the Ipad, and you don't need to export the DCU on your main screens, you might as well restore the original indicator luas, then the CDU export should be gone.

Posted

The location my good friend Entropy is referring to is:

....DCS World\Mods\aircraft\A-10C\Scripts\CDU\indicator

 

The file name is CDU_init.lua.

 

You can run a DCS repair to re-establish the original CDU_init.lua provided you don't have any other mods installed as they will be removed as well.

 

Cheers

Hans

  • 6 years later...
Posted
On 8/24/2015 at 6:45 PM, Hansolo said:

The location my good friend Entropy is referring to is:

....DCS World\Mods\aircraft\A-10C\Scripts\CDU\indicator

 

The file name is CDU_init.lua.

 

You can run a DCS repair to re-establish the original CDU_init.lua provided you don't have any other mods installed as they will be removed as well.

 

Cheers

Hans

Thanks, it works for my 2.X version. And the path is DCS World/Mods/aircraft/A-10C/Cockpit/Scripts/CDU/indicator/CDU_init.lua

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...