Class OlcbLight

    • Constructor Detail

      • OlcbLight

        public OlcbLight​(java.lang.String systemName)
      • OlcbLight

        public OlcbLight​(java.lang.String prefix,
                         java.lang.String address,
                         org.openlcb.OlcbInterface iface)
    • Method Detail

      • finishLoad

        void finishLoad()
        Helper function that will be invoked after construction once the properties have been loaded. Used specifically for preventing double initialization when loading lights from XML.
      • setState

        public void setState​(int newState)
        Handle a request for a state change. For these lights, ON and OFF just transition immediately between MinIntensity and MaxIntensity. Ignores any outputDelay setting for connection.
        Specified by:
        setState in interface Light
        Specified by:
        setState in interface NamedBean
        Overrides:
        setState in class AbstractLight
        Parameters:
        newState - new state
      • doNewState

        protected void doNewState​(int oldState,
                                  int newState)
        Set the current state of this Light This routine requests the hardware to change to newState.
        Overrides:
        doNewState in class AbstractLight
        Parameters:
        oldState - old state
        newState - new state
      • setProperty

        public void setProperty​(@Nonnull
                                java.lang.String key,
                                java.lang.Object value)
        Attach a key/value pair to the NamedBean, which can be retrieved later. These are not bound properties as yet, and don't throw events on modification. Key must not be null.

        Prior to JMRI 4.3, the key was of Object type. It was constrained to String to make these more like normal Java Beans.

        Specified by:
        setProperty in interface NamedBean
        Overrides:
        setProperty in class AbstractNamedBean
        Parameters:
        key - the property to set
        value - the value of the property
      • dispose

        public void dispose()
        Deactivate this object, so that it releases as many resources as possible and no longer effects others.

        For example, if this object has listeners, after a call to this method it should no longer notify those listeners. Any native or system-wide resources it maintains should be released, including threads, files, etc.

        It is an error to invoke any other methods on this object once dispose() has been called. Note, however, that there is no guarantee about behavior in that case.

        Afterwards, references to this object may still exist elsewhere, preventing its garbage collection. But it's formally dead, and shouldn't be keeping any other objects alive. Therefore, this method should null out any references to other objects that this NamedBean contained.

        Specified by:
        dispose in interface NamedBean
        Overrides:
        dispose in class AbstractNamedBean