- Messages
- 777
- Country
...even though it took way to long and probably looks a bit crude to the pros.
The mission: a new switch for the taxi/landing lights on the default Lear 45.
The goal: taxi lights dependent on gear position. They should only be on when the gear is down.
The code...
Any suggestions to clean this up are appreciated.
cheers,
Lane
(still an XML newb, after all these years)
The mission: a new switch for the taxi/landing lights on the default Lear 45.
The goal: taxi lights dependent on gear position. They should only be on when the gear is down.
The code...
Code:
<Gauge Name="3WayLandingLights" Version="1.0">
<Element>
<Select>
<Value>(L:3wayLLswitch,number)</Value>
<Case Value="0">
<Image Name="switch_off.bmp"/>
</Case>
<Case Value="1">
<Image Name="switch_mid.bmp"/>
</Case>
<Case Value="2">
<Image Name="switch_on.bmp"/>
</Case>
</Select>
</Element>
<Element> <!-- Off -->
<Select>
<Value>(L:3wayLLswitch,number) 0 == if{ 0 (>K:LANDING_LIGHTS_SET) (A:LIGHT TAXI,bool) if{ (>K:TOGGLE_TAXI_LIGHTS) } }</Value>
</Select>
</Element>
<Element> <!-- Taxi -->
<Select>
<Value>(L:3wayLLswitch,number) 1 == if{ 0 (>K:LANDING_LIGHTS_SET) }</Value>
</Select>
</Element>
<Element> <!-- Land -->
<Select>
<Value>(L:3wayLLswitch,number) 2 == if{ 1 (>K:LANDING_LIGHTS_SET) }</Value>
</Select>
</Element>
<Element> <!-- Taxi -->
<Select>
<Value>(L:3wayLLswitch,number) 1 == if{ (A:GEAR POSITION,percent) 75 >= if{ (A:LIGHT TAXI,bool) 0 == if{ (>K:TOGGLE_TAXI_LIGHTS) } } els{ (A:LIGHT TAXI,bool) 1 == if{ (>K:TOGGLE_TAXI_LIGHTS) } } }</Value>
</Select>
</Element>
<Element> <!-- Land -->
<Select>
<Value>(L:3wayLLswitch,number) 2 == if{ (A:GEAR POSITION,percent) 75 >= if{ (A:LIGHT TAXI,bool) 0 == if{ (>K:TOGGLE_TAXI_LIGHTS) } } els{ (A:LIGHT TAXI,bool) 1 == if{ (>K:TOGGLE_TAXI_LIGHTS) } } }</Value>
</Select>
</Element>
<Mouse>
<Tooltip>Taxi/Landing Lights</Tooltip>
<Area Left="0" Top="0" Width="34" Height="21">
<Cursor Type="UpArrow"/>
<Click>(L:3wayLLswitch,number) 2 < if{ (L:3wayLLswitch,number) 1 + d (>L:3wayLLswitch,number) }</Click>
</Area>
<Area Left="0" Top="22" Width="34" Height="21">
<Cursor Type="DownArrow"/>
<Click>(L:3wayLLswitch,number) 0 > if{ (L:3wayLLswitch,number) 1 - d (>L:3wayLLswitch,number) }</Click>
</Area>
</Mouse>
</Gauge>
Any suggestions to clean this up are appreciated.
cheers,
Lane
(still an XML newb, after all these years)