001package jmri.jmrix.ztc.ztc611;
002
003import jmri.jmrix.lenz.XNetTrafficController;
004
005/**
006 * Extend jmri.jmrix.XNetTurnout to handle turnouts on ZTC ZTC611
007 * connections. See XNetTurnout for further documentation.
008 *
009 * @author Paul Bender Copyright (C) 2008,2017
010 */
011public class ZTC611XNetTurnout extends jmri.jmrix.lenz.XNetTurnout {
012
013    public ZTC611XNetTurnout(String prefix, int pNumber, XNetTrafficController tc) {  // a human-readable turnout number must be specified!
014        super(prefix, pNumber, tc);
015    }
016
017    /* Send an "Off" message to the decoder for this output  */
018    @Override
019    protected synchronized void sendOffMessage() {
020        // The ZTC611 appears to react send an on DCC packet when the On 
021        // command is sent and an off DCC packet when the OFF command is
022        // sent.  This causes some decoders to turn off the output 
023        // instead of waiting for the time to expire.
024        // so set the known state to the commanded state, and send
025        // the next queued message.
026        newKnownState(getCommandedState());
027        sendQueuedMessage();
028    }
029
030}