<?xml version="1.0"?>


<system name="instruments-lights">

    <property>systems/effets/lights/blinker-kinemat-out</property>
   

    <channel name="lights">
        <switch name="instruments factor SW">
            <default value="0"/>
            <test  logic="AND" value="1">
		electrical/switch/master == 1
                electrical/outputs/instrument-lights gt 27
            </test>
	    <output>electrical/instruments-factor</output>
            <output>/instrumentation/nav[0]/power-btn</output>
            <output>/instrumentation/nav[1]/power-btn</output>
        </switch>
	
	<scheduled_gain name="animation/instrument-dimmer">
            <input>/sim/model/lighting/instrument-lights</input>
            <table>
                <independentVar lookup="row">/sim/time/sun-angle-rad</independentVar>
                <tableData>
                    0.5  0.4
                    1.5  0.8
                    1.8  1
                </tableData>
            </table>
        </scheduled_gain>
	
	<pure_gain name="electrical/instrument-lights">
            <input>electrical/instruments-factor</input>
            <gain>animation/instrument-dimmer</gain>
            <output>electrical/lighting/instruments-norm</output>
	</pure_gain>

        <switch name="electrical/avionic/instruments_power">
            <default value="0"/>
            <test  logic="AND" value="1">
                electrical/avionic/instruments GE 27
            </test>
        </switch>

    </channel>

    <channel name="light-outdoor">

        <switch name="electrical/landing-light">
            <default value="0"/>
            <test logic="AND" value="1">
                electrical/generic/landing-light-power  == 1
                electrical/outputs/landing-light  gt 24
            </test>
        </switch>
	
	<switch name="electrical/position-light">
            <default value="0"/>
            <test logic="AND" value="1">
                electrical/generic/position-light  == 1
                electrical/outputs/position-lights  gt 24
            </test>
        </switch>
	
	<switch name="electrical/strobe-lights">
            <default value="0"/>
            <test logic="AND" value="1">
                electrical/generic/strobe-lights-power == 1
                electrical/outputs/strobe-lights  gt 24
            </test>
        </switch>
	
	<switch name="electrical/beacon">
            <default value="0"/>
            <test logic="AND" value="1">
                electrical/generic/beacon-power == 1
                electrical/outputs/beacon  gt 24
            </test>
        </switch>
	


        <switch name="blinker-sw">
            <default value="systems/effets/lights/blinker-kinemat-in"/>
            <test logic="AND" value="1">
                systems/effets/lights/blinker-kinemat-in == 0
                systems/effets/lights/blinker-kinemat-out == 0
            </test>
            <test logic="AND" value="0">
                systems/effets/lights/blinker-kinemat-in == 1
                systems/effets/lights/blinker-kinemat-out == 1
            </test>
            <output>systems/effets/lights/blinker-kinemat-in</output>
        </switch>

        <kinematic name="blinker-norm-light">
            <input>systems/effets/lights/blinker-kinemat-in</input>
            <traverse>
                <setting>
                    <position>0</position>
                    <time>0</time>
                </setting>
                <setting>
                    <position>1</position>
                    <time>1</time>
                </setting>
            </traverse>
            <output>systems/effets/lights/blinker-kinemat-out</output>
        </kinematic>

        <switch name="beacon1-sw">
            <default value="0"/>
            <test logic="AND" value="1">
                systems/effets/lights/blinker-kinemat-out gt 0.90
                systems/effets/lights/blinker-kinemat-out lt 0.97
            </test>
            <output>systems/effets/lights/beacon1-on</output>
        </switch>

        <switch name="beacon2-sw">
            <default value="1"/>
            <test logic="AND" value="0">
                systems/effets/lights/blinker-kinemat-out gt 0.03
                systems/effets/lights/blinker-kinemat-out lt 0.10
            </test>
            <output>systems/effets/lights/beacon2-on</output>
        </switch>

        <switch name="beacon-sw">
            <default value="0"/>
            <test logic="AND" value="1">
                systems/effets/lights/blinker-kinemat-out gt 0.90
                systems/effets/lights/blinker-kinemat-out lt 0.97
            </test>
            <output>systems/effets/lights/beacon-on</output>
        </switch>


    </channel>


</system>
