Jump to content
The simFlight Network Forums

ricardoherrera

Members
  • Posts

    6
  • Joined

  • Last visited

About ricardoherrera

  • Birthday 01/01/1970

Contact Methods

  • Website URL
    http://

ricardoherrera's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi. I’m trying to determine the Vertical Speed of the aircraft when it first touches the runway so I can determine how hard the landing was. I can read the VS of the aircraft and also determine if it’s on the air or on the ground, so what I’m doing now is waiting for the ground flag to turn true to read the vertical speed, but I always get lower values that I’m supposed to. If anybody has a better clue of doing this I will really appreciate a comment. (P.S. I’m working with C#) Regards.
  2. Hi All!! Is there any way to check, with any programming language, if a user is all set to fly, ( if the user has already chosen an aircraft and a departure point and is now parked)… I cannot find anything related to that, because even when FS is on any menu, I can get values from FSUIPC, but that doesn’t mean that everything is set.. I hope this is clear enough so I can get an answer, sorry my English.
  3. Sorry Pete, I missed this part. Actually the function FSUIPC_Write is defined 5 different ways on the fsuipc.cs file in the SDK: FSUIPC_Write(int dwOffset, byte param, ref int Token, ref int dwResult) FSUIPC_Write(int dwOffset, short param, ref int Token, ref int dwResult) FSUIPC_Write(int dwOffset, int param, ref int Token, ref int dwResult) FSUIPC_Write(int dwOffset, long param, ref int Token, ref int dwResult) FSUIPC_Write(int dwOffset, int dwSize, ref byte[] param, ref int Token, ref int dwResult) So, you can use any of the 5 above: (I used the fifth one for 0x3380 and the first one for 32FA). I wish I can have a valid answer, but awesomely enough that is the only value that when I pass gives me the time I want (in seconds) for the message to be displayed I think that if you cannot answer that question yourself then I’m the last person on hearth to be able to answer it. The C# example that is on the SDK comes with it defined globally for all the functions within the application assigned as token = -1, and all the functions to set or get values use the same token. Going over the fsuipc.cs file I found a definition of Token as: “Contains the unique identifier token used to Get the value”; At the moment is all I can sai about it. Sorry. I guess is all about the money :D Sorry I can’t be helpful; to be honest this is my first C# program ever as a matter of fact mi first program ever. Thank you again, an thank you also for this beautiful piece of work --> FSUIPC
  4. You where totally right, after reading your post, I started to test with ASCII instead of Unicode (just for testing purposes because honestly I don’t really understand very well the difference or their use for that matter), And it worked (at least that is what it seems) Here is the code.. int dwResult = -1; //Default on FSUIPC C# SDK; int token = -1 ; //Default on FSUIPC C# SDK; string chars = "Message to display"; //String to display byte[] bytes; //Variable where the string is going to be stored once converted to bytes byte MsgTTL; //This variable will hold the time the message is displayed in bytes ASCIIEncoding ascii = new ASCIIEncoding(); int byteCount = ascii.GetByteCount(chars.ToCharArray()); //Variable where the string is going to be stored once converted to bytes bytes = new Byte[byteCount+1]; //Declaring Number of items in byte[] bytes[byteCount] = 0x00; //0 Terminator; bytes = ascii.GetBytes(chars); //Converting the string to byte[] MsgTTL = 10; //Holds the message for 10 Sec. Fsuipc fsuipc = new Fsuipc(); fsuipc.FSUIPC_Write(0x3380, bytes.Length, ref bytes, ref token, ref dwResult); fsuipc.FSUIPC_Write(0x32FA, MsgTTL, ref token , ref dwResult); fsuipc.FSUIPC_Process(ref dwResult); It works for me, but I haven’t tested that much, so if somebody has a suggestion or correction PLEASE Let me know. Thank you Pete very much for your reply, Cya on my next question :lol:
  5. Can anybody help me with the same code in c#, I’m able to do most of the querying, but when it comes to Write, I’m completely lost. I’ve been working on a code, but maybe I’m just destroying my computer :D int dwResult = -1; int token = 14; byte[] bytes; string chars = "Message Text0"; UnicodeEncoding Unicode = new UnicodeEncoding(); bytes = Unicode.GetBytes(chars); fsuipc.FSUIPC_Write(0x3380, chars.Length, ref bytes, ref token, ref dwResult); fsuipc.FSUIPC_Write(0x32FA, 2, ref token , ref dwResult); fsuipc.FSUIPC_Process(ref dwResult); With this code all I can get in FS is the word “M” displayed. (the token =14 is just a number I’m randomly selecting, I know is neither technical nor professional, but that only shows how anxious I am to get this code done) Thanks in advanced for any help, and sorry my English.
×
×
  • 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.