Package jmri.jmrix.tmcc
Class TmccConsist
java.lang.Object
jmri.implementation.DccConsist
jmri.jmrix.tmcc.TmccConsist
- All Implemented Interfaces:
EventListener,Consist,ProgListener
This is the Consist definition for a consist on a TMCC system.
Based on MqttConsist by
-
Field Summary
FieldsFields inherited from class jmri.implementation.DccConsist
consistAddress, consistDir, consistID, consistList, consistPosition, consistRoster, consistTypeFields inherited from interface jmri.Consist
ADVANCED_CONSIST, CS_CONSIST, POSITION_LEAD, POSITION_TRAILFields inherited from interface jmri.ProgListener
CommError, ConfirmFailed, FailedTimeout, NoAck, NoLocoDetected, NotImplemented, OK, ProgrammerBusy, ProgrammingShort, SequenceError, UnknownError, UserAborted -
Constructor Summary
ConstructorsConstructorDescriptionTmccConsist(int address, TmccSystemConnectionMemo memo, String sendTopicPrefix) TmccConsist(DccLocoAddress address, TmccSystemConnectionMemo memo, String sendTopicPrefix) -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Activates the consist for use with a throttlevoidadd(DccLocoAddress locoAddress, boolean directionNormal) Add a Locomotive to a Consistbooleancontains(DccLocoAddress address) Does the consist contain the specified address?voidDeactivates 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 TMCC ENG (loco ID#) address allowed?voidremove(DccLocoAddress locoAddress) Remove a Locomotive from this Consist Clear Consist ID from Locomotivevoidrestore(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.intIs there a size limit for this consist?Methods inherited from class jmri.implementation.DccConsist
addConsistListener, addToAdvancedConsist, getConsistAddress, getConsistID, getConsistList, getConsistType, getPosition, getRosterId, loadDecoderFile, loadDecoderFromLoco, notifyConsistListeners, programmingOpReply, removeConsistListener, removeFromAdvancedConsist, resetRosterEntryCVValue, restore, reverse, setConsistID, setPosition, setRosterEntryCVValue, setRosterId, updateRosterCV
-
Field Details
-
sendTopicPrefix
-
tc
-
-
Constructor Details
-
TmccConsist
-
TmccConsist
-
-
Method Details
-
dispose
Description copied from interface:ConsistA method for cleaning up the consist- Specified by:
disposein interfaceConsist- Overrides:
disposein classDccConsist
-
setConsistType
Description copied from interface:ConsistSet the Consist Type.- Specified by:
setConsistTypein interfaceConsist- Overrides:
setConsistTypein classDccConsist- Parameters:
consist_type- the consist type
-
isAddressAllowed
Is this TMCC ENG (loco ID#) address allowed? TMCC systems only use ENG (loco ID#) addresses 1-98. 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 interfaceConsist- Overrides:
isAddressAllowedin classDccConsist- Parameters:
address- the address- Returns:
- true if allowed; false otherwise
-
sizeLimit
Is there a size limit for this consist?- Specified by:
sizeLimitin interfaceConsist- Overrides:
sizeLimitin classDccConsist- Returns:
- -1 for Controller Consists (no limit), 0 for any other consist type
-
contains
Does the consist contain the specified address? Does the consist contain the specified locomotive address?- Specified by:
containsin interfaceConsist- Overrides:
containsin classDccConsist- Parameters:
address- the address to check- Returns:
- true if in consist; false otherwise
-
getLocoDirection
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 interfaceConsist- Overrides:
getLocoDirectionin classDccConsist- Parameters:
address- the address to check- Returns:
- true if locomotive is in consist in its normal direction of travel; false otherwise
-
add
Add a Locomotive to a Consist- Specified by:
addin interfaceConsist- Overrides:
addin classDccConsist- Parameters:
locoAddress- - is the Locomotive address to add to the consist.directionNormal- - is True if the locomotive is traveling the same direction as the consist, or false otherwise.
-
restore
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 interfaceConsist- Overrides:
restorein classDccConsist- Parameters:
locoAddress- is the Locomotive address to add to the locomotivedirectionNormal- is True if the locomotive is traveling the same direction as the consist, or false otherwise.
-
remove
Remove a Locomotive from this Consist Clear Consist ID from Locomotive- Specified by:
removein interfaceConsist- Overrides:
removein classDccConsist- Parameters:
locoAddress- is the Locomotive address to add to the locomotive
-
activate
Activates the consist for use with a throttle -
deactivate
Deactivates and removes the consist from a throttle
-