001package jmri.jmrix.lenz.hornbyelite;
002
003import jmri.jmrix.lenz.XNetTrafficController;
004
005/**
006 * Extend jmri.jmrix.XNetTurnout to handle turnouts on Hornby Elite
007 * connections.
008 * @see jmri.jmrix.lenz.XNetTurnout for further documentation.
009 *
010 * @author Paul Bender Copyright (C) 2008
011 */
012public class EliteXNetTurnout extends jmri.jmrix.lenz.XNetTurnout {
013
014    public EliteXNetTurnout(String prefix, int pNumber, XNetTrafficController tc) {  // a human-readable turnout number must be specified!
015        super(prefix, pNumber, tc);
016        mNumber = pNumber + 1;  // The Elite has an off by 1 error.  What the 
017        // protocol says should be address 2 is address 
018        // 1 on the Elite.
019    }
020
021    /**
022     * Send an "Off" message to the decoder for this output.
023     */
024    @Override
025    protected synchronized void sendOffMessage() {
026        // The Elite appears to react to the on and off messages
027        // in the same manner, and does not handle feedback properly
028        // Set the known state to the command state and send the next
029        // queued message.
030        newKnownState(getCommandedState());
031        sendQueuedMessage();
032    }
033
034}