Class SE8cSignalHead

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

    public class SE8cSignalHead
    extends DefaultSignalHead
    Extend jmri.SignalHead for signals implemented by an SE8C.

    This implementation writes out to the physical signal when it's commanded to change appearance, and updates its internal state when it hears commands from other places.

    To get a complete set of aspects, we assume that the SE8C board has been configured such that the 4th aspect is "dark". We then do flashing aspects by commanding the lit appearance to change.

    We can't assume any form of numbering for Turnouts to address the digits, so we take two turnout names as arguments. As a convenience, we manage the user names if they're not already set.

    Only the DARK, RED, GREEN and YELLOW appearances will be properly tracked when they occur on the LocoNet. The FLASHING aspects won't be, nor will the Held or Lit states.

    The algorithms in this class are a collaborative effort of Digitrax, Inc and Bob Jacobsen.

    • Constructor Detail

      • SE8cSignalHead

        public SE8cSignalHead​(java.lang.String sname,
                              NamedBeanHandle<Turnout> lowTO,
                              NamedBeanHandle<Turnout> highTO,
                              java.lang.String userName)
        Ctor specifying system name and user name.
        sname - system name for mast
        lowTO - lower-numbered Turnout reference
        highTO - higher-numbered Turnout reference
        userName - user name for mast
      • SE8cSignalHead

        public SE8cSignalHead​(int pNumber,
                              java.lang.String userName)
        Compatibility ctor.
        pNumber - number (address) of low turnout
        userName - name to use for this signal head
      • SE8cSignalHead

        public SE8cSignalHead​(int pNumber)
        Compatibility ctor
        pNumber - number (address) of low turnout
    • Method Detail

      • makeSystemName

        static java.lang.String makeSystemName​(NamedBeanHandle<Turnout> lowTO,
                                               NamedBeanHandle<Turnout> highTO)
        Implement convention for making a system name.

        Must pass arguments, as it is used before object is complete.

        lowTO - lower-numbered Turnout reference
        highTO - higher-numbered Turnout reference
        system name with fixed elements, i.e. IH:SE8c:to1\to2
      • makeHandle

        static NamedBeanHandle<TurnoutmakeHandle​(int i)
                                            throws java.lang.IllegalArgumentException
        Create a handle from a raw number.

        Static, so can be referenced before ctor complete.

        i - index number (address) of a turnout on the signal head
        NamedBeanHandle<Turnout> object to use as output for head
        java.lang.IllegalArgumentException - when creation from i fails
      • updateOutput

        protected void updateOutput()
        Type-specific routine to handle output to the layout hardware. Implemented to handle a request to change state by sending a LocoNet command.

        Does not notify listeners of changes; that's done elsewhere. Should consider the following variables to determine what to send:

        • mAppearance
        • mLit
        • mFlashOn
        Specified by:
        updateOutput in class DefaultSignalHead