Package jmri.jmrix.tmcc
Class TmccConsistManager
java.lang.Object
jmri.implementation.AbstractConsistManager
jmri.jmrix.tmcc.TmccConsistManager
- All Implemented Interfaces:
ConsistManager
Consist Manager for use with the TmccConsist class for the
consists it builds.
Based on MqttConsistManager by
-
Nested Class Summary
Nested classes/interfaces inherited from interface jmri.ConsistManager
ConsistManager.EnableListener -
Field Summary
FieldsFields inherited from class jmri.implementation.AbstractConsistManager
consistTable -
Constructor Summary
ConstructorsConstructorDescriptionConstructor - call the constructor for the superclass, and initialize the consist reader thread, which retrieves consist information from the command station. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateConsist(LocoAddress address) Consist is activated on the controller for the specified LocoAddress This is used by TmccThrottle to either publish an existing consist or clear an old one upon opening the new throttle.addConsist(LocoAddress address) Add a new TMCC Consist with the given address to consistTable/consistList.booleanDoes a CS consist require a separate consist address?voiddeactivateConsist(LocoAddress address) If a consist exists with the given address, the consist is deactivated on the controller, otherwise it does nothing.getConsist(LocoAddress address) Read the new TMCC Consist address.booleanDoes this ConsistManager allow advanced consisting?booleanThis implementation does support command station consists, so return true.booleanDoes this ConsistManager require that all locomotives in a consist use the same protocol?voidRequest an update from the layout, loading Consists from the command station.voidsetSendTopic(String sendTopicPrefix) protected booleanAllow a request for consist updates from the layout.Methods inherited from class jmri.implementation.AbstractConsistManager
addConsistListListener, decodeErrorCode, delConsist, getConsistList, notifyConsistListChanged, removeConsistListListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.ConsistManager
canBeDisabled, isEnabled, registerEnableListener, unregisterEnableListener
-
Field Details
-
adapterMemo
-
sendTopicPrefix
-
-
Constructor Details
-
TmccConsistManager
Constructor - call the constructor for the superclass, and initialize the consist reader thread, which retrieves consist information from the command station.- Parameters:
memo- the associated connection memo
-
-
Method Details
-
isAdvancedConsistPossible
Does this ConsistManager allow advanced consisting?- Returns:
- true if this manager's protocols support DCC advanced consisting
-
isSingleFormConsistRequired
Does this ConsistManager require that all locomotives in a consist use the same protocol?- Returns:
- true if this manager requires that all locomotives in a consist use the same protocol
-
setSendTopic
-
isCommandStationConsistPossible
This implementation does support command station consists, so return true.- Returns:
- true if command station consists are supported; false otherwise
-
csConsistNeedsSeperateAddress
Does a CS consist require a separate consist address? CS consist addresses are assigned by the user, so return true.- Returns:
- true is command station consist requires separate address; false otherwise
-
addConsist
Add a new TMCC Consist with the given address to consistTable/consistList.- Specified by:
addConsistin classAbstractConsistManager- Parameters:
address- consist address- Returns:
- a consist at address; this will be the existing consist if a consist is already known to exist at address
-
getConsist
Read the new TMCC Consist address.- Specified by:
getConsistin interfaceConsistManager- Overrides:
getConsistin classAbstractConsistManager- Parameters:
address- the consist address- Returns:
- an existing or new consist
-
requestUpdateFromLayout
Description copied from interface:ConsistManagerRequest an update from the layout, loading Consists from the command station.- Specified by:
requestUpdateFromLayoutin interfaceConsistManager- Overrides:
requestUpdateFromLayoutin classAbstractConsistManager
-
shouldRequestUpdateFromLayout
Description copied from class:AbstractConsistManagerAllow a request for consist updates from the layout. If not overridden by a concrete subclass, this method always returns true.- Overrides:
shouldRequestUpdateFromLayoutin classAbstractConsistManager- Returns:
- true if the request can be made, false if not
-
activateConsist
Consist is activated on the controller for the specified LocoAddress This is used by TmccThrottle to either publish an existing consist or clear an old one upon opening the new throttle.- Parameters:
address- Consist address to be activated
-
deactivateConsist
If a consist exists with the given address, the consist is deactivated on the controller, otherwise it does nothing. This is used by a throttle in case it is controlling a consist.- Parameters:
address- Consist address to be deactivated
-