Jump to content
The simFlight Network Forums

HondaCop

Members
  • Posts

    27
  • Joined

  • Last visited

Posts posted by HondaCop

  1. Your refresh rate really depends on what type of data you are getting and how you are using it.  For example a black box flight recorder will require a high refresh rate (e.g. 30 times per second) whereas a moving map may only need to measure the aircraft position every few seconds.

     

    Also within the same application you might want to run different timers that work with different offset groups (see my UserGuide for more info on Offset groups) at different frequencies.  Some data you might need to collect many times a second, some you only need maybe once per minute.

     

    Another way of doing that would be to use one fast timer and only process() the slower groups on every 10 ticks or whatever.

     

    Realistically you wouldn't need to update faster than the FS framerate because the data is only going to be different between frames. 

     

    FSUIPC and my DLL can handle refresh rates of around 30 times per second (Timer Interval = 33ms) without a problem and this would be plenty fast enough even for a glass cockpit.  You may even be able to go faster.

     

    The other thing you need to consider is the performance of your own program.  If the contents of the timer tick() method takes say 60ms to run then this will be the fastest you can run the timer even if you give it a lower interval (e.g. 40ms).

     

    Basically, the rule of thumb is go as slow as you can get away with.  If your application works fine with getting data every 60 seconds then there's not much point having a 100ms timer.

     

    Paul

     

    Thanks for the explanation, Paul. I will just keep the timer that I use to process all FSUIPC offsets at 100ms... :-)

  2. I'm not really sure. I think the whole point of XPUIPC is to spoof the FSUIPC interface and report that FSX is running. If it didn't then some FSUIPC applications would not work with it as they check for a specific version of FS. Also there doesn't seem to be an ID number reserved for XPlane in the FSUIPC SDK documentation.

    I can only suggest contacting the makers of XPUIPC and see if they have a way you can detect it. They may have a way of reporting a different version number than FSX, or maybe they have some special offset you can check.

    Paul

    That makes sense, Paul... Will contact them. Thanks!

  3. Hello Pete,

    I downloaded your MakeRunways utility and when I tried importing the runways.xml file into an Access database, it imports fine but with one issue. It will not create an ICAO ID column for the airports or runways.

    It will show all airports, one per row, but the ICAO column is not displayed.

    Is there a way to have the XML tell Access to create a coumn for ICAO ID as well?

  4. No, other than the strange coincidence that it is almost identical to the one I found. Weird.

    Try deleting that section altogether so it gets a default size and position.

    The window used is the same one as used by FS's own ATIS and other notifications. Do you not see those either?

    That is, unless you are using a mult-line message? I think that might mbe a different one. are there any more similar sections?

    Pete

    I deleted ALL FLT files and let FS rebuild one when I booted it up. Still the same issue. It will display the text when in windowed mode. But when it's in full-screen mode, it will not display the text. This is really weird. Don't know what else to check or do. And no, I'm not using a multi-line message. It's just a small text about 30 characters long. I even made sure the show ATC messages is ENABLED in the FS settings.

  5. It's always worked okay in either mode. Are you sure it isn't there but sized wrongly or off-screen? FS keeps a record of the window size and position in the FLT files, so it could be different for each saved flight. See the section like

    [Message Window]

    Undocked=False

    ScreenUniCoords=64, 200, 8064, 435

    UndocCoords=0, 0, 0, 0

    Note that you can't normally have an Undocked window in full screen mode -- maybe that's your problem?

    Pete

    Ok Pete,

    I am using the PMDG 737 for FS9 and when I check the FLT file for the previous flight, it shows this entry:

    [Message Window]

    Undocked=False

    ScreenUniCoords=64, 200, 8064, 100

    UndocCoords=0, 0, 0, 0

    Any thoughts?

  6. I'm pretty certain it's not because of getting the offset size wrong. I can't say why it doesn't show in full screen though - Pete will have to address that.

    Yes, it doesn't mean place a character '0' at the end, it means the last byte in the character array (string) must have the value 0. In any case, you don't need to worry about such things as my DLL takes care of all the string processing for you.

    Paul

    Oh ok, thanks for that info, Paul. I am all set, the text display works BUT only in windowed screen. Now I just need to figure out why it won't display in full screen. :-( Hopefully Pete will have a solution.

  7. This won't solve your problem, but you need to take care with your offset sizing. Both 0x3302 and 0x32FA are marked a 2 Bytes in the FSUIPC documentation. You have declared them as 'int' which is 4 bytes. When you write to these offsets you are also writing data (0) into the adjacent offsets. Many times you won't notice, but such mistakes could have very bad effects.

    See my User Guide supplied with the FSUIPC Client DLL for an explanation and table of what .NET types to use for each type of FSUIPC offset.

    For 2 bytes integer data you need to declare the offset as 'short' or 'ushort', not 'int'.

    BTW, The FSUIPC docs seems to suggest that 0x3302 is readonly:

    Paul

    Gotcha Paul! I will change those offsets from INT to SHORT. One thing I have noticed is that the text will ONLY appear when FS is in windowed mode. It will NOT display when in FULL-SCREEN mode. Could this be caused by the offset being set as INT and not SHORT? Or is this problem something else? Another thing... Docs say that the text string has to be terminated by a 0. How does one go about doing this? I figured that whatever text I send, the last character would be 0 but when I do this, the text itself shows a 0 on the text being displayed.

  8. Sorry I know nothing at all about C#. It doesn't look anything like C to me! I hope some other C# programmer can help you.

    Regards

    Pete

    Pete,

    This code:

    Offset<int> displaytextcolor = new Offset<int>(0x3302);

    Will allow me to write to the offset. So by doing the following:

    displaytextcolor.Value = 0;

    allow me to change the text from RED to WHITE?

    I know you said you don't know C# but I just want to make sure that by writing a 0 to that offset, forces the display text to be white instead of the typical red.

    UPDATE: Just tried it and the display still shows up as RED on a green, translucent background. Any ideas? Thanks.

  9. Check the appropriate offsets list for your version of FS. They are all listed in the documents supplied in the FSUIPC SDK. Look initially at 32FA, the control word.

    Regards

    Pete

    Hi Pete!

    Ok, I found the offset which is 3380 and the control is 32FA. Would the following work in C#:

    Offset<string> displaytext = new Offset<string>(0x3380);

    Offset<int> displaytexttimer = new Offset<int>(0x32FA);

    I placed the following inside a button click action just to test things out:

    displaytext.Value = (string) "THIS IS A TEST0";

    displaytexttimer.Value = 5;

    When I try to debug the prgram, Visual Studio is giving a compile error like this:

    $exception {"Must set a size set for ArrayOrStringLength for Byte[], BitArray or String."} System.Exception

    Any ideas? It's been 3 years since I coded in C# and I am super rusty. Thanks for the help.

    UPDATE: Nevermind, Pete... I figured it out. Just had to add the BYTE LENGTH to the string (0x3380, 128) and now it works. Thanks!

×
×
  • 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.