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

Timer - 2 diff displays - 2 diff durations -same location

Messages
542
Country
australia
I have a timer that is triggered at 6 nm to go to a target ,
it displays a low impact text reminder message ( SET BOMBS ) once every 8 seconds during a maximum duration period of 40 seconds ,
only if zero bombs were set in another instrument ,
if one or more bombs are set it will either switch off or not show ,
at 40 seconds it automatically switches off , it worked nicely .
Code is ,
Code:
 <!-- REMINDER Bomb # NOT set in RIPPLE Inst duration timer trigger   -->
      <Element>
        <Select>
            <Value>(L:DistanceTargetPos,nmiles) 6 &lt; (L:DistanceTargetPos,nmiles) 5.8 &gt; and
                      if{ 1 (&gt;L:TokenDistance,enum) }
                   (L:TokenDistance,enum) 1 ==
                         if{ (P:Absolute time, seconds) (&gt;L:Reminder Text START, seconds)
                           0 (&gt;L:TokenDistance,enum) }
            </Value>
        </Select>
      </Element>

<!-- Flashing reminder that NO bombs set in Ripple Inst  -->
    <Element>
     <Visible>(P:Absolute time, seconds) (L:Reminder Text START, seconds) - 40 &lt;</Visible>
    <Element>
     <Visible>(L:F111_Nbr_Sum, number) 0.5 &lt; (P:Local time,seconds) 8.0 % 0.95 &lt; *</Visible>
       <Element>     
          <Position X="92" Y="41" />
            <FormattedText X="34" Y="24" Font="Tahoma" FontSize="10" LineSpacing="12" Adjust="Left" Color="#FF0000" Bright="Yes">
              <String>%SET%
                       \n%BOMBS%</String>
          </FormattedText>
       </Element>
    </Element>
    </Element>

I then wanted to add text indicating progressive count of bombs dropped and max current set number of bombs ,
only if one or more bombs were set ,
and for a longer duration of 80 seconds .

I tried the following code , in a flight ,
I initially had zero bombs set , the reminder text flashed very briefly , then no more , when it should have .
I then quickly set 12 bombs and the bomb count successfully appeared for the 80 second duration .
Code:
 <!-- REMINDER Bomb # NOT set in RIPPLE Inst duration timer trigger   -->
      <Element>
        <Select>
            <Value>(L:DistanceTargetPos,nmiles) 6 &lt; (L:DistanceTargetPos,nmiles) 5.8 &gt; and
                      if{ 1 (&gt;L:TokenDistance,enum) }
                   (L:TokenDistance,enum) 1 ==
                         if{ (P:Absolute time, seconds) (&gt;L:Reminder Text START, seconds)
                           0 (&gt;L:TokenDistance,enum) }
            </Value>
        </Select>
      </Element>

<!-- Flashing reminder that NO bombs set in Ripple Inst  -->
    <Element>
     <Visible>(P:Absolute time, seconds) (L:Reminder Text START, seconds) - 40 &lt;</Visible>
    <Element>
     <Visible>(L:F111_Nbr_Sum, number) 0.5 &lt; (P:Local time,seconds) 8.0 % 0.95 &lt; *</Visible>
       <Element>     
          <Position X="92" Y="41" />
            <FormattedText X="34" Y="24" Font="Tahoma" FontSize="10" LineSpacing="12" Adjust="Left" Color="#FF0000" Bright="Yes">
              <String>%SET%
                       \n%BOMBS%</String>
          </FormattedText>
       </Element>
    </Element>
    </Element>
  
<!-- Progressive No released and  No of bombs set in Ripple Inst  -->
    <Element>
     <Visible>(P:Absolute time, seconds) (L:Reminder Text START, seconds) - 80 &lt;</Visible>
    <Element>
     <Visible>(L:F111_Nbr_Sum, number) 0.8 &gt; </Visible>
       <Element>     
          <Position X="92" Y="41" />
            <FormattedText X="34" Y="24" Font="Tahoma" FontSize="10" LineSpacing="12" Adjust="Left" Color="#C7C7C7" Bright="Yes">
               <Color Value="#349F34"/>         
              <String>%((L:Bombs_dropped, number))%!02d!%
                       \n%\{clr2}%((L:F111_Nbr_Sum, number))%!02d!%</String>
          </FormattedText>
       </Element>
    </Element>
    </Element>

In an attempt to get both text/data displays to work as they should , I defined the 2 time durations each with the bomb condition in the Select element
as follows , this worked exactly as desired .
Code is ,
Code:
<!-- 1. REMINDER Bomb # NOT set in RIPPLE Inst duration timer trigger and  2. duration of data display   -->
      <Element>
        <Select>
            <Value>(L:DistanceTargetPos,nmiles) 6 &lt; (L:DistanceTargetPos,nmiles) 5.8 &gt; and
                      if{ 1 (&gt;L:TokenDistance,enum) }
                   (L:TokenDistance,enum) 1 ==
                         if{ (P:Absolute time, seconds) (&gt;L:Reminder Text START, seconds)
                           0 (&gt;L:TokenDistance,enum) }
                   (L:F111_Nbr_Sum, number) 0.5 &lt;
                         if{ 40 (&gt;L:Time_Interval_Choice, number) }
                   (L:F111_Nbr_Sum, number) 0.8 &gt;
                         if{ 80 (&gt;L:Time_Interval_Choice, number) }                     
            </Value>
        </Select>
      </Element>

<!-- Flashing reminder that NO bombs set in Ripple Inst   is visible for 40 seconds  -->
    <Element>
     <Visible>(P:Absolute time, seconds) (L:Reminder Text START, seconds) - (L:Time_Interval_Choice, number) &lt;</Visible>
    <Element>
     <Visible>(L:F111_Nbr_Sum, number) 0.5 &lt; (P:Local time,seconds) 8.0 % 0.95 &lt; *</Visible>
       <Element>     
          <Position X="92" Y="41" />
            <FormattedText X="34" Y="24" Font="Tahoma" FontSize="10" LineSpacing="12" Adjust="Left" Color="#FF0000" Bright="Yes">
              <String>%SET%
                       \n%BOMBS%</String>
          </FormattedText>
       </Element>
    </Element>
    </Element>
  
<!-- Progressive No released and  No of bombs set in Ripple Inst    is visible for 80 seconds -->
    <Element>
     <Visible>(P:Absolute time, seconds) (L:Reminder Text START, seconds) - (L:Time_Interval_Choice, number) &lt;</Visible>
    <Element>
     <Visible>(L:F111_Nbr_Sum, number) 0.8 &gt; </Visible>
       <Element>     
          <Position X="92" Y="41" />
            <FormattedText X="34" Y="24" Font="Tahoma" FontSize="10" LineSpacing="12" Adjust="Left" Color="#C7C7C7" Bright="Yes">
               <Color Value="#349F34"/>         
              <String>%((L:Bombs_dropped, number))%!02d!%
                       \n%\{clr2}%((L:F111_Nbr_Sum, number))%!02d!%</String>
          </FormattedText>
       </Element>
    </Element>
    </Element>

While it works beautifully as required , it looks a mess .
Is there a better way to write this last working code ?

Cheers
Karol
 
Last edited:
Code:
      <Element>   
          <Position X="92" Y="41" />
            <FormattedText X="34" Y="24" Font="Tahoma" FontSize="10" LineSpacing="12" Adjust="Left" Color="#FF0000" Bright="Yes">
              <String>
              %((P:Absolute time, seconds) (L:Reminder Text START, seconds) - (L:Time_Interval_Choice, number) &lt;)
             %((L:F111_Nbr_Sum, number) 0.5 &lt;
             %(&amp;&amp;)
             %((P:Local time,seconds) 8.0 % 0.95 &lt; *)
             %(&amp;&amp;)
             %{if}
                 %SET\n
                 %BOMBS
             %{end}
            </String>
           </FormattedText>
       </Element>

Karol,
you could write all the elements in one string element,
replacing the visible tags by boolsche algebra and {if} ,{ else} {end}. Also case could be used.

Above is not tested :alert:

Edi
 
Code:
<!-- Flashing reminder that NO bombs set in Ripple Inst   is visible for 40 seconds  -->
<!-- Progressive No released and  No of bombs set in Ripple Inst    is visible for 80 seconds -->
    <Element>
     <Visible>(P:Absolute time, seconds) (L:Reminder Text START, seconds) - (L:Time_Interval_Choice, number) &lt;</Visible>
       <Element>   
          <Position X="92" Y="41" />
            <FormattedText X="34" Y="24" Font="Tahoma" FontSize="10" LineSpacing="12" Adjust="Left" Color="#FF0000" Bright="Yes">
            <Color Value="#C7C7C7"/>
             <Color Value="#349F34"/>
              <String>%((L:F111_Nbr_Sum, number) 0.5 &lt;)%{if}%((P:Local time,seconds) 8.0 % 0.95 &lt;)%{if}SET\nBOMBS%{else}-\n-%{end}
                             %{else}\{clr2}%((L:Bombs_dropped, number))%!02d!\n\{clr3}%((L:F111_Nbr_Sum, number))%!02d!%{end}
                      </String>
          </FormattedText>
       </Element>
    </Element>

I hope that works.
 
Edi

Thank you for your code , very nice , I adapted it as follows ,
Code:
     <Element>  
          <Position X="92" Y="41" />
            <FormattedText X="64" Y="24" Font="Tahoma" FontSize="10" LineSpacing="12" Adjust="Left" Color="#FF0000" Bright="Yes" Tabs="0,1L">
                 <Color Value="#C7C7C7"/>
                 <Color Value="#349F34"/>                
              <String>
              %((P:Absolute time, seconds) (L:Reminder Text START, seconds) - (L:Time_Interval_Choice, number) &lt;)
             %{if}            
             %((L:F111_Nbr_Sum, number) 0.5 &lt; (P:Local time,seconds) 8.0 % 0.95 &lt; *)
             %{if}
                 \t%SET%\n
                 \t%BOMBS
             %{end}
              %((P:Absolute time, seconds) (L:Reminder Text START, seconds) - (L:Time_Interval_Choice, number) &lt;)            
             %{if}
             %((L:F111_Nbr_Sum, number) 0.8 &gt;)%
             %{if}            
                  \t%\{clr2}%((L:Bombs_dropped, number))%!02d!%\n
                \t%\{clr3}%((L:F111_Nbr_Sum, number))%!02d!            
             %{end}
            </String>
           </FormattedText>
       </Element>
That worked as required , except that the first or top line was translated to the Right in each instance , the second line
was in the correct location , it was as if each vertical line of code caused a one place movement to the right , and that
movement was cumulative .
The "SET'" was over a couple of spaces and the "Progressive count" was even a few more spaces over to the right .
It was probably something that I did that caused that effect , before I resolved it I tried another code solution .

Heretic
Thanks for that code , it worked as provided , it does everything that was required , it's a neat function , is very nice , decided to use your code , Thank you .


Thanks again for two great solutions .

Cheers
Karol
 
Karol,
your code works, because its a very short.
With a complexer or longer code probably you run into some, often strange error!
You forget two {end} !
So i prefer writing this way - since 30 years;)


Code:
              <String>
              %((P:Absolute time, seconds) (L:Reminder Text START, seconds) - (L:Time_Interval_Choice, number) &lt;)
              %{if}           
                 %((L:F111_Nbr_Sum, number) 0.5 &lt; (P:Local time,seconds) 8.0 % 0.95 &lt; *)
                 %{if}
                    \t%SET%\n
                    \t%BOMBS
                 %{end}      <!-- **** here a second end ?? **** -->
                 %((P:Absolute time, seconds) (L:Reminder Text START, seconds) - (L:Time_Interval_Choice, number) &lt;)           
                 %{if}
                    %((L:F111_Nbr_Sum, number) 0.8 &gt;)%
                    %{if}           
                       \t%\{clr2}%((L:Bombs_dropped, number))%!02d!%\n
                       \t%\{clr3}%((L:F111_Nbr_Sum, number))%!02d!           
                    %{end}     <!-- **** or here two extra end ?? **** -->
            </String>
Looks in text editor a little bit better!

{if} and {and} which belongs together are at the same distance from the left.

Yes, hidden blanks make some problems with the out format.

Edi
 
Thanks for that code , it worked as provided , it does everything that was required , it's a neat function , is very nice , decided to use your code , Thank you .

You're welcome, Karol!
 
Back
Top