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 void
deregister()
Deregister as listener of NamedBeansvoid
filterList()
(package private) void
handleMessage(java.lang.String message, DeviceServer deviceServer)
parse and process a turnout command messagevoid
propertyChange(java.beans.PropertyChangeEvent evt)
void
register()
Register as listener of NamedBeans to be updated of changes.void
sendList()
Send list of turnouts Format: PTL]\[SysName}|{UsrName}|{CurrentState]\[SysName}|{UsrName}|{CurrentStatevoid
sendTitles()
Send Info on turnouts to devices, not specific to any one turnout.void
sendTurnoutState(Turnout t)
(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, removeControllerListener
-
-
-
-
Constructor Detail
-
TurnoutController
public TurnoutController()
-
-
Method Detail
-
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
-
filterList
public void filterList()
- Overrides:
filterList
in 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:
handleMessage
in 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:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
sendTurnoutState
public void sendTurnoutState(Turnout t)
-
register
public void register()
Description copied from class:AbstractController
Register as listener of NamedBeans to be updated of changes.- Specified by:
register
in classAbstractController
-
deregister
public void deregister()
Description copied from class:AbstractController
Deregister as listener of NamedBeans- Specified by:
deregister
in classAbstractController
-
-