Package jmri.jmrit.withrottle
Class ConsistController
- java.lang.Object
-
- jmri.jmrit.withrottle.AbstractController
-
- jmri.jmrit.withrottle.ConsistController
-
- All Implemented Interfaces:
java.util.EventListener
,ProgListener
public class ConsistController extends AbstractController implements ProgListener
-
-
Field Summary
-
Fields inherited from class jmri.jmrit.withrottle.AbstractController
canBuildList, isValid, listeners, sysNameList
-
Fields inherited from interface jmri.ProgListener
CommError, ConfirmFailed, FailedTimeout, NoAck, NoLocoDetected, NotImplemented, OK, ProgrammerBusy, ProgrammingShort, SequenceError, UnknownError, UserAborted
-
-
Constructor Summary
Constructors Constructor Description ConsistController()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkForBroadcastAddress(DccLocoAddress addr)
Check to see if an address will try to broadcast (0) a programming message.(package private) void
deregister()
Deregister as listener of NamedBeans(package private) void
handleMessage(java.lang.String message, DeviceServer deviceServer)
Break down a message and use it.void
programmingOpReply(int value, int status)
Receive a callback at the end of a programming operation.(package private) void
register()
Register as listener of NamedBeans to be updated of changes.void
sendAllConsistData()
void
sendConsistListType()
Allows device to decide how to handle consisting.void
sendDataForConsist(Consist con)
void
setIsConsistAllowed(boolean b)
static DccLocoAddress
stringToDcc(java.lang.String s)
(package private) boolean
verifyCreation()
isValid is used to indicate if the Controller is created.-
Methods inherited from class jmri.jmrit.withrottle.AbstractController
addControllerListener, buildList, checkCanBuildList, filterList, removeControllerListener
-
-
-
-
Constructor Detail
-
ConsistController
public ConsistController()
-
-
Method Detail
-
sendConsistListType
public void sendConsistListType()
Allows device to decide how to handle consisting. Just selection or selection and Make and Break. .size() indicates how many consists are being sent so the device can wait before displaying them
-
sendAllConsistData
public void sendAllConsistData()
-
sendDataForConsist
public void sendDataForConsist(Consist con)
-
setIsConsistAllowed
public void setIsConsistAllowed(boolean b)
-
verifyCreation
boolean verifyCreation()
Description copied from class:AbstractController
isValid is used to indicate if the Controller is created. If false, we can null the controller and reduce overhead.- Specified by:
verifyCreation
in classAbstractController
- Returns:
- isValid
-
handleMessage
void handleMessage(java.lang.String message, DeviceServer deviceServer)
Description copied from class:AbstractController
Break down a message and use it.- Specified by:
handleMessage
in classAbstractController
- Parameters:
message
- string containing new consist informationdeviceServer
- DeviceServer that sent this message, used to send response messages to proper client
-
programmingOpReply
public void programmingOpReply(int value, int status)
Description copied from interface:ProgListener
Receive a callback at the end of a programming operation.- Specified by:
programmingOpReply
in interfaceProgListener
- Parameters:
value
- Value from a read operation, or value written on a writestatus
- Denotes the completion code. Note that this is a bitwise combination of the various status coded defined in this interface.
-
stringToDcc
public static DccLocoAddress stringToDcc(java.lang.String s)
-
checkForBroadcastAddress
public boolean checkForBroadcastAddress(DccLocoAddress addr)
Check to see if an address will try to broadcast (0) a programming message.- Parameters:
addr
- The address to check- Returns:
- true if address is no good, otherwise false
-
register
void register()
Description copied from class:AbstractController
Register as listener of NamedBeans to be updated of changes.- Specified by:
register
in classAbstractController
-
deregister
void deregister()
Description copied from class:AbstractController
Deregister as listener of NamedBeans- Specified by:
deregister
in classAbstractController
-
-