<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../XSLT/decoder.xsl"?>
<!-- Copyright (C) JMRI 2006 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="Ian Ware" version="1" lastUpdated="20070323"/>
  <!-- Version 1 - created from Lenz_silver.xml "20070322"-->
  <!-- These are the Silver decoders, with "6th gen BEMF", "Precision Braking Control" -->
  <!-- and "Low Gear Switching Drive" -->
  <!-- need to update version ID" -->
  <decoder>
    <family name="Lenz Silver with 6th gen BEMF" mfg="Lenz" highVersionID="0" lowVersionID="0" comment="Decoders featuring Precision Braking Control and Low Gear Switching Drive">
      <model model="Silver Mini" numOuts="2" numFns="8" lowVersionID="0" maxMotorCurrent="0.5A (peak=0.8A)" formFactor="N">
        <output name="1" label="A - White"/>
        <output name="2" label="B - Yellow"/>
      </model>
    </family>
    <programming direct="yes" paged="yes" register="yes" ops="yes"/>
    <variables>
      <xi:include href="http://jmri.org/xml/decoders/nmra/shortAndLongAddress.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/lenz/vStartHighMid.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/lenz/accelDecel.xml"/>
      <variable CV="7" item="Decoder Version" readOnly="yes" default="65">
        <decVal/>
        <label>Decoder Version No: </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>
      <variable CV="8" item="Reset" comment="Writing a value of 8 or 33 will reset decoder to factory defaults">
        <decVal/>
        <label>Manufacturer ID - Reset</label>
        <comment>Writing a value of 8 or 33 will reset decoder to factory defaults</comment>
        <label xml:lang="de">Reset</label>
        <comment xml:lang="de">Writing a value of 8 or 33 will reset decoder to factory defaults</comment>
      </variable>
      <variable CV="9" item="Total PWM Period" default="15" comment="Range 0-63">
        <decVal min="0" max="63"/>
        <label>Back EMF Repetition Rate (0-63)</label>
        <label xml:lang="de">Total PWM Period</label>
        <label xml:lang="it">Periodo PWM (Frequenza pilotaggio Motore)</label>
        <comment>Range 0-63</comment>
        <comment xml:lang="de">Range 0-63</comment>
        <comment xml:lang="it">Valori 0-63</comment>
      </variable>
      <!-- CV=19 -->
      <xi:include href="http://jmri.org/xml/decoders/nmra/consistAddrDirection.xml"/>
      <!-- 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/cv29table3-28.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/lenz/protection_cv30.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/lenz/functionmap.xml"/>
      <variable CV="50" mask="XXXXVVVV" item="Motor type" default="0" comment="Range 0-5">
        <enumVal>
          <enumChoice choice="0 ">
            <choice>0 </choice>
            <choice xml:lang="de">0 </choice>
          </enumChoice>
          <enumChoice choice="1 ">
            <choice>1 </choice>
            <choice xml:lang="de">1 </choice>
          </enumChoice>
          <enumChoice choice="2 ">
            <choice>2 </choice>
            <choice xml:lang="de">2 </choice>
          </enumChoice>
          <enumChoice choice="3 ">
            <choice>3 </choice>
            <choice xml:lang="de">3 </choice>
          </enumChoice>
          <enumChoice choice="4 ">
            <choice>4 </choice>
            <choice xml:lang="de">4 </choice>
          </enumChoice>
          <enumChoice choice="5 ">
            <choice>5 </choice>
            <choice xml:lang="de">5 </choice>
          </enumChoice>
        </enumVal>
        <label>Motor Type(0-5)</label>
        <comment>Range 0-5</comment>
        <label xml:lang="de">Motor type</label>
        <comment xml:lang="de">Range 0-5</comment>
      </variable>
      <variable CV="50" mask="XXVXXXXX" item="EMF Switch" default="0">
        <enumVal>
          <enumChoice choice="Inactive">
            <choice>Inactive</choice>
            <choice xml:lang="de">Inactive</choice>
          </enumChoice>
          <enumChoice choice="Active">
            <choice>Active</choice>
            <choice xml:lang="de">Active</choice>
          </enumChoice>
        </enumVal>
        <label>EMF Switch</label>
        <label xml:lang="de">EMF Switch</label>
      </variable>
      <variable CV="50" mask="XVXXXXXX" item="BEMF Control" default="0">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-OnOff.xml"/>
        <label>BEMF Control</label>
        <label xml:lang="de">BEMF Control</label>
      </variable>
      <variable CV="50" mask="VXXXXXXX" item="Motor Frequency" default="0">
        <enumVal>
          <enumChoice choice="High ">
            <choice>High </choice>
            <choice xml:lang="de">High </choice>
          </enumChoice>
          <enumChoice choice="Low ">
            <choice>Low </choice>
            <choice xml:lang="de">Low </choice>
          </enumChoice>
        </enumVal>
        <label>Motor Drive Frequency</label>
        <label xml:lang="de">Motor Frequency</label>
      </variable>
      <xi:include href="http://jmri.org/xml/decoders/lenz/braking_cv51.xml"/>
      <xi:include href="http://jmri.org/xml/decoders/lenz/abc_cv51.xml"/>
      <variable CV="55" item="Global lighting option 1" default="255" tooltip="Sets intensity of dimmed headlight (larger number = brighter light)">
        <decVal min="0" max="255"/>
        <label>Dimming Intensity, Output A (0-255)</label>
        <label xml:lang="de">Global lighting option 1</label>
        <tooltip xml:lang="de">Sets intensity of dimmed headlight (larger number = brighter light)</tooltip>
      </variable>
      <variable CV="56" item="Global lighting option 2" default="255" tooltip="Sets intensity of dimmed headlight (larger number = brighter light)">
        <decVal min="0" max="255"/>
        <label>Dimming Intensity, Output B (0-255)</label>
        <label xml:lang="de">Global lighting option 2</label>
        <tooltip xml:lang="de">Sets intensity of dimmed headlight (larger number = brighter light)</tooltip>
      </variable>
      <xi:include href="http://jmri.org/xml/decoders/lenz/fn_ctrl_57_59.xml"/>
      <variable CV="60" item="Lighting effects A/B" default="0" comment="Range 0-44">
        <decVal min="0" max="44"/>
        <label>Enter the value corresponding to the desired lighting effect for B/A outputs (0-44) </label>
        <comment>Range 0-44</comment>
        <label xml:lang="de">Lighting effects A/B</label>
        <comment xml:lang="de">Range 0-44</comment>
      </variable>
      <variable item="Toggle effect (outputs A/B) with F1" CV="61" mask="XXXXXXXV" tooltip="Toggle Lighting Effect for outputs A and B 'off' using F1">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>Toggle effect (outputs A/B) with F1</label>
        <label xml:lang="de">Toggle effect (outputs A/B) with F1</label>
        <tooltip xml:lang="de">Toggle Lighting Effect for outputs A and B 'off' using F1</tooltip>
      </variable>
      <variable item="Toggle effect (outputs A/B) with F2" CV="61" mask="XXXXXXVX" tooltip="Toggle Lighting Effect for outputs A and B 'off' using F2">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>Toggle effect (outputs A/B) with F2</label>
        <label xml:lang="de">Toggle effect (outputs A/B) with F2</label>
        <tooltip xml:lang="de">Toggle Lighting Effect for outputs A and B 'off' using F2</tooltip>
      </variable>
      <variable item="Toggle effect (outputs A/B) with F3" CV="61" mask="XXXXXVXX" tooltip="Toggle Lighting Effect for outputs A and B 'off' using F3">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>Toggle effect (outputs A/B) with F3</label>
        <label xml:lang="de">Toggle effect (outputs A/B) with F3</label>
        <tooltip xml:lang="de">Toggle Lighting Effect for outputs A and B 'off' using F3</tooltip>
      </variable>
      <variable item="Toggle effect (outputs A/B) with F4" CV="61" mask="XXXXVXXX" tooltip="Toggle Lighting Effect for outputs A and B 'off' using F4">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>Toggle effect (outputs A/B) with F4</label>
        <label xml:lang="de">Toggle effect (outputs A/B) with F4</label>
        <tooltip xml:lang="de">Toggle Lighting Effect for outputs A and B 'off' using F4</tooltip>
      </variable>
      <variable item="Toggle effect (outputs A/B) with F5" CV="61" mask="XXXVXXXX" tooltip="Toggle Lighting Effect for outputs A and B 'off' using F5">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>Toggle effect (outputs A/B) with F5</label>
        <label xml:lang="de">Toggle effect (outputs A/B) with F5</label>
        <tooltip xml:lang="de">Toggle Lighting Effect for outputs A and B 'off' using F5</tooltip>
      </variable>
      <variable item="Toggle effect (outputs A/B) with F6" CV="61" mask="XXVXXXXX" tooltip="Toggle Lighting Effect for outputs A and B 'off' using F6">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>Toggle effect (outputs A/B) with F6</label>
        <label xml:lang="de">Toggle effect (outputs A/B) with F6</label>
        <tooltip xml:lang="de">Toggle Lighting Effect for outputs A and B 'off' using F6</tooltip>
      </variable>
      <variable item="Toggle effect (outputs A/B) with F7" CV="61" mask="XVXXXXXX" tooltip="Toggle Lighting Effect for outputs A and B 'off' using F7">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>Toggle effect (outputs A/B) with F7</label>
        <label xml:lang="de">Toggle effect (outputs A/B) with F7</label>
        <tooltip xml:lang="de">Toggle Lighting Effect for outputs A and B 'off' using F7</tooltip>
      </variable>
      <variable item="Toggle effect (outputs A/B) with F8" CV="61" mask="VXXXXXXX" tooltip="Toggle Lighting Effect for outputs A and B 'off' using F8">
        <xi:include href="http://jmri.org/xml/decoders/parts/enum-NoYes.xml"/>
        <label>Toggle effect (outputs A/B) with F8</label>
        <label xml:lang="de">Toggle effect (outputs A/B) with F8</label>
        <tooltip xml:lang="de">Toggle Lighting Effect for outputs A and B 'off' using F8</tooltip>
      </variable>
      <xi:include href="http://jmri.org/xml/decoders/nmra/cv67speedTableBasic.xml"/>
      <variable CV="105" item="User Id #1" default="255" comment="Range 0-255">
        <decVal min="0" max="255"/>
        <label>User Identification #1</label>
        <comment>Range 0-255</comment>
        <label xml:lang="de">User Id #1</label>
        <comment xml:lang="de">Range 0-255</comment>
      </variable>
      <variable CV="106" item="User Id #2" default="255" comment="Range 0-255">
        <decVal min="0" max="255"/>
        <label>User Identification #2</label>
        <comment>Range 0-255</comment>
        <label xml:lang="de">User Id #2</label>
        <comment xml:lang="de">Range 0-255</comment>
      </variable>
      <variable CV="113" item="Minimum PWM Value" default="40" comment="Range 0-255">
        <decVal min="0" max="255"/>
        <label>Minimum PWM (Types 4, 5 only)</label>
        <comment>Range 0-255</comment>
        <label xml:lang="de">Minimum PWM Value</label>
        <comment xml:lang="de">Range 0-255</comment>
      </variable>
      <variable CV="114" item="Motor Duty Cycle" default="10" comment="Range 0-255">
        <decVal min="0" max="255"/>
        <label>Duty Cycle (Types 4, 5 only)</label>
        <comment>Range 0-255</comment>
        <label xml:lang="de">Motor Duty Cycle</label>
        <comment xml:lang="de">Range 0-255</comment>
      </variable>
      <variable CV="128" readOnly="yes" item="Decoder Software Version" default="1">
        <decVal/>
        <label>Decoder Software Version (read only): </label>
        <label xml:lang="de">Decoder Software Version</label>
      </variable>
    </variables>
    <resets>
      <factReset label="Reset All CVs" CV="8" default="33">
        <label xml:lang="it">Reset delle CV ai valori di fabbrica</label>
      </factReset>
    </resets>
  </decoder>
  <xi:include href="http://jmri.org/xml/decoders/lenz/paneLighting.xml"/>
  <pane>
    <name>Lenz</name>
    <name xml:lang="de">Lenz</name>
    <column>
      <row>
        <column>
          <label>
            <text>Fault Indication</text>
            <text xml:lang="de">Fault Indication</text>
          </label>
          <display item="Light Short"/>
          <display item="Overheating"/>
          <display item="Motor Short"/>
          <label>
            <text> </text>
          </label>
          <label>
            <text>Motor Configuration</text>
            <text xml:lang="de">Motor Configuration</text>
          </label>
          <display item="Motor type"/>
          <display item="EMF Switch"/>
          <display item="BEMF Control"/>
          <display item="Motor Frequency"/>
          <display item="Minimum PWM Value"/>
          <display item="Motor Duty Cycle"/>
          <label>
            <text> </text>
          </label>
        </column>
        <column>
          <label>
            <text>           </text>
          </label>
        </column>
        <column>
          <label>
            <text>Braking Configuration</text>
            <text xml:lang="de">Braking Configuration</text>
          </label>
          <display item="Constant Braking"/>
          <display item="ABC"/>
          <display item="ABC Direction"/>
          <display item="Push-Pull w/o Stop"/>
          <display item="Push-Pull w Stop"/>
          <display item="Stop on DC"/>
          <display item="Braking Distance"/>
          <display item="ABC Approach Speed"/>
          <display item="Push-Pull Stop Time"/>
          <label>
            <text> </text>
          </label>
          <label>
            <text> </text>
          </label>
          <label>
            <text> </text>
          </label>
        </column>
      </row>
      <row>
        <column>
          <label>
            <text> </text>
          </label>
          <label>
            <text>Tip: Constant Braking only works when momementum is enabled, and when not in switching gear</text>
            <text xml:lang="de">Tip: Constant Braking only works when momementum is enabled, and when not in switching gear</text>
          </label>
          <label>
            <text> </text>
          </label>
          <separator/>
          <label>
            <text> </text>
          </label>
          <display item="Decoder Software Version"/>
        </column>
      </row>
    </column>
  </pane>
  <xi:include href="http://jmri.org/xml/decoders/lenz/paneLighting.xml"/>
</decoder-config>
