<?xml version="1.0" encoding="UTF-8"?>

<!--
    ##########################################
    
     # DR400-dauphin by PAF team
     # April 2012 : Modified by PAF team
     # http://equipe-flightgear.forumactif.com
    
    ##########################################
-->

<!--
    ELT based on an Artex ELT (now Cobham)
    http://www.acrelectronics.com/products/b/aviation/catalog/elt-remote-switches/remote-switch-standard
    Author: Pavel Cueto
    License: GPL

    Designed to work with the "ELTmessage.nas" file provided in the instrument folder.
    Be sure to link the Nasal in your -set file, typing:
    <nasal>
        <ELT>
            <file>YOUR/INSTRUMENT/FOLDER/ROUTE/HERE/ELTmessage.nas</file>
        </ELT>
    </nasal>
-->

<PropertyList>

    <path>ArtexELT.ac</path>

	<animation>
		<type>material</type>
		<object-name>GroupLighting</object-name>
		<emission>
			<red>0.1</red>
			<green>0.1</green>
			<blue>0.1</blue>
		  <factor-prop>controls/lighting/panel-norm</factor-prop>
		</emission>
	</animation>


	<animation>
        <type>pick</type>
        <object-name>SwitchUp</object-name>
        <visible>false</visible>
        <action>
            <button>0</button>
            <repeatable>false</repeatable>
            <binding>
                <command>property-toggle</command>
                <property>instrumentation/elt/armed</property>
            </binding>
            <binding>
                <command>property-toggle</command>
                <property>instrumentation/elt/on</property>
            </binding>

            <binding>
                <command>property-toggle</command>
                <property>sim/sound/click2</property>
            </binding>
        </action>
        <hovered>
            <binding>
            <command>set-tooltip</command>
                <tooltip-id>elt-switch</tooltip-id>
                <label>ELT: %s</label>
                <property>instrumentation/elt/on</property>
                <mapping>nasal</mapping>
                <script>
                    var m = getprop("/instrumentation/elt/on");
                    if ( m ) return 'ON';
                    return 'ARMED';
                </script>
            </binding>
        </hovered>
    </animation>

    <animation>
        <type>pick</type>
        <object-name>SwitchDown</object-name>
        <visible>false</visible>
        <action>
            <button>0</button>
            <repeatable>false</repeatable> 
            <binding>
                <command>property-assign</command>
                <property>instrumentation/elt/test</property>
                <value type="bool">true</value>
            </binding>
            <binding>
                <command>property-assign</command>
                <property>instrumentation/elt/armed</property>
                <value type="bool">false</value>
            </binding>
            <binding>
                <command>property-assign</command>
                <property>instrumentation/elt/on</property>
                <value type="bool">false</value>
            </binding>
            <binding>
                <command>property-toggle</command>
                <property>sim/sound/click2</property>
            </binding>
            <mod-up>
                <binding>
                    <command>property-assign</command>
                    <property>instrumentation/elt/test</property>
                    <value type="bool">false</value>
                </binding>
                <binding>
                    <command>property-assign</command>
                    <property>instrumentation/elt/armed</property>
                    <value type="bool">false</value>
                </binding>
                <binding>
                    <command>property-assign</command>
                    <property>instrumentation/elt/on</property>
                    <value type="bool">true</value>
                </binding>

                <binding>
                    <command>property-toggle</command>
                    <property>sim/sound/click2</property>
                </binding>
            </mod-up>
        </action>
        <hovered>
            <binding>
                <command>set-tooltip</command>
                <tooltip-id>elt-test</tooltip-id>
                <label>ELT test: %s</label>
                <property>instrumentation/elt/test</property>
                <mapping>nasal</mapping>
                <script>
                    var m = getprop("instrumentation/elt/test");
                    if ( m ) return 'ON';
                    return 'OFF';
                </script>
            </binding>
        </hovered>
    </animation>

    <animation>
        <type>select</type>
        <object-name>Switch</object-name>
        <condition>
            <not>
                <property>instrumentation/elt/test</property>
            </not>
        </condition>
    </animation>

    <animation>
        <type>select</type>
        <object-name>Switch.test</object-name>
        <condition>
            <property>instrumentation/elt/test</property>
        </condition>
    </animation>

    <animation>
        <type>rotate</type>
        <object-name>Switch</object-name>
        <property>instrumentation/elt/on-pos</property>
        <factor>10</factor>
        <center>
            <x-m>0.003</x-m>
            <y-m>0.000</y-m>
            <z-m>0.000</z-m>
        </center>
        <axis>
            <x> 0</x>
            <y>-1</y>
            <z> 0</z>
        </axis>    
    </animation>

    <animation>
        <type>select</type>
        <object-name>Light-ON</object-name>
        <condition>
            <or>
                <property>instrumentation/elt/on</property>
                <property>instrumentation/elt/test</property>
            </or>
        </condition>
    </animation>

    <animation>
        <type>select</type>
        <object-name>Light-OFF</object-name>
        <condition>
            <not>
                <or>
                    <property>instrumentation/elt/on</property>
                    <property>instrumentation/elt/test</property>
                </or>
            </not>
        </condition>
    </animation>

</PropertyList>




