Class DccSignalHead

  • All Implemented Interfaces:
    java.beans.VetoableChangeListener, java.lang.Comparable<NamedBean>, java.util.EventListener, PropertyChangeProvider, NamedBean, Signal, SignalHead

    public class DccSignalHead
    extends AbstractSignalHead
    This class implements a SignalHead that maps the various appearances values to aspect values in the Extended Accessory Decoder Control Packet Format and outputs that packet to the DCC System via the generic CommandStation interface

    The mapping is as follows:

    0 = RED
    1 = YELLOW
    2 = GREEN
    3 = LUNAR
    4 = FLASHRED
    5 = FLASHYELLOW
    6 = FLASHGREEN
    7 = FLASHLUNAR
    8 = DARK

    The FLASH appearances are expected to be implemented in the decoder.

    • Field Detail

      • appearanceToOutput

        protected java.util.HashMap<java.lang.Integer,​java.lang.Integer> appearanceToOutput
    • Constructor Detail

      • DccSignalHead

        public DccSignalHead​(java.lang.String sys,
                             java.lang.String user)
    • Method Detail

      • setAppearance

        public void setAppearance​(int newAppearance)
        Description copied from interface: SignalHead
        Set the Signal Head Appearance.
        Parameters:
        newAppearance - integer representing a valid Appearance for this head
      • setLit

        public void setLit​(boolean newLit)
        Description copied from interface: SignalHead
      • setHeld

        public void setHeld​(boolean newHeld)
        Set the held parameter.

        Note that this does not directly affect the output on the layout; the held parameter is a local variable which affects the aspect only via higher-level logic.

      • setDccSignalHeadPacketSendCount

        public void setDccSignalHeadPacketSendCount​(int count)
        Set Number of times the packet should be sent to the track.
        Parameters:
        count - - less than 1 is treated as 1
      • getDccSignalHeadPacketSendCount

        public int getDccSignalHeadPacketSendCount()
        Get the number of times the packet should be sent to the track.
        Returns:
        the count