jmri.jmrix
Class AbstractProgrammer

java.lang.Object
  extended by jmri.jmrix.AbstractProgrammer
All Implemented Interfaces:
Programmer
Direct Known Subclasses:
EasyDccProgrammer, Mx1Programmer, NceProgrammer, QsiProgrammer, SlotManager, SprogProgrammer, SRCPProgrammer, XNetProgrammer

public abstract class AbstractProgrammer
extends Object
implements Programmer

Common implementations for the Programmer interface.

Author:
Bob Jacobsen Copyright (C) 2001

Field Summary
protected  int LONG_TIMEOUT
           
protected  Vector propListeners
           
protected  int SHORT_TIMEOUT
           
 
Fields inherited from interface jmri.Programmer
ADDRESSMODE, DIRECTBITMODE, DIRECTBYTEMODE, NONE, OPSACCBITMODE, OPSACCBYTEMODE, OPSACCEXTBITMODE, OPSACCEXTBYTEMODE, OPSBITMODE, OPSBYTEMODE, PAGEMODE, REGISTERMODE
 
Constructor Summary
AbstractProgrammer()
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
           
 String decodeErrorCode(int code)
           
 int registerFromCV(int cv)
          Find the register number that corresponds to a specific CV number.
 void removePropertyChangeListener(PropertyChangeListener l)
           
protected  void restartTimer(int delay)
          Internal routine to handle timer starts & restarts
protected  void startLongTimer()
          Internal routine to restart timer with a long delay
protected  void startShortTimer()
          Internal routine to start timer to protect the mode-change.
protected  void stopTimer()
          Internal routine to stop timer, as all is well
protected abstract  void timeout()
          Internal routine to handle a timeout, should be synchronized!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jmri.Programmer
confirmCV, getCanRead, getMode, hasMode, readCV, setMode, writeCV
 

Field Detail

propListeners

protected Vector propListeners

SHORT_TIMEOUT

protected int SHORT_TIMEOUT

LONG_TIMEOUT

protected int LONG_TIMEOUT
Constructor Detail

AbstractProgrammer

public AbstractProgrammer()
Method Detail

decodeErrorCode

public String decodeErrorCode(int code)
Specified by:
decodeErrorCode in interface Programmer

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
Specified by:
addPropertyChangeListener in interface Programmer

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
Specified by:
removePropertyChangeListener in interface Programmer

startShortTimer

protected void startShortTimer()
Internal routine to start timer to protect the mode-change.


startLongTimer

protected void startLongTimer()
Internal routine to restart timer with a long delay


stopTimer

protected void stopTimer()
Internal routine to stop timer, as all is well


restartTimer

protected void restartTimer(int delay)
Internal routine to handle timer starts & restarts


registerFromCV

public int registerFromCV(int cv)
                   throws ProgrammerException
Find the register number that corresponds to a specific CV number.

Parameters:
cv - CV number (1 through 512) for which equivalent register is desired
Returns:
register number corresponding to cv
Throws:
ProgrammerException - if the requested CV does not correspond to a register

timeout

protected abstract void timeout()
Internal routine to handle a timeout, should be synchronized!



Copyright © 1997 - 2008 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: SourceForge_Logo