Hello all,
My name is melvin, and i'm learning to programm for about 4 weeks now in C#.net.
I'm using fsuipc and fsuipc client dll 2.0 and VS2010.
I'm am able to build a PFD wich is working perfect:)
i'm also able to read the offset for the autopilot heading value/selector.
Now have have encountert a problem, I want to read the heading and display it in a string in GDI+.
here is what i have tried,
Offset<int> headingview = new Offset<int>(0x05D0);
Offset<short> varmag = new Offset<short>(0x2A0);
double degree =(double)headingview.Value *360d/(65536d*65536d);
double degreetrue =(double) degree-(varmag.Value *360d/65536d);
A.DrawString(degreetrue.ToString("000"),
new Font("Verdana", 13, FontStyle.Bold),
new SolidBrush(Color.LawnGreen),
new Point(200, 310));
it works, only it displays the heading from 000 to 340, the the last 20 degrees are showen from -1 to -20 :s
I have tried every option, uint/int/double but i just cant get it to work like it should :S
Maybe someone can tell me what i'm doing wrong?
Sorry for my english, but it isnt my native language ;)
greetings,
Melvin.