Package jmri.jmrix.rps
Class Transmitter
- java.lang.Object
-
- jmri.jmrix.rps.Transmitter
-
- All Implemented Interfaces:
java.util.EventListener
,ThrottleListener
public class Transmitter extends java.lang.Object implements ThrottleListener
Represents an RPS transmitter, generally a locomotive.The "ID" is used to identify this transmitter in RPS. The "rosterName" is the name (ID) of the roster entry this was originally created from.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.ThrottleListener
ThrottleListener.DecisionType
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
address
(package private) java.lang.String
id
(package private) Measurement
lastMeasurement
(package private) boolean
longAddress
(package private) boolean
needReqThrottle
(package private) boolean
polled
(package private) java.lang.String
rosterName
(package private) DccThrottle
throttle
-
Constructor Summary
Constructors Constructor Description Transmitter(java.lang.String id, boolean polled, int address, boolean longAddress)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) boolean
checkInit()
int
getAddress()
java.lang.String
getId()
Measurement
getLastMeasurement()
java.lang.String
getRosterName()
(package private) DccThrottle
getThrottle()
boolean
isLongAddress()
boolean
isPolled()
void
notifyDecisionRequired(LocoAddress address, ThrottleListener.DecisionType question)
No steal or share decisions made locallyvoid
notifyFailedThrottleRequest(LocoAddress address, java.lang.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
setAddress(int address)
void
setId(java.lang.String id)
void
setLastMeasurement(Measurement last)
void
setLongAddress(boolean longAddress)
void
setPolled(boolean polled)
void
setRosterName(java.lang.String rosterName)
-
-
-
Field Detail
-
id
java.lang.String id
-
rosterName
java.lang.String rosterName
-
longAddress
boolean longAddress
-
address
int address
-
polled
boolean polled
-
lastMeasurement
Measurement lastMeasurement
-
throttle
DccThrottle throttle
-
needReqThrottle
boolean needReqThrottle
-
-
Constructor Detail
-
Transmitter
Transmitter(java.lang.String id, boolean polled, int address, boolean longAddress)
-
-
Method Detail
-
getId
public java.lang.String getId()
-
setId
public void setId(java.lang.String id)
-
getRosterName
public java.lang.String getRosterName()
-
setRosterName
public void setRosterName(java.lang.String rosterName)
-
isLongAddress
public boolean isLongAddress()
-
setLongAddress
public void setLongAddress(boolean longAddress)
-
getAddress
public int getAddress()
-
setAddress
public void setAddress(int address)
-
isPolled
public boolean isPolled()
-
setPolled
public void setPolled(boolean polled)
-
setLastMeasurement
public void setLastMeasurement(Measurement last)
-
getLastMeasurement
public Measurement getLastMeasurement()
-
getThrottle
DccThrottle getThrottle()
-
checkInit
boolean checkInit()
-
notifyThrottleFound
public void notifyThrottleFound(DccThrottle t)
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
public void notifyFailedThrottleRequest(LocoAddress address, java.lang.String reason)
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
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:
notifyDecisionRequired
in interfaceThrottleListener
- Parameters:
address
- The LocoAddress that needs the decision.question
- The question being asked, steal / cancel, share / cancel, steal / share / cancel
-
-