Sign in to follow this  
spokes2112

whiskey compass and heading trouble xml

Recommended Posts

Hi,I am working on a whiskey compass where I also can see the preselected heading of the autopilot. My problem is that when the preselected heading is below 0/360 the heading indicating triangle is positioned a long way to the right instead of the left see my picture.So how can solve this problem?Best regardsEugen(A:Autopilot heading lock dir, degrees) (A:Wiskey compass indication degrees,degrees) - dnor%((A:Autopilot heading lock dir, degrees) (A:Wiskey compass indication degrees,degrees) - dnor)%!03d!

Share this post


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

Eugen, Been thinking about this one all day.. Maybe this will help. You would use a non-linearity table where "zero" is in the middle and 335 on the left and 25 on the right. But you would need 2 tables, left and right. You may want the bug to disappear if greater than 25 and less than 335. (A:Autopilot heading lock dir, degrees) (A:Wiskey compass indication degrees, degrees) - dnor s1 335 > l1 359.9999 < &l1(A:Autopilot heading lock dir, degrees) (A:Wiskey compass indication degrees, degrees) - dnor s1 0 > l1 25 < &l1Replace the red Xs with coordinates for left, center and right placements. Also I noticed in your string that your are finding the difference.. Would you not want the actual autopilot selected heading to be displayed ?%((A:Autopilot heading lock dir, degrees) (A:Wiskey compass indication degrees,degrees) - dnor)%!03d!%((A:Autopilot heading lock dir, degrees))%!03d!Maybe this will help, maybe not... Not tested.. Just an idea and may be better ways. Note, the way it looks here on the forum is different since HTML has processed it. On paper the " < " would be " & l t ; " , the " > " would be " & g t ; " and the " & " would be " & a m p ; ". All without the quotes and remove spaces between characters.Regards,Roman[link:www.packers.com]GREEN BAY PACKERS][/i :-ukliam :-beerchug

Share this post


Link to post
Share on other sites

Roman,Many thanks for your dedicated support, I'll have look at it tomorrow while it is past midnight here and it is bedtime, simming late :-) Lets stay in touch Btw I had look at your 737 project screenshots looks really really good, looking forward for the release :-)BrgdsEugen

Share this post


Link to post
Share on other sites

Roman,I was experimenting with the following code below to get it to work. If the value is above 180 then make it negative by subtracting 360but I did'nt manage maybee wrong syntax ? It Always chooses the second if condtion? Wonder why?(A:Autopilot heading lock dir, degrees) (A:Wiskey compass indication degrees,degrees) - dnor s1 180 <= if{ l1 } els { l1 360 - }%((A:Autopilot heading lock dir, degrees) (A:Wiskey compass indication degrees,degrees) - dnor s1 180 <= if{ l1 } els { l1 360 - } )%!03d! Best regardsEugen

Share this post


Link to post
Share on other sites

Eugen, WOW that should work then with one ... I would still use the tag w/ the following:(A:Autopilot heading lock dir, degrees) (A:Wiskey compass indication degrees, degrees) - dnor s1 180 <= if{ l1 } els{ l1 360 - s1 } + l1 -25 > l1 25 < &And the folllowing table: As for your problem with the if{ } els{ } the only thing I see is that you have a space ( a no no ) between the els and the {Regards,Roman[link:www.packers.com]GREEN BAY PACKERS][/i :-ukliam :-beerchug

Share this post


Link to post
Share on other sites

Hi Roman,It was the space so the code below works now :-)However one strange thing that I discovered was that -09 and above becomes 0-9 but -10 is alright see attached picture. A bug? Any idea why it happens?BrgdsEugen(A:Autopilot heading lock dir, degrees) (A:Wiskey compass indication degrees, degrees) - dnor s1 180 <= if{ l1 } els{ l1 360 - s1 } + l1 -25 > l1 25 < &(A:Autopilot heading lock dir, degrees) (A:Wiskey compass indication degrees,degrees) - dnor s1 180 <= if{ l1 } els{ l1 360 - }

Share this post


Link to post
Share on other sites

Roman,How does this "string formatting" work I have just studied the code in other gauges and done try and error I haven't really understood how it works, what is the structure and logic?BrgdsEugen

Share this post


Link to post
Share on other sites

Thanks, That did it! I had missed the zipped files in Arne Bartels xml guide.An other question is there a way to get the actual track (trk) and the flight path angle fpa I saw somewhere that fs 2002 does'nt support this, is there a workaround can it be calculated?BrgdsEugen

Share this post


Link to post
Share on other sites

Hi Eugen, For flight track try (from 747-400 hsi):(A:Velocity world X, m/s) (A:Velocity world Z, m/s) atg2 (A:Magvar, radians) - (A:Plane heading degrees gyro, radians) - For FPA I truly think its possible. I made some design notes for this.. ( Damn if I can find them now ) But.... If you take the groundspeed, feet per second and apply some trig..(vertical speed ft/sec) (groundspeed ft/sec) / tan * = FPAI think that is right... My trig is lacking. But to control FPA is another story as VS is limited by the autopilot to +/- 100 Ft/min ( 1.666 Ft/sec ).. You most likely would have to have your own VS section made to control this as the ground speed changes so does the V/S rate to keep the same angle.. You could though just display current FPA in the VS window using above formula.. ( if correct )Regards,Roman[link:www.packers.com]GREEN BAY PACKERS][/i :-ukliam :-beerchug

Share this post


Link to post
Share on other sites

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