<?xml version="1.0"?>

<!-- C172p-detailed
 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>mooring-parameters</name>
    <layout>vbox</layout>
    <resizable>false</resizable>
    <modal>false</modal>
    <draggable>true</draggable>
    <pref-width>300</pref-width>

    <group>
        <layout>hbox</layout>

        <empty><stretch>true</stretch></empty>
        <text>
            <label>Mooring Parameters</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>vbox</layout>
        <padding>6</padding>

        <checkbox>
            <halign>left</halign>
            <label>Set/Release mooring anchor</label>
            <property>/controls/mooring/anchor</property>
            <live>true</live>
            <enable>
                <and>
                    <not>
                        <property>/sim/freeze/replay-state</property>
                    </not>
                    <property>/fdm/jsbsim/hydro/active-norm</property>
                    <or>
                        <equals>
                            <property>/fdm/jsbsim/bushkit</property>
                            <value>3</value>
                        </equals>
                        <equals>
                            <property>/fdm/jsbsim/bushkit</property>
                            <value>4</value>
                        </equals>
                    </or>
                </and>
            </enable>
            <binding>
                <command>dialog-apply</command>
            </binding>
            <binding>
                <command>nasal</command>
                <script>
                    setprop("/fdm/jsbsim/mooring/anchor-lon", getprop("/position/longitude-deg"));
                    setprop("/fdm/jsbsim/mooring/anchor-lat", getprop("/position/latitude-deg"));
                    setprop("sim/anchorbuoy/enable", 0);
                    setprop("/fdm/jsbsim/mooring/anchor-dist", 0);
                    setprop("/fdm/jsbsim/mooring/anchor-length", 0);
                    setprop("/fdm/jsbsim/mooring/mooring-connected", 0);
                </script>
            </binding>
        </checkbox>
        <group>
            <layout>vbox</layout>
            <group>
                <layout>hbox</layout>
                <text>
                    <label>Wind Dir:</label>
                    <enable>
                        <not>
                            <property>/sim/rendering/rembrandt/enabled</property>
                        </not>
                    </enable>
                </text>
                <text>
                    <property>/environment/wind-from-heading-deg</property>
                    <format>%3.0f</format>
                    <live>true</live>
                    <color>
                        <red>0.2</red>
                        <green>0.9</green>
                        <blue>0.2</blue>
                        <alpha>1</alpha>
                    </color>
                </text>
                <text>
                    <label>Wind Speed:</label>
                    <enable>
                        <not>
                            <property>/sim/rendering/rembrandt/enabled</property>
                        </not>
                    </enable>
                </text>
                <text>
                    <property>/environment/windsock/wind-speed-kt</property>
                    <format>%3.0f</format>
                    <live>true</live>
                    <color>
                        <red>0.2</red>
                        <green>0.9</green>
                        <blue>0.2</blue>
                        <alpha>1</alpha>
                    </color>
                </text>
            </group>
            <group>
                <layout>hbox</layout>
                <text>
                    <label>Heading:</label>
                    <enable>
                        <not>
                            <property>/sim/rendering/rembrandt/enabled</property>
                        </not>
                    </enable>
                </text>
                <text>
                    <property>/orientation/heading-deg</property>
                    <format>%3.0f</format>
                    <live>true</live>
                    <color>
                        <red>0.2</red>
                        <green>0.9</green>
                        <blue>0.2</blue>
                        <alpha>1</alpha>
                    </color>
                </text>
                <text>
                    <label>Fwd Speed:</label>
                    <enable>
                        <not>
                            <property>/sim/rendering/rembrandt/enabled</property>
                        </not>
                    </enable>
                </text>
                <text>
                    <property>/fdm/jsbsim/hydro/vbx-fps</property>
                    <format>%3.0f</format>
                    <live>true</live>
                    <color>
                        <red>0.2</red>
                        <green>0.9</green>
                        <blue>0.2</blue>
                        <alpha>1</alpha>
                    </color>
                </text>
            </group>
        </group>
    </group>

    <hrule/>

    <group>
        <layout>hbox</layout>
        <default-padding>6</default-padding>

        <empty><stretch>true</stretch></empty>

        <button>
            <legend>Close</legend>
            <equal>true</equal>
            <key>Esc</key>
            <default>true</default>
            <binding>
                <command>dialog-close</command>
            </binding>
        </button>
    </group>

</PropertyList>