Package jmri.jmrix.zimo
Class Mx1TrafficController
java.lang.Object
jmri.jmrix.zimo.Mx1TrafficController
- All Implemented Interfaces:
Mx1Interface
- Direct Known Subclasses:
Mx1Packetizer
Abstract base class for implementations of MX-1 Interface.
This provides just the basic interface, plus the "" static method for locating the local implementation.
Adapted by Sip Bosch for use with zimo Mx-1.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Mx1SystemConnectionMemostatic final booleanstatic final booleanprotected Vector<Mx1Listener>(package private) Mx1CommandStationReference to the command station in communication here(package private) booleanFields inherited from interface jmri.jmrix.zimo.Mx1Interface
ALL, POWER, PROGRAMMING, SENSORS, SLOTINFO, TURNOUTS -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new TrafficController instance.Mx1TrafficController(Mx1CommandStation pCommandStation, boolean prot) Must provide a ZimoCommandStation reference at creation time -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMx1Listener(int mask, Mx1Listener l) Request notification of things happening on the MX-1.Get access to communicating command station objectbooleanprotected voidnotify(Mx1Message m, Mx1Listener replyTo) Forward a message to all registered listeners.voidremoveMx1Listener(int mask, Mx1Listener l) abstract voidsendMx1Message(Mx1Message m, Mx1Listener reply) Forward a pre-formatted Mx1Message to the actual interface.voidabstract booleanstatus()
-
Field Details
-
ASCII
- See Also:
-
BINARY
- See Also:
-
protocol
boolean protocol -
listeners
-
mCommandStation
Reference to the command station in communication here -
adaptermemo
-
-
Constructor Details
-
Mx1TrafficController
public Mx1TrafficController()Create a new TrafficController instance. Simple implementation. -
Mx1TrafficController
Mx1TrafficController(Mx1CommandStation pCommandStation, boolean prot) Must provide a ZimoCommandStation reference at creation time
-
-
Method Details
-
getProtocol
-
status
- Specified by:
statusin interfaceMx1Interface
-
sendMx1Message
Forward a pre-formatted Mx1Message to the actual interface.- Specified by:
sendMx1Messagein interfaceMx1Interface- Parameters:
m- Message to send; will be updated with CRCreply- the listener to notify of a response
-
addMx1Listener
Description copied from interface:Mx1InterfaceRequest notification of things happening on the MX-1.The same listener can register multiple times with different masks. (Multiple registrations with a single mask value are equivalent to a single registration) Mask values are defined as class constants. Note that these are bit masks, and should be OR'd, not added, if multiple values are desired.
The event notification contains the received message as source, not this object, so that we can notify of an incoming message to multiple places and then move on.
- Specified by:
addMx1Listenerin interfaceMx1Interface- Parameters:
mask- The OR of the key values of messages to be reported (to reduce traffic, provide for listeners interested in different things)l- Object to be notified of new messages as they arrive.
-
removeMx1Listener
- Specified by:
removeMx1Listenerin interfaceMx1Interface
-
notify
Forward a message to all registered listeners.- Parameters:
m- Message to forward. Listeners should not modify it!replyTo- Listener for the reply to this message, doesn't get the echo of it.
-
getCommandStation
Get access to communicating command station object- Returns:
- associated Command Station object
-
getAdapterMemo
-
setAdapterMemo
-
getUserName
-
getSystemPrefix
-