Jump to content
The simFlight Network Forums

CXA001

Members
  • Posts

    245
  • Joined

  • Last visited

Posts posted by CXA001

  1. 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

  2. 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

  3. 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,

  4. 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

  5. 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?

     

     

  6. 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?

  7. 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?

  8. 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.