<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="../XSLT/decoder.xsl"?>
<!DOCTYPE decoder-config SYSTEM "../DTD/decoder-config.dtd">

<!-- Copyright (C) JMRI 2003, 2005 All rights reserved -->
<!-- $Id: Kuehn_ZTC217.xml,v 1.3 2007/09/21 05:49:31 jacobsen Exp $ -->
<!--                                                                        -->
<!-- JMRI is free software; you can redistribute it and/or modify it under  -->
<!-- the terms of version 2 of the GNU General Public License as published  -->
<!-- by the Free Software Foundation. See the "COPYING" file for a copy     -->
<!-- of this license.                                                       -->
<!--                                                                        -->
<!-- JMRI 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.                                                      -->

<decoder-config>
		<version author="Bob Blackwell afticarr@sympatico.ca)"
			version="1" lastUpdated="20060812" />

<!-- ZTC Speed Stabilized / WhisperDrive decoder -->

<decoder>
	<family name="ZTC WhisperDrive" mfg="Kuehn" lowVersionID="0" highVersionID="255">
		<model model="ZTC217" numOuts="2" >
			<output name="1" label="White" />
			<output name="2" label="Yellow" /></model>
			</family>

	<programming direct="byteOnly" paged="yes"
	                     register="yes" ops="no"></programming>

	<variables>

		<variable label="Primary Address" CV="1" comment="Short address"
						item="Short Address"  default="03">
			<shortAddressVal/></variable>

		<variable label="Start Volts" CV="2" item="Vstart"
				comment="Range 0-255">
			<decVal></decVal>
			</variable>

		<variable label="Accel" CV="3"
				comment="Range 0-15">
			<decVal max="15"/>
			</variable>

		<variable label="Decel" CV="4"
				comment="Range 0-15">
			<decVal max="15"/>
			</variable>

		<variable label="Vhigh" CV="5"
				comment="Range 0-255">
			<decVal max="255"/>
			</variable>

		<variable label="Vmid" CV="6"
				comment="Range 1-13">
			<decVal min="0" max="13"/>
			</variable>

		<variable label="Version ID" CV="7" readOnly="yes"
				item="Decoder Version" >
			<decVal/>
			</variable>

		<variable label="Manufacturer ID" CV="8" readOnly="yes"
				item="Manufacturer" default="157">
			<decVal/>
			</variable>

		<variable label="Normal direction of motion" CV="29"
				mask="XXXXXXXV"
		        item="Locomotive Direction">
			<enumVal>
				<enumChoice choice="Forward"/>
				<enumChoice choice="Reverse"/>
				</enumVal>
			</variable>

		<variable label="Speed Steps" CV="29" mask="XXXXXXVX"
				item="Speed Step Mode" default="1">
			<enumVal>
				<enumChoice choice="14"/>
				<enumChoice choice="28/128 (recommended)"/>
				</enumVal>
			</variable>

		<variable label="Analog conversion mode" CV="29"
				mask="XXXXXVXX" default="1"
				item="Analog (DC) Operation">
			<enumVal>
				<enumChoice choice="Off"/>
				<enumChoice choice="On"/>
				</enumVal>
			</variable>

	<variable label="Motor Drive Selection" CV="54"
				mask="XXXXXXXV" default="0">
  			<enumVal>
				<enumChoice choice="WhisperDrive ON"/>
				<enumChoice choice="WhisperDrive OFF"/>
				</enumVal>
			</variable>

<variable label="Static Compensation" CV="55"				
item="Static Compensation" default="128"
			comment="Range 0-255" >
			<decVal min="0" max="255" />
			</variable>

<variable label="Dynamic Compensation" CV="56"				
item="Dynamic Compensation" default="48"
			comment="Range 0-255" >
			<decVal min="0" max="255" />
			</variable>

<variable label="Decay Rate" CV="57"				
item="Decay Rate" default="0"
			comment="Range 0-15" >
			<decVal min="0" max="15" />
			</variable>

<variable label="Directional Headlights" CV="61"
               	mask="XXXXXXXV">
		     <enumVal>
		         <enumChoice choice="Headlights are directional and operate automatically"/>
		         <enumChoice choice="Headlights are independently controlled (F0-Front, F4-Rear)"/>
		         </enumVal>
			</variable>

		<variable label=" Kick Start " CV="65"
				comment="Range 0-63">
			<decVal max="63"/>
			</variable>

<!-- Define the fixed Function-Output mapping -->
	<constant label="F1 controls output 3" minOut="3" default="1" /> 
	<constant label="F2 controls output 4" minOut="4" default="1" />
	<constant label="F3 controls output 5" minOut="5" default="1" />
	<constant label="F4 controls output 6" minOut="6" default="1" />

	</variables>

</decoder>

<pane name="ZTC">
<column><row><column>
			<display item="Static Compensation" format="hslider" label=""/>
			<display item="Static Compensation" />

			<display item="Dynamic Compensation" format="hslider" label=""/>
			<display item="Dynamic Compensation" />

			<display item="Decay Rate" format="hslider" label=""/>
			<display item="Decay Rate" />
			
		</column></row><separator/><row><column>
			<display item="Motor Drive Selection" 
					layout="above" label="Motor Drive Selection"/>
		</column></row></column>
</pane>

</decoder-config>




