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

Timed Digital-Font Auto-Scan

Messages
10,163
Country
us-arizona
Hey all,

I am working on a neat little readout plate, about 1 by 3 inches big, (very small), that is a transparent LCD HUD panel (plate). Its very simple, will have visible font that rotates through 4 readouts; ALT, HDG, ASI, and OAT.

What I am hung up on is how to control a timer that will show each one for roughly 5 seconds.

I was trying to use VoloLibirista's Timed code from last week, but the code I am using in my own stack assembly seems to not function.

Could someone perhaps give me a pointer on what I am doing wrong? I would be greatful.


This is what I have so far.

The system basically has 4 windows that are digital font strings. The controller has 4 L:var's for Visibility, and 4 L:var's for enum selection. Thus, it turns on and off the visibilities, per 5 seconds each.

Its a huge monstrocity of a code execution, so beware. Hold onto your eyebrows. Maybe place some bits of alum. foil over your eyebrows to protect them from hyper aging when viewing this code work.

:eek:


Code:
[COLOR="Blue"][B]
<Element>
   <Select>
      <Value>
          (L:AVE POPUP HUD, bool) 1 ==
   if{
       (L:AVE POPUP ENUM1,bool) 0 == 
       (L:AVE POPUP ENUM2,bool) 0 == 
       (L:AVE POPUP ENUM3,bool) 0 == 
       (L:AVE POPUP ENUM4,bool) 0 == 
       and and and
         if{
           1 (>L:AVE POPUP ENUM1,bool) 
           1 (>L:PLAY AVE POPUP ENUM1,bool)
              (P:Absolute time, seconds) 5
              +
            }
     }
   if{
       (L:AVE POPUP ENUM1,bool) 1 == 
       (L:AVE POPUP ENUM2,bool) 0 == 
       (L:AVE POPUP ENUM3,bool) 0 == 
       (L:AVE POPUP ENUM4,bool) 0 == 
       and and and
         if{
           1 (>L:AVE POPUP ENUM2,bool) 
           1 (>L:PLAY AVE POPUP ENUM2,bool)
              (P:Absolute time, seconds) 5
              +
            }
     }
   if{
       (L:AVE POPUP ENUM1,bool) 1 == 
       (L:AVE POPUP ENUM2,bool) 1 == 
       (L:AVE POPUP ENUM3,bool) 0 == 
       (L:AVE POPUP ENUM4,bool) 0 == 
       and and and
         if{
           1 (>L:AVE POPUP ENUM3,bool) 
           1 (>L:PLAY AVE POPUP ENUM3,bool)
              (P:Absolute time, seconds) 5
              +
            }
     }
   if{
       (L:AVE POPUP ENUM1,bool) 1 == 
       (L:AVE POPUP ENUM2,bool) 1 == 
       (L:AVE POPUP ENUM3,bool) 1 == 
       (L:AVE POPUP ENUM4,bool) 0 == 
       and and and
         if{
           1 (>L:AVE POPUP ENUM4,bool) 
           1 (>L:PLAY AVE POPUP ENUM4,bool)
              (P:Absolute time, seconds) 5
              +
            }
     }
   if{
       (L:AVE POPUP ENUM1,bool) 1 == 
       (L:AVE POPUP ENUM2,bool) 1 == 
       (L:AVE POPUP ENUM3,bool) 1 == 
       (L:AVE POPUP ENUM4,bool) 1 == 
       and and and
         if{
           0 (>L:AVE POPUP ENUM1,bool)
           0 (>L:AVE POPUP ENUM2,bool)
           0 (>L:AVE POPUP ENUM3,bool) 
           0 (>L:AVE POPUP ENUM4,bool) 
           1 (>L:PLAY AVE POPUP ENUM1,bool)
              (P:Absolute time, seconds) 5
              +
            }
     }
      </Value>
    </Select>
   </Element>[/B][/COLOR]
 
Last edited:
What is the P:Absolute time, seconds) 5 + doing at the end of these IF statements? It's not saved into any variable. And that variable will need to be tested against the current time to test if 5 seconds have elapsed.

You do need to write out a flow chart:

1. Start with select variable at 0, which displays the default screen
2. Save the current time into a timer variable.
3. When current time > timer variable + 5, add one to the select variable.
4. When the select variable = 1, display the second screen.
5. Repeat 2-4 for the other two screens (select variable = 2 and 3).
6. When the select variable = 3 and after 5 seconds, set the display variable to 0.
7. See #1.

Hope this helps,
 
Hey Tom,

Awesome. Off to try that.

I have no idea how to write in a timer. I was looking at the FSX SDK on the stop watch, and it is telling you how to add these into a stack in their tool design utility, not how to section them in a XML situation. (Though they do tell you how to write the Mouse script).

...and I did do a flow chart. ;) I am on that...


Bill
 
No luck.


How does one write a timed display loop for visibilities?


* Show enum 0 == for five seconds,
* Turn off enum 0 ==
* Turn on enum 1 == for five seconds,
* Show enum 1 == for five seconds,
* Turn off enum 1 ==
* Turn on enum 2 == for five seconds,
* Show enum 2 == for five seconds,
* Turn off enum 2 ==
* Turn on enum 3 == for five seconds,
* Show enum 3 == for five seconds,
* Turn off enum 3 ==
(Repeat or loop)
* Turn on enum 0 == for five seconds,
Continue
 
Maybe:
Code:
(L:Initialized, bool) !
if{
<!-- Previous time has to start out equal to current time -->
(P:Absolute time, seconds) (>L:Previous Time, seconds) 
1 (>L:Initialized, bool)
}

(P:Absolute time, seconds) (L:Previous Time, seconds) - (>L:Time Change, seconds)
(L:Time Change, seconds) 0 &lt;
if{ 0 (>L:Time Change, seconds) }  <!-- In case Absolute time has reset -->


(L:AVE POPUP HUD, bool) 1 ==
if{
(L:Accumulated Time, seconds) (L:Time Change, seconds) + (>L:Accumulated Time, seconds)

(L:Accumulated Time, seconds) 0 &gt;
(L:Accumulated Time, seconds) 5 &lt;
and
if{
0 (>L:AVE POPUP ENUM4,bool)
1 (>L:AVE POPUP ENUM1,bool)
}

(L:Accumulated Time, seconds) 5 &gt;
(L:Accumulated Time, seconds) 10 &lt;
and
if{
0 (>L:AVE POPUP ENUM1,bool)
1 (>L:AVE POPUP ENUM2,bool)
}

(L:Accumulated Time, seconds) 10 &gt;
(L:Accumulated Time, seconds) 15 &lt;
and
if{
0 (>L:AVE POPUP ENUM2,bool)
1 (>L:AVE POPUP ENUM3,bool)
}

(L:Accumulated Time, seconds) 15 &gt;
(L:Accumulated Time, seconds) 20 &lt;
and
if{
0 (>L:AVE POPUP ENUM3,bool)
1 (>L:AVE POPUP ENUM4,bool)
}

(L:Accumulated Time, seconds) 20 &gt;
if{
0 (>L:Accumulated Time, seconds)
}

}

Doug
 
Is there some reason you need 4 L: variables, one for each subpanel? Won't one variable set to 0, 1, 2, and 3 work as well?
 
Is there some reason you need 4 L: variables, one for each subpanel? Won't one variable set to 0, 1, 2, and 3 work as well?

Hey Tom,

I originally started with enum's, 0 thru 3, but couldnt figure out how to wire that into the timer system. I then created font strings with visibilities, and used a separate L:var for each for each viz.

I was thinking I would run a timer on each one, but as it turns out, there was a way to rotate through them easily.

I'll post the code.

Thanks to David at Iris for the timer code and mini lessen on how it works.



Bill
 
Doug, thanks for that. You posted when I was working on one that David at Iris had sent over.

I copy/paste all this down for notes. I am very greatful for the input.


Bill
 
Back
Top