Package jmri.jmrix.loconet
Class LnPowerManager
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.managers.AbstractPowerManager<LocoNetSystemConnectionMemo>
-
- jmri.jmrix.loconet.LnPowerManager
-
- All Implemented Interfaces:
java.util.EventListener
,PropertyChangeFirer
,PropertyChangeProvider
,LocoNetListener
,PowerManager
- Direct Known Subclasses:
LnPr2PowerManager
public class LnPowerManager extends AbstractPowerManager<LocoNetSystemConnectionMemo> implements LocoNetListener
PowerManager implementation for controlling layout power.Some of the message formats used in this class are Copyright Digitrax, Inc. and used with permission as part of the JMRI project. That permission does not extend to uses in other software products. If you wish to use this code, algorithm or these message formats outside of JMRI, please contact Digitrax Inc for separate permission.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
LnPowerManager.LnTrackStatusUpdateThread
Class providing a thread to delay, then query slot 0.-
Nested classes/interfaces inherited from class jmri.managers.AbstractPowerManager
AbstractPowerManager.TimeKeeper
-
-
Field Summary
Fields Modifier and Type Field Description (package private) LnTrafficController
tc
(package private) LnPowerManager.LnTrackStatusUpdateThread
thread
static java.lang.String
TRACK_STATUS_UPDATE_THREAD_NAME
Constant for the name of the Track Status Update Thread.-
Fields inherited from class jmri.managers.AbstractPowerManager
memo, power
-
Fields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description LnPowerManager(LocoNetSystemConnectionMemo memo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
boolean
implementsIdle()
Returns whether command station supports IDLE funcitonalityvoid
message(LocoNetMessage m)
Member function that will be invoked by a LocoNetInterface implementation to forward a LocoNet message from the layout.void
setPower(int v)
-
Methods inherited from class jmri.managers.AbstractPowerManager
firePowerPropertyChange, getPower, getUserName, timeSinceLastPowerOn
-
Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
TRACK_STATUS_UPDATE_THREAD_NAME
public static final java.lang.String TRACK_STATUS_UPDATE_THREAD_NAME
Constant for the name of the Track Status Update Thread. Requires the connection UserName prepending.- See Also:
- Constant Field Values
-
thread
volatile LnPowerManager.LnTrackStatusUpdateThread thread
-
-
Constructor Detail
-
LnPowerManager
public LnPowerManager(LocoNetSystemConnectionMemo memo)
-
-
Method Detail
-
setPower
public void setPower(int v) throws JmriException
Description copied from class:AbstractPowerManager
- Specified by:
setPower
in interfacePowerManager
- Overrides:
setPower
in classAbstractPowerManager<LocoNetSystemConnectionMemo>
- Throws:
JmriException
-
dispose
public void dispose()
- Specified by:
dispose
in interfacePowerManager
-
message
public void message(LocoNetMessage m)
Description copied from interface:LocoNetListener
Member function that will be invoked by a LocoNetInterface implementation to forward a LocoNet message from the layout.- Specified by:
message
in interfaceLocoNetListener
- Parameters:
m
- The received LocoNet message. Note that this same object may be presented to multiple users. It should not be modified here.
-
implementsIdle
public boolean implementsIdle()
Returns whether command station supports IDLE funcitonality- Specified by:
implementsIdle
in interfacePowerManager
- Returns:
- true if connection's command station supports IDLE state, else false
-
-