Package jmri.jmrix.mqtt
Class MqttConsist
- java.lang.Object
- 
- jmri.implementation.DccConsist
- 
- jmri.jmrix.mqtt.MqttConsist
 
 
- 
- All Implemented Interfaces:
- java.util.EventListener,- Consist,- ProgListener
 
 public class MqttConsist extends DccConsist This is the Consist definition for a consist on an MQTT system.
- 
- 
Field SummaryFields Modifier and Type Field Description java.lang.StringsendTopicPrefix- 
Fields inherited from class jmri.implementation.DccConsistconsistAddress, consistDir, consistID, consistList, consistPosition, consistRoster, consistType
 - 
Fields inherited from interface jmri.ConsistADVANCED_CONSIST, CS_CONSIST, POSITION_LEAD, POSITION_TRAIL
 - 
Fields inherited from interface jmri.ProgListenerCommError, ConfirmFailed, FailedTimeout, NoAck, NoLocoDetected, NotImplemented, OK, ProgrammerBusy, ProgrammingShort, SequenceError, UnknownError, UserAborted
 
- 
 - 
Constructor SummaryConstructors Constructor Description MqttConsist(int address, MqttSystemConnectionMemo memo, java.lang.String sendTopicPrefix)MqttConsist(DccLocoAddress address, MqttSystemConnectionMemo memo, java.lang.String sendTopicPrefix)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()Activates the consist for use with a throttlevoidadd(DccLocoAddress locoAddress, boolean directionNormal)Add a Locomotive to a Consist.booleancontains(DccLocoAddress address)Does the consist contain the specified address?voiddeactivate()Deactivates and removes the consist from a throttlevoiddispose()A method for cleaning up the consistbooleangetLocoDirection(DccLocoAddress address)Get the relative direction setting for a specific locomotive in the consist.booleanisAddressAllowed(DccLocoAddress address)Is this address allowed?voidremove(DccLocoAddress locoAddress)Remove a Locomotive from this Consist.voidrestore(DccLocoAddress locoAddress, boolean directionNormal)Restore a Locomotive to Consist, but don't write to the command station.voidsetConsistType(int consist_type)Set the Consist Type.intsizeLimit()Is there a size limit for this consist?- 
Methods inherited from class jmri.implementation.DccConsistaddConsistListener, addToAdvancedConsist, getConsistAddress, getConsistID, getConsistList, getConsistType, getPosition, getRosterId, loadDecoderFile, loadDecoderFromLoco, notifyConsistListeners, programmingOpReply, removeConsistListener, removeFromAdvancedConsist, resetRosterEntryCVValue, restore, reverse, setConsistID, setPosition, setRosterEntryCVValue, setRosterId, updateRosterCV
 
- 
 
- 
- 
- 
Field Detail- 
sendTopicPrefix@Nonnull public java.lang.String sendTopicPrefix 
 
- 
 - 
Constructor Detail- 
MqttConsistpublic MqttConsist(int address, MqttSystemConnectionMemo memo, java.lang.String sendTopicPrefix) 
 - 
MqttConsistpublic MqttConsist(DccLocoAddress address, MqttSystemConnectionMemo memo, java.lang.String sendTopicPrefix) 
 
- 
 - 
Method Detail- 
disposepublic void dispose() Description copied from interface:ConsistA method for cleaning up the consist- Specified by:
- disposein interface- Consist
- Overrides:
- disposein class- DccConsist
 
 - 
setConsistTypepublic void setConsistType(int consist_type) Description copied from interface:ConsistSet the Consist Type.- Specified by:
- setConsistTypein interface- Consist
- Overrides:
- setConsistTypein class- DccConsist
- Parameters:
- consist_type- the consist type
 
 - 
isAddressAllowedpublic boolean isAddressAllowed(DccLocoAddress address) Is this address allowed? On MQTT systems, all addresses but 0 can be used in a consist. Is this address allowed? Since address 00 is an analog locomotive, we can't program CV19 to include it in a consist, but all other addresses are ok.- Specified by:
- isAddressAllowedin interface- Consist
- Overrides:
- isAddressAllowedin class- DccConsist
- Parameters:
- address- the address
- Returns:
- true if allowed; false otherwise
 
 - 
sizeLimitpublic int sizeLimit() Is there a size limit for this consist?- Specified by:
- sizeLimitin interface- Consist
- Overrides:
- sizeLimitin class- DccConsist
- Returns:
- -1 for Controller Consists (no limit), 0 for any other consist type
 
 - 
containspublic boolean contains(DccLocoAddress address) Does the consist contain the specified address? Does the consist contain the specified locomotive address?- Specified by:
- containsin interface- Consist
- Overrides:
- containsin class- DccConsist
- Parameters:
- address- the address to check
- Returns:
- true if in consist; false otherwise
 
 - 
getLocoDirectionpublic boolean getLocoDirection(DccLocoAddress address) Get the relative direction setting for a specific locomotive in the consist. Get the relative direction setting for a specific locomotive in the consist.- Specified by:
- getLocoDirectionin interface- Consist
- Overrides:
- getLocoDirectionin class- DccConsist
- Parameters:
- address- the address to check
- Returns:
- true if locomotive is in consist in its normal direction of travel; false otherwise
 
 - 
addpublic void add(DccLocoAddress locoAddress, boolean directionNormal) Add a Locomotive to a Consist.- Specified by:
- addin interface- Consist
- Overrides:
- addin class- DccConsist
- Parameters:
- locoAddress- is the Locomotive address to add to the locomotive
- directionNormal- is True if the locomotive is traveling the same direction as the consist, or false otherwise.
 
 - 
restorepublic void restore(DccLocoAddress locoAddress, boolean directionNormal) Restore a Locomotive to Consist, but don't write to the command station. This is used for restoring the consist from a file or adding a consist read from the command station.- Specified by:
- restorein interface- Consist
- Overrides:
- restorein class- DccConsist
- Parameters:
- locoAddress- is the Locomotive address to add to the locomotive
- directionNormal- is True if the locomotive is traveling the same direction as the consist, or false otherwise.
 
 - 
removepublic void remove(DccLocoAddress locoAddress) Remove a Locomotive from this Consist.- Specified by:
- removein interface- Consist
- Overrides:
- removein class- DccConsist
- Parameters:
- locoAddress- is the Locomotive address to add to the locomotive
 
 - 
activatepublic void activate() Activates the consist for use with a throttle
 - 
deactivatepublic void deactivate() Deactivates and removes the consist from a throttle
 
- 
 
-