<?xml version="1.0"?>
<!--
        Description: F-104G system
        Author: Richard Harrison (rjh@zaretto.com)
    -->

<system name="hydraulic">

    <property value="3022">systems/hydraulics/normal-pressure</property>
    <property value="0">systems/hydraulics/number1-system-pump-failed</property>
    <property value="0">systems/hydraulics/number2-system-pump-failed</property>
    <property value="0">systems/hydraulics/landing-gear-standby-accumulator-psi</property>
    <channel name="Hyds">
        <scheduled_gain name="systems/hydraulics/number1-system-pump-psi">
            <input>propulsion/engine[0]/n2</input>
            <table>
                <independentVar lookup="row">propulsion/engine[0]/n2</independentVar>
                <independentVar lookup="column">systems/hydraulics/number1-system-pump-failed</independentVar>
                <tableData>
                    0      1
                    0       0      0
                    18    130      0
                </tableData>
            </table>
            <clipto>
                <min> 0 </min>
                <max>systems/hydraulics/normal-pressure</max>
            </clipto>
        </scheduled_gain>
        <scheduled_gain name="systems/hydraulics/number2-system-pump-psi">
            <input>propulsion/engine[0]/n2</input>
            <table>
                <independentVar lookup="row">propulsion/engine[0]/n2</independentVar>
                <independentVar lookup="column">systems/hydraulics/number2-system-pump-failed</independentVar>
                <tableData>
                    0      1
                    0       0      0
                    18    130      0
                </tableData>
            </table>
            <clipto>
                <min> 0 </min>
                <max>systems/hydraulics/normal-pressure</max>
            </clipto>
        </scheduled_gain>
        <switch name="systems/hydraulics/number1-system-pressure">
            <default value="0"/>
            <test  logic="AND" value="1">
                systems/hydraulics/number1-system-pump-psi ge 1800
            </test>
        </switch>
        <switch name="systems/hydraulics/number2-system-pressure">
            <default value="0"/>
            <test  logic="AND" value="1">
                systems/hydraulics/number2-system-pump-psi ge 2000
            </test>
        </switch>
        <switch name="systems/hydraulics/system-pressure1">
            <default value="0"/>
            <test  logic="OR" value="1">
                systems/hydraulics/number1-system-pump-psi ge 1800
                systems/hydraulics/number2-system-pump-psi ge 1800
            </test>
        </switch>
        <switch name="systems/hydraulics/system-pressure">
            <default value="systems/hydraulics/system-pressure1"/>
        </switch>
    </channel>

</system>
