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

FS2004 TRU Display

Messages
1,468
Country
italy
I have a problem with the needle display. When I select a different bus the needle stays steadfastly fixed. Because the voltage values are the same. What I want to see however, is the needle to flicker momentarily each time I move the selector switch. I have tried a couple of ideas but they don't have any effect.

Is there a way of making this happen? Many thanks.
 
I assume your needle uses simulation vars (A:xxxxx,volts) and your selector uses a keyevent (K: ) An easy solution could be this:

Change the value in the needle gauge from (A:xxxx,volts) to (A:xxxx,volts) (L:needle flicker, volts) -
Give (L:needle flicker,volts) a positive value any time you toggle the selector (if you use keyevents you can use a "on event" script) this way 6 (>L:needle flicker, volts). This will be the amount of volts
the needle will drop.
Finally, add an update section to your needle gauge with (L:needle flicker, volts) 0.3 - 0 max (>L:needle flicker, volts). In this example, 6/(0.3x18) = 1.1 seconds of recovery time.

In sum, this way you will see an inmediate drop in voltage and a subsequent and gradual recovery. And you can play with voltage drop and time of recovery to simulate the effect as you like.
 
I assume your needle uses simulation vars (A:xxxxx,volts) and your selector uses a keyevent (K: ) An easy solution could be this:

Change the value in the needle gauge from (A:xxxx,volts) to (A:xxxx,volts) (L:needle flicker, volts) -
Give (L:needle flicker,volts) a positive value any time you toggle the selector (if you use keyevents you can use a "on event" script) this way 6 (>L:needle flicker, volts). This will be the amount of volts
the needle will drop.
Finally, add an update section to your needle gauge with (L:needle flicker, volts) 0.3 - 0 max (>L:needle flicker, volts). In this example, 6/(0.3x18) = 1.1 seconds of recovery time.

In sum, this way you will see an inmediate drop in voltage and a subsequent and gradual recovery. And you can play with voltage drop and time of recovery to simulate the effect as you like.

Thanks for that. I'll give it a try.
It works but it seems to be in reverse. The gauge reads zero instead of 28 volts. And when I change the switch the needle flickers a bit. What I want to see is the needle reading 28 volts and when I change the switch for the needle to flicker and then read the next voltage.
 
Last edited:
You'r welcome. If you have access to the selector code (if its a xml gauge or it is driven by a mouserect in the .mdl file) you don't need to use a "on event" script. Just
add the 6 (>L:needle flicker, volts) code to the mouse click script.

And perhaps would be more efficient to change:

Code:
(L:needle flicker,volts) 0.3 - 0 max (>L:needle flicker,volts)

for
Code:
(L:needle flicker,volts) 0 > if{ (L:needle flicker,volts) 0.3 - 0 max (>L:needle flicker,volts) }

This way the system will make the computation only when needed.
 
Last edited:
What I have is
Code:
<Mouse>
<Tooltip>Stby TRU</Tooltip>
      <Area Left="0" Top="0" Width="105" Height="376">
        <Cursor Type="Hand"/>
         <Click>1 (&gt;G:Var1) 1 (>L:Sound_click,enum) 0 (>L:TRU_TEST,number) 1 (>L:Stby_TRU_sw,number) 6 (>L:needle flicker, volts)</Click>
      </Area>
      <Area Left="106" Top="0" Width="105" Height="376">
         <Cursor Type="Hand"/>
         <Click>0 (&gt;G:Var1) 1 (>L:Sound_click,enum) 0 (>L:TRU_TEST,number) 0 (>L:Stby_TRU_sw,number) 6 (>L:needle flicker, volts)</Click>
      </Area>
      <Area Left="211" Top="0" Width="105" Height="376">
         <Cursor Type="Hand"/>
         <Click>2 (&gt;G:Var1) 1 (>L:Sound_click,enum) 2 (>L:TRU_TEST,number) 2 (>L:Stby_TRU_sw,number) 6 (>L:needle flicker, volts)</Click>
      </Area>
   </Mouse>
as the mouse part of the selector switch.
And the gauge itself
Code:
<Gauge Name="STBY TRU Amps" Version="1.0">
   <Image Name="TRU_AMPS.bmp" Luminous="1"/>
<Update>
(L:needle flicker, volts) 0.3 - 0 max (>L:needle flicker, volts)
</Update>
<Element>
      <Position X="0" Y="0"/>
      <Select>
         <Value>(L:OHP_ILL,bool) 1 == (L:BUS_SWITCH,number) (P:local time, seconds) &lt; and</Value>
         <Case Value="1">
            <Image Name="tru_ring.bmp" Bright="Yes"/>
         </Case>
      </Select>
   </Element>

   <Element>
      <Position X="200" Y="152"/>
      <Image Name="NEEDLE_TRU.bmp" Luminous="1" PointsTo="South">
         <Axis X="45" Y="47"/>
      </Image>
      <Rotate>
         <Value>(L:Stby_TRU_res,number) (L:needle flicker, volts)</Value>
         <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="0"/>
         </Failures>
         <Nonlinearity>
            <Item Value="40.00" X="316" Y="224"/>
            <Item Value="28.00" X="246" Y="282"/>          
            <Item Value="0" X="95" Y="254"/>
         </Nonlinearity>
         <Delay DegreesPerSecond="300"/>
      </Rotate>
   </Element>
</Gauge>
The problem is that the selector switch has three positions. When each position is selected the needle is deflected to show 28 volts. The needle is steady. What I am trying to achieve is for the needle to flicker when I change the switch. But at the moment with your solution the needle does flicker but shows zero and not 28volts even though (L:Stby_TRU_res,number) has that value. In the image 28 volts is equivalent to the red mark on the dial.
TRU_AMPS.jpg
It seems the steady state of the needle with your solution is zero not 28volts.
 
Last edited:
Hi. You have an error. You should change this:

Code:
<Value>(L:Stby_TRU_res,number) (L:needle flicker, volts)</Value>

For this:

Code:
<Value>(L:Stby_TRU_res,number) (L:needle flicker, volts) -</Value>


This means that the needle will point to the value of (L:Stby_TRU_res,number) minus (L:needle flicker, volts). In this language a b - means a - b.
 
Thanks I'll try that.

Got it working nicely. Thanks. My mistake, I didn't spot the minus in your original post.
Here's the DC panel the bottom part of the main electrical panel. There's still loads and loads to do.
dc.jpg
 
Last edited:
What if you created a timer, set the needle 'in' a Element (embedded) and have the timer turn the entire Element system in a blip, only when a certain event occurs and returns it back to start? Can that be done? Timer with rotation around an axis...
I guess your timer would need to be separate and it initializes when things align and then the L:var engages.
 
What if you created a timer, set the needle 'in' a Element (embedded) and have the timer turn the entire Element system in a blip, only when a certain event occurs and returns it back to start? Can that be done? Timer with rotation around an axis...
I guess your timer would need to be separate and it initializes when things align and then the L:var engages.

Perhaps that would be another solution but I find "my" system more simple and easy to implement. Of course, it's a matter of choice. Regards.
 
Perhaps that would be another solution but I find "my" system more simple and easy to implement. Of course, it's a matter of choice. Regards.
The only problem with a timer is that it would have to be a very short "time". It is in effect just a twitch. Disconnecting from one supply and reconnecting to another. So this works well for that. For anything else of a few seconds or more a timer would be a good idea.
for example pretty much every light and needle gauge has this
(L:BUS_SWITCH,number) (P:local time, seconds) &lt; and which is a timer and turns everything off so that the lights blink etc when I turn the ground/flight switch from one to the other.
And, part of Palacio's code is a voltage level to which the needle drops to and then the update times how quickly the needle recovers.
 
Last edited:
Yes, it could be. For this I use a random value that I add to the code:

Code:
<Value>(L:Stby_TRU_res,number) (L:needle flicker, volts) - (L:ramdom value, number) +</Value>

This random value can take positive and negative values and has to be generated in the update section. It can be dependent
on airspeed, engine revolutions or any other simulation variable as well.
 
Last edited:
Back
Top