• 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 I don't want flashing text!

Messages
97
Country
sweden
How do I prevent the, "Nav Rdy" text from flashing? I want it to appear when the time has expired.

Code:
<Macro id="NavrdyTimer" Name="NavrdyTimer">
            <MacroValue>(L:Navrdy,bool) 1 == (P:Local Time,seconds) 1 * 20 % near if{ 1 } els{ 0 } !
</MacroValue>
        </Macro>
 
 
<Element id="onoroff">
<Visibility>(A:Avionics Master Switch,bool) (A:CIRCUIT GENERAL PANEL ON, bool)</Visibility>      
 
////////------------------------- Upper Window Readouts -------------------------////
 
                
<Element id="Inertial Readout - NavRdy">
            <FloatPosition>316.000,108.000</FloatPosition>
            <Visibility>@NavrdyTimer (L:Inertial Data,number) 1 == &amp;&amp;</Visibility>
<GaugeText id="Inertial Align">
                <Bright>True</Bright>
        <Luminous>True</Luminous>
                <FontFace>Quartz</FontFace>
                <FontColor>NEONGreen</FontColor>
                <FontHeight>22</FontHeight>
                  <GaugeString>NAV RDY</GaugeString>
                <HorizontalAlign>LEFT</HorizontalAlign>
                <Italic>false</Italic>
                <Size>162,24</Size>
                <Transparent>True</Transparent>
            </GaugeText>

Regards,
John
 
Messages
1,564
Country
thailand
John,

It's a little difficult to know what you are asking - what expired time are you referring to? Do you want "Nav Rdy" to appear 20 seconds after the Avionics Master Switch is clicked 'On'? Or, do you want "Nav Rdy" to appear for 20 (or whatever) seconds only after some other time has expired?

What's the purpose of (L:Navrdy, bool)? Is that what you want to use to control display of the "Nav Rdy" text?

If you can explain what you want to do a little more thoroughly you'll get a lot of help.

Cheers
 
Messages
97
Country
sweden
I am trying to create a Lasertrack system and there is a Knob on this panel (L:Inertial Data,number) that you can twist from off 0 == to align 1 == and then nav 3 == or att 4 ==. Just like a INS alignment system. When I twist the knob from off 0 == to align 1 == there is a small display at the top of the instrument that readout Nav Rdy after a certain amount of minutes (I am not sure how many yet).

The <Visibility>(A:Avionics Master Switch,bool) (A:CIRCUIT GENERAL PANEL ON, bool)</Visibility> just control if the displays will show anything when the alignment knob is twisted from off to any of the above mentioned positions and if the keypads will lightup and so on. Basically it just checks if there is any electrical juice to the system and is not relevant.

So basicly I want the, "Nav Rdy" text to showup after the alignment knob (L:Inertial Data,number) have been twisted from off 0 == to align 1 == and the, "Nav Rdy" text will appear 10 minutes or so after doing this when the system is aligned.

YOU:
What's the purpose of (L:Navrdy, bool)? Is that what you want to use to control display of the "Nav Rdy" text?

ANSWER:
The (L:Navrdy,bool) was just an experiment.......I should have removed that before posting. I did think that it could possibly control the, "Nav Rdy" text but there is probably a more easy way of doing this???

Any suggestions?

Regards,
John
 
Messages
1,564
Country
thailand
One approach involves storing the time at which the knob is switched from 0 to 1, and turning on the NAV RDY text. That part is included the mouse click instructions for the knob. Then, turn off NAV RDY text when the current time is 10 minutes greater than the stored time.

I think the following works though probably isn't quite efficient:

Code:
<Click Kind="LeftSingle+RightSingle">              
    (M:Event) 'LeftSingle'  scmp 0 == if{ (L:Inertial Data, enum) (>L:Inertial Data Previous, enum) 0 (L:Inertial Data, enum) -- max (>L:Inertial Data, enum) }
    (M:Event) 'RightSingle' scmp 0 == if{ (L:Inertial Data, enum) (>L:Inertial Data Previous, enum) 4 (L:Inertial Data, enum) ++ min (>L:Inertial Data, enum) }              
    (L:Inertial Data Previous, enum) 0 == (L:Inertial Data, enum) 1 == and if{ (P:ABSOLUTE TIME, minutes) 10 + (>L:Inertial Data Align, minutes) 1 (>L:NavRdy, bool) }
</Click>

and in an Update section:

Code:
(P:ABSOLUTE TIME, minutes) (L:Inertial Data Align, minutes) &gt; if{ 0 (>L:NavRdy, bool) }

Finally, in the NAV RDY display element:

Code:
<Visibility> (L:NavRdy, bool) </Visibility>

Probably can combine the Update part into the Visibility statement.

Bob
 
Messages
97
Country
sweden
:twocents: I tried your method but the Nav Rdy text showed right away when I switched on the system. I do not want the Nav Rdy text to be turned off again after 10 min. it should remain lit after the alignment is finished. In other words, I want the Nav Rdy text to show 10 minutes after I have switched the system on from Off to Align and then remain lit after that.

John
 
Messages
1,564
Country
thailand
then remove 1 (>L:NavRdy, bool) in the Click part and change if{ 0 (>L:NavRdy, bool) } to if{ 1 (>L:NavRdy, bool) }
 
Messages
97
Country
sweden
It did not work....the gauge did not load at all.
I think we should focus on this line:
Code:
<Macro id="NavrdyTimer" Name="NavrdyTimer">
            <MacroValue>(L:Navrdy,bool) 1 == (P:Local Time,seconds) 1 * 20 % near if{ 1 } els{ 0 } !
</MacroValue>
        </Macro>

How do I keep the Macro @NavrdyTimer at 1 or, "high" ? The way the code is written above the Nav Rdy text only flash on after 20 seconds and then off again and turn on again for 1 second after 20 seconds and off again. In other words, flashing every 20 seconds. Maybe if I change the 1 to a infinite value? I will try that.


Didn't work either....the text just flashed faster :banghead:

John
 
Last edited:

taguilo

Resource contributor
Messages
1,585
Country
argentina
You don't need the macro at all.

As Bob showed you before, in the IRS selector <Area><Click>, just check for:

Code:
(L:Inertial Data, enum) 1 == if{ (P:ABSOLUTE TIME, minutes) 10 + (>L:Inertial Data Align, minutes) 0 (>L:NavRdy, bool) }

Then, in the <Update> section:

Code:
(P:ABSOLUTE TIME, minutes) (L:Inertial Data Align, minutes) > if{ 1 (>L:NavRdy, bool) }

And finally in the <Element> section, instead of:

Code:
<Visibility>@NavrdyTimer (L:Inertial Data,number) 1 == &amp;&amp;</Visibility>

write:

Code:
<Visibility>(L:NavRdy, bool)</Visibility>

Also make sure to properly refresh the parent <Element> or your text won't display as desired.

Tom
 
Messages
97
Country
sweden
You don't need the macro at all.

As Bob showed you before, in the IRS selector <Area><Click>, just check for:

Code:
(L:Inertial Data, enum) 1 == if{ (P:ABSOLUTE TIME, minutes) 10 + (>L:Inertial Data Align, minutes) 0 (>L:NavRdy, bool) }

Then, in the <Update> section:

Code:
(P:ABSOLUTE TIME, minutes) (L:Inertial Data Align, minutes) > if{ 1 (>L:NavRdy, bool) }

And finally in the <Element> section, instead of:

Code:
<Visibility>@NavrdyTimer (L:Inertial Data,number) 1 == &amp;&amp;</Visibility>

write:

Code:
<Visibility>(L:NavRdy, bool)</Visibility>

Also make sure to properly refresh the parent <Element> or your text won't display as desired.

Tom

Okej, if I have understood you correctly you wanted me to do this?:


Code:
  <Size>710,874</Size>
        <Element id="Background">
            <FloatPosition>0.000,0.000</FloatPosition>
            <Image id="Image" Name="Lasertrak.bmp">
                <Transparent>True</Transparent>
            </Image>
        </Element>
       
<Update>
  (P:ABSOLUTE TIME, minutes) (L:Inertial Data Align, minutes) > if{ 1 (>L:NavRdy, bool) }         
</Update>
 
 
<Element id="onoroff">
<Visibility>(A:Avionics Master Switch,bool) (A:CIRCUIT GENERAL PANEL ON, bool)</Visibility>      
 
////////------------------------- Upper Window Readouts -------------------------////
 
                
<Element id="Inertial Readout - NavRdy">
            <FloatPosition>316.000,108.000</FloatPosition>
            <Visibility>(L:NavRdy, bool)</Visibility>
<GaugeText id="Inertial Align">
                <Bright>True</Bright>
        <Luminous>True</Luminous>
                <FontFace>Quartz</FontFace>
                <FontColor>NEONGreen</FontColor>
                <FontHeight>22</FontHeight>
                  <GaugeString>NAV RDY</GaugeString>
                <HorizontalAlign>LEFT</HorizontalAlign>
                <Italic>false</Italic>
                <Size>162,24</Size>
                <Transparent>True</Transparent>
            </GaugeText>
        </Element>

And in the mouse section add this:

<MouseArea id="Inertial Data Knob">
<FloatPosition>78.000,39.000</FloatPosition>
<Size>160,164</Size>
<MouseArea id="Inertial Data Knob DEC">
<FloatPosition>0.000,0.000</FloatPosition>
<Size>75,164</Size>
<CursorType>UpArrow</CursorType>
<MouseClick id="MouseClick">
<Script>(L:Inertial Data, enum) 1 == if{ (P:ABSOLUTE TIME, minutes) 10 + (>L:Inertial Data Align, minutes) 0 (>L:NavRdy, bool) }</Script>
<ClickType>LeftSingle</ClickType>
</MouseClick>
</MouseArea>


I can not add the:
<Script>(L:Inertial Data, enum) 1 == if{ (P:ABSOLUTE TIME, minutes) 10 + (>L:Inertial Data Align, minutes) 0 (>L:NavRdy, bool) }</Script>

In the IRS knob section, can I? that looks like this:

<Element id="IRS Knob">
<FloatPosition>78.000,39.000</FloatPosition>
<Select id="Select">
<Expression id="Expression">
<Minimum>0.000</Minimum>
<Maximum>3.000</Maximum>
<Script>(L:Inertial Data,number)</Script>
</Expression>
<Case id="Case">
<ExpressionResult>0.000</ExpressionResult>
<Image id="Image" Name="Navoff.bmp">
<Transparent>True</Transparent>
</Image>
</Case>
<Case id="Case">
<ExpressionResult>1.000</ExpressionResult>
<Image id="Image" Name="Navalign.bmp">
<Transparent>True</Transparent>
</Image>
</Case>
<Case id="Case">
<ExpressionResult>2.000</ExpressionResult>
<Image id="Image" Name="Navnav.bmp">
<Transparent>True</Transparent>
</Image>
</Case>
<Case id="Case">
<ExpressionResult>3.000</ExpressionResult>
<Image id="Image" Name="Navatt.bmp">
<Transparent>True</Transparent>
</Image>
</Case>
</Select>
</Element>
 

taguilo

Resource contributor
Messages
1,585
Country
argentina
These are the changes you should make to your code:

In the <Update> section:

Code:
<Update id="Update">
  <Script>
      (P:ABSOLUTE TIME, minutes) (L:Inertial Data Align, minutes) >
      (L:Inertial Data,number) 1 > and
      if{ 1 (>L:NavRdy, bool) }
  </Script>
</Update>


In the inertial readout's element:

Code:
<Element id="Inertial Readout - NavRdy">
   <FloatPosition>316.000,108.000</FloatPosition>
   <Visibility>(L:NavRdy, bool)</Visibility>
   ...

Finally, in the mouse section:

Code:
<MouseClick id="MouseClick">
   <ClickType>LeftSingle+RightSingle</ClickType>
      <Script>
         (M:Event) 'LeftSingle' scmi 0 ==
         if{
              (L:Inertial Data, enum) ++ 3 min (>L:Inertial Data, enum)
              (L:Inertial Data, enum) 1 ==
              if{ (P:ABSOLUTE TIME, minutes) 10 + (>L:Inertial Data Align, minutes)  }
            }
         (M:Event) 'RightSingle' scmi 0 ==
         if{
              (L:Inertial Data, enum) -- 0 max (>L:Inertial Data, enum)
              (L:Inertial Data, enum) 0 ==
              if{ 0 (>L:NavRdy, bool) }
            }
     </Script>



And that's all, no need to touch the IRS knob's section.

Tom
 
Messages
97
Country
sweden
:D Hello again Tom,

I managed to get it all to work now. I just changed the 1 to a 0 below so that the alignment begun when I twisted the knob from 0 to 1:

Code:
<Update id="Update">
  <Script>
      (P:ABSOLUTE TIME, minutes) (L:Inertial Data Align, minutes) >
      (L:Inertial Data,number) 1 > and
      if{ 1 (>L:NavRdy, bool) }
  </Script>
</Update>

:greenflag In the mouse section I had to change the scmi code to scmp and I made some other small adjustments:

<MouseArea id="Inertial Data Knob">
<FloatPosition>78.000,39.000</FloatPosition>
<Size>160,164</Size>
<MouseArea id="Inertial Data Knob INC">
<FloatPosition>74.000,0.000</FloatPosition>
<Size>75,164</Size>
<CursorType>UpArrow</CursorType>
<MouseClick id="MouseClick">
<Script>scmp 0 == if{ (L:Inertial Data, enum) ++ 3 min (>L:Inertial Data, enum) (L:Inertial Data, enum) 1 ==
if{ (P:ABSOLUTE TIME, minutes) 17 + (>L:Inertial Data Align, minutes) }
}</Script>
<ClickType>LeftSingle</ClickType>
</MouseClick>
</MouseArea>
<MouseArea id="Inertial Data Knob DEC">
<FloatPosition>0.000,0.000</FloatPosition>
<Size>74,164</Size>
<CursorType>DownArrow</CursorType>
<MouseClick id="MouseClick">
<Script>scmp 0 == if{ (L:Inertial Data, enum) -- 0 max (>L:Inertial Data, enum) (L:Inertial Data, enum) 0 ==
if{ 0 (>L:NavRdy, bool) }
} </Script>
<ClickType>LeftSingle</ClickType>
</MouseClick>
</MouseArea>
</MouseArea>

Thank you for your help once again. This will help me to create some of the other gauges too, much appreciated. :stirthepo
Regards,
John
 

taguilo

Resource contributor
Messages
1,585
Country
argentina
John,

Good that you got it working.

Just a comment regarding <Mouse> scripts:

<Script>scmp 0 == if{ (L:Inertial Data, enum) ++ 3 min (>L:Inertial Data, enum) (L:Inertial Data, enum) 1 ==
if{ (P:ABSOLUTE TIME, minutes) 17 + (>L:Inertial Data Align, minutes) }
}</Script>


the parts in red are not necessary at all. As you wrote <ClickType>LeftSingle</ClickType>, the scrip will execute only when you click the left button so there is no need to code a conditional detection.
If you'd had written <ClickType>LeftSingle+RightSingle</ClickType>, the script would execute when either left or right button is clicked and in this case it would be necessary to detect which one was pressed, then writing:

(M:Event) 'LeftSingle' scmi 0 == if{ do something }
(M:Event) 'RightSingle' scmi 0 == if{ do something }


or also

(M:Event) 'LeftSingle' scmi 0 == if{ do something } els{ do something }

Tom
 
Top