Jump to content

Stupid speed/autopilot question


PietVDW

Recommended Posts

Hello,

 

Are there in prepar3DV5 - Aerosoft pro A319 some controls to adjust the numbers in the speed/mach selector from the autopilot panel.

Now I do it with the mousewheel- maybe a control by keyboard is possible?

Link to comment
Share on other sites

Hi,

 

If you are aware, how to program in LUA provided by FSUIPC, you can decrease/increase in steps (-10,-1,+1,+10) the speed value by manipulating LVars:

 

-- Inc/Dec IAS
function IncDecIAS (pStep)

	local lIAS = 0
	
	if ipc.readLvar("L:AB_AP_SPDmode_set") == -1 then		-- only if pulled

		if ipc.readLvar("L:AB_AP_SPDMACH") == 0 then
			lIAS = math.floor(ipc.readLvar("L:AB_AP_SPEED_Select"))
		else
			lIAS = math.floor(ipc.readLvar("L:AB_AP_Mach_Select") * 100 + 0.5)
		end	
			
		lIAS = lIAS + pStep

		if ipc.readLvar("L:AB_AP_SPDMACH") == 0 then

			if lIAS < 100 then
				lIAS = 100
			end

			if lIAS >= 399 then
				lIAS = 399
			end
		
		else
		
			if lIAS < 10 then
				lIAS = 10
			end

			if lIAS >= 99 then
				lIAS = 99
			end

		end

		if ipc.readLvar("L:AB_AP_SPDMACH") == 0 then
			ipc.writeLvar("L:AB_AP_SPEED_Select", lIAS)
		else
			ipc.writeLvar("L:AB_AP_Mach_Select", lIAS / 100)
		end
		
	end

end

 

This function can be called via event.button handling. Please understand, that I am not able to provide support, and that you must be aware, what LUA and FSUIPC is about. But it shows you a way, how to handle this.

 

Rgds
Reinhard

 

 

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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. Privacy Policy & Terms of Use