Package jmri.jmrit.withrottle
Class RouteController
- java.lang.Object
-
- jmri.jmrit.withrottle.AbstractController
-
- jmri.jmrit.withrottle.RouteController
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener
,java.util.EventListener
public class RouteController extends AbstractController implements java.beans.PropertyChangeListener
-
-
Field Summary
Fields Modifier and Type Field Description protected NamedBeanHandleManager
nbhm
-
Fields inherited from class jmri.jmrit.withrottle.AbstractController
canBuildList, isValid, listeners, sysNameList
-
-
Constructor Summary
Constructors Constructor Description RouteController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deregister()
Remove this from each managed route's aligned sensor.void
filterList()
(package private) void
handleMessage(java.lang.String message, DeviceServer deviceServer)
parse and process a route command messagevoid
propertyChange(java.beans.PropertyChangeEvent evt)
This is on the aligned sensor, not the route itself.void
register()
Register this as a listener of each managed route's aligned sensor.void
sendList()
Send list of routes Format: PRL]\[SysName}|{UsrName}|{CurrentState]\[SysName}|{UsrName}|{CurrentStatevoid
sendTitles()
Send Info on routes to devices, not specific to any one route.(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
-
-
-
-
Field Detail
-
nbhm
protected NamedBeanHandleManager nbhm
-
-
Constructor Detail
-
RouteController
public RouteController()
-
-
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 route command messageFormat: PRA[command][routename] where command is always '2' for Toggle routename is a complete system name 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 routes to devices, not specific to any one route.Format: PRT]\[routeText}|{routeKey]\[stateText}|{stateKey]\[stateText}|{stateKey...
-
sendList
public void sendList()
Send list of routes Format: PRL]\[SysName}|{UsrName}|{CurrentState]\[SysName}|{UsrName}|{CurrentStateStates: 1 - UNKNOWN, 2 - ACTIVE, 4 - INACTIVE (based on turnoutsAligned sensor, if used)
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
This is on the aligned sensor, not the route itself.- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
register
public void register()
Register this as a listener of each managed route's aligned sensor.- Specified by:
register
in classAbstractController
-
deregister
public void deregister()
Remove this from each managed route's aligned sensor.- Specified by:
deregister
in classAbstractController
-
-