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

Blinking Image

MijoBerlin,

Is it possible to post your finding when you get it working right? I would be interested how it is controlled, out of curiosity.

A timer upon a timer?
 
this is my code. this button is blinking.
but i don`t know how i can disable this button after 5 times blinking.

Code:
<Element>
<Visible>(P:Absolute time,seconds) 2 % 1 1 * > ! // no funktion --> and (L:ibf_test_r,bool) 5 == </Visible>
 <Position X="434" Y="52"/>
   <Select>
      <Value>(L:ibf_test_r,bool) 1 == if{ (A:Avionics master switch, bool) (A:Electrical master battery, bool) 1 == &amp;&amp; }</Value>
        <Case Value="1">
            <Image Name="balken_test.bmp"/>
        </Case>
    </Select>
</Element>

the code after "no function" is the code in the thread from tgibson`s link
it is equal, which L:var i use
 
Not tested, but this should give you the idea. I'm sure there is a more elegant solution, but I don't know those.

Code:
<Element>
<Visible>(P:Absolute time,seconds) 2 % 1 1 * (L:Blink_Counter, enum) 5 &lt;= &amp;&amp; </Visible>
 <Position X="434" Y="52"/>
   <Select>
      <Value>(L:ibf_test_r,bool) 1 == if{ (A:Avionics master switch, bool) (A:Electrical master battery, bool) 1 == &amp;&amp; }</Value>
        <Case Value="1">
            <Image Name="balken_test.bmp"/>
        </Case>
    </Select>
</Element>

<Element>
   <Select>
      <Value>(P:Absolute time,seconds) 2 % 1 1 * 1 == (L:Blink_Test, bool) ! &amp;&amp; if{ (L:Blink_Counter, enum) ++ (>L:Blink_Counter, enum) (L:Blink_Test, bool) ! (>L:Blink_Test,bool) } els{ (P:Absolute time,seconds) 2 % 1 1 * 0 == (L:Blink_Test, bool)  &amp;&amp; if{ (L:Blink_Test, bool) ! (>L:Blink_Test,bool) }  } </Value>
    </Select>
</Element>

Logic: Upon panel load (or trigger event), Blink_Test is False and Blink_Counter is 0. First time the light comes on, Blink_Counter is incremented to 1, and Blink_Test is set to True. When light turns off, Blink_Test is set to False. This repeats for each blink cycle until after the 5th blink. At this point the Visible statement is no longer true (Blink_Counter is greater than 5) so the button stops blinking. You will also need code that then resets the Blink_Counter to 0 when you want it to start blinking again - that would be the trigger event.

Note I did not change your Value statement, because I have no idea of the logic behind it.

Hope this helps,
 
hmm, is blinking when i load the helicopter :D
an attempt was worth it.

That's because the blink_counter equals 0 at startup.

Another way of doing this is by assigning the times you want it to blink to the trigger variable:

Code:
[I]trigger_condition[/I] if{ 5 (>L:Blink_Counter, enum) [I]remove_trigger_condition[/I] }
then:


Code:
<Visible>(P:Absolute time,seconds) 2 % 0.5 2 * > ! (L:Blink_Counter, enum) 0 > and s0 (L:Blink_Counter, enum)  l0 - (>L:Blink_Counter, enum)</Visible>
 <Position X="434" Y="52"/>
   <Select>
      <Value>(L:ibf_test_r,bool) 1 == if{ (A:Avionics master switch, bool) (A:Electrical master battery, bool) 1 == &amp;&amp; }</Value>
        <Case Value="1">
            <Image Name="balken_test.bmp"/>
        </Case>
    </Select>
</Element>

Another good thing would be to place the <Value> contents as a part of the <Visible> condition, to avoid a redundant <Select>

Tom
 
Don't give up so easy!:eek:

If you can figure out how to code the trigger condition, just copy the second snippet as is and should work fine :).

Tom
 
How about this:
Code:
<Visible> current_time begin_blink_time - sp0 l0 &gt num_blinks blink_period * l0 blink_period / 2 * flr 2 % 1 &lt; || </Visible>
 
How about this:
Code:
<Visible> current_time begin_blink_time - sp0 l0 &gt num_blinks blink_period * l0 blink_period / 2 * flr 2 % 1 &lt; || </Visible>

A quick analysis:

current_time begin_blink_time - sp0 = empty stack

l0 &gt; = you are comparing to an empty stack, is this ok to your intentions?

Suppose you intended s0 instead, then,

s0 l0 &gt; is always false (0)


Tom
 
hey guys. it must not work. if it does not blinking 5 times, but until the switch is off, that's ok. It's just too bad, because the blinking in the real EC135 is only 5 times.

thanks @ all
 
A quick analysis:

current_time begin_blink_time - sp0 = empty stack

l0 &gt; = you are comparing to an empty stack, is this ok to your intentions?

Suppose you intended s0 instead, then,

s0 l0 &gt; is always false (0)


Tom

sp0 should store the value on top of the stack in variable 0 and then pop it off the stack.
l0 should place the value in variable 0 on top of the stack.
 
sp0 should store the value on top of the stack in variable 0 and then pop it off the stack.

Right. So the stack is now empty.

l0 should place the value in variable 0 on top of the stack.

Right. Now the stack has only one value, l0.

Then,

l0 &gt; (or better l0 > , for clarity), you are telling "something is greater than l0", but the stack has only one value wich is l0. As it is written, what is analyzed is 0 l0 > because an empty stack has a value of 0 by default and for the calcs. Hence my question again, is this ok to your intentions?

Tom
 
O heck, you're right.
I placed the &gt; in the wrong place.
Code:
current_time begin_blink_time - sp0 
l0 num_blinks blink_period * &gt 
l0 blink_period / 2 * flr 2 % 1 &lt; 
||
 
Code:
current_time begin_blink_time -

I understand the complete blinking does not depend on an elapsed period but on the number of times it needs to blink, 5 in this case.

Code:
blink_period

I believe this would be 5 ?

Code:
num_blinks

And if this is the accumulated blinks so far, where and/or how is the variable actualized?


Tom
 
the so everything looks good. But what is the correct syntax for the red words.

Code:
[COLOR="Red"]current_time[/COLOR] [COLOR="Red"]begin_blink_time[/COLOR] - sp0 
l0 [COLOR="Red"]num_blinks blink_period[/COLOR] * &gt 
l0 [COLOR="Red"]blink_period[/COLOR] / 2 * flr 2 % 1 &lt; 
||

never thought that this topic is so big.
you are great.
 
Back
Top