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

controlling cycles

Messages
1,468
Country
italy
For simplicity's sake I set up a gauge that flashes off and on. What is the best way I can control the number of flashing on/off cycles.
It is triggered by a sound (the last communication between the Marshaller and the cockpit) By looking out of the left window (selecting left view) one sees the Marshaller appear holding up the pins!
This is one way of doing it. I'm testing another. The question is how do I set the number of on/off cycles?
vololiberista
Code:
<Gauge Name="Chocks Away" Version="1.0">
   <Element>
     <Visible>(L:Sound_G Pushback_6_Played,bool) 1 == (P:Absolute time,seconds) 18 % 9 > ! and (L:counter,number) 0 == and</Visible>
            <Image Name="marshaller.bmp" Luminous="1"/>      
   </Element>
</Gauge>
 
Hi,

Instead of using this:

(P:Absolute time,seconds) 18 % 9 > !

You must use something like

(P:Absolute time,seconds) 18 % 0.5 > !

And the meaning is: make the BMP visible on and off every 9 seconds of a complete cycle of 18 seconds.

Other examples:

(P:Absolute time,seconds) 18 % 0.8 > ! will make the bmp visible for aprox. 14 secs and hidden for aprox 4 secs.

(P:Absolute time,seconds) 18 % 0.3 > ! will make the bmp visible for aprox. 5 secs and hidden for aprox 13 secs.


Tom
 
Hi,

Instead of using this:

(P:Absolute time,seconds) 18 % 9 > !

You must use something like

(P:Absolute time,seconds) 18 % 0.5 > !

And the meaning is: make the BMP visible on and off every 9 seconds of a complete cycle of 18 seconds.

Other examples:

(P:Absolute time,seconds) 18 % 0.8 > ! will make the bmp visible for aprox. 14 secs and hidden for aprox 4 secs.

(P:Absolute time,seconds) 18 % 0.3 > ! will make the bmp visible for aprox. 5 secs and hidden for aprox 13 secs.


Tom



Are you absolutely sure!!! ??
It came on for half a second and stayed off for 18!!!!!!
vololiberista
 
You're right. I forgot to add the adaptor number
Try:

(P:Absolute time,seconds) 18 % 0.5 18 * > !

For a 9 on- 9 off cycle.

Tom
 
Last edited:
That's exactly the same as he wrote originally, since 0.5 18 * is the same as 9.

But I do understand it makes it easier to use for other flashing timings :)
 
Yes, was me the confused when I saw the integer because I recalled my original formula actually handled lapses ("seed") greater than one second. But I did a search on Avsim and after findig the original post I realized it was not clearly explicited how to write the code for bigger "seeds". That's the reason for not using 9 in my latest example but the integer "adaptor"

I guess the entire formula should be ammended to something like:

(P:Absolute time,seconds) seed % blink_lapse seed * > !

Where
seed is the complete duration of the cycle, from 0.0x seconds to any number (1,2,5,20,100, etc).
blink_lapse is the part of the cycle where the blink should be in ON state, in percent over 100.

Tom
 
I have increased the "blink" duration and it is now also controlled by the switch connecting "Ground". The effect when switching to the left window is therefore to see the image only once.
Each successive message turns off the previous blinking image. The last one is turned off by disconnecting "Ground".
vololiberista
 
Yes, was me the confused when I saw the integer because I recalled my original formula actually handled lapses ("seed") greater than one second.

Tom, that's probably why I wrote the notes for this Wiki entry to make that point more clear:

http://www.fsdeveloper.com/wiki/index.php?title=XML:_Timer
The seed parameter is the total length of the blinking cycle. For example, if you want something to blink once every second, you use 1, if you want it blink every half a second, use 0.5 , every two seconds, 2, etc.
Please feel free to edit the Wiki entry and add more detail if you like. That's what it's for... ;)
 
Already done Bill, thanks.

Tom

Okay. I'd still mentally "do the math" and eliminate the * calculation entirely in my "production version," but for educational purposes and clarity of the logic, the revisions do make it more clear... :D
 
Back
Top