<?xml version="1.0"?>
<!--	Dornier DO228(-212 NG) Hydraulic System	-->
<!--	Benedikt Wolf (D-ECHO) based on nasal hydraulic system by Joshua Davidson	-->

<!--
	Reference: ref.[1] p.7-27ff.
		Description
	* there is one hydraulic system
	* it powers:
		* Landing Gear ( retraction/extension )
		* Wheel Brakes
		* Nose Wheel Steering
	* pressure: 3000 PSI
	* reservoir capacity: max. 3.2l
	* operating when:
		* HYDRAULIC switch NORM _and_ Landing Gear not up and locked
		* HYDRAULIC switch MAN ON
	* powered by:
		* WHEN HYDRAULIC switch NORM: GPU or generator
		* WHEN HYDRAULIC switch MAN ON: GPU, battery or generator-->
		

<system name="Dornier DO228: Hydraulic System">
	<channel name="Logic">
		<!--	Hydraulics Switch:
				0	OFF
				1	NORM
				2	MAN ON
		-->
		<switch name="systems/hydraulic/gear-transit">
			<default value="0"/>
			<test value="1" logic="AND">
				gear/gear-cmd-norm eq 1.0
				gear/gear-pos-norm eq 0.0
			</test>
			<test value="1">
				gear/gear-pos-norm ne 0.0
			</test>
		</switch>
		<switch name="systems/hydraulic/active-cmd">
			<default value="0"/>
			<test value="1" logic="AND">
				/controls/hydraulic/hydraulic-switch eq 1
				systems/hydraulic/gear-transit eq 1
			</test>
			<test value="1">
				/controls/hydraulic/hydraulic-switch eq 2
			</test>
		</switch>
	</channel>
	<channel name="Power">
		<switch name="systems/hydraulic/powered">
			<default value="0"/>
			<test value="1" logic="OR">
				propulsion/engine[0]/set-running eq 1
				propulsion/engine[1]/set-running eq 1
				<!-- put GPU property here -->
			</test>
			<test value="1" logic="AND">
				/controls/hydraulic/hydraulic-switch eq 2
				<!-- put battery bus property here -->
			</test>
		</switch>
	</channel>
	<channel name="System Pressure">
		<switch name="systems/hydraulic/pressure-raw-psi">
			<default value="0"/>
			<test value="3000" logic="AND">
				systems/hydraulic/powered eq 1
				systems/hydraulic/active-cmd eq 1
			</test>
		</switch>
		<lag_filter>
			<input>systems/hydraulic/pressure-raw-psi</input>
			<c1>5.0</c1>
			<output>systems/hydraulic/pressure-psi</output>
		</lag_filter>
	</channel>
</system>
