Jump to content
The simFlight Network Forums

jspringe

Members
  • Posts

    21
  • Joined

  • Last visited

Everything posted by jspringe

  1. Pete, So I have found the answer to this one. These values are stored in the FS9.cfg file ("\Documents and Settings\[user]\Application Data\Microsoft\FS9\FS9.cfg") I've also come up with a solution to my earlier question about how to get the current flightplan data. If you recall, the problem was that the flightplan data is only saved to the .FLT file if you create a flight. It is not saved to the .FLT file if you change the flightplan after starting a flight. The solution is quite easy (and I don't know why I didn't think of this earlier), just force the flight to save (FSUIPC offsets 0x3F00 and 0x3F04) using a safe temporary file name, and then go read that file. Simple. Hope this helps someone :) Jason
  2. Pete, Yes, I can certify that these three offsets do not return values in FS9. Thanks, Jason
  3. Can anyone help with this one... I want to be able to detect the user's currect realism settings. In particular, Realism Setting (0x0C44), Crash Detection Enabled (0x0848), and Stress Damage Enabled (0x0338). All of these offsets are returning 0 regardless of the FS9 setting. Is there any way to fetsh the realism settings? Thanks, Jason
  4. Well, except that it didn't quite work. The problem is that the FLT file only contains a reference to the PLN file if it was created before starting the flight. If you create a flight without a plan and then use the FlightPlanner menu option this does not "re-save" the FLT file with a refernece to the PLN file. So, I still have no way to find out the current flight plan information. Any help? Thanks, Jason
  5. JD, Thanks so much! I didn't realize that the flight file contained the path to the selected pln file. That helps me tremendously! Thanks again, Jason
  6. I am trying to figure out how to get the path/filename of the currently loaded flightplan. I see offsets for the current AIR (3C00) and FLT (3F04) files, but not the PLN file. Anyone know how to determine the path/name of the current PLN file? Thanks, Jason
  7. Why use C#? Well good or bad, it is the closest thing to Java and true OO (I still prefer Java). Really, it is extremely simple. The only time it can be difficult is when you need to interface to legacy modules (and that's just because it is my first time developing an app in C#). The syntax and structure is much like Java which makes it easier to switch between the two on different projects (I have completely forgotten my c programming skills from 20 years ago -- char* far * what?). A long time ago I vowed never to program in VB. Just not ready to eat crow on that one yet. Jason
  8. Well, I finally came up with an answer. There is a conversion method from byte[] to type double (took forever to find it). It is the "BitConverter" class. byte[] buffer = new byte[255]; // get loaded weight bResult = m_fsuipc.FSUIPC_Read(0x30C0, 8, ref token, ref dwResult); bResult = m_fsuipc.FSUIPC_Process(ref dwResult); bResult = m_fsuipc.FSUIPC_Get(ref token, 8, ref buffer); double dLoadedWeight = BitConverter.ToDouble(buffer, 0); Jason
  9. Pete, Just got up some courage to look inside Scott McCrory's C# library. Looks simple enough to add a FSUIPC_Get double method. However, he is using a builtin class called "Marshal" that can read the datatypes he provided methods for. The Marshal class does not have a method to read type double. This is what I have so far and where I'm stuck: public bool FSUIPC_Get(ref int Token, ref double Result) { int Size = 8; // 8 bytes in a double if ((Token < 0) || (Token > IPC_BUFFER_SIZE - (4 + Size)) ) { //Token out of range Result = 0; return false; } IntPtr heapbuf = Marshal.AllocHGlobal(Size); Marshal.Copy(IPC, Token + 4, heapbuf, Size); Result = Marshal.Read??????(heapbuf); Marshal.FreeHGlobal(heapbuf); if (IPCdr[Token] ) { IPCdr[Token] = false; // reset data ready flag return true; } else { // if (data ready flag not set) return false; } } Marshal supports the following reads: Marshal.ReadByte Marshal.ReadInt16 Marshal.ReadInt32 Marshal.ReadInt64 Marshal.ReadIntPtr So, I either need an example of how to call one of the existing methods that Scott provided (my original question on how to convert a byte[] to double) or I need an answer on how to add a FSUIPC_Get that takes a "double". Thanks, Jason
  10. I'm new to C#. Using the methods provided in the CSHARP SDK I have been able to fetch and use most datatypes, but I'm having trouble with the 8 byte FLOAT64 values. The overloaded methods provided are: public bool FSUIPC_Get(ref int Token, ref byte Result) public bool FSUIPC_Get(ref int Token, ref short Result) public bool FSUIPC_Get(ref int Token, ref int Result) public bool FSUIPC_Get(ref int Token, ref long Result) public bool FSUIPC_Get(ref int Token, int dwSize, ref byte[] Result) I assume to fetch an 8 byte value that I will use a new byte[8] array. So the question: how do I convert the 8 separate bytes returned from the get into a C# double value. Thanks for any help, Jason
  11. Pete, Thank you so much for being patient with Yahoo's ridiculous spam filtering. I can only assume that your reply went into the bulk mail folder and was emptied without being seen. I never saw the reply. I am left still trying to decide whether this will be an internal DLL module or an external EXE app. I'm testing right now with a .NET C# app. I prefer the app approach but I want the app to launch automatically when FS9 is started (or even better when a new flight is created). I'm not sure that can be done from an app. Will it make a difference as far as app key request which way I go? Thanks, Jason
  12. Pete, Thanks for the reply. I'm kind of stuck waiting for an application access code before I can do any real digging. Did you get my email a couple of days ago (from jspringe). I know you have been a bit busy lately with the eye problems and all. Thanks, Jason
  13. Is there any way (offsets) to fetch flightplan data such as the origin & destination airport codes?
×
×
  • 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.