Package jmri.jmrix.nce
Class NceConsist
- java.lang.Object
- 
- jmri.implementation.DccConsist
- 
- jmri.jmrix.nce.NceConsist
 
 
- 
- All Implemented Interfaces:
- java.util.EventListener,- Consist,- AbstractMRListener,- NceListener,- ProgListener
 
 public class NceConsist extends DccConsist implements NceListener The Consist definition for a consist on an NCE system. It uses the NCE specific commands to build a consist.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description classNceConsist.NceReadConsist
 - 
Field SummaryFields Modifier and Type Field Description static intCONSIST_MAXstatic intCONSIST_MIN- 
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 NceConsist(int address, NceSystemConnectionMemo m)NceConsist(DccLocoAddress locoAddress, NceSystemConnectionMemo m)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(DccLocoAddress locoAddress, boolean directionNormal)Add a Locomotive to a ConsistvoidcheckConsist()voiddispose()A method for cleaning up the consistDccLocoAddressgetLocoAddressByPosition(int position)booleanisValid()Used to determine if consist has been initialized properly.(package private) voidkillConsist(int address, boolean isLong)Kills consist using lead loco addressvoidmessage(NceMessage m)voidremove(DccLocoAddress locoAddress)Remove a locomotive from this consistvoidreply(NceReply r)voidrestore(DccLocoAddress locoAddress, boolean directionNormal, int position)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, contains, getConsistAddress, getConsistID, getConsistList, getConsistType, getLocoDirection, getPosition, getRosterId, isAddressAllowed, loadDecoderFile, loadDecoderFromLoco, notifyConsistListeners, programmingOpReply, removeConsistListener, removeFromAdvancedConsist, resetRosterEntryCVValue, restore, restore, reverse, setConsistID, setPosition, setRosterEntryCVValue, setRosterId, updateRosterCV
 
- 
 
- 
- 
- 
Field Detail- 
CONSIST_MINpublic static final int CONSIST_MIN - See Also:
- Constant Field Values
 
 - 
CONSIST_MAXpublic static final int CONSIST_MAX - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
NceConsistpublic NceConsist(int address, NceSystemConnectionMemo m) 
 - 
NceConsistpublic NceConsist(DccLocoAddress locoAddress, NceSystemConnectionMemo m) 
 
- 
 - 
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
 
 - 
sizeLimitpublic int sizeLimit() Description copied from class:DccConsistIs there a size limit for this consist? For Decoder Assisted Consists, returns -1 (no limit) return 0 for any other consist type.- Specified by:
- sizeLimitin interface- Consist
- Overrides:
- sizeLimitin class- DccConsist
- Returns:
- -1 if no limit; 0 if the Consist Type is not supported; or the total number of usable spaces if the consist has a limit (do not subtract used spaces).
 
 - 
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 consist
- directionNormal- is True if the locomotive is traveling the same direction as the consist, or false otherwise.
 
 - 
restorepublic void restore(DccLocoAddress locoAddress, boolean directionNormal, int position) 
 - 
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 remove from this consist
 
 - 
checkConsistpublic void checkConsist() 
 - 
getLocoAddressByPositionpublic DccLocoAddress getLocoAddressByPosition(int position) 
 - 
isValidpublic boolean isValid() Used to determine if consist has been initialized properly.- Returns:
- true if command station memory has been read for this consist number.
 
 - 
killConsistvoid killConsist(int address, boolean isLong) Kills consist using lead loco address- Parameters:
- address- loco address
- isLong- true if long address
 
 - 
messagepublic void message(NceMessage m) - Specified by:
- messagein interface- NceListener
 
 - 
replypublic void reply(NceReply r) - Specified by:
- replyin interface- NceListener
 
 
- 
 
-