Package jmri.jmrix.mqtt
Class MqttSignalMast
- java.lang.Object
-
- jmri.implementation.AbstractNamedBean
-
- jmri.implementation.AbstractSignalMast
-
- jmri.jmrix.mqtt.MqttSignalMast
-
- All Implemented Interfaces:
java.beans.VetoableChangeListener,java.lang.Comparable<NamedBean>,java.util.EventListener,PropertyChangeProvider,NamedBean,Signal,SignalMast
public class MqttSignalMast extends AbstractSignalMast
SignalMast implemented via MQTT messagesSystem name specifies the creation information:
IF$mqm:basic:one-searchlight($0001)
The name is a colon-separated series of terms:- IF$mqm - defines signal masts of this type
- basic - name of the signaling system
- one-searchlight - name of the particular aspect map
- ($0001) - small ordinal number for telling various signal masts apart apart
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringsendTopicPrefix-
Fields inherited from class jmri.implementation.AbstractSignalMast
aspect, disabledAspects, map, speed
-
Fields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, register
-
Fields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_COMMENT, PROPERTY_ENABLED, PROPERTY_KNOWN_STATE, PROPERTY_STATE, PROPERTY_USERNAME, QUOTED_NAME_FORMAT, UNKNOWN
-
Fields inherited from interface jmri.Signal
PROPERTY_HELD, PROPERTY_LIT
-
Fields inherited from interface jmri.SignalMast
PROPERTY_ASPECT, PROPERTY_ASPECT_DISABLED, PROPERTY_ASPECT_ENABLED, PROPERTY_PERMISSIVE_SML_DISABLED
-
-
Constructor Summary
Constructors Constructor Description MqttSignalMast(java.lang.String systemName)MqttSignalMast(java.lang.String systemName, java.lang.String userName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intgetLastRef()protected java.lang.StringmakeSendTopic(java.lang.String systemName)voidsetAspect(java.lang.String aspect)Set aspect to a valid name in the current signal system definition.voidsetHeld(boolean held)Set the held property of the signal mast.protected static voidsetLastRef(int newVal)voidsetLit(boolean lit)Set the lit property.static voidsetSendTopicPrefix(java.lang.String prefix)-
Methods inherited from class jmri.implementation.AbstractSignalMast
allowUnLit, configureAspectTable, configureSignalSystemDefinition, getAllKnownAspects, getAppearanceMap, getAspect, getBeanType, getDisabledAspects, getHeld, getLit, getMastType, getSignalSystem, getSpeed, getState, getUsageReport, getValidAspects, isAspectDisabled, isAtStop, isCleared, isPermissiveSmlDisabled, isShowingRestricting, setAllowUnLit, setAspectDisabled, setAspectEnabled, setMastType, setPermissiveSmlDisabled, setState, vetoableChange
-
Methods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, describeState, dispose, equals, firePropertyChange, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, hashCode, removeProperty, removePropertyChangeListener, removePropertyChangeListener, setComment, setProperty, setUserName, toString, toStringSuffix, updateListenerRef
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, dispose, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getSystemName, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRef
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
sendTopicPrefix
@Nonnull public static java.lang.String sendTopicPrefix
-
-
Constructor Detail
-
MqttSignalMast
public MqttSignalMast(java.lang.String systemName, java.lang.String userName)
-
MqttSignalMast
public MqttSignalMast(java.lang.String systemName)
-
-
Method Detail
-
setSendTopicPrefix
public static void setSendTopicPrefix(@Nonnull java.lang.String prefix)
-
makeSendTopic
protected java.lang.String makeSendTopic(java.lang.String systemName)
-
setAspect
public void setAspect(@Nonnull java.lang.String aspect)
Description copied from interface:SignalMastSet aspect to a valid name in the current signal system definition.- Specified by:
setAspectin interfaceSignalMast- Overrides:
setAspectin classAbstractSignalMast- Parameters:
aspect- the new aspect shown
-
setHeld
public void setHeld(boolean held)
Description copied from class:AbstractSignalMastSet the held property of the signal mast.Note that this does not directly effect the output on the layout; the held property is a local variable which effects the aspect only via higher-level logic.
- Specified by:
setHeldin interfaceSignal- Specified by:
setHeldin interfaceSignalMast- Overrides:
setHeldin classAbstractSignalMast- Parameters:
held- the new value of the help property
-
setLit
public void setLit(boolean lit)
Description copied from class:AbstractSignalMastSet the lit property.This acts on all the SignalHeads included in this SignalMast
- Specified by:
setLitin interfaceSignal- Specified by:
setLitin interfaceSignalMast- Overrides:
setLitin classAbstractSignalMast- Parameters:
lit- the new value of lit
-
setLastRef
protected static void setLastRef(int newVal)
- Parameters:
newVal- for ordinal of all MqttSignalMasts in use
-
getLastRef
public static int getLastRef()
- Returns:
- highest ordinal of all MqttSignalMasts in use
-
-