Hi Guys,
I've been having a hard time recently with pulling and adapting some code from ADNSS's Generic Wet Compass. I am currently attempting to replicate the idea onto a Sperry A/P system for the DC3 (among others). I've made all the PNG files with Skinman and have loaded them up in AM. Here is where I am rather stuck and would appreciate some help. The following is ADNSS's Wet Compass Code:
"move(img_comp_drum, -497 + hdg * 501 / 360, nil, nil, nil)"
I can infer that the -497 is the starting position of the PNG, but does anyone know where the 501 and 360 are coming from.
Thanks for your help in advance guys,
Cheers
(PS, A little preview)
Wet Compass Help
Re: Wet Compass Help
Hi and welcome to the forum,
I haven’t got the instrument in front of me but this is pretty straight forward and common place code you may find in an AM instrument. The 501 is the number of pixels the image will move from one end to the other end of its scale. The 360 is simply the full revolution of a compass in degrees. So as an example when the heading is at 180 it moves 180/360 or 1/2 of the 501 pixels.
I hope this helps.
Tony
I haven’t got the instrument in front of me but this is pretty straight forward and common place code you may find in an AM instrument. The 501 is the number of pixels the image will move from one end to the other end of its scale. The 360 is simply the full revolution of a compass in degrees. So as an example when the heading is at 180 it moves 180/360 or 1/2 of the 501 pixels.
I hope this helps.
Tony
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
-
- Posts: 2
- Joined: Sun Jan 31, 2021 1:46 am
Re: Wet Compass Help
Hi Tony,
Thank you for your prompt reply. Yeah I was thinking there would be a simple explanation for it! So with my Compass, the image is 1000 pixels long, with the midpoint being 500px. I guess I will just have to plug the numbers in and try it out!
Thank you again,
Joshua
Thank you for your prompt reply. Yeah I was thinking there would be a simple explanation for it! So with my Compass, the image is 1000 pixels long, with the midpoint being 500px. I guess I will just have to plug the numbers in and try it out!
Thank you again,
Joshua