jmri
Class DccConsist

java.lang.Object
  extended by jmri.DccConsist
All Implemented Interfaces:
EventListener, Consist, ProgListener
Direct Known Subclasses:
EasyDccConsist, XNetConsist

public class DccConsist
extends Object
implements Consist, ProgListener

This is the Default DCC consist. It utilizes the fact that IF a Command Station supports OpsMode Programing, you can write the consist information to CV19, so ANY Command Station that supports Ops Mode Programing can write this address to a Command Station that supports it.

Author:
Paul Bender Copyright (C) 2003-2008

Field Summary
protected  DccLocoAddress ConsistAddress
           
protected  Hashtable ConsistDir
           
protected  String ConsistID
           
protected  ArrayList ConsistList
           
protected  Hashtable ConsistPosition
           
protected  int ConsistType
           
 
Fields inherited from interface jmri.Consist
ADVANCED_CONSIST, CS_CONSIST, POSITION_LEAD, POSITION_TRAIL
 
Fields inherited from interface jmri.ProgListener
ConfirmFailed, FailedTimeout, NoAck, NoLocoDetected, NotImplemented, OK, ProgrammerBusy, ProgrammingShort, UnknownError, UserAborted
 
Constructor Summary
DccConsist(DccLocoAddress address)
           
DccConsist(int address)
           
 
Method Summary
 void add(DccLocoAddress LocoAddress, boolean directionNormal)
           
 void addConsistListener(ConsistListener Listener)
           
 boolean contains(DccLocoAddress address)
           
 void dispose()
           
 DccLocoAddress getConsistAddress()
           
 String getConsistID()
           
 ArrayList getConsistList()
           
 int getConsistType()
           
 boolean getLocoDirection(DccLocoAddress address)
           
 int getPosition(DccLocoAddress address)
           
 boolean isAddressAllowed(DccLocoAddress address)
           
protected  void notifyConsistListeners(DccLocoAddress LocoAddress, int ErrorCode)
           
 void programmingOpReply(int value, int status)
          Receive a callback at the end of a programming operation.
 void remove(DccLocoAddress LocoAddress)
           
 void removeConsistListener(ConsistListener Listener)
           
 void removeFromAdvancedConsist(DccLocoAddress LocoAddress)
           
 void restore(DccLocoAddress LocoAddress, boolean directionNormal)
           
 void setConsistID(String ID)
           
 void setConsistType(int consist_type)
           
 void setPosition(DccLocoAddress address, int position)
           
 int sizeLimit()
          is there a size limit for this type of consist?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ConsistList

protected ArrayList ConsistList

ConsistDir

protected Hashtable ConsistDir

ConsistPosition

protected Hashtable ConsistPosition

ConsistType

protected int ConsistType

ConsistAddress

protected DccLocoAddress ConsistAddress

ConsistID

protected String ConsistID
Constructor Detail

DccConsist

public DccConsist(int address)

DccConsist

public DccConsist(DccLocoAddress address)
Method Detail

dispose

public void dispose()
Specified by:
dispose in interface Consist

setConsistType

public void setConsistType(int consist_type)
Specified by:
setConsistType in interface Consist

getConsistType

public int getConsistType()
Specified by:
getConsistType in interface Consist

getConsistAddress

public DccLocoAddress getConsistAddress()
Specified by:
getConsistAddress in interface Consist

isAddressAllowed

public boolean isAddressAllowed(DccLocoAddress address)
Specified by:
isAddressAllowed in interface Consist

sizeLimit

public int sizeLimit()
Description copied from interface: Consist
is there a size limit for this type of consist? returns -1 if no limit returns 0 if the Consist Type is not supported returns the total number of useable spaces if the consist has a limit (do not subtract used spaces).

Specified by:
sizeLimit in interface Consist

getConsistList

public ArrayList getConsistList()
Specified by:
getConsistList in interface Consist

contains

public boolean contains(DccLocoAddress address)
Specified by:
contains in interface Consist

getLocoDirection

public boolean getLocoDirection(DccLocoAddress address)
Specified by:
getLocoDirection in interface Consist

add

public void add(DccLocoAddress LocoAddress,
                boolean directionNormal)
Specified by:
add in interface Consist

restore

public void restore(DccLocoAddress LocoAddress,
                    boolean directionNormal)
Specified by:
restore in interface Consist

remove

public void remove(DccLocoAddress LocoAddress)
Specified by:
remove in interface Consist

removeFromAdvancedConsist

public void removeFromAdvancedConsist(DccLocoAddress LocoAddress)

setPosition

public void setPosition(DccLocoAddress address,
                        int position)
Specified by:
setPosition in interface Consist

getPosition

public int getPosition(DccLocoAddress address)
Specified by:
getPosition in interface Consist

addConsistListener

public void addConsistListener(ConsistListener Listener)
Specified by:
addConsistListener in interface Consist

removeConsistListener

public void removeConsistListener(ConsistListener Listener)
Specified by:
removeConsistListener in interface Consist

setConsistID

public void setConsistID(String ID)
Specified by:
setConsistID in interface Consist

getConsistID

public String getConsistID()
Specified by:
getConsistID in interface Consist

notifyConsistListeners

protected void notifyConsistListeners(DccLocoAddress LocoAddress,
                                      int ErrorCode)

programmingOpReply

public void programmingOpReply(int value,
                               int status)
Description copied from interface: ProgListener
Receive a callback at the end of a programming operation.

Specified by:
programmingOpReply in interface ProgListener
Parameters:
value - Value from a read operation, or value written on a write
status - Denotes the completion code. Note that this is a bitwise combination of the various status coded defined in this interface.


Copyright © 1997 - 2008 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: SourceForge_Logo