Package jmri.jmrix.rps
Class RpsBlock
java.lang.Object
jmri.jmrix.rps.RpsBlock
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,ThrottleListener
public class RpsBlock extends Object implements 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) float
fast
(package private) RpsSensor
sensor
(package private) SignalHead
signal
(package private) float
slow
(package private) static Hashtable<Integer,DccThrottle>
throttleTable
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description (package private) void
acquireThrottle(Integer num)
(package private) void
appearance()
(package private) void
arriving(Integer number)
void
dispose()
(package private) void
handleParameterChange(String property, Object oldState, Object newState, Object source)
(package private) void
leaving(Integer number)
void
notifyDecisionRequired(LocoAddress address, ThrottleListener.DecisionType question)
No steal or share decisions made locallyvoid
notifyFailedThrottleRequest(LocoAddress address, String reason)
Get notification that an attempt to request a throttle has failed.void
notifyThrottleFound(DccThrottle t)
Get notification that a throttle has been found as requested.void
propertyChange(PropertyChangeEvent e)
(package private) void
updateCurrentThrottles()
(package private) void
updateOneThrottle(DccThrottle t)
-
Field Details
-
Constructor Details
-
Method Details
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
-
handleParameterChange
-
arriving
-
leaving
-
appearance
void appearance() -
acquireThrottle
-
notifyThrottleFound
Description copied from interface:ThrottleListener
Get notification that a throttle has been found as requested.- Specified by:
notifyThrottleFound
in interfaceThrottleListener
- Parameters:
t
- the throttle with the requested address
-
notifyFailedThrottleRequest
Description copied from interface:ThrottleListener
Get notification that an attempt to request a throttle has failed.- Specified by:
notifyFailedThrottleRequest
in interfaceThrottleListener
- Parameters:
address
- address of the failed requestreason
- failure cause
-
notifyDecisionRequired
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:
notifyDecisionRequired
in 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
-
dispose
-