<?xml version="1.0"?>

<!-- Lever to swap static ports from  S1/S5 to Emergency port 1 in radar chamber-->

<PropertyList>
 <path>../../../shared/pressure-valve.ac</path>

 <animation>
   <type>knob</type>
   <object-name>valvescrew</object-name>
    <action>
     <binding>
      <command>property-adjust</command>
      <property>an24/Pressure/pitotvalve2</property>
      <factor>0.2</factor>
      <min>-1</min>
      <max>1</max>                
      <wrap>false</wrap>
     </binding>

<!-- S1 and S5 selected or not (atm only S1 is regarded) -->
     <binding>
      <condition>
       <greater-than>
	<property>an24/Pressure/pitotvalve2</property>
	<value>0.9</value>
       </greater-than>
      </condition>
      <command>nasal</command>
      <script>
	pitotstatic.staticswap_S1selected.start();
      </script>
     </binding>

     <binding>
      <condition>
       <less-than>
	<property>an24/Pressure/pitotvalve2</property>
	<value>0.9</value>
       </less-than>
      </condition>
      <command>nasal</command>
      <script>
	pitotstatic.staticswap_S1selected.stop();
      </script>
     </binding>

<!-- E1 selected or not -->
     <binding>
      <condition>
       <less-than>
	<property>an24/Pressure/pitotvalve2</property>
	<value>0.1</value>
       </less-than>
      </condition>
      <command>nasal</command>
      <script>
	pitotstatic.staticswap_E1selected.start();
      </script>
     </binding>

     <binding>
      <condition>
       <greater-than>
	<property>an24/Pressure/pitotvalve2</property>
	<value>0.1</value>
       </greater-than>
      </condition>
      <command>nasal</command>
      <script>
	pitotstatic.staticswap_E1selected.stop();
      </script>
     </binding>
    </action>

  <hovered>
    <binding>
      <command>set-tooltip</command>
      <tooltip-id>pitotvalve2</tooltip-id>
      <label>%s</label>
      <property>an24/Pressure/pitotvalve2</property>
      <mapping>nasal</mapping>
      <script>
        var modes2 = ['Closed', 'Static Ports S1/S5 Main', 'E1 Emergency Port'];
        return modes2[arg[0]];
      </script>
    </binding>
  </hovered>

 </animation>

 <animation>
  <object-name>valvelever</object-name>
  <type>rotate</type>
   <property>an24/Pressure/pitotvalve2</property>
   <factor>30</factor>
   <axis>
    <x>0</x>
    <y>0</y>
    <z>-1</z>
   </axis>
 </animation>

</PropertyList>
