Jump to content
The simFlight Network Forums

CXA001

Members
  • Posts

    245
  • Joined

  • Last visited

Everything posted by CXA001

  1. You sir, are a life saver. :) Thanks again! Marc
  2. I am working with FS9, but came up with a bug in FSX/P3D. For whatever reason, I always have issues working with Bytes & BitConverters and I can never get the values I need. Offset<byte[]> FSUIPCHandle = new Offset<byte[]>("FSUIPCHandle", 0x0BFC, 2); //Flaps handle for FSX, P3D. //Get data from FSUPIC FSUIPCConnection.Process(new string[] { "FSUIPCHandle" }); labelCurrentHandle.Text = BitConverter.ToString(FSUIPCHandle.Value, 1); This is running in a timer that runs every 1 second and I always get a value of 1. I can confirm that there is not value for this in FS9. Sorry for the trouble, Marc
  3. For 0BFC, 1, Flaps handle index (0 full up) I need to read how many bytes from it. I have tried different values, but I am getting weird numbers. Regards, Marc
  4. Makes sense! Thanks again, Marc
  5. As we are not a military VA, we do not have facilities to refuel during mid-flight. How would I go about prevent our pilots from adding fuel during mid-flight? I have looked at the different offsets and can't seem to find one that would prevent the pilot from adding fuel. Regards, Marc
  6. Thanks Pete for the great explanation. Reworked things a little bit and I am happy with the results. Regards, Marc
  7. I have a question regarding grouping and / or requesting data from FSUIPC and performance. Lets say I have a timer that every 5 seconds queries FSUIPC. As far as performance, is it better to request all the information at the begining of my process: FSUIPCConnection.Process(new string[] { "FSUIPCParkingBrake", "FSUIPCOnGround", "FSUIPCGroundAltitude", "etc..." }); or would it be better to request it as needed through out my code: FSUIPCConnection.Process(new string[] { "FSUIPCParkingBrake" }); Some code... FSUIPCConnection.Process(new string[] { "FSUIPCPOnGround" }); Some code... FSUIPCConnection.Process(new string[] { "FSUIPCGroundAltitude" }); Normally with a database, I would query everything at once as you need to create the connection, run the query, then close the connection, etc. As FSUIPC is always connected, I am curious as to what is the most efficient way to do this. Marc
  8. I realized that last night and switched to doubles. Did some more changes last night and I think I finally have the answer, but more testing is required on my part to be sure. Will advise. Marc
  9. I spoke to soon... My code worked great with the default C172, but when I loaded the default FS9 737-400 most handles which I was trying to get work. Back to the drawing board. :( Marc
  10. I will definitely add it in the User Contributions when I have completed the final code. Kind regards, Marc
  11. I figured out how to get the handle like in 0BFC. I will post the final code I used in case someone else needs it in the future, in the next day or so. Regards,
  12. Hi Thomas, Got that part no problem. My apologies, in reading back my previous post I was not very clear. (Too many hours in front of a keyboard, I guess). I have the number of total detentes, but was looking for away to get the same results as 0BFC , but in FS9 meaning: Flaps Up value would be 0, Flaps 10 value would be 1, Flaps 20 = value would be 2, Flaps 30 value would be 3, etc. This way I can easily get the corresponding degrees of flaps from my aircraft database. I am getting Flaps 0 value = 0, Flaps 1 value = 1, Flaps 2 value = 3, Flaps 3 value =3 Offset<short> FSUIPCDetentes = new Offset<short>("FSUIPCDetentes", 0x3BFA); //Number of flap positions (NOT Including Full Up). Offset<int> FSUIPCAircraftDetente = new Offset<int>("FSUIPCAircraftDetente", 0x0BDC); //Current aircraft detente. int intDetentes; //Total number of flap positions +1 (to include full up). int intAircraftDetente; //Current aircraft detente from FSUIPC. //Get total number of flap positions including full up. intDetentes = (16383 / FSUIPCDetentes.Value) +1; //Curent aircraft detente handle. intAircraftDetente = intDetentes - (16383 / FSUIPCAircraftDetente.Value); This is driving me crazy as it is the last thing I need to get working as far as data from FSUIPC in my ACARS program. Any assistance suggestions or other offsets I can maybe try (although, I think I have been through them all) would be greatly appreciated. Regards,
  13. The flaps handle index 0BFC, works great and will use it for FSX & P3D.Unfortunately this offset will not work in FS9. Any ideas on the logic to get handle indexes for FS9?
  14. I really need widefs as I have separate PCs for Flight Sim and development. No big deal as it is not as if it costs hundreds of dollars. Regards, Marc
  15. Argh! What a shame, considering I never fly FS9, but only have it installed for development, but it is what it is. :) Thanks for the information, I will pick it up this weekend. Regards, Marc
  16. If I understand things correctly, offset 3BF8 is used for determining the number of flap positions on a given aircraft. (For example, the default C172 would return a value of 4). In looking at all the different offsets available, I understand that there are a variety of ways to get the different values, angles, etc. of flaps. As the program I am writing in C# is to be used across multiple flight simulator platforms, trying to read the different degrees of flaps from each flight sim platform could be problematic. How can I go about simply getting the current flaps detent value of an aircraft? Once I have that value, I can manage the degrees of flaps, etc. from my aircraft database that contains these values? Regards, Marc
  17. I realize that the there are different versions of FSUIPC & WideFS for FS9 vs FSX/P3D. I have my keys for FSX/P3D, but need to do some debugging on software I am writing in FS9 which is a lot easier to do with WideFS & FSUIPC, but my keys don't work for the FS9 versions. Do I need to purchase a separate keys for the FS9 versions? Regards, Marc
  18. Thanks Paul, That was indeed the problem. I am now getting the proper display data and time display in zulu. Really appreciate the help, Regards, Marc
  19. While I have no problems getting the local date and time from the flight simulator, I am having an issue trying to get the zulu (or GMT) data and time from the flight simulator. Here is my code (C#): Offset<byte[]> FSUIPCGMTDateTime = new Offset<byte[]>("FSUIPCGMTDateTime", 0x023B, 10); string stringFSGMTDateTime; string stringFSGMTDate; string stringFSGMTTime; FSUIPCConnection.Process(new string[] {"FSUIPCGMTDateTime" }); short GMTYear = BitConverter.ToInt16(FSUIPCGMTDateTime.Value, 8); DateTime FSGMTTime = new DateTime(GMTYear, 1, 1, FSUIPCGMTDateTime.Value[0], FSUIPCGMTDateTime.Value[1], FSUIPCGMTDateTime.Value[2]); short GMTDayNo = BitConverter.ToInt16(FSUIPCGMTDateTime.Value, 6); FSGMTTime = FSGMTTime.Add(new TimeSpan(GMTDayNo - 1, 0, 0, 0)); stringFSGMTDateTime = "[" + FSGMTTime.ToString("yyyy/MM/dd HH:mm") + "]"; stringFSGMTDate = FSGMTTime.ToString("yyyy MM dd"); stringFSGMTTime = FSGMTTime.ToString("HH:mm"); I should be getting something like: [2016/07/14 22:13] What I am getting is: [1801/12/05 22:13] What am I missing?
  20. Good thing I asked. :) Ok, so as long as the previous value is not equal to the current one. Much appreciate it and thanks again for the quick response. Back to coding... Marc
  21. Hi Pete, Thanks for the quick response. If I understand correctly, I would create a variable with the previous value of 337E and basically have a timer (with a reasonable period of time) that would compare the previous value to the current one. The current value should always be greater than the previous one. If it isn't, basically I would have my application prompt the pilot to check his connection to the flight simulator and either try again or quit. Am I understanding the use of the 337E offset?
  22. I am in the progress of writing and ACARS program (what a task!) and I have a question. If my application is running directly on the flight sim PC and the flight sim crashes (or my application loses connection), my application catches the exception and displays a warning i.e. Lost connection with your fight simulator... However, if the flight sim crashes and my application is running via widefs on a secondary PC, this doesn't happen as widefs is still running. Is there an offset that I can monitor for widefs to see if it is still connected to the flight sim or do you have any other ideas on how to go about this?
  23. Hi Pete, I was also having this issue. Installed the 4.924a DLL and it resolved the issue for me. :)
  24. Will update to the current release, try again and advise. Kind regards,
  25. Hi Pete, FSUIPC v4751a is the version that I have installed. The eggbeaters that I fly have keyboard shortcuts: Ctrl+Shift+Up (I want this for the up position on my hat switch) Ctrl+Shift+Down (I want this for the down position on my hat switch) Ctrl+Shift+Left (I want this for the left position on my hat switch) Ctrl+Shift+Right (I want this for the right position on my hat switch) Etc... Under Button & Switches in FSUPIC Options & Settings I have mapped these keyboard shortcuts to the hat switch on my Microsoft Flight Sidewinder Joystick but to no avail. Kind regards,
×
×
  • 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.