<?xml version="1.0"?>

<!--
    Copyright 2018, Daniel Meissner (daniel_hl.83@googlemail.com)
 
    This file is part of the Flightgear CRJ700-family.

    The Flightgear CRJ700-family is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 2 of the License, or
    (at your option) any later version.

    The Flightgear CRJ700-family is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with the Flightgear CRJ700-family.  If not, see <http://www.gnu.org/licenses/>.
 -->

<system name="Flaps">
	<channel name="Flaps">
		<kinematic name="Flaps Control">
			<input>fcs/flap-cmd-norm</input>
			<traverse>
				<setting>
					<position>  0 </position>
					<time>      0 </time>
				</setting>
				<setting>
					<position>  1 </position>
					<time>      0.5 </time>
				</setting>
				<setting>
					<position> 8 </position>
					<time>      2.49 </time>
				</setting>
				<setting>
					<position> 20 </position>
					<time>      4.75 </time>
				</setting>
				<setting>
					<position> 30 </position>
					<time>      3.715 </time>
				</setting>
				<setting>
					<position> 45 </position>
					<time>      5.573 </time>
				</setting>
			</traverse>
			<output>fcs/flap-inbd-pos-deg</output>
            <output>fcs/flap-pos-deg</output>
		</kinematic>
		<aerosurface_scale name="Inboard Flap Normalization">
			<input>fcs/flap-inbd-pos-deg</input>
			<domain>
				<min>  0 </min>
				<max> 45 </max>
			</domain>
			<range>
				<min> 0 </min>
				<max> 1 </max>
			</range>
			<output>fcs/flap-inbd-pos-norm</output>
            <output>fcs/flap-pos-norm</output>
		</aerosurface_scale>
        
        <aerosurface_scale name="Outboard Flap Control">
            <input>fcs/flap-inbd-pos-deg</input>
            <domain>
                <min>  0 </min>
                <max> 45 </max>
            </domain>
            <range>
                <min>  9 </min>
                <max> 40 </max>
            </range>
            <output>fcs/flap-outbd-pos-deg</output>
        </aerosurface_scale>
        
        <aerosurface_scale name="Outboard Flap Normalization">
			<input>fcs/flap-outbd-pos-deg</input>
			<domain>
				<min>  0 </min>
				<max> 40 </max>
			</domain>
			<range>
				<min> 0 </min>
				<max> 1 </max>
			</range>
			<output>fcs/flap-outbd-pos-norm</output>
		</aerosurface_scale>
    </channel>
</system>
