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 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 voidderegister()Remove this from each managed route's aligned sensor.voidfilterList()(package private) voidhandleMessage(java.lang.String message, DeviceServer deviceServer)parse and process a route command messagevoidpropertyChange(java.beans.PropertyChangeEvent evt)This is on the aligned sensor, not the route itself.voidregister()Register this as a listener of each managed route's aligned sensor.voidsendList()Send list of routes Format: PRL]\[SysName}|{UsrName}|{CurrentState]\[SysName}|{UsrName}|{CurrentStatevoidsendTitles()Send Info on routes to devices, not specific to any one route.(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
-
RouteController
public RouteController()
-
-
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 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:
handleMessagein 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:
propertyChangein interfacejava.beans.PropertyChangeListener
-
register
public void register()
Register this as a listener of each managed route's aligned sensor.- Specified by:
registerin classAbstractController
-
deregister
public void deregister()
Remove this from each managed route's aligned sensor.- Specified by:
deregisterin classAbstractController
-
-