Package jmri.jmrit.withrottle
Class TurnoutController
- java.lang.Object
-
- jmri.jmrit.withrottle.AbstractController
-
- jmri.jmrit.withrottle.TurnoutController
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener,java.util.EventListener
public class TurnoutController extends AbstractController implements java.beans.PropertyChangeListener
-
-
Field Summary
-
Fields inherited from class jmri.jmrit.withrottle.AbstractController
canBuildList, isValid, listeners, sysNameList
-
-
Constructor Summary
Constructors Constructor Description TurnoutController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidderegister()Deregister as listener of NamedBeansvoidfilterList()(package private) voidhandleMessage(java.lang.String message, DeviceServer deviceServer)parse and process a turnout command messagevoidpropertyChange(java.beans.PropertyChangeEvent evt)voidregister()Register as listener of NamedBeans to be updated of changes.voidsendList()Send list of turnouts Format: PTL]\[SysName}|{UsrName}|{CurrentState]\[SysName}|{UsrName}|{CurrentStatevoidsendTitles()Send Info on turnouts to devices, not specific to any one turnout.voidsendTurnoutState(Turnout t)(package private) booleanverifyCreation()isValid is used to indicate if the Controller is created.-
Methods inherited from class jmri.jmrit.withrottle.AbstractController
addControllerListener, buildList, checkCanBuildList, removeControllerListener
-
-
-
-
Constructor Detail
-
TurnoutController
public TurnoutController()
-
-
Method Detail
-
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
public void filterList()
- Overrides:
filterListin classAbstractController
-
handleMessage
void handleMessage(java.lang.String message, DeviceServer deviceServer)
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
public void sendTitles()
Send Info on turnouts to devices, not specific to any one turnout.Format: PTT]\[turnoutText}|{turnoutKey]\[stateText}|{stateKey]\[stateText}|{stateKey...
-
sendList
public void sendList()
Send list of turnouts Format: PTL]\[SysName}|{UsrName}|{CurrentState]\[SysName}|{UsrName}|{CurrentStateStates: 1 - UNKNOWN, 2 - CLOSED, 4 - THROWN
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener
-
sendTurnoutState
public void sendTurnoutState(Turnout t)
-
register
public void register()
Description copied from class:AbstractControllerRegister as listener of NamedBeans to be updated of changes.- Specified by:
registerin classAbstractController
-
deregister
public void deregister()
Description copied from class:AbstractControllerDeregister as listener of NamedBeans- Specified by:
deregisterin classAbstractController
-
-