Class BiDiBSignalMast
- All Implemented Interfaces:
VetoableChangeListener,Comparable<NamedBean>,EventListener,PropertyChangeProvider,BiDiBNamedBeanInterface,NamedBean,Signal,SignalMast
This implementation writes out to BiDiB when it's commanded to change appearance, and updates its internal state when it receives a status feedback from BiDiB.
System name specifies the creation information:
BF$bsm:basic:one-searchlight(123)The name is a colon-separated series of terms:
- B - system prefix
- F$bsm - defines signal masts of this type
- basic - name of the signaling system
- one-searchlight - name of the particular aspect map
- (node:123) - BiDiB Accessory address
To keep the state consistent, setAspect(java.lang.String) does not immediately
change the local aspect. Instead, it produces the relevant BiDiB message on the
network, waiting for that to return and do the local state change, notification, etc.
Based upon DccSignalMast by Kevin Dickerson
-
Nested Class Summary
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException -
Field Summary
FieldsModifier and TypeFieldDescription(package private) BiDiBAddress(package private) intprotected String(package private) BiDiBOutputMessageHandler(package private) BiDiBTrafficController(package private) intFields inherited from class jmri.implementation.AbstractSignalMast
aspect, disabledAspects, map, speedFields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, registerFields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_COMMENT, PROPERTY_ENABLED, PROPERTY_KNOWN_STATE, PROPERTY_STATE, PROPERTY_USERNAME, QUOTED_NAME_FORMAT, UNKNOWNFields inherited from interface jmri.Signal
PROPERTY_HELD, PROPERTY_LITFields inherited from interface jmri.SignalMast
PROPERTY_ASPECT, PROPERTY_ASPECT_DISABLED, PROPERTY_ASPECT_ENABLED, PROPERTY_PERMISSIVE_SML_DISABLED -
Constructor Summary
ConstructorsConstructorDescriptionBiDiBSignalMast(String sys) BiDiBSignalMast(String sys, String user) BiDiBSignalMast(String sys, String user, String mastSubType) -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Deactivate this object, so that it releases as many resources as possible and no longer effects others.getAddr()Get the BiDiB address instancestatic StringintgetOutputForAppearance(String appearance) intstatic StringisAccessoryAddressUsed(BiDiBAddress address) voidnodeLost()called then a node was lostvoidnodeNew()called then a new node has been discoveredvoidRequest the state of the accessory from the layout.protected voidsendMessage(int aspect) Send a accessory message to BiDiBvoidSet aspect to a valid name in the current signal system definition.voidsetLit(boolean newLit) Set the lit property.voidsetOutputForAppearance(String appearance, int number) voidsetUnlitId(int i) 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, setHeld, setMastType, setPermissiveSmlDisabled, setState, vetoableChangeMethods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, describeState, equals, firePropertyChange, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, hashCode, removeProperty, removePropertyChangeListener, removePropertyChangeListener, setComment, setProperty, setUserName, toString, toStringSuffix, updateListenerRefMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jmri.jmrix.bidib.BiDiBNamedBeanInterface
finishLoadMethods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getSystemName, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRefMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
tc
-
messageHandler
-
addr
-
commandedAspect
int commandedAspect -
mastType
-
appearanceToOutput
-
unLitId
int unLitId
-
-
Constructor Details
-
BiDiBSignalMast
-
BiDiBSignalMast
-
BiDiBSignalMast
-
-
Method Details
-
getNamePrefix
-
setOutputForAppearance
-
getOutputForAppearance
-
setAspect
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
-
setLit
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:
newLit- the new value of lit
-
queryAccessory
Request the state of the accessory from the layout. The listener gets the answer. -
sendMessage
Send a accessory message to BiDiB- Parameters:
aspect- to send
-
setUnlitId
-
getUnlitId
-
getAccessoryAddress
-
getTrafficController
-
getAddr
Get the BiDiB address instance- Specified by:
getAddrin interfaceBiDiBNamedBeanInterface- Returns:
- BiDiBAddress
-
nodeNew
called then a new node has been discovered- Specified by:
nodeNewin interfaceBiDiBNamedBeanInterface
-
nodeLost
called then a node was lost- Specified by:
nodeLostin interfaceBiDiBNamedBeanInterface
-
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. Remove the Message Listener for this signal mast
- Specified by:
disposein interfaceNamedBean- Overrides:
disposein classAbstractNamedBean
-
isAccessoryAddressUsed
-