Package jmri.jmrit.withrottle
Class TurnoutController
java.lang.Object
jmri.jmrit.withrottle.AbstractController
jmri.jmrit.withrottle.TurnoutController
- All Implemented Interfaces:
PropertyChangeListener,EventListener
-
Field Summary
Fields inherited from class jmri.jmrit.withrottle.AbstractController
canBuildList, isValid, listeners, sysNameList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDeregister as listener of NamedBeansvoid(package private) voidhandleMessage(String message, DeviceServer deviceServer) parse and process a turnout command messagevoidvoidregister()Register as listener of NamedBeans to be updated of changes.voidsendList()Send list of turnouts Format: PTL]\[SysName}|{UsrName}|{CurrentState]\[SysName}|{UsrName}|{CurrentStatevoidSend Info on turnouts to devices, not specific to any one turnout.void(package private) booleanisValid is used to indicate if the Controller is created.Methods inherited from class jmri.jmrit.withrottle.AbstractController
addControllerListener, buildList, checkCanBuildList, removeControllerListener
-
Constructor Details
-
TurnoutController
public TurnoutController()
-
-
Method Details
-
verifyCreation
boolean verifyCreation()Description copied from class:AbstractControllerisValid is used to indicate if the Controller is created. If false, we can null the controller and reduce overhead.- Specified by:
verifyCreationin classAbstractController- Returns:
- isValid
-
filterList
- Overrides:
filterListin classAbstractController
-
handleMessage
parse and process a turnout command messageFormat: PTA[command][turnoutname] where command is 'C'losed, 'T'hrown, '2'oggle and turnoutname is a complete system name or a turnout number only if number only, system prefix and letter will be added Checks for existing turnout and verifies it is allowed, or if Create Turnout preference enabled, will attempt to create turnout Then sends command to alter state of turnout Can return HM error messages to client
- Specified by:
handleMessagein classAbstractController- Parameters:
message- Command string to be parseddeviceServer- client to send responses (error messages) back to
-
sendTitles
Send Info on turnouts to devices, not specific to any one turnout.Format: PTT]\[turnoutText}|{turnoutKey]\[stateText}|{stateKey]\[stateText}|{stateKey...
-
sendList
Send list of turnouts Format: PTL]\[SysName}|{UsrName}|{CurrentState]\[SysName}|{UsrName}|{CurrentStateStates: 1 - UNKNOWN, 2 - CLOSED, 4 - THROWN
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
sendTurnoutState
-
register
Description copied from class:AbstractControllerRegister as listener of NamedBeans to be updated of changes.- Specified by:
registerin classAbstractController
-
deregister
Description copied from class:AbstractControllerDeregister as listener of NamedBeans- Specified by:
deregisterin classAbstractController
-