Package jmri.jmrix.openlcb
Class OlcbSignalMast.StateMachine<T>
java.lang.Object
org.openlcb.AbstractConnection
org.openlcb.MessageDecoder
jmri.jmrix.openlcb.OlcbSignalMast.StateMachine<T>
- All Implemented Interfaces:
Connection
- Enclosing class:
- OlcbSignalMast
Implement a general state machine where state transitions are
associated with the production and consumption of specific events.
There's a one-to-one mapping between transitions and events.
EventID storage is via Strings, so that the user-visible
eventID string is preserved.
non-static because it references systemMemo from parent class
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openlcb.Connection
Connection.ConnectionListener -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Connection(package private) boolean(package private) final NodeID(package private) T -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetEventIDForState(T key) (package private) EventStategetEventIDState(EventID event) Internal method to determine the EventState for a reply to an Identify* methodgetEventStringForState(T key) getState()voidhandleConsumerIdentified(ConsumerIdentifiedMessage msg, Connection sender) voidhandleIdentifyConsumers(IdentifyConsumersMessage msg, Connection sender) voidvoidvoidhandleIdentifyProducers(IdentifyProducersMessage msg, Connection sender) voidvoidhandleProducerIdentified(ProducerIdentifiedMessage msg, Connection sender) voidUsed at start up to emit the required messages, and in response to a IdentifyEvents messagevoidsetEventForState(T key, String value) voidMethods inherited from class org.openlcb.MessageDecoder
defaultHandler, handleConsumerRangeIdentified, handleDatagram, handleDatagramAcknowledged, handleDatagramRejected, handleInitializationComplete, handleLearnEvent, handleOptionalIntRejected, handleProducerRangeIdentified, handleProtocolIdentificationReply, handleProtocolIdentificationRequest, handleSimpleNodeIdentInfoReply, handleSimpleNodeIdentInfoRequest, handleStreamDataComplete, handleStreamDataProceed, handleStreamDataSend, handleStreamInitiateReply, handleStreamInitiateRequest, handleTractionControlReply, handleTractionControlRequest, handleTractionProxyReply, handleTractionProxyRequest, handleUnknownMTI, handleVerifiedNodeIDNumber, handleVerifyNodeIDNumberAddressed, handleVerifyNodeIDNumberGlobal, putMethods inherited from class org.openlcb.AbstractConnection
registerStartNotification
-
Field Details
-
connection
-
node
-
state
-
initizalized
boolean initizalized -
stateToEventString
-
stateToEventID
-
eventToState
-
-
Constructor Details
-
StateMachine
-
-
Method Details
-
setState
-
getState
-
setEventForState
-
getEventIDForState
-
getEventStringForState
-
getEventIDState
Internal method to determine the EventState for a reply to an Identify* method- Parameters:
event- Method returns the underlying state for this EventID- Returns:
- State corresponding to the given EventID
-
handleProducerConsumerEventReport
public void handleProducerConsumerEventReport(@Nonnull ProducerConsumerEventReportMessage msg, Connection sender) - Overrides:
handleProducerConsumerEventReportin classMessageDecoder
-
handleProducerIdentified
- Overrides:
handleProducerIdentifiedin classMessageDecoder
-
handleConsumerIdentified
- Overrides:
handleConsumerIdentifiedin classMessageDecoder
-
handleIdentifyEventsAddressed
public void handleIdentifyEventsAddressed(@Nonnull IdentifyEventsAddressedMessage msg, Connection sender) - Overrides:
handleIdentifyEventsAddressedin classMessageDecoder
-
handleIdentifyEventsGlobal
- Overrides:
handleIdentifyEventsGlobalin classMessageDecoder
-
sendAllIdentifiedMessages
Used at start up to emit the required messages, and in response to a IdentifyEvents message -
handleIdentifyProducers
- Overrides:
handleIdentifyProducersin classMessageDecoder
-
handleIdentifyConsumers
- Overrides:
handleIdentifyConsumersin classMessageDecoder
-