Package jmri.jmrix.can.cbus
Class CbusPowerManager
- java.lang.Object
-
- jmri.beans.PropertyChangeSupport
-
- jmri.managers.AbstractPowerManager<CanSystemConnectionMemo>
-
- jmri.jmrix.can.cbus.CbusPowerManager
-
- All Implemented Interfaces:
java.util.EventListener
,PropertyChangeFirer
,PropertyChangeProvider
,Disposable
,AbstractMRListener
,CanListener
,PowerManager
public class CbusPowerManager extends AbstractPowerManager<CanSystemConnectionMemo> implements CanListener, Disposable
PowerManager implementation for controlling CBUS layout power.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jmri.managers.AbstractPowerManager
AbstractPowerManager.TimeKeeper
-
-
Field Summary
-
Fields inherited from class jmri.managers.AbstractPowerManager
memo, power
-
Fields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description CbusPowerManager(CanSystemConnectionMemo memo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Called when disposing of a disposable.void
message(CanMessage m)
Does not listen to outgoing messages.void
reply(CanReply m)
Called when an incoming CanFrame is received from the CAN Network.void
setPower(int v)
void
updatePower(int newPower)
Notification to JMRI of main track power state.-
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.jmrix.can.CanListener
addTc, addTc, removeTc, removeTc
-
Methods inherited from interface jmri.PowerManager
implementsIdle
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Constructor Detail
-
CbusPowerManager
public CbusPowerManager(CanSystemConnectionMemo 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<CanSystemConnectionMemo>
- Throws:
JmriException
-
updatePower
public void updatePower(int newPower)
Notification to JMRI of main track power state. Does not send to Layout. Only used to bypass having the PowerManager respond to messages from the command station because I don't know why the PowerManager should not do the job the PowerManager API was created to do in the CBus package.- Parameters:
newPower
- New Power Status
-
dispose
public void dispose()
Called when disposing of a disposable.Note there are no assurances this method will not be called multiple times against a single instance of this Disposable. It is the responsibility of this Disposable to protect itself and the application from ensuring that calling this method multiple times has no unwanted side effects.
- Specified by:
dispose
in interfaceDisposable
- Specified by:
dispose
in interfacePowerManager
-
reply
public void reply(CanReply m)
Description copied from interface:CanListener
Called when an incoming CanFrame is received from the CAN Network.- Specified by:
reply
in interfaceCanListener
- Parameters:
m
- the CanReply being received.
-
message
public void message(CanMessage m)
Does not listen to outgoing messages. Called when an outgoing message is sent to the CAN Network.- Specified by:
message
in interfaceCanListener
- Parameters:
m
- the CanMessage being sent.
-
-