Package jmri.jmrix.rps
Class RpsBlock
- java.lang.Object
-
- jmri.jmrix.rps.RpsBlock
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener,java.util.EventListener,ThrottleListener
public class RpsBlock extends java.lang.Object implements java.beans.PropertyChangeListener, ThrottleListener
Create a Block that can control a locomotive within a specific Block based on an RpsSensor. It sets speed based on aspect of a specific signal.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.ThrottleListener
ThrottleListener.DecisionType
-
-
Field Summary
Fields Modifier and Type Field Description (package private) floatfast(package private) RpsSensorsensor(package private) SignalHeadsignal(package private) floatslow(package private) static java.util.Hashtable<java.lang.Integer,DccThrottle>throttleTable
-
Constructor Summary
Constructors Constructor Description RpsBlock(java.lang.String sensorname, java.lang.String signalname, float slow, float fast)RpsBlock(RpsSensor sensor, SignalHead signal, float slow, float fast)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidacquireThrottle(java.lang.Integer num)(package private) voidappearance()(package private) voidarriving(java.lang.Integer number)voiddispose()(package private) voidhandleParameterChange(java.lang.String property, java.lang.Object oldState, java.lang.Object newState, java.lang.Object source)(package private) voidleaving(java.lang.Integer number)voidnotifyDecisionRequired(LocoAddress address, ThrottleListener.DecisionType question)No steal or share decisions made locallyvoidnotifyFailedThrottleRequest(LocoAddress address, java.lang.String reason)Get notification that an attempt to request a throttle has failed.voidnotifyThrottleFound(DccThrottle t)Get notification that a throttle has been found as requested.voidpropertyChange(java.beans.PropertyChangeEvent e)(package private) voidupdateCurrentThrottles()(package private) voidupdateOneThrottle(DccThrottle t)
-
-
-
Field Detail
-
slow
float slow
-
fast
float fast
-
signal
SignalHead signal
-
throttleTable
static java.util.Hashtable<java.lang.Integer,DccThrottle> throttleTable
-
-
Constructor Detail
-
RpsBlock
public RpsBlock(RpsSensor sensor, SignalHead signal, float slow, float fast)
-
RpsBlock
public RpsBlock(java.lang.String sensorname, java.lang.String signalname, float slow, float fast)
-
-
Method Detail
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener
-
handleParameterChange
void handleParameterChange(java.lang.String property, java.lang.Object oldState, java.lang.Object newState, java.lang.Object source)
-
arriving
void arriving(java.lang.Integer number)
-
leaving
void leaving(java.lang.Integer number)
-
appearance
void appearance()
-
acquireThrottle
void acquireThrottle(java.lang.Integer num)
-
notifyThrottleFound
public void notifyThrottleFound(DccThrottle t)
Description copied from interface:ThrottleListenerGet notification that a throttle has been found as requested.- Specified by:
notifyThrottleFoundin interfaceThrottleListener- Parameters:
t- the throttle with the requested address
-
notifyFailedThrottleRequest
public void notifyFailedThrottleRequest(LocoAddress address, java.lang.String reason)
Description copied from interface:ThrottleListenerGet notification that an attempt to request a throttle has failed.- Specified by:
notifyFailedThrottleRequestin interfaceThrottleListener- Parameters:
address- address of the failed requestreason- failure cause
-
notifyDecisionRequired
public void notifyDecisionRequired(LocoAddress address, ThrottleListener.DecisionType question)
No steal or share decisions made locallyGet notification that a throttle request is in use by another device, and a "steal", "share", or "steal/share" decision may be required.
- Specified by:
notifyDecisionRequiredin interfaceThrottleListener- Parameters:
address- The LocoAddress that needs the decision.question- The question being asked, steal / cancel, share / cancel, steal / share / cancel
-
updateCurrentThrottles
void updateCurrentThrottles()
-
updateOneThrottle
void updateOneThrottle(DccThrottle t)
-
dispose
public void dispose()
-
-