|
FOROS PROFESIONALES WINDEV, WEBDEV y WINDEV Mobile |
| | | | | |
| [WD22] DotNET object declarion with a datatype |
| Iniciado por guest, 30,mar. 2018 16:16 - 2 respuestas |
| |
| | | |
|
| |
| Publicado el 30,marzo 2018 - 16:16 |
I'm searching for a way to connect an arduino to FSUIPC, a tool for flightsimulator software.
An other developer created an dotnet solution for this incl some examples writen in VB and C#. This and the great movies from Fabrice Harari give me a jumpstart but 1 'little' syntax problem i can't solve.
With totaly no knowledge of C# and VB i have to ask for help.
The example code in C# i want transfer to WD is : private Offset< uint > airspeed = new Offset< uint >(0x02BC); // 4-byte offset - Unsigned integer private Offset< int > verticalSpeed = new Offset< int >(0x02C8); // 4-byte offset - Signed integer private Offset< Double > compass = new Offset< double >(0x02CC); // 8 byte offset - double (FLOAT64) private Offset< ushort > onGround = new Offset< ushort >(0x0366); // 2-byte offset - Unsigned short private Offset< string > aircraftType = new Offset< string >(0x3160, 24); // 24 byte offset - String The declaration of an object with a < DataType > gives me headache, so if someone can help me with this, is much appreaciated.
ps: i Added extra spaces around the < DataType > because without, the forum delete them. |
| |
| |
| | | |
|
| | |
| |
| Publicado el 03,abril 2018 - 16:05 |
Hi Theo,
Looks you're trying to do something like this: http://www.flightsim.com/vbfs/content.php…
From what I understand (after a 2 minute reading) the FSUIPC provides a stream of data with tons of variables in it. The offsets define the addresses within this stream where a specific value can be found.
Not sure how to define the Offset type in WD but I guess it is a native variable (class) specific to the FSUIPC or FSX library. Have you included these DotNet libraries in your project? That way you would have access to all the objects within the library (if they aren't too complex causing WD to crash) out of WD.
Good luck !
Peter Holemans |
| |
| |
| | | |
|
| | |
| |
| Publicado el 04,abril 2018 - 12:19 |
Hi Peter,
Thanks for your reply, Your link is a good example. I needed more than 2 minuts to understand a bit 
I have the DotNet included in my project and can connect to FSUIPC using FSUIPCConnection.Open(); , and as example i request DLL version and receive it.
It's no option to receive all the offsets (if it's possible) every time i need just a few. Some will change once or twice during a flight (Gear Up/Down) and some will change every 1/100 sec (Location, heading )
I still hope someone can translate : private Offset< int> airspeed = new Offset< int>(0x02BC); // Basic integer read example private Offset< string> aircraftType = new Offset< string>("AircraftInfo", 0x3160, 24); // Aircraft type private Offset< int> engineType = new Offset< int>(0x0609); // Offset for engine type private Offset< short> pause = new Offset< short>(0x0262, true); // Pause private Offset< long> playerLatitude = new Offset< long>(0x0560); // Offset for Lat/Lon features private Offset< long> playerLongitude = new Offset< long>(0x0568); // Offset for Lat/Lon features private Offset< short> magVar = new Offset< short>(0x02A0); // Offset for Lat/Lon features private Offset< uint> playerHeadingTrue = new Offset< uint>(0x0580); // Offset for the heading private Offset< long> playerAltitude = new Offset< long>(0x0570); // Offset for the altitude private Offset< short> slewMode = new Offset< short>(0x05DC); // Offset ndicating slew mode into WD code.
Regards Theo |
| |
| |
| | | |
|
| | | | |
| | |
| | |
| |
|
|
|