Class DccConsist

    • Method Detail

      • dispose

        public void dispose()
        Description copied from interface: Consist
        A method for cleaning up the consist
        Specified by:
        dispose in interface Consist
      • setConsistType

        public void setConsistType​(int consist_type)
        Description copied from interface: Consist
        Set the Consist Type.
        Specified by:
        setConsistType in interface Consist
        Parameters:
        consist_type - the consist type
      • isAddressAllowed

        public boolean isAddressAllowed​(DccLocoAddress address)
        Description copied from interface: Consist
        Is the specific address allowed? (needed for system specific restrictions)
        Specified by:
        isAddressAllowed in interface Consist
        Parameters:
        address - the address
        Returns:
        true if allowed; false otherwise
      • sizeLimit

        public int sizeLimit()
        Description copied from interface: Consist
        Is there a size limit for this type of consist?
        Specified by:
        sizeLimit in interface Consist
        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).
      • contains

        public boolean contains​(DccLocoAddress address)
        Description copied from interface: Consist
        Does the consist contain the specified locomotive address?
        Specified by:
        contains in interface Consist
        Parameters:
        address - the address to check
        Returns:
        true if in consist; false otherwise
      • getLocoDirection

        public boolean getLocoDirection​(DccLocoAddress address)
        Description copied from interface: Consist
        Get the relative direction setting for a specific locomotive in the consist.
        Specified by:
        getLocoDirection in interface Consist
        Parameters:
        address - the address to check
        Returns:
        true if locomotive is in consist in its normal direction of travel; false otherwise
      • add

        public void add​(DccLocoAddress LocoAddress,
                        boolean directionNormal)
        Description copied from interface: Consist
        Add a Locomotive to a Consist
        Specified by:
        add in interface Consist
        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.
      • restore

        public void restore​(DccLocoAddress LocoAddress,
                            boolean directionNormal)
        Description copied from interface: Consist
        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:
        restore in interface Consist
        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.
      • remove

        public void remove​(DccLocoAddress LocoAddress)
        Description copied from interface: Consist
        Remove a Locomotive from this Consist
        Specified by:
        remove in interface Consist
        Parameters:
        LocoAddress - is the Locomotive address to add to the locomotive
      • setPosition

        public void setPosition​(DccLocoAddress address,
                                int position)
        Description copied from interface: Consist
        Set the position of a locomotive within the consist
        Specified by:
        setPosition in interface Consist
        Parameters:
        address - is the Locomotive address
        position - is a constant representing the position within the consist.
      • getPosition

        public int getPosition​(DccLocoAddress address)
        Description copied from interface: Consist
        Get the position of a locomotive within the consist
        Specified by:
        getPosition in interface Consist
        Parameters:
        address - is the Locomotive address of interest
        Returns:
        integer equal to jmri.Consist.POSITION_LEAD for the designated lead locomotive. equal to jmri.Consist.POSITION_TRAIL for the designated trailing locomotive. between 1 and 254 for other locomotives in the consist
      • setRosterId

        public void setRosterId​(DccLocoAddress address,
                                java.lang.String rosterId)
        Set the roster entry of a locomotive within the consist
        Specified by:
        setRosterId in interface Consist
        Parameters:
        address - is the Locomotive address
        rosterId - is the roster Identifer of the associated roster entry.
      • getRosterId

        public java.lang.String getRosterId​(DccLocoAddress address)
        Get the rosterId of a locomotive within the consist
        Specified by:
        getRosterId in interface Consist
        Parameters:
        address - is the Locomotive address of interest
        Returns:
        string roster Identifier associated with the given address in the consist. Returns null if no roster entry is associated with this entry.
      • setRosterEntryCVValue

        protected void setRosterEntryCVValue​(DccLocoAddress address)
        Update the value in the roster entry for CV19 for the specified address
        Parameters:
        address - is the Locomotive address we are updating.
      • resetRosterEntryCVValue

        protected void resetRosterEntryCVValue​(DccLocoAddress address)
        Set the value in the roster entry's value for for CV19 to 0
        Parameters:
        address - is the Locomotive address we are updating.
      • updateRosterCV

        protected void updateRosterCV​(DccLocoAddress address,
                                      java.lang.Boolean direction,
                                      int value)
        If allowed by the preferences, Update the CV19 value in the specified address's roster entry, if the roster entry is known.
        Parameters:
        address - is the Locomotive address we are updating.
        direction - the direction to set.
        value - the numeric value of the consist address.
      • setConsistID

        public void setConsistID​(java.lang.String ID)
        Description copied from interface: Consist
        Set the text ID associated with the consist
        Specified by:
        setConsistID in interface Consist
        Parameters:
        ID - is a string identifier for the consist
      • getConsistID

        public java.lang.String getConsistID()
        Description copied from interface: Consist
        Get the text ID associated with the consist
        Specified by:
        getConsistID in interface Consist
        Returns:
        String identifier for the consist default value is the string Identifier for the consist address.
      • reverse

        public void reverse()
        Description copied from interface: Consist
        Reverse the order of the consist and the direction the locomotives are traveling
        Specified by:
        reverse in interface Consist
      • restore

        public void restore()
        Description copied from interface: Consist
        restore the consist to the command station.
        Specified by:
        restore in interface Consist
      • 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.