<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../XSLT/decoder.xsl"?>
<!-- Copyright (C) JMRI 2003 All rights reserved -->
<!--                                                                        -->
<!-- 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 xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://jmri.org/xml/schema/decoder.xsd">
  <version author="Alain Le Marchand" version="8" lastUpdated="20180216"/>
  <version author="Phil Grainger (phil.grainger@ca.com)" version="7.1" lastUpdated="20031008"/>
  <!-- Updated to new names by jake@physics.berkeley.edu -->
  <!-- Added CV 23, 24, and function mapping - Bob J -->
  <!-- Changed FX to match older LExxxXF decoders, file had SelectDrive FX settings -->
  <!-- version 5 - add consist direction - jake -->
  <!-- version 6 - fix Vstart and leight effects bugs -->
  <!-- version 7 - made speed table selection more generic -->
  <!-- Version 7.1 - changed spelling of "behavior" (Jack Shall) -->
  <!-- Version 8 - Implement Reset properly (Alain Le Marchand) -->
  <!-- These are the version 4.5 decoders, with "precision glide" and "XF" -->
  <decoder>
    <family name="Lenz XF, precision glide decoders" mfg="Lenz" lowVersionID="44" highVersionID="45">
      <model model="LE062XF" numOuts="2" nmraWarrant="yes" nmraWarrantStart="200506">
        <output name="1" label="A - White"/>
        <output name="2" label="B - Yellow"/>
      </model>
      <model model="LE063XF" numOuts="2">
        <output name="1" label="A - White"/>
        <output name="2" label="B - Yellow"/>
      </model>
      <model model="LE077XF" numOuts="3" nmraWarrant="yes" nmraWarrantStart="20000123">
        <output name="1" label="A - White"/>
        <output name="2" label="B - Yellow"/>
        <output name="3" label="C - Green"/>
      </model>
      <model model="LE102XF" numOuts="3">
        <output name="1" label="A - White"/>
        <output name="2" label="B - Yellow"/>
        <output name="3" label="C - Green"/>
      </model>
      <model model="LE103XF" numOuts="3" nmraWarrant="yes" nmraWarrantStart="200506">
        <output name="1" label="A - White"/>
        <output name="2" label="B - Yellow"/>
        <output name="3" label="C - Green"/>
      </model>
      <model model="LE104XF" numOuts="3" nmraWarrant="yes" nmraWarrantStart="200506">
        <output name="1" label="A - White"/>
        <output name="2" label="B - Yellow"/>
        <output name="3" label="C - Green"/>
      </model>
      <model model="LE105XF" numOuts="4" nmraWarrant="yes" nmraWarrantStart="200506">
        <output name="1" label="A - White"/>
        <output name="2" label="B - Yellow"/>
        <output name="3" label="C - Green"/>
        <output name="4" label="D - Violet"/>
      </model>
      <model model="LE113XF" numOuts="4" nmraWarrant="yes" nmraWarrantStart="200506">
        <output name="1" label="A - White"/>
        <output name="2" label="B - Yellow"/>
        <output name="3" label="C - Green"/>
        <output name="4" label="D - Violet"/>
      </model>
    </family>
    <programming direct="byteOnly" paged="yes" register="yes" ops="yes"/>
    <variables>
      <xi:include href="http://jmri.org/xml/decoders/nmra/shortAndLongAddress.xml"/>
      <variable CV="2" item="Vstart" comment="Range 0-31">
        <decVal/>
        <label>Start Volts</label>
        <label xml:lang="it">Volt Partenza</label>
        <label xml:lang="fr">V démarr.</label>
        <label xml:lang="de">Anfahrspannung</label>
        <comment>Range 0-31</comment>
        <comment xml:lang="de">Vstart</comment>
        <comment xml:lang="de">Range 0-31</comment>
      </variable>
      <!-- CV 3-4 -->
     <xi:include href="http://jmri.org/xml/decoders/nmra/accelDecel_31.xml"/>
      <!-- deleted max and mid voltage-->
      <variable CV="7" item="Decoder Version" readOnly="yes">
        <decVal/>
        <label>Version ID</label>
        <label xml:lang="it">Versione Decoder: </label>
        <label xml:lang="fr">Version décodeur: </label>
        <label xml:lang="de">Decoder Version: </label>
      </variable>
      <variable CV="8" readOnly="yes" item="Manufacturer" default="99">
        <decVal/>
        <label>Manufacturer ID</label>
        <label xml:lang="it">ID Costruttore: </label>
        <label xml:lang="fr">ID constructeur: </label>
        <label xml:lang="de">Hersteller ID: </label>
      </variable>
      <!-- Deleted all CV 13 references-->
      <!-- CV=19 -->
     <xi:include href="http://jmri.org/xml/decoders/nmra/consistAddrDirection.xml"/>
      <variable CV="23" default="255" item="Consist Acceleration Adjustment" comment="Additional Acceleration rate info for fine-tuning. (Range 0-255)">
        <decVal min="0" max="255"/>
        <label>Acceleration Trim (range 0-255)</label>
        <comment>Additional Acceleration rate info for fine-tuning. (Range 0-255)</comment>
        <label xml:lang="de">Consist Acceleration Adjustment</label>
        <comment xml:lang="de">Additional Acceleration rate info for fine-tuning. (Range 0-255)</comment>
      </variable>
      <variable CV="24" default="255" item="Consist Deceleration Adjustment" comment="Additional Deceleration (braking) rate info for fine-tuning. (Range 0-255)">
        <decVal min="0" max="255"/>
        <label>Deceleration Trim (range 0-255)</label>
        <comment>Additional Deceleration (braking) rate info for fine-tuning. (Range 0-255)</comment>
        <label xml:lang="de">Consist Deceleration Adjustment</label>
        <comment xml:lang="de">Additional Deceleration (braking) rate info for fine-tuning. (Range 0-255)</comment>
      </variable>
      <!-- CV=29 -->
     <xi:include href="http://jmri.org/xml/decoders/nmra/cv29direction.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/nmra/cv29speedSteps.xml"/>
     <xi:include href="http://jmri.org/xml/decoders/nmra/cv29analog.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/nmra/cv29table1-28.xml"/>
      <variable item="Accel/Decel Trim" CV="50" mask="XXXXXXXV" comment="Governs how loco acts in DC track block">
        <enumVal>
          <enumChoice choice="Accel/Decel trim OFF">
            <choice>Accel/Decel trim OFF</choice>
            <choice xml:lang="de">Accel/Decel trim OFF</choice>
          </enumChoice>
          <enumChoice choice="Accel/Decel trim ON">
            <choice>Accel/Decel trim ON</choice>
            <choice xml:lang="de">Accel/Decel trim ON</choice>
          </enumChoice>
        </enumVal>
        <label>Accel/Decel Trim</label>
        <comment>Governs how loco acts in DC track block</comment>
        <label xml:lang="de">Accel/Decel Trim</label>
        <comment xml:lang="de">Governs how loco acts in DC track block</comment>
      </variable>
      <!-- CV=50 -->
     <xi:include href="http://jmri.org/xml/decoders/nmra/cv50_DCbrake.xml"/>
      <!-- CV=51 -->
     <xi:include href="http://jmri.org/xml/decoders/nmra/cv51_DirectionalHeadlights.xml"/>
      <variable CV="51" mask="XXXXXXVX" item="Global lighting option 1">
        <enumVal>
          <enumChoice choice="Dimming Disabled">
            <choice>Dimming Disabled</choice>
            <choice xml:lang="de">Dimming Disabled</choice>
          </enumChoice>
          <enumChoice choice="Dimming Enabled. If headlights are directional, F1 dims headlight">
            <choice>Dimming Enabled. If headlights are directional, F1 dims headlight</choice>
            <choice xml:lang="de">Dimming Enabled. If headlights are directional, F1 dims headlight</choice>
          </enumChoice>
        </enumVal>
        <label>Functional Headlight Dimming</label>
        <label xml:lang="de">Global lighting option 1</label>
      </variable>
      <variable CV="51" mask="XXXXXVXX" item="Global lighting option 2">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>If Lights Independent, F4 dims F0</label>
        <label xml:lang="de">Global lighting option 2</label>
      </variable>
      <variable CV="51" mask="XXXXVXXX" item="Global lighting option 3">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>If Lights Independent, F4 dims F1</label>
        <label xml:lang="de">Global lighting option 3</label>
      </variable>
      <variable CV="52" item="Global lighting option 4" default="64">
        <decVal/>
        <label>Dimming Value</label>
        <label xml:lang="de">Global lighting option 4</label>
      </variable>
      <variable CV="56" item="Function 4 options" default="15" minOut="3">
        <decVal min="0" max="255"/>
        <label>Output C, D blink rate</label>
        <label xml:lang="de">Function 4 options</label>
      </variable>
      <variable CV="53" minOut="3" item="Function 3 effect generated" mask="XXXXXXXV">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>Output C blinks</label>
        <label xml:lang="de">Function 3 effect generated</label>
      </variable>
      <variable CV="53" minOut="3" item="Function 4 effect generated" mask="XXXXXXVX">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>Output D blinks</label>
        <label xml:lang="de">Function 4 effect generated</label>
      </variable>
      <variable CV="53" minOut="3" item="Function 4 behavior" mask="XXXXXVXX">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>Output C, D are ditch lights</label>
        <label xml:lang="de">Function 4 behavior</label>
      </variable>
      <variable CV="54" mask="XXXXXXXV" minOut="3" minFn="1" item="F1 controls output 3" default="1">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>F1 controls output C</label>
        <label xml:lang="de">F1 controls output 3</label>
      </variable>
      <variable CV="54" mask="XXXXXXVX" minOut="3" minFn="2" item="F2 controls output 3">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>F2 controls output C</label>
        <label xml:lang="de">F2 controls output 3</label>
      </variable>
      <variable CV="54" mask="XXXXXVXX" minOut="3" minFn="3" item="F3 controls output 3">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>F3 controls output C</label>
        <label xml:lang="de">F3 controls output 3</label>
      </variable>
      <variable CV="54" mask="XXXXVXXX" minOut="3" minFn="4" item="F4 controls output 3">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>F4 controls output C</label>
        <label xml:lang="de">F4 controls output 3</label>
      </variable>
      <variable CV="54" mask="XXXVXXXX" minOut="3" minFn="5" item="F5 controls output 3">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>F5 controls output C</label>
        <label xml:lang="de">F5 controls output 3</label>
      </variable>
      <variable CV="54" mask="XXVXXXXX" minOut="3" minFn="6" item="F6 controls output 3">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>F6 controls output C</label>
        <label xml:lang="de">F6 controls output 3</label>
      </variable>
      <variable CV="54" mask="XVXXXXXX" minOut="3" minFn="7" item="F7 controls output 3">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>F7 controls output C</label>
        <label xml:lang="de">F7 controls output 3</label>
      </variable>
      <variable CV="54" mask="VXXXXXXX" minOut="3" minFn="8" item="F8 controls output 3">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>F8 controls output C</label>
        <label xml:lang="de">F8 controls output 3</label>
      </variable>
      <variable CV="55" mask="XXXXXXXV" minOut="4" minFn="1" item="F1 controls output 4">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>F1 controls output D</label>
        <label xml:lang="de">F1 controls output 4</label>
      </variable>
      <variable CV="55" mask="XXXXXXVX" minOut="4" minFn="2" item="F2 controls output 4" default="1">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>F2 controls output D</label>
        <label xml:lang="de">F2 controls output 4</label>
      </variable>
      <variable CV="55" mask="XXXXXVXX" minOut="4" minFn="3" item="F3 controls output 4">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>F3 controls output D</label>
        <label xml:lang="de">F3 controls output 4</label>
      </variable>
      <variable CV="55" mask="XXXXVXXX" minOut="4" minFn="4" item="F4 controls output 4">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>F4 controls output D</label>
        <label xml:lang="de">F4 controls output 4</label>
      </variable>
      <variable CV="55" mask="XXXVXXXX" minOut="4" minFn="5" item="F5 controls output 4">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>F5 controls output D</label>
        <label xml:lang="de">F5 controls output 4</label>
      </variable>
      <variable CV="55" mask="XXVXXXXX" minOut="4" minFn="6" item="F6 controls output 4">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>F6 controls output D</label>
        <label xml:lang="de">F6 controls output 4</label>
      </variable>
      <variable CV="55" mask="XVXXXXXX" minOut="4" minFn="7" item="F7 controls output 4">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>F7 controls output D</label>
        <label xml:lang="de">F7 controls output 4</label>
      </variable>
      <variable CV="55" mask="VXXXXXXX" minOut="4" minFn="8" item="F8 controls output 4">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>F8 controls output D</label>
        <label xml:lang="de">F8 controls output 4</label>
      </variable>
      <variable CV="105" item="User Id #1">
        <decVal/>
        <label>User Private ID #1</label>
        <label xml:lang="de">User Id #1</label>
      </variable>
      <variable CV="106" item="User Id #2">
        <decVal/>
        <label>User Private ID #2</label>
        <label xml:lang="de">User Id #2</label>
      </variable>
      <xi:include href="http://jmri.org/xml/decoders/nmra/cv67speedTableBasic.xml"/>
      <!-- Define the fixed Function-Output mapping -->
      <constant item="FL(f) controls output 1" minOut="1" default="1"/>
      <constant item="FL(r) controls output 2" minOut="2" default="1"/>
    </variables>
    <resets>
      <factReset label="Reset All CVs except speed table" CV="8" default="33">
        <label xml:lang="it">Reset delle CV salvo Tabella Velocità ai valori di fabbrica</label>
      </factReset>
    </resets>
  </decoder>
  <pane>
    <name>Lenz</name>
    <name xml:lang="de">Lenz</name>
    <column>
      <display item="Accel/Decel Trim"/>
      <label>
        <text> </text>
      </label>
    </column>
  </pane>
</decoder-config>
