Package jmri.jmrix.loconet.pr2
Class LnPr2PowerManager
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.managers.AbstractPowerManager<LocoNetSystemConnectionMemo>
-
- jmri.jmrix.loconet.LnPowerManager
-
- jmri.jmrix.loconet.pr2.LnPr2PowerManager
-
- All Implemented Interfaces:
java.util.EventListener
,PropertyChangeFirer
,PropertyChangeProvider
,LocoNetListener
,PowerManager
public class LnPr2PowerManager extends LnPowerManager
PowerManager implementation for controlling layout power via PR2.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/interfaces inherited from class jmri.managers.AbstractPowerManager
AbstractPowerManager.TimeKeeper
-
-
Field Summary
Fields Modifier and Type Field Description (package private) LnOpsModeProgrammer
pm
(package private) LnTrafficController
tc
(package private) javax.swing.Timer
timer
-
Fields inherited from class jmri.jmrix.loconet.LnPowerManager
TRACK_STATUS_UPDATE_THREAD_NAME
-
Fields inherited from class jmri.managers.AbstractPowerManager
memo, power
-
Fields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description LnPr2PowerManager(LocoNetSystemConnectionMemo memo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
implementsIdle()
Returns false to indicate PR2 does not implement an "IDLE" power state.void
message(LocoNetMessage m)
Member function that will be invoked by a LocoNetInterface implementation to forward a LocoNet message from the layout.(package private) void
refresh()
void
setPower(int v)
-
Methods inherited from class jmri.jmrix.loconet.LnPowerManager
dispose
-
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
-
timer
javax.swing.Timer timer
-
-
Constructor Detail
-
LnPr2PowerManager
public LnPr2PowerManager(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 classLnPowerManager
- Throws:
JmriException
-
refresh
void refresh()
-
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
- Overrides:
message
in classLnPowerManager
- 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 false to indicate PR2 does not implement an "IDLE" power state.- Specified by:
implementsIdle
in interfacePowerManager
- Overrides:
implementsIdle
in classLnPowerManager
- Returns:
- false
-
-