Sign in to follow this  
Guest Eugen

challenging k-event

Recommended Posts

Hi,I am working with my autopilot and logic behind it is quite complex :-)The autopilot has two ap buttons ap1 and ap2.The are a number of rules directing if posible to click and the actions taken.If you are on ground only one autopilot can be engaged if one engine is running and only one engine. However you can also toggle between ap1 and ap2.If you are airborn you can toggle between ap1 and ap2. The only case when both ap1 and ap2 can be engaged at the same time is when approach is active.The code below is quite complex and I was thinking of adding as well three hold events. The code only deals with the ap1 and ap2 lights Could this be done in a simpler way?The code for ap1 is not working for engaging when ap1 or ap2 are not active and trying to engage ap1.Any suggestions ?BrgdsEugen(A:SIM ON GROUND,bool) if{ (L:ENG Mode, bool) if{ (L:AP1, bool) if{ 0 (>L:AP1, bool) } els{ (L:AP2, bool) if{ 0 (>L:AP2, bool) 1 (>L:AP1, bool) } els{ 1 (>L:AP1, bool } } els{ } } els{ (L:AP1, bool) if{ 0 (>L:AP1, bool) } els{ (L:AP2, bool) if{(A:Autopilot approach hold, bool) if{ 1 (>L:AP1, bool) } els{ 0 (>L:AP2, bool) 1 (>L:AP1, bool) } } els{ 1 (>L:AP1, bool) } } }

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

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
Sign in to follow this