Ing. Nieto Posted March 4, 2020 Report Share Posted March 4, 2020 Hola, estoy utilizando FSUIPC Version 5.153 con Visual Studio 2017 y Prepar3D V4.5, estoy desarrollando un programa en el cual con un boton deseo modificar el el Nav 1 OBS, me enfocare en este, ya que hay varios botones que hacen lo mismo, pero resolviendo este se podrán resolver los otros, el punto es el siguiente, estoy utilizando el offset "0C4E 2 NAV1 OBS setting (degrees, 0–359)", pero surge un error, después de que pasa el valor de 359 sigue sumando, asi tambien, cuando el valor disminuye de 0, se pone otro valor, adjunto foto de este valor, primero para tratar de resolverlo le puse la siguiente condicional if(CRS1.Value >= 360) { CRS1.Value = 1; } if (CRS1.Value <= 0) { CRS1.Value = 359; } y cuando esta en tierra va bien, pero cuando esta en vuelo el avión, el valor sobrepasa el valor de 359, se pone un numero como en el de la imagen y regresa a 1, por lo que no permite que funcione correctamente, habrá alguna solución para este problema, gracias Link to comment Share on other sites More sharing options...
Ing. Nieto Posted March 4, 2020 Author Report Share Posted March 4, 2020 Link to comment Share on other sites More sharing options...
Ing. Nieto Posted March 4, 2020 Author Report Share Posted March 4, 2020 Link to comment Share on other sites More sharing options...
Paul Henty Posted March 4, 2020 Report Share Posted March 4, 2020 That number is very large. I think you have declared the Offset as 'int'. It is only 2 Bytes long so you need to declare it as 'ushort'. Paul 1 Link to comment Share on other sites More sharing options...
Ing. Nieto Posted March 4, 2020 Author Report Share Posted March 4, 2020 Hola Paul, muchas gracias, al hacer eso, queda en un rango de 0 a 65536, pero ya no hace el problema, de antemano gracias Link to comment Share on other sites More sharing options...
Paul Henty Posted March 4, 2020 Report Share Posted March 4, 2020 Offset 0x0C4E is the OBS for Nav1. This returns 0 to 360. I think you are now talking about the autopilot heading at 0x07CC. This is also 2 bytes. But it returns the heading between 0 and 65535. This is allow for decimal heading like 132.2 degrees. You just need to convert the value like this: double crs1Degrees = (double)CRS1.Value / 65536d * 360d; This is explained in the "FSUIPC5 Offsets Status" PDF. Paul Link to comment Share on other sites More sharing options...
Ing. Nieto Posted March 4, 2020 Author Report Share Posted March 4, 2020 Perfecto Paul, muchas gracias, otra pregunta que no encontré, hay alguna manera de hacer este control, Standby Battery, no encontre un offset que pudiera realizar esta tarea, saludos Link to comment Share on other sites More sharing options...
Paul Henty Posted March 5, 2020 Report Share Posted March 5, 2020 Quote hay alguna manera de hacer este control, Standby Battery, Please see my reply in the other thread you made. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now