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

<!-- Copyright (C) JMRI 2004, 2007 All rights reserved -->
<!-- $Id: Bachmann_EZDCC.xml,v 1.9 2010/01/25 17:50:08 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="Peter Ulvestad" version="4" lastUpdated="20090725"/>
		<version author="Peter Ulvestad" version="3" lastUpdated="20090627"/>
		<version author="Michael Greene (mgreene@cedarlane.com)" version="1" lastUpdated="20041022" />
                <!-- Version 2 - added factory reset menu items (Paul Bender) -->
		<!-- Version 3 - added max value for CV2 (Peter Ulvestad) -->
		<!-- Version 4 - Changed model name, added decoder dimensions, updated defaults and cleaned up xml formatting (Peter Ulvestad) -->
<decoder>
	<family name="E-Z Command decoders" mfg="Bachmann Trains">
		<model model="2 function decoder (36-552)" numOuts="2" numFns="0" maxMotorCurrent="1A" formFactor="HO" connector="NMRAmedium"
			lowVersionID="46" nmraWarrant="yes" nmraWarrantStart="2006-04">
			<size length="25" width="16" height="5" units="mm"/>
		</model>
	</family>

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

	<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" default="10" comment="Range 0-31">
			<decVal max="31"/>
		</variable>

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

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

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

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

		<variable label="Long Address" CV="17" item="Extended Address" comment="4 digit address (Range 0001-9999)">
			<longAddressVal/>
		</variable>

		<variable label="Consist Address" CV="19" mask="XVVVVVVV" item="Consist Address">
			<decVal/>
		</variable>
		
		<variable label="Consist Direction" CV="19" mask="VXXXXXXX">
			<enumVal>
				<enumChoice choice="Normal"></enumChoice>
				<enumChoice choice="Reversed"></enumChoice>
			</enumVal>
		</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="Addressing Mode" CV="29" mask="XXVXXXXX" item="Address Format">
			<enumVal>
				<enumChoice choice="2 digit addressing"/>
				<enumChoice choice="4 digit addressing"/>
			</enumVal>
		</variable>

		<variable label="Brake Momentum on DC" CV="50" item="DC Brake Momentum" mask="XXXXXVXX" comment="Governs how loco acts in DC track block">
			<enumVal>
				<enumChoice choice="Loco runs under DC analog voltage control"/>
				<enumChoice choice="Loco brakes to a stop using momentum set in CV4"/>
		        </enumVal>
		</variable>

		<variable label="Headlight Dimmed By" CV="51" mask="VVVVVVVV" item = "Function F0F options" comment="Controls which function dims headlight (CV 52 controls amount)">
			<enumVal>
				<enumChoice choice="Always Dim" value="00000000"/>
				<enumChoice choice="F1" value="1"/>
				<enumChoice choice="F2" value="2"/>
				<enumChoice choice="F3" value="4"/>
				<enumChoice choice="F4" value="8"/>
				<enumChoice choice="F5" value="16"/>
				<enumChoice choice="F6" value="32"/>
				<enumChoice choice="F7" value="64"/>
				<enumChoice choice="F8" value="128"/>
		      </enumVal>
		</variable>

		<variable label="Headlight Dimming intensity" CV="52" default="64" comment="Controls how much headlights dim (0-dark to 255-max bright)" item="Function F0F behavior">
			<decVal min="0" max="255"/>
		</variable>

	<!-- User private ID CV's are not documented by Bachamann, but appear to work --> 
	        <variable label="User Private ID #1" CV="105" item="User Id #1">
			<decVal/>
		</variable>

		<variable label="User Private ID #2" CV="106" item="User Id #2">
			<decVal/>
		</variable>

	<!-- Define the fixed Function-Output mapping -->
		<constant label="FL(f) controls output 1" minOut="1" default="1" /> 
		<constant label="FL(r) controls output 2" minOut="2" default="1" /> 
	</variables>

        <resets>
           <factReset label="Reset All CVs" CV="8" default="33"/>
        </resets>

</decoder>

<pane name="Bachmann">
	<column>
		<display item="Function F0F behavior" />
		<display item="Function F0F options" />
		<label label=" "/>
	</column> 
</pane>

</decoder-config>

 	  	 
