I am trying to get a light to work correctly, and it kind of works. Even if it is wrong.
The light is on, as long as the switch is hold, but i does not take in account if the fuel valve is shut or not.
Ideally this light should shut after 2 seconds, even if the switch is hold. The manual says "Light on for 2 seconds", valve ok. If light is hold more than 3 sec, something is wrong.
So in addition to fix the code, I need to incorporate (P:local time, seconds) to this syntax, somehow?
Anyone?
Rotorhub
The light is on, as long as the switch is hold, but i does not take in account if the fuel valve is shut or not.
Ideally this light should shut after 2 seconds, even if the switch is hold. The manual says "Light on for 2 seconds", valve ok. If light is hold more than 3 sec, something is wrong.
So in addition to fix the code, I need to incorporate (P:local time, seconds) to this syntax, somehow?
Anyone?
Rotorhub
Code:
<PartInfo>
<Name>T4_valve_L_light</Name> <!-- show only during valve test -->
<Visibility>
<Parameter>
<Code>
(A:CIRCUIT GENERAL PANEL ON, bool) 1 == (L:T4_valve_L, number) 1 == and if{(A:GENERAL ENG FUEL VALVE:1, bool) 1 == } els{ 0 }
</Code>
</Parameter>
</Visibility>
</PartInfo>
Code:
<PartInfo>
<Name>T4_valve_L</Name>
<AnimLength>50</AnimLength>
<Animation>
<Parameter>
<Code>(L:T4_valve_L, number) 50 *</Code>
<Lag>400</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>hand</Cursor>
<TooltipText>T4_valve_L</TooltipText>
<MouseFlags>LeftSingle+LeftRelease+LeftDrag</MouseFlags>
<CallbackCode>
(M:Event) 'LeftRelease' scmp 0 == if{ 0 (>L:T4_valve_L, number) }
(M:Event) 'LeftSingle' scmp 0 == if{ 1 (>L:T4_valve_L, number) }
</CallbackCode>
</MouseRect>
</PartInfo>

