Package jmri.jmrix.nce
Class NceTurnoutMonitor
java.lang.Object
jmri.jmrix.nce.NceTurnoutMonitor
- All Implemented Interfaces:
PropertyChangeListener,EventListener,AbstractMRListener,NceListener
Polls NCE Command Station for turnout discrepancies
This implementation reads the NCE Command Station (CS) memory that stores the state of all accessories thrown by cabs or through the com port using the new binary switch command. The accessory states are stored in 256 byte array starting at address 0xEC00 (PH5 0x5400).
byte 0, bit 0 = ACCY 1, bit 1 = ACCY 2 byte 1, bit 0 = ACCY 9, bit 1 = ACCY 10
byte 255, bit 0 = ACCY 2041, bit 3 = ACCY 2044 (last valid addr)
ACCY bit = 0 turnout thrown, 1 = turnout closed
Block reads (16 bytes) of the NCE CS memory are performed to minimize impact to the NCE CS. Data from the CS is then compared to the JMRI turnout (accessory) state and if a discrepancy is discovered, the JMRI turnout state is modified to match the CS.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean[](package private) byte[](package private) byte[](package private) Thread(package private) boolean[](package private) static final int(package private) boolean(package private) boolean[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoid
-
Field Details
-
POLL_TIME
- See Also:
-
newTurnouts
boolean[] newTurnouts -
activeBlock
boolean[] activeBlock -
validBlock
boolean[] validBlock -
csAccMemCopy
byte[] csAccMemCopy -
dataBuffer
byte[] dataBuffer -
nceTurnoutMonitorThread
-
turnoutUpdateValid
boolean turnoutUpdateValid
-
-
Constructor Details
-
NceTurnoutMonitor
-
-
Method Details
-
pollMessage
-
message
- Specified by:
messagein interfaceNceListener
-
reply
- Specified by:
replyin interfaceNceListener
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-