• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSX Time display oddity

Messages
206
Country
unitedkingdom
This is very strange and I cannot work out what is doing it. I noticed that one of my stopwatch gauges had stopped working, so I put all it's variables into a text element for debug. Turns out that the time variable has gone crazy!

The following code should just give the P: / E: absolute time values, as per the SDK, but instead the returned values are .(-*,( in each case. The same is returned for any calculations that use those terms so if anyboby knows (excusing my language) WTF is going on, please give me a clue?

Code:
<Gauge Name="GC_DEBUG" Version="1.0">

<Element>
<Position X="0" Y="0"/>
<FormattedText X="240" Y="300" Font="Arial" FontSize="14" Adjust="Left" Color="red" BackgroundColor="Black" 

VerticalAdjust="Center" Bright="Yes" LineSpacing="5">
<String>
DEBUG DATA\n
\n
Logic P00 = %((P:ABSOLUTE TIME,seconds))%!5.5f!%\n
Logic P01 = %((E:ABSOLUTE TIME,seconds))%!5.5f!%\n
\n
</String>
</FormattedText>
</Element>

</Gauge>

Geoff :confused:

Edit: I should add, the same gauge quite happilt shows all manner of other variables and even long strings...
 
Messages
206
Country
unitedkingdom
What if you use %!d! instead of %!5.5f! ? Or %!2.2f! ?

Still getting nowhere with this :mad:

%!2.2f! gives the same as %!5.5f!

%!d! gives "-"

If I set
Code:
(P:Absolute Time, seconds) (>L:DebugTime, enum)
and display that, I also see the same returns, depending on formatting, and not the numbers I expect. Other variables are displayed as expected.

A few more tests:
  • I have a clean install of FSX SP2 on my laptop, and this does the same there -> not something from my settings.
  • Removing all the other gauges from my panel and re-loading the sim doesn't fix it -> not a problem from another gauge.
  • Placing only the string viewing gauge in a default panel (A321) has the same result -> not something to do with my user aircraft.

I'm out of ideas. I assume others are not seeing the same, so could someone please post some code that correctly displays the Absolute Time (seconds) variable and I'll then test that here?

Geoff
 
Messages
206
Country
unitedkingdom
Update:

It's not the fact that it's absolute time - FSX simply cannot handle really big numbers it seems?
In a test any number much greater than 2147450000 will have this effect / will not be read properly...

(P:Absolute Time, Minutes) 1058500000 - 60 * gives a timestamp that does seem to work...

Geoff
 

taguilo

Resource contributor
Messages
1,585
Country
argentina
FSX can handle big numbers, is the numeric format "f" (or "d") specifier that cannot deal with them.
As you've already noticed, only 32 bit signed numbers are supported.

If you want to see the actual value, just use !s! and it will be expressed in exponential form ie 4553.34343e10.

Tom
 
Messages
206
Country
unitedkingdom
FSX can handle big numbers, is the numeric format "f" (or "d") specifier that cannot deal with them.
As you've already noticed, only 32 bit signed numbers are supported.

If you want to see the actual value, just use !s! and it will be expressed in exponential form ie 4553.34343e10.

Tom

Ah, ok. That would explain why some functions still worked, only the ones that displayed something or did a calculation on the time were messed up.

Geoff
 
Top