Class EasyDccConsist

    • Method Detail

      • isAddressAllowed

        public boolean isAddressAllowed​(DccLocoAddress address)
        Is this address allowed? On EasyDCC systems, all addresses but 0 can be used in a consist (either an Advanced Consist or a Standard Consist).
        Specified by:
        isAddressAllowed in interface Consist
        Overrides:
        isAddressAllowed in class DccConsist
        Parameters:
        address - the address
        Returns:
        true if allowed; false otherwise
      • sizeLimit

        public int sizeLimit()
        Is there a size limit for this consist?
        Specified by:
        sizeLimit in interface Consist
        Overrides:
        sizeLimit in class DccConsist
        Returns:
        8 for EasyDcc Standard Consist, -1 for Decoder Assisted Consists (no limit), 0 for any other consist type
      • contains

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

        public boolean getLocoDirection​(DccLocoAddress address)
        Get the relative direction setting for a specific locomotive in the consist.
        Specified by:
        getLocoDirection in interface Consist
        Overrides:
        getLocoDirection in class DccConsist
        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)
        Add a Locomotive to a Consist.
        Specified by:
        add in interface Consist
        Overrides:
        add in class DccConsist
        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)
        Restore a Locomotive to an Advanced 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
        Overrides:
        restore in class DccConsist
        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.
      • remove

        public void remove​(DccLocoAddress LocoAddress)
        Remove a Locomotive from this Consist.
        Specified by:
        remove in interface Consist
        Overrides:
        remove in class DccConsist
        Parameters:
        LocoAddress - is the Locomotive address to add to the locomotive
      • addToAdvancedConsist

        protected void addToAdvancedConsist​(DccLocoAddress LocoAddress,
                                            boolean directionNormal)
        Add a Locomotive to an Advanced Consist.
        Overrides:
        addToAdvancedConsist in class DccConsist
        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.
      • removeFromCSConsist

        public void removeFromCSConsist​(DccLocoAddress LocoAddress)
        Remove a Locomotive from an EasyDCC Standard Consist.
        Parameters:
        LocoAddress - is the Locomotive address to add to the locomotive