Package jmri.jmrix.loconet
Class LocoNetConsist
java.lang.Object
jmri.implementation.DccConsist
jmri.jmrix.loconet.LocoNetConsist
- All Implemented Interfaces:
EventListener,Consist,SlotListener,ProgListener,ThrottleListener
LocoNetConsist.java
This is the Consist definition for a consist on a LocoNet system.
It uses the LocoNet specific commands to build a consist.
-
Nested Class Summary
Nested classes/interfaces inherited from interface jmri.ThrottleListener
ThrottleListener.DecisionType -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final intFields 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
ConstructorsConstructorDescriptionLocoNetConsist(int address, LocoNetSystemConnectionMemo lm) LocoNetConsist(DccLocoAddress address, LocoNetSystemConnectionMemo lm) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(DccLocoAddress locoAddress, boolean directionNormal) Add a Locomotive to a Consist.protected voidaddToAdvancedConsist(DccLocoAddress locoAddress, boolean directionNormal) Add a Locomotive to an Advanced Consist.booleancontains(DccLocoAddress address) Does the consist contain the specified locomotive address?booleangetLocoDirection(DccLocoAddress address) Get the relative direction setting for a specific locomotive in the consist.booleanisAddressAllowed(DccLocoAddress address) Is this address allowed?voidvoidnotifyDecisionRequired(LocoAddress address, ThrottleListener.DecisionType question) No steal or share decisions made locallyvoidnotifyFailedThrottleRequest(LocoAddress address, String reason) Get notification that an attempt to request a throttle has failed.voidGet notification that a throttle has been found as requested.voidremove(DccLocoAddress locoAddress) Remove a Locomotive from this Consist.protected voidremoveFromAdvancedConsist(DccLocoAddress locoAddress) Remove a Locomotive from an Advanced ConsistvoidremoveFromCSConsist(DccLocoAddress locoAddress) Remove a Locomotive from a LocoNet Universal Consist.voidrestore(DccLocoAddress locoAddress, boolean directionNormal) Restore a Locomotive to a Consist, but don't write to the command station.voidsetConsistType(int type) Set the Consist Type.intIs there a size limit for this consist?Methods inherited from class jmri.implementation.DccConsist
addConsistListener, dispose, getConsistAddress, getConsistID, getConsistList, getConsistType, getPosition, getRosterId, loadDecoderFile, loadDecoderFromLoco, notifyConsistListeners, programmingOpReply, removeConsistListener, resetRosterEntryCVValue, restore, reverse, setConsistID, setPosition, setRosterEntryCVValue, setRosterId, updateRosterCV
-
Field Details
-
IDLESTATE
- See Also:
-
LEADREQUESTSTATE
- See Also:
-
LINKSTAGEONESTATE
- See Also:
-
LINKSTAGETWOSTATE
- See Also:
-
LINKSTAGETHREESTATE
- See Also:
-
UNLINKSTAGEONESTATE
- See Also:
-
-
Constructor Details
-
LocoNetConsist
-
LocoNetConsist
-
-
Method Details
-
setConsistType
Description copied from interface:ConsistSet the Consist Type.- Specified by:
setConsistTypein interfaceConsist- Overrides:
setConsistTypein classDccConsist- Parameters:
type- the consist type
-
isAddressAllowed
Is this address allowed? On LocoNet systems, All addresses can be used in a Universal Consist and only 0 is not allowed in Advanced Consists. 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 (no limit) for both CS and Advanced Consists, 0 for any other consist type.
-
contains
Description copied from interface:ConsistDoes 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
Description copied from interface:ConsistGet 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- the Locomotive address to add to the locomotivedirectionNormal- if the locomotive is traveling the same direction as the consist, false otherwise
-
restore
Restore a Locomotive to a 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- the Locomotive address to add to the locomotivedirectionNormal- True if the locomotive is traveling the same direction as the consist, false otherwise
-
remove
Remove a Locomotive from this Consist.- Specified by:
removein interfaceConsist- Overrides:
removein classDccConsist- Parameters:
locoAddress- is the Locomotive address to add to the locomotive
-
addToAdvancedConsist
Add a Locomotive to an Advanced Consist.- Overrides:
addToAdvancedConsistin classDccConsist- Parameters:
locoAddress- the Locomotive address to add to the locomotivedirectionNormal- True if the locomotive is traveling the same direction as the consist, false otherwise
-
removeFromAdvancedConsist
Remove a Locomotive from an Advanced Consist- Overrides:
removeFromAdvancedConsistin classDccConsist- Parameters:
locoAddress- is the Locomotive address to add to the locomotive
-
removeFromCSConsist
Remove a Locomotive from a LocoNet Universal Consist.- Parameters:
locoAddress- is the Locomotive address to add to the locomotive.
-
notifyChangedSlot
- Specified by:
notifyChangedSlotin interfaceSlotListener
-
notifyThrottleFound
Description copied from interface:ThrottleListenerGet notification that a throttle has been found as requested.- Specified by:
notifyThrottleFoundin interfaceThrottleListener- Parameters:
t- the throttle with the requested address
-
notifyFailedThrottleRequest
Description copied from interface:ThrottleListenerGet notification that an attempt to request a throttle has failed.- Specified by:
notifyFailedThrottleRequestin interfaceThrottleListener- Parameters:
address- address of the failed requestreason- failure cause
-
notifyDecisionRequired
No steal or share decisions made locallyGet notification that a throttle request is in use by another device, and a "steal", "share", or "steal/share" decision may be required.
- Specified by:
notifyDecisionRequiredin interfaceThrottleListener- Parameters:
address- The LocoAddress that needs the decision.question- The question being asked, steal / cancel, share / cancel, steal / share / cancel
-