Jump to content
The simFlight Network Forums

Recommended Posts

Posted

This was done just to see if it could be made to work. ( too much coffee , insomnia & boredom also contributed )
For the advanced FSUIPC user, gauge programmer, cockpit builder, lua tweaker etc.., a problem arises, at times, where the aircraft designer has code that constantly fires commands into the sim. 👎👎👎  

When it comes time to do some logging, for instance, to see what control is being fired, on user input, is tough to find in the FSUIPC console window. The [General] "DontLogThese=" entry in the FSUIPC.ini does a fine job of blocking these. 

Of course, you could do a text log of the Events (non-axis controls), open the log and find the offending controls and then build up an entry for  "DontLogThese=".
This lua does it automatically and appends to a text file, appending it so you can have a library of the offending aircraft.
An output example of my testing :

NOTES :
axis pan heading 66504
axis pan pitch 66503
mouse look toggle 66734
misc maddog 70646
---------------------------------------------

Fly The Maddog X MD-82 - North Central N760NC
[General]
DontLogThese=66557,66556,66523,66479,66478,66466,66463,66442,66239,65962,65836,65833,65832,65709,65708,65707,

PMDG DC-6B PMDG House (N6PM | 2017)
[General]
DontLogThese=66818,66659,66508,66073,66060,65786,

P-51D civ 'Providence Permittin'
[General]
DontLogThese=66508,66507,65764,

Lockheed Constellation L049, C69
[General]
DontLogThese=66507,65922,65921,65920,65919,

666 F-16D AK375 F
[General]
DontLogThese=66707,66073,66065,66057,66031,

When needed :
1) Assign a temporary key to run the lua (as you named it)
2) Run it with the aircraft loaded, keeping your hands off of any controls ( axis or other )
3) When its done, it will report so, making, or appending, a file named "NoLogReport.txt" in the modules folder (or wherever FSUIPC is installed)
4) Copy the aircraft's report and paste in to the FSUIPC.ini [General] section, replacing the line if already there. 
5) In the FSUIPC UI, go to the Axis Assignment tab and click on Reload All Assignments. Done, the offending controls are now blocked. 
This was only tested in FSX, I would imagine it would still work from FS9 thru P3Dv4+.
The lua :

-- USER SETTINGS
local startCtrl = 65537 	-- THE STARTING CONTROL NUMBER TO BE SCANNED
local endCtrl = 68309 		-- THE ENDING CONTROL NUMBER TO BE SCANNED
local runTime = 3				-- RUN THE CONTROL RECORDER FOR HOW MANY SECONDS, >= 2 (NOT REALLY LEGIT, THERE IS A "LOT" OF BACKED UP FUNCTION CALLS!)
-- END USER SETTINGS

local cntrlsOut = {}
local doesContain = 0
local acftTitle = ipc.readSTR(0x3D00, 256)
acftTitle = acftTitle:gsub('%z','')
local outString = "\n\n" .. acftTitle .. "\n[General]\nDontLogThese="

function logControl(controlnum, param)
	doesContain = 0
	for _, value in pairs(cntrlsOut) do
		if value == controlnum then
			doesContain = 1
		end
	end	
	if doesContain == 0 then
		table.insert(cntrlsOut, 1, controlnum)
	end
end

function countDown(timer)
	if runTime == 0 then
		file = assert(io.open("NoLogReport.txt","a+"))		
		for i = 1, #cntrlsOut, 1 do		
			outString = outString .. cntrlsOut[i] .. ","			
		end		
		file:write(outString)
		file:close()
		ipc.display("Modules\\NoLogReport.txt was created", 1)		
		ipc.sleep(1000)
		
		-- !!! OPTION, OPEN UP THE REPORT.TXT AND FSUIPC.INI
		-- !!! UNCOMMENT & CHANGE THE PATHS OF YOUR PREFERRED EDITOR AND OUTPUT FILE(S)
				-- handle1, error1 = ext.runif("E:/Notepad++/notepad++.exe","G:/FSX/Modules/NoLogReport.txt")
				-- handle2, error2 = ext.runif("E:/Notepad++/notepad++.exe","G:/FSX/Modules/FSUIPC4.ini")
		-- !!! UNCOMMENT IF THE ABOVE DOES NOT WORK, PROVIDES ERROR DISPLAY
		-- ipc.display(handle1 .. error1 .. "\n" .. handle2 .. error2, 0, 5)
		-- ipc.sleep(5000)

		ipc.exit()
	end
	runTime = runTime - 1
end

for i = startCtrl, endCtrl, 1 do
		event.control(i, "logControl")
end

event.timer(1000, "countDown")

Roman

  • Like 1
Posted (edited)
43 minutes ago, Pete Dowson said:

Got me thinking -- maybe "DontLogThese" should be made Profile Specific? I'll mention it to John.

It should be, and this has been on my list for a while, especially since the arrival of MSFS. I'll probably implement this in FSUIPC7 shortly, then later roll the changes into FSUIPC6.
I may also update FSUIPC5, depending upon user request, but any such change certainly won't make it to FSUIPC4 and so Roman's solution can be used there.

John

Edited by John Dowson
name corrected!
Posted
14 minutes ago, John Dowson said:

so Ramon's solution can be used there.

You translated his name into Spanish! 😉

Roman's Lua appears to be a semi-automatic way of discovering what should be in the DontLogThese parameter, so would actually still be useful after you implement the changes in FSUIPC too.

 

Posted
21 hours ago, Pete Dowson said:

maybe "DontLogThese" should be made Profile Specific?

👍 Just for kicks I even tried it in v4, ofc it didn't work. Good Idea! No worries, even if the proposed feature doesn't make it down to v4.
I can only imagine what you 2 are going through. Get something, or a bunch of things working only to have P3D and/or MSFS getting updated. 
For now I am sticking to FSX until MSFS matures - a lot! I like tinkering, gauge coding etc.. The following quote from FSDeveloper reflect my thoughts  :

Quote

Personally, and with the same arguments, I'm staying away from any addon development for the new MSFS for now.
Whatever an end-user thinks of it as-is now, it should be an addon-developer's worst nightmare.
The way it's being developed (as a continuous 'service' based on the so-called 'agile' way of today's SW-development) makes me very sad; even as a simple user, I gave up on the continuous (and likely) endless stream of patches and hotfixes, introducing new things, solving bugs and with it, introducing new bugs.
Making me feel I'm (at best) an alpha-tester.

-----------------------------------------------------------------------------------------------------------------------

21 hours ago, John Dowson said:

It should be, and this has been on my list for a while, especially since the arrival of MSFS.

I don't have MSFS but at a friends place I looked at some of their panel code and did some monitoring.. WOW! A command flooding mess! Perhaps they have some kind of internals that allow it with better results than the FSX based sims. As you may know, in FSX based sims, door exits, engine select, (both via keyboard) altitudes stuck @ +/- 1000 increments etc..  are all signs of a flooding panel system. Your older .dlls do a fine job in misc settings, for the end user, to allow this flooding to happen and still have a usable sim. 👍

20 hours ago, Pete Dowson said:

You translated his name into Spanish! 😉

No worries! In my extended family we have 2 Romy's (Roman's) & 1 Ray (Ramon).. During family events there is a lot of - "Who are you talking to/about?" 😅 

Roman ( or is it Romy? or Ramon? lol )

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.