Package jmri.implementation
Class DefaultSignalGroup
- java.lang.Object
-
- jmri.implementation.AbstractNamedBean
-
- jmri.implementation.DefaultSignalGroup
-
- All Implemented Interfaces:
java.lang.Comparable<NamedBean>
,PropertyChangeProvider
,NamedBean
,SignalGroup
public class DefaultSignalGroup extends AbstractNamedBean implements SignalGroup
A Conditional type to provide Signal Groups (n Signal Heads w/Conditionals for a main Mast).- See Also:
SignalGroup
-
-
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 (package private) java.util.ArrayList<jmri.implementation.DefaultSignalGroup.SignalHeadItem>
_signalHeadItem
(package private) java.util.ArrayList<java.lang.String>
_signalMastAspects
protected java.beans.PropertyChangeListener
mSignalMastListener
-
Fields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, register
-
Fields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_STATE, QUOTED_NAME_FORMAT, UNKNOWN
-
Fields inherited from interface jmri.SignalGroup
ONACTIVE, ONCLOSED, ONINACTIVE, ONTHROWN
-
-
Constructor Summary
Constructors Constructor Description DefaultSignalGroup(java.lang.String systemName)
Constructor for SignalGroup instance.DefaultSignalGroup(java.lang.String systemName, java.lang.String userName)
Constructor for SignalGroup instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSignalHead(java.lang.String pName)
Add a new Signal Head to the group by name.void
addSignalHead(NamedBeanHandle<SignalHead> headBean)
Add a Signal Head item for this Signal Head to the list in the Group.void
addSignalHead(SignalHead signalHead)
Add a Signal Head item for this Signal Head to the list in the Group.void
addSignalMastAspect(java.lang.String aspect)
Add an Aspect that can trigger the group activation.void
clearHeadSensor(SignalHead signalHead)
Delete all Sensors for a given Signal Head in the group.void
clearHeadTurnout(SignalHead signalHead)
Delete all Turnouts for a given Signal Head in the group.void
clearSignalMastAspect()
Clear the list of SignalMast Aspects that may trigger the group.void
deleteSignalHead(NamedBeanHandle<SignalHead> headBean)
Remove the Signal Head item for this Signal Head from the group by NamedBeanvoid
deleteSignalHead(SignalHead sh)
Remove the Signal Head item for this Signal Head from the group by Name.void
deleteSignalMastAspect(java.lang.String aspect)
Remove a SignalMast Aspect from the set of triggers.java.lang.String
getBeanType()
For instances in the code where we are dealing with just a bean and a message needs to be passed to the user or in a log.boolean
getEnabled()
Get enabled status of the signal group.SignalHead
getHeadItemBeanByIndex(int x)
Get a Signal Head by Index.java.lang.String
getHeadItemNameByIndex(int x)
Get the name of a Signal Head by Index.int
getHeadOffState(SignalHead headBean)
Get the Off (conditions NOT met) State of a Signal Head item in the group.int
getHeadOffStateByIndex(int x)
Get the Off State for the Signal Head item at Index x in the group.int
getHeadOnState(SignalHead headBean)
Get the On (conditions met) State of a Signal Head item in the group.int
getHeadOnStateByIndex(int x)
Get the On State for the Signal Head item at Index x in the group.int
getNumHeadItems()
Get the number of Signal Heads configured as items in this group.int
getNumHeadSensorsByIndex(int x)
Get the number of Sensors configured for the Signal Head at index x.int
getNumHeadTurnoutsByIndex(int x)
Get the number of turnouts configured for the Signal Head at index x.int
getNumSignalMastAspects()
Get the total number of Signal Mast Aspects available in this group.Sensor
getSensorByIndex(int x, int pSensor)
Get the Sensor at index pSensor, for the Signal Head at index x.java.lang.String
getSensorNameByIndex(int x, int pSensor)
Get the name of the Sensor at index pSensor for the Signal Head at index x.int
getSensorState(SignalHead signalHead, Sensor sensor)
Get the On state of the Sensor for the Signal Head in the group.int
getSensorStateByIndex(int x, int pSensor)
Get the On state of the Sensor at index pSensor for the Signal Head at index x.boolean
getSensorTurnoutOper(SignalHead signalHead)
Get the AND/OR conditional operand set for a Signal Head in the group.boolean
getSensorTurnoutOperByIndex(int x)
Get the state of the AND/OR conditional operand for Signal Head at Index.SignalMast
getSignalMast()
Get the main Signal Mast in a group.java.lang.String
getSignalMastAspectByIndex(int x)
Get a SignalMast Aspect for the Main Signal Mast by its Index.java.lang.String
getSignalMastName()
Get the name of the main Signal Mast in a group.int
getState()
Provide generic access to internal state.Turnout
getTurnoutByIndex(int x, int pTurnout)
Get the Turnout at index x, for the Signal Head at index x in the group.java.lang.String
getTurnoutNameByIndex(int x, int pTurnout)
Get the Name of the Turnout at index pTurnout, for the Signal Head at index x in the group.int
getTurnoutState(SignalHead signalHead, Turnout turnout)
Get the On state of the Turnout for the given Signal Head in the group.int
getTurnoutStateByIndex(int x, int pTurnout)
Get the On state of the Turnout at index pTurnout, for the Signal Head at index x in the group.int
getTurnoutStateByIndex(int x, Turnout turnout)
Get the On state of a given Turnout for the Signal Head at index x.java.util.List<NamedBeanUsageReport>
getUsageReport(NamedBean bean)
Get a list of references for the specified bean.boolean
isHeadIncluded(SignalHead signalHead)
Inquire if a Signal Head item for this head is included in this Group.boolean
isSensorIncluded(SignalHead signalHead, Sensor sensor)
Inquire if a Sensor is included in the Signal Head Calculation.boolean
isSignalMastAspectIncluded(java.lang.String aspect)
Inquire if a Signal Mast Aspect is included in the group.boolean
isTurnoutIncluded(SignalHead signalHead, Turnout turnout)
Inquire if a Turnout is included in the Signal Head Calculation.void
setEnabled(boolean boo)
Set enabled status of the signal group.void
setHeadAlignSensor(SignalHead signalHead, Sensor sensor, int state)
Add a Sensor and its On state to a Signal Head.void
setHeadAlignTurnout(SignalHead signalHead, Turnout turnout, int state)
Add a Turnout and its On state to a Signal Head.void
setHeadOffState(SignalHead head, int state)
Set the Off (conditions NOT met) State of a Signal Head item in the Group.void
setHeadOnState(SignalHead head, int state)
Set the On (conditions met) State of a Signal Head item in the Group.void
setSensorTurnoutOper(SignalHead signalHead, boolean boo)
Set whether the sensors and turnouts should be treated as separate calculations (OR) or as one (AND) when determining if the Signal Head should be On or Off.void
setSignalMast(java.lang.String pName)
Set the main Signal Mast for the Group by name.void
setSignalMast(SignalMast signalMast, java.lang.String mastName)
Set the main Signal Mast for the Group.void
setState(int state)
Provide generic access to internal state.-
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, vetoableChange
-
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, vetoableChange
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
_signalMastAspects
java.util.ArrayList<java.lang.String> _signalMastAspects
-
mSignalMastListener
protected java.beans.PropertyChangeListener mSignalMastListener
-
_signalHeadItem
java.util.ArrayList<jmri.implementation.DefaultSignalGroup.SignalHeadItem> _signalHeadItem
-
-
Constructor Detail
-
DefaultSignalGroup
public DefaultSignalGroup(java.lang.String systemName, java.lang.String userName)
Constructor for SignalGroup instance.- Parameters:
systemName
- suggested system nameuserName
- provided user name
-
DefaultSignalGroup
public DefaultSignalGroup(java.lang.String systemName)
Constructor for SignalGroup instance.- Parameters:
systemName
- suggested system name
-
-
Method Detail
-
getBeanType
public java.lang.String getBeanType()
Description copied from interface:NamedBean
For instances in the code where we are dealing with just a bean and a message needs to be passed to the user or in a log.- Specified by:
getBeanType
in interfaceNamedBean
- Returns:
- a string of the bean type, eg Turnout, Sensor etc
-
setEnabled
public void setEnabled(boolean boo)
Description copied from interface:SignalGroup
Set enabled status of the signal group.- Specified by:
setEnabled
in interfaceSignalGroup
- Parameters:
boo
- true if signal group should be enabled; false otherwise
-
getEnabled
public boolean getEnabled()
Description copied from interface:SignalGroup
Get enabled status of the signal group.- Specified by:
getEnabled
in interfaceSignalGroup
- Returns:
- true if signal group is enabled; false otherwise
-
setSignalMast
public void setSignalMast(java.lang.String pName)
Description copied from interface:SignalGroup
Set the main Signal Mast for the Group by name.- Specified by:
setSignalMast
in interfaceSignalGroup
- Parameters:
pName
- Name of the (existing) Signal Mast to set as main mast for the group
-
setSignalMast
public void setSignalMast(SignalMast signalMast, java.lang.String mastName)
Description copied from interface:SignalGroup
Set the main Signal Mast for the Group.- Specified by:
setSignalMast
in interfaceSignalGroup
- Parameters:
signalMast
- Mast object to attachmastName
- Name of the (existing) Signal Mast to set as main mast for the group
-
getSignalMast
public SignalMast getSignalMast()
Description copied from interface:SignalGroup
Get the main Signal Mast in a group.- Specified by:
getSignalMast
in interfaceSignalGroup
- Returns:
- The main Signal Mast as bean
-
getSignalMastName
public java.lang.String getSignalMastName()
Description copied from interface:SignalGroup
Get the name of the main Signal Mast in a group.- Specified by:
getSignalMastName
in interfaceSignalGroup
- Returns:
- Name of the mast as string
-
addSignalMastAspect
public void addSignalMastAspect(java.lang.String aspect)
Description copied from interface:SignalGroup
Add an Aspect that can trigger the group activation.- Specified by:
addSignalMastAspect
in interfaceSignalGroup
- Parameters:
aspect
- Name of an aspect for the Main Signal Mast in the Group, must be valid for the Mast type
-
isSignalMastAspectIncluded
public boolean isSignalMastAspectIncluded(java.lang.String aspect)
Description copied from interface:SignalGroup
Inquire if a Signal Mast Aspect is included in the group.- Specified by:
isSignalMastAspectIncluded
in interfaceSignalGroup
- Parameters:
aspect
- name of the Aspect, i.e. "Clear"- Returns:
- true if aspect is included in group
-
deleteSignalMastAspect
public void deleteSignalMastAspect(java.lang.String aspect)
Description copied from interface:SignalGroup
Remove a SignalMast Aspect from the set of triggers.- Specified by:
deleteSignalMastAspect
in interfaceSignalGroup
- Parameters:
aspect
- Name of the Aspect, i.e. "Clear"
-
getNumSignalMastAspects
public int getNumSignalMastAspects()
Description copied from interface:SignalGroup
Get the total number of Signal Mast Aspects available in this group.- Specified by:
getNumSignalMastAspects
in interfaceSignalGroup
- Returns:
- the number of Aspects on the main Signal Mast, null if no Main Mast is assigned
-
getSignalMastAspectByIndex
public java.lang.String getSignalMastAspectByIndex(int x)
Description copied from interface:SignalGroup
Get a SignalMast Aspect for the Main Signal Mast by its Index.- Specified by:
getSignalMastAspectByIndex
in interfaceSignalGroup
- Parameters:
x
- index of the Signal Mast Aspect in the list- Returns:
- the aspect or null if there are no aspects with that index
-
clearSignalMastAspect
public void clearSignalMastAspect()
Description copied from interface:SignalGroup
Clear the list of SignalMast Aspects that may trigger the group. Causes the Aspect list to be rebuilt next time it is called- Specified by:
clearSignalMastAspect
in interfaceSignalGroup
-
addSignalHead
public void addSignalHead(NamedBeanHandle<SignalHead> headBean)
Description copied from interface:SignalGroup
Add a Signal Head item for this Signal Head to the list in the Group.- Specified by:
addSignalHead
in interfaceSignalGroup
- Parameters:
headBean
- The Signal Head as a Named Bean
-
addSignalHead
public void addSignalHead(java.lang.String pName)
Add a new Signal Head to the group by name.- Parameters:
pName
- system or username of existing signal head to add to group
-
addSignalHead
public void addSignalHead(SignalHead signalHead)
Description copied from interface:SignalGroup
Add a Signal Head item for this Signal Head to the list in the Group.- Specified by:
addSignalHead
in interfaceSignalGroup
- Parameters:
signalHead
- The Signal Head object
-
setHeadAlignTurnout
public void setHeadAlignTurnout(SignalHead signalHead, Turnout turnout, int state)
Description copied from interface:SignalGroup
Add a Turnout and its On state to a Signal Head.- Specified by:
setHeadAlignTurnout
in interfaceSignalGroup
- Parameters:
signalHead
- SignalHead we are adding the turnout toturnout
- Turnout Beanstate
- Value for the turnout On state (Turnout.THROWN or Turnout.CLOSED).
-
setHeadAlignSensor
public void setHeadAlignSensor(SignalHead signalHead, Sensor sensor, int state)
Description copied from interface:SignalGroup
Add a Sensor and its On state to a Signal Head.- Specified by:
setHeadAlignSensor
in interfaceSignalGroup
- Parameters:
signalHead
- Signal Head we are adding the sensor tosensor
- Sensor Beanstate
- Value for the Sensor On state (Sensor.ACTIVE or Sensor.INACTIVE).
-
getHeadItemNameByIndex
public java.lang.String getHeadItemNameByIndex(int x)
Description copied from interface:SignalGroup
Get the name of a Signal Head by Index.- Specified by:
getHeadItemNameByIndex
in interfaceSignalGroup
- Parameters:
x
- Index of the SignalHead in the Group- Returns:
- null if there are no Signal Heads with that index in the group
-
getHeadItemBeanByIndex
public SignalHead getHeadItemBeanByIndex(int x)
Description copied from interface:SignalGroup
Get a Signal Head by Index.- Specified by:
getHeadItemBeanByIndex
in interfaceSignalGroup
- Parameters:
x
- Index of the SignalHead in the Group- Returns:
- null if there are no Signal Heads with that index in the group
-
getNumHeadItems
public int getNumHeadItems()
Description copied from interface:SignalGroup
Get the number of Signal Heads configured as items in this group.- Specified by:
getNumHeadItems
in interfaceSignalGroup
- Returns:
- the number of Signal Heads
-
getHeadOffState
public int getHeadOffState(SignalHead headBean)
Description copied from interface:SignalGroup
Get the Off (conditions NOT met) State of a Signal Head item in the group.- Specified by:
getHeadOffState
in interfaceSignalGroup
- Parameters:
headBean
- The Signal Head Bean object we are querying- Returns:
- state value for the Off state (appearance)
-
getHeadOnState
public int getHeadOnState(SignalHead headBean)
Description copied from interface:SignalGroup
Get the On (conditions met) State of a Signal Head item in the group.- Specified by:
getHeadOnState
in interfaceSignalGroup
- Parameters:
headBean
- The Signal Head object we are querying- Returns:
- state value for the On state (appearance)
-
getHeadOnStateByIndex
public int getHeadOnStateByIndex(int x)
Description copied from interface:SignalGroup
Get the On State for the Signal Head item at Index x in the group.- Specified by:
getHeadOnStateByIndex
in interfaceSignalGroup
- Parameters:
x
- Index of the SignalHead in Group- Returns:
- -1 if there are less than 'x' Signal Heads defined
-
getHeadOffStateByIndex
public int getHeadOffStateByIndex(int x)
Description copied from interface:SignalGroup
Get the Off State for the Signal Head item at Index x in the group.- Specified by:
getHeadOffStateByIndex
in interfaceSignalGroup
- Parameters:
x
- Index of the SignalHead in Group- Returns:
- -1 if there are less than 'x' Signal Heads defined
-
deleteSignalHead
public void deleteSignalHead(SignalHead sh)
Description copied from interface:SignalGroup
Remove the Signal Head item for this Signal Head from the group by Name.- Specified by:
deleteSignalHead
in interfaceSignalGroup
- Parameters:
sh
- The Signal Head to be deleted from the group.
-
deleteSignalHead
public void deleteSignalHead(NamedBeanHandle<SignalHead> headBean)
Description copied from interface:SignalGroup
Remove the Signal Head item for this Signal Head from the group by NamedBean- Specified by:
deleteSignalHead
in interfaceSignalGroup
- Parameters:
headBean
- The Named Bean to be removed from the group.
-
setHeadOnState
public void setHeadOnState(SignalHead head, int state)
Description copied from interface:SignalGroup
Set the On (conditions met) State of a Signal Head item in the Group.- Specified by:
setHeadOnState
in interfaceSignalGroup
- Parameters:
head
- The SignalHead Beanstate
- The Appearance that the SignalHead will change to when the conditions are met.
-
setHeadOffState
public void setHeadOffState(SignalHead head, int state)
Description copied from interface:SignalGroup
Set the Off (conditions NOT met) State of a Signal Head item in the Group.- Specified by:
setHeadOffState
in interfaceSignalGroup
- Parameters:
head
- The SignalHead Beanstate
- The Apperance that the SignalHead will change to when the conditions are NOT met.
-
isHeadIncluded
public boolean isHeadIncluded(SignalHead signalHead)
Description copied from interface:SignalGroup
Inquire if a Signal Head item for this head is included in this Group.- Specified by:
isHeadIncluded
in interfaceSignalGroup
- Parameters:
signalHead
- The Signal Head object we are querying- Returns:
- true if the signal head is included in the group; false otherwise
-
isTurnoutIncluded
public boolean isTurnoutIncluded(SignalHead signalHead, Turnout turnout)
Description copied from interface:SignalGroup
Inquire if a Turnout is included in the Signal Head Calculation.- Specified by:
isTurnoutIncluded
in interfaceSignalGroup
- Parameters:
signalHead
- signalHead that may consider turnoutturnout
- turnout to consider- Returns:
- true if turnout state is considered; false otherwise
-
getTurnoutState
public int getTurnoutState(SignalHead signalHead, Turnout turnout)
Description copied from interface:SignalGroup
Get the On state of the Turnout for the given Signal Head in the group.- Specified by:
getTurnoutState
in interfaceSignalGroup
- Parameters:
signalHead
- Signal Head Beanturnout
- The Turnout within the Group- Returns:
- -1 if the Turnout or Signal Head is invalid
-
getTurnoutStateByIndex
public int getTurnoutStateByIndex(int x, Turnout turnout)
Description copied from interface:SignalGroup
Get the On state of a given Turnout for the Signal Head at index x.- Specified by:
getTurnoutStateByIndex
in interfaceSignalGroup
- Parameters:
x
- Index for the Signal Head in the groupturnout
- Name of the Turnout configured for the head- Returns:
- -1 if the Turnout or Signal Head is invalid
-
getTurnoutStateByIndex
public int getTurnoutStateByIndex(int x, int pTurnout)
Description copied from interface:SignalGroup
Get the On state of the Turnout at index pTurnout, for the Signal Head at index x in the group.- Specified by:
getTurnoutStateByIndex
in interfaceSignalGroup
- Parameters:
x
- Index for the Signal Head in the grouppTurnout
- Index of the Turnout configured for the head- Returns:
- -1 if the Turnout or Signal Head is invalid
-
getTurnoutNameByIndex
public java.lang.String getTurnoutNameByIndex(int x, int pTurnout)
Description copied from interface:SignalGroup
Get the Name of the Turnout at index pTurnout, for the Signal Head at index x in the group.- Specified by:
getTurnoutNameByIndex
in interfaceSignalGroup
- Parameters:
x
- Index for the Signal Head in the grouppTurnout
- Index for the turnout in the signal head item- Returns:
- null if the Turnout or Signal Head is invalid
-
getTurnoutByIndex
public Turnout getTurnoutByIndex(int x, int pTurnout)
Description copied from interface:SignalGroup
Get the Turnout at index x, for the Signal Head at index x in the group.- Specified by:
getTurnoutByIndex
in interfaceSignalGroup
- Parameters:
x
- Index for the Signal Head in the grouppTurnout
- Index for the turnout in the signal head item- Returns:
- null if the Turnout or Signal Head is invalid
-
getSensorStateByIndex
public int getSensorStateByIndex(int x, int pSensor)
Description copied from interface:SignalGroup
Get the On state of the Sensor at index pSensor for the Signal Head at index x.- Specified by:
getSensorStateByIndex
in interfaceSignalGroup
- Parameters:
x
- Index for the Signal Head in the grouppSensor
- Index of the Sensor in the head item- Returns:
- -1 if the Sensor or Signal Head is invalid
-
getSensorNameByIndex
public java.lang.String getSensorNameByIndex(int x, int pSensor)
Description copied from interface:SignalGroup
Get the name of the Sensor at index pSensor for the Signal Head at index x.- Specified by:
getSensorNameByIndex
in interfaceSignalGroup
- Parameters:
x
- Index for the Signal Head in the grouppSensor
- Index of the Sensor in the head item- Returns:
- null if the Sensor or Signal Head is invalid
-
getSensorByIndex
public Sensor getSensorByIndex(int x, int pSensor)
Description copied from interface:SignalGroup
Get the Sensor at index pSensor, for the Signal Head at index x.- Specified by:
getSensorByIndex
in interfaceSignalGroup
- Parameters:
x
- Index for the Signal Head in the grouppSensor
- Index of the Sensor in the head item- Returns:
- null if the Sensor or Signal Head is invalid
-
isSensorIncluded
public boolean isSensorIncluded(SignalHead signalHead, Sensor sensor)
Description copied from interface:SignalGroup
Inquire if a Sensor is included in the Signal Head Calculation.- Specified by:
isSensorIncluded
in interfaceSignalGroup
- Parameters:
signalHead
- Signal Head Beansensor
- Sensor Bean- Returns:
- true if sensor is considered for signalHead state; false otherwise
-
getSensorState
public int getSensorState(SignalHead signalHead, Sensor sensor)
Description copied from interface:SignalGroup
Get the On state of the Sensor for the Signal Head in the group.- Specified by:
getSensorState
in interfaceSignalGroup
- Parameters:
signalHead
- The Signal Head Beansensor
- Name of the Sensor in the head item- Returns:
- -1 if the Sensor or Signal Head is invalid
-
getSensorTurnoutOper
public boolean getSensorTurnoutOper(SignalHead signalHead)
Description copied from interface:SignalGroup
Get the AND/OR conditional operand set for a Signal Head in the group.- Specified by:
getSensorTurnoutOper
in interfaceSignalGroup
- Parameters:
signalHead
- The Signal Head Bean- Returns:
- true when set to AND, false for OR
-
getSensorTurnoutOperByIndex
public boolean getSensorTurnoutOperByIndex(int x)
Description copied from interface:SignalGroup
Get the state of the AND/OR conditional operand for Signal Head at Index.- Specified by:
getSensorTurnoutOperByIndex
in interfaceSignalGroup
- Parameters:
x
- Index of the SignalHead in Group- Returns:
- true when set to AND, false for OR
-
setSensorTurnoutOper
public void setSensorTurnoutOper(SignalHead signalHead, boolean boo)
Description copied from interface:SignalGroup
Set whether the sensors and turnouts should be treated as separate calculations (OR) or as one (AND) when determining if the Signal Head should be On or Off.- Specified by:
setSensorTurnoutOper
in interfaceSignalGroup
- Parameters:
signalHead
- The SignalHead Beanboo
- Provide true for AND, false for OR
-
clearHeadTurnout
public void clearHeadTurnout(SignalHead signalHead)
Description copied from interface:SignalGroup
Delete all Turnouts for a given Signal Head in the group.- Specified by:
clearHeadTurnout
in interfaceSignalGroup
- Parameters:
signalHead
- The Signal Head Bean from which the Turnouts will be removed
-
clearHeadSensor
public void clearHeadSensor(SignalHead signalHead)
Description copied from interface:SignalGroup
Delete all Sensors for a given Signal Head in the group.- Specified by:
clearHeadSensor
in interfaceSignalGroup
- Parameters:
signalHead
- The Signal Head Bean from which the Turnouts will be removed
-
getNumHeadSensorsByIndex
public int getNumHeadSensorsByIndex(int x)
Description copied from interface:SignalGroup
Get the number of Sensors configured for the Signal Head at index x.- Specified by:
getNumHeadSensorsByIndex
in interfaceSignalGroup
- Parameters:
x
- Index for the Signal Head in the group- Returns:
- -1 if there are less than 'x' Signal Heads defined
-
getNumHeadTurnoutsByIndex
public int getNumHeadTurnoutsByIndex(int x)
Description copied from interface:SignalGroup
Get the number of turnouts configured for the Signal Head at index x.- Specified by:
getNumHeadTurnoutsByIndex
in interfaceSignalGroup
- Parameters:
x
- Index of the SignalHead in Group- Returns:
- -1 if there are less than 'x' Signal Heads defined
-
getState
public int getState()
Description copied from interface:NamedBean
Provide generic access to internal state.This generally shouldn't be used by Java code; use the class-specific form instead (e.g. getCommandedState in Turnout). This is provided to make scripts easier to read.
- Specified by:
getState
in interfaceNamedBean
- Specified by:
getState
in interfaceSignalGroup
- Returns:
- the state
-
setState
public void setState(int state)
Description copied from interface:NamedBean
Provide generic access to internal state.This generally shouldn't be used by Java code; use the class-specific form instead (e.g. setCommandedState in Turnout). This is provided to make scripts access easier to read.
- Specified by:
setState
in interfaceNamedBean
- Specified by:
setState
in interfaceSignalGroup
- Parameters:
state
- the state
-
getUsageReport
public java.util.List<NamedBeanUsageReport> getUsageReport(NamedBean bean)
Description copied from interface:NamedBean
Get a list of references for the specified bean.- Specified by:
getUsageReport
in interfaceNamedBean
- Parameters:
bean
- The bean to be checked.- Returns:
- a list of NamedBeanUsageReports or an empty ArrayList.
-
-