<?php require_once "atp.header.php"; ?>

<section class="content-wrapper" data-heading="display" id="damping">

	<!--Heading-->
	<div class="page-title">
		<h1>Damping</h1>
		<p>
			Note that values set here, with the exception of TWD/TWS, <strong>only</strong> affect data display and do
			<strong>not</strong> affect calculations.
		</p>
	</div>

	<div class="box top-wrapper">
		<div class="flex-row flex-spaced">
			<div class="tooltip-wrapper">
				<h2>Enable Network Damping</h2>
				<div class="tooltip">
					<p>
						Apply display damping to data sent to Expedition, NMEA0183 over UDP etc.
					</p>
				</div>
			</div>
			<input type="checkbox" id="network-damping">
		</div>	
	</div>

	<!--Damping Grid-->
	<div id="fixed-damping-content">
		<div class="box top-wrapper damping-table" data-sender="0x0f" data-instance="0">
			<fieldset>
				<div class="fixed-damping-grid">
				<h2>Field</h2>
                    <h2>Damping</h2>
                    <h2>Raw Data</h2>
                    <h2>Damped Data</h2>
                    <div>SOG</div>
                    <div class="input-unit">
                        <input type="number" step="0.1" id="sog-damping" data-field="0x0103" data-sender="0x0f00">
                        <span>s</span>
                    </div>
                    <div class="field-container" id="sog-raw" data-field="0x0103" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div class="field-container" id="sog-damped" data-field="0x0103" data-sender="Damping" data-instance="0">&nbsp;</div>
                    <div>COG (&deg;T)</div>
                    <div class="input-unit">
                        <input type="number" step="0.1" id="cog-damping-t" data-field="0x0104" data-sender="0x0f00">
                        <span>s</span>
                    </div>
                    <div class="field-container" id="cog-raw-t" data-field="0x0104" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div class="field-container" id="cog-damped-t" data-field="0x0104" data-sender="Damping" data-instance="0">&nbsp;</div>
                    <div>COG (&deg;M)</div>
                    <div></div>
                    <div class="field-container" id="cog-raw-m" data-field="0x0105" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div class="field-container" id="cog-damped-m" data-field="0x0105" data-sender="Damping" data-instance="0">&nbsp;</div>
                    <div>Heel Angle</div>
                    <div class="input-unit">
                        <input type="number" step="0.1" id="heel-damping" data-field="0x0710" data-sender="0x0f00">
                        <span>s</span>
                    </div>
                    <div class="field-container" id="heel-raw" data-field="0x0710" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div class="field-container" id="heel-damped" data-field="0x0710" data-sender="Damping" data-instance="0">&nbsp;</div>
                    <div>Trim Angle</div>
                    <div class="input-unit">
                        <input type="number" step="0.1" id="trim-damping" data-field="0x0722" data-sender="0x0f00">
                        <span>s</span>
                    </div>
                    <div class="field-container" id="trim-raw" data-field="0x0722" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div class="field-container" id="trim-damped" data-field="0x0722" data-sender="Damping" data-instance="0">&nbsp;</div>
                    <div>Boat Speed (kts)</div>
                    <div class="input-unit">
                        <input type="number" step="0.1" id="bspd-damping" data-field="0x1200" data-sender="0x0f00">
                        <span>s</span>
                    </div>
                    <div class="field-container" id="bspd-raw" data-field="0x1200" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div class="field-container" id="bspd-damped" data-field="0x1200" data-sender="Damping" data-instance="0">&nbsp;</div>
                    <div>AWS (kts)</div>
                    <div class="input-unit">
                        <input type="number" step="0.1" id="aws-damping" data-field="0x1300" data-sender="0x0f00">
                        <span>s</span>
                    </div>
                    <div class="field-container" id="aws-raw" data-field="0x1300" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div class="field-container" id="aws-damped" data-field="0x1300" data-sender="Damping" data-instance="0">&nbsp;</div>
                    <div>AWA</div>
                    <div class="input-unit">
                        <input type="number" step="0.1" id="awa-damping" data-field="0x1302" data-sender="0x0f00">
                        <span>s</span>
                    </div>
                    <div class="field-container" id="awa-raw" data-field="0x1302" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div class="field-container" id="awa-damped" data-field="0x1302" data-sender="Damping" data-instance="0">&nbsp;</div>
                    <div>VMG (kts)</div>
                    <div class="input-unit">
                        <input type="number" step="0.1" id="vmg-damping" data-field="0x1315" data-sender="0x0f00">
                        <span>s</span>
                    </div>
                    <div class="field-container" id="vmg-raw" data-field="0x1315" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div class="field-container" id="vmg-damped" data-field="0x1315" data-sender="Damping" data-instance="0">&nbsp;</div>
                    <div>TWS (kts)</div>
                    <div class="input-unit">
                        <input type="number" step="0.1" id="tws-damping" data-field="0x1320" data-sender="0x0f00">
                        <span>s</span>
                    </div>
                    <!-- TWS is always damped during calculation. The 'raw' value is a per-calculation instantaneous value-->
                    <div class="field-container" id="tws-raw" data-field="0x1329" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div class="field-container" id="tws-damped" data-field="0x1320" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div>TWA</div>
                    <div class="input-unit">
                        <input type="number" step="0.1" id="twa-damping" data-field="0x1322" data-sender="0x0f00">
                        <span>s</span>
                    </div>
                    <div class="field-container" id="twa-raw" data-field="0x132B" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div class="field-container" id="twa-damped" data-field="0x1322" data-sender="Damping" data-instance="0">&nbsp;</div>
                    <div>TWD (&deg;T)</div>
                    <div class="input-unit">
                        <input type="number" step="0.1" id="twd-damping-t" data-field="0x1325" data-sender="0x0f00">
                        <span>s</span>
                    </div>
                    <!-- TWD is always damped during calculation. The 'raw' value is a per-calculation instantaneous value-->
                    <div class="field-container" id="twd-raw-t" data-field="0x1327" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div class="field-container" id="twd-damped-t" data-field="0x1325" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div>TWD (&deg;M)</div>
                    <div></div>
                    <div class="field-container" id="twd-raw-m" data-field="0x1328" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div class="field-container" id="twd-damped-m" data-field="0x1324" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div>Heading (&deg;T)</div>
                    <div class="input-unit">
                        <input type="number" step="0.1" id="heading-damping-t" data-field="0x1500" data-sender="0x0f00">
                        <span>s</span>
                    </div>
                    <div class="field-container" id="hdg-raw-t" data-field="0x1500" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div class="field-container" id="hdg-damped-t" data-field="0x1500" data-sender="Damping" data-instance="0">&nbsp;</div>
                    <div>Heading (&deg;M)</div>
                    <div></div>
                    <div class="field-container" id="hdg-raw-m" data-field="0x1501" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div class="field-container" id="hdg-damped-m" data-field="0x1501" data-sender="Damping" data-instance="0">&nbsp;</div>
                    <div>Course (&deg;T)</div>
                    <div class="input-unit">
                        <input type="number" step="0.1" id="course-damping-t" data-field="0x1520" data-sender="0x0f00">
                        <span>s</span>
                    </div>
                    <div class="field-container" id="course-raw-t" data-field="0x1520" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div class="field-container" id="course-damped-t" data-field="0x1520" data-sender="Damping" data-instance="0">&nbsp;</div>
                    <div>Course (&deg;M)</div>
                    <div></div>
                    <div class="field-container" id="course-raw-m" data-field="0x1521" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div class="field-container" id="course-damped-m" data-field="0x1521" data-sender="Damping" data-instance="0">&nbsp;</div>
                    <div>Rudder Angle</div>
                    <div class="input-unit">
                        <input type="number" step="0.1" id="rudder-damping" data-field="0x0711" data-sender="0x0f00">
                        <span>s</span>
                    </div>
                    <div class="field-container" id="rudder-raw" data-field="0x0711" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div class="field-container" id="rudder-damped" data-field="0x0711" data-sender="Damping" data-instance="0">&nbsp;</div>
					<div>Mast Rotation</div>
                    <div class="input-unit">
                        <input type="number" step="0.1" id="mast-rot-damping" data-field="0x0721" data-sender="0x0f00">
                        <span>s</span>
                    </div>
                    <div class="field-container" id="mast-rot-raw" data-field="0x0721" data-sender="Processor" data-instance="0">&nbsp;</div>
                    <div class="field-container" id="mast-rot-damped" data-field="0x0721" data-sender="Damping" data-instance="0">&nbsp;</div>
				</div>
			</fieldset>
		</div>
	</div>

	<div id="damping-content">

	</div>

	<!--Buttons-->
	<div class="button-box" id="button-container">
		<div class="box box-bottom">
			<a id="ok-button" class="button button-gray button-medium">OK</a>
			<a id="cancel-button" class="button button-gray button-medium">Cancel</a>
			<a id="apply-button" class="button button-gray button-medium">Apply</a>
		</div>
	</div>

</section>

<script type="text/javascript" src="/js/atp.field-names.js" defer></script>
<script type="text/javascript" src="/js/atp.sender-pair.js" defer></script>
<script type="text/javascript" src="/js/atp.damping.js" defer></script>
<script>
$(document).ready(function() {

	let model = new DampingModel();
	let controller = new DampingController(model);
	let view = new DampingView(controller);

});
</script>

<?php require_once "footer.php";?>