Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi

 

plane AP heading value = 100

 

in the fsuipc log screen show = 07CC (u16) 18204

 

calculated AP heading value = 18204 *360 / 65536 = 99,99755859375

 

How can i get integer value (100) . Should i round this value ?

 

 

 

Posted

Hi

 

plane AP heading value = 100

 

in the fsuipc log screen show = 07CC (u16) 18204

 

calculated AP heading value = 18204 *360 / 65536 = 99,99755859375

 

How can i get integer value (100) . Should i round this value ?

 

The normal method is to round to the nearest integer: i.e. add 0.5 and take the integer part.

 

Pete

Posted

Thank you , Pete.

 

this csharp code is working . Maybe usefull for some one.

 

 

private Offset<UInt16> APHeadingValue= new Offset<UInt16>(0x07CC);

 

Get:

txtApHeadingValue.Text = ((int)((APHeadingValue.Value+0.5)*360/65536)).ToString();

 

Set: "70 degree"

 

APHeadingValue.Value = (70 * 65536 / 360);

 

 

 

 

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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy 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.