jmri.jmrix.sprog.update
Class SprogVersionQuery

Show UML class diagram
java.lang.Object
  extended by jmri.jmrix.sprog.update.SprogVersionQuery
All Implemented Interfaces:
EventListener, SprogListener

public class SprogVersionQuery
extends Object
implements SprogListener

Get the firmware version of the attached SPROG


Nested Class Summary
(package private) static class SprogVersionQuery.QueryState
           
 
Field Summary
(package private) static org.slf4j.Logger log
           
protected static int LONG_TIMEOUT
           
(package private)  String replyString
           
protected static SprogVersionQuery self
           
(package private) static SprogVersionQuery.QueryState state
           
(package private) static SprogTrafficController tc
           
(package private) static Timer timer
           
(package private) static SprogVersion ver
           
protected static Vector<SprogVersionListener> versionListeners
           
 
Constructor Summary
SprogVersionQuery()
           
 
Method Summary
protected  void addSprogVersionListener(SprogVersionListener l)
           
static SprogVersionQuery instance()
          static function returning the SprogVersionQuery instance to use.
 void notifyMessage(SprogMessage m)
          SprogListener notify Message not used
 void notifyReply(SprogReply m)
          SprogListener notify Reply listens to replies and looks for version reply
protected static void notifyVersion(SprogVersion v)
          Notify all registered listeners of the SPROG version
 void removeSprogVersionListener(SprogVersionListener l)
           
static void requestVersion(SprogVersionListener l)
           
protected static void restartTimer(int delay)
          Internal routine to handle timer starts & restarts
protected static void startLongTimer()
          Internal routine to restart timer with a long delay
protected  void stopTimer()
          Internal routine to stop timer, as all is well
protected static void timeout()
          Internal routine to handle a timeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

replyString

String replyString

tc

static SprogTrafficController tc

ver

static SprogVersion ver

state

static SprogVersionQuery.QueryState state

LONG_TIMEOUT

protected static final int LONG_TIMEOUT
See Also:
Constant Field Values

timer

static Timer timer

versionListeners

protected static final Vector<SprogVersionListener> versionListeners

self

protected static volatile SprogVersionQuery self

log

static org.slf4j.Logger log
Constructor Detail

SprogVersionQuery

public SprogVersionQuery()
Method Detail

addSprogVersionListener

protected void addSprogVersionListener(SprogVersionListener l)

removeSprogVersionListener

public void removeSprogVersionListener(SprogVersionListener l)

instance

public static SprogVersionQuery instance()
static function returning the SprogVersionQuery instance to use.

Returns:
The registered SprogVersionQuery instance for general use, if need be creating one.

requestVersion

public static void requestVersion(SprogVersionListener l)

notifyVersion

protected static void notifyVersion(SprogVersion v)
Notify all registered listeners of the SPROG version

Parameters:
v -

notifyMessage

public void notifyMessage(SprogMessage m)
SprogListener notify Message not used

Specified by:
notifyMessage in interface SprogListener
Parameters:
m -

notifyReply

public void notifyReply(SprogReply m)
SprogListener notify Reply listens to replies and looks for version reply

Specified by:
notifyReply in interface SprogListener
Parameters:
m -

timeout

protected static void timeout()
Internal routine to handle a timeout


startLongTimer

protected static 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 static void restartTimer(int delay)
Internal routine to handle timer starts & restarts



Copyright © 1997-2014 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: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads