<?xml version="1.0"?>

<!-- C182s Skylane
 This program 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.

 This program 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.
-->

<PropertyList>

    <name>aircraft-dialog</name>
    <layout>vbox</layout>
    <resizable>false</resizable>
    <modal>false</modal>
    <draggable>true</draggable>

    <group>
        <layout>hbox</layout>

        <empty><stretch>true</stretch></empty>
        <text>
            <label>Aircraft Options</label>
        </text>
        <empty><stretch>true</stretch></empty>

        <button>
            <legend/>
            <key>Esc</key>
            <pref-width>16</pref-width>
            <pref-height>16</pref-height>
            <binding>
                <command>dialog-close</command>
            </binding>
		</button>
	</group>

	<hrule/>	

	<group>
		<layout>hbox</layout>
		<padding>6</padding>
		<checkbox>
			<halign>left</halign>
			<label>Place left safety cone</label>
			<live>true</live>
			<property>/sim/coneL/enable</property>
			<enable>
				<less-than>
					<property>velocities/groundspeed-kt</property>
					<value>0.1</value>
				</less-than>
			</enable>
			<binding>
				<command>property-toggle</command>
				<property>/sim/coneL/enable</property>
			</binding>
			<binding>
				<command>dialog-update</command>
			</binding>
		</checkbox>	

		<checkbox>
			<halign>left</halign>
			<label>Place right safety cone</label>
			<live>true</live>
			<property>/sim/coneR/enable</property>
			<enable>
				<less-than>
					<property>velocities/groundspeed-kt</property>
					<value>0.1</value>
				</less-than>
			</enable>
			<binding>
				<command>property-toggle</command>
				<property>/sim/coneR/enable</property>
			</binding>
			<binding>
				<command>dialog-update</command>
			</binding>
		</checkbox>
	</group>	
    
    <hrule/>
	
	<group>
		<layout>hbox</layout>
		<padding>6</padding>
		<checkbox>
            <halign>left</halign>
            <label>Place nose wheel chock</label>
            <live>true</live>
			<property>/sim/chocks001/enable</property>
			<enable>
                <less-than>
                    <property>velocities/groundspeed-kt</property>
                    <value>0.1</value>
                </less-than>
			</enable>
            <binding>
				<command>property-toggle</command>
				<property>/sim/chocks001/enable</property>
            </binding>
			<binding>
                <command>dialog-update</command>
            </binding>
		</checkbox>
	
		<checkbox>
            <halign>center</halign>
            <label>Place left wheel chock</label>
            <live>true</live>
			<property>/sim/chocks002/enable</property>
			<enable>
                <less-than>
                    <property>velocities/groundspeed-kt</property>
                    <value>0.1</value>
                </less-than>
			</enable>
            <binding>
                <command>property-toggle</command>
				<property>/sim/chocks002/enable</property>
            </binding>
			<binding>
                <command>dialog-update</command>
            </binding>
		</checkbox>
	
		<checkbox>
            <halign>right</halign>
            <label>Place right wheel chock</label>
			<live>true</live>
			<property>/sim/chocks003/enable</property>
			<enable>
                <less-than>
                <property>velocities/groundspeed-kt</property>
                <value>0.1</value>
                </less-than>
			</enable>
            <binding>
                <command>property-toggle</command>
				<property>/sim/chocks003/enable</property>
            </binding>
			<binding>
				<command>dialog-update</command>
            </binding>
		</checkbox>
	</group>	
	
	<hrule/>
 
	<group>
		<layout>hbox</layout>
		<padding>6</padding>
            <checkbox>
                <halign>left</halign>
                <label>Place Ground Power Unit</label>
                <live>true</live>
                <property>/sim/gpu/enable</property>
                <enable>
                    <and>
                        <less-than>
                            <property>velocities/groundspeed-kt</property>
                            <value>0.1</value>
                        </less-than>
                        <not>
                            <property>/controls/electric/external-power</property>
                        </not>
                    </and>
                </enable>
                <binding>
                    <command>property-toggle</command>
                    <property>/sim/gpu/enable</property>
                </binding>
                <binding>
                    <command>dialog-update</command>
                </binding>
            </checkbox>
			<checkbox>
				<halign>left</halign>
				<label>Connect GPU to aircraft</label>
				<live>true</live>
				<property>/controls/electric/external-power</property>
				<enable>
					<property>/sim/gpu/enable</property>
				</enable>
				<binding>
					<command>property-toggle</command>
					<property>/controls/electric/external-power</property>
				</binding>
				<binding>
					<command>dialog-update</command>
				</binding>
			</checkbox> 
										
	</group>

    <hrule/>

	<group>
		<layout>vbox</layout>
		<padding>6</padding> 
			<checkbox>
                <halign>left</halign>
                <label>Attach Towbar</label>
                <property>/fdm/jsbsim/external_reactions/towbar/attached</property>
                <live>true</live>
                <binding>
                    <command>property-toggle</command>
                    <property>/fdm/jsbsim/external_reactions/towbar/attached</property>
                </binding>
                <binding>
                    <command>property-assign</command>
                    <property>/fdm/jsbsim/external_reactions/towbar/steer-deg</property>
                    <value>0</value>
                </binding>
                <binding>
                    <command>dialog-update</command><!-- makes sure that command is still there when dialog is closed-->
                </binding>
                <enable>
                    <and>
                        <property>gear/gear[0]/wow</property>
                        <less-than>
                            <property>velocities/groundspeed-kt</property>
                            <value>1.0</value>
                        </less-than>
                        <less-than>
                            <property>/engines/engine/thruster/rpm</property>
                            <value>0.01</value>
                        </less-than>
                    </and>
                </enable>
            </checkbox>
	</group>
	
</PropertyList>
