jmri
Interface SignalGroup

All Superinterfaces:
NamedBean
All Known Implementing Classes:
DefaultSignalGroup

public interface SignalGroup
extends NamedBean

SignalGroup.java The Signal Group is used to represent European subsidary signals that would be sited with a signal mast. Such subsidary signals would be used to indicated routes, junctions and allowable speeds. Each such route/junction/speed would be represented by a single output signal, that is either off or on. Within the group on one such signal would be allowed on at any one time. The group is attached to a signal mast, and can be configured to be activated depending upon that masts appearance. The Each signal head within the group is defined with a On and Off appearance, and a set of criteria in the form of matching turnouts and sensor states, that must be met for the head to be set On.

This file is part of JMRI.

JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.

JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Author:
Pete Cressman Copyright (C) 2009

Field Summary
static Logger log
           
static int ONACTIVE
           
static int ONCLOSED
           
static int ONINACTIVE
           
static int ONTHROWN
           
 
Fields inherited from interface jmri.NamedBean
INCONSISTENT, UNKNOWN
 
Method Summary
 void addSignalHead(NamedBeanHandle<SignalHead> sh)
          Add a Signal Head to the Group
 void addSignalHead(String pName)
          Add a Signal Head to the Group
 void addSignalMastAppearance(String sppearance)
          Add an appearance that can trigger the group activation
 void clearSignalMastAppearance()
          Clear the list of SignalMast Appearances that trigger the group
 void clearSignalSensor(String pSignal)
          Delete all Sensors for a given SignalHead in the group
 void clearSignalTurnout(String pSignal)
          Delete all Turnouts for a given SignalHead in the group
 void deleteSignalHead(NamedBeanHandle<SignalHead> sh)
          Delete Signal Head by NamedBean
 void deleteSignalHead(String pName)
          Delete Signal Head by Name
 void deleteSignalMastAppearance(String appearance)
          Remove a SignalMast Appearance from the set of triggers.
 boolean getEnabled()
          Get enabled status
 int getNumSignalHeadItems()
           
 int getNumSignalHeadSensorsByIndex(int x)
          Method to get the number of Sensors used to determine the On state for the signalhead at index x
 int getNumSignalHeadTurnoutsByIndex(int x)
          Method to get the number of turnouts used to determine the On state for the signalhead at index x
 int getNumSignalMastAppearances()
           
 String getSensorNameByIndex(int x, int pSensor)
          Gets the state of the Sensor at index x, for the given Signal Head at index x
 int getSensorState(String pSignal, String pSensor)
          Gets the state of the Sensor for the given Signal Head in the group
 int getSensorStateByIndex(int x, int pSensor)
          Gets the state of the Sensor for the given Signal Head at index x
 boolean getSensorTurnoutOper(String pSignal)
           
 boolean getSensorTurnoutOperByIndex(int x)
           
 String getSignalHeadItemNameByIndex(int n)
          Method to get a SignalHead by Index Returns null if there are no Signal Heads with that index
 int getSignalHeadOffState(String name)
          Method to get the Off State of Signal Head
 int getSignalHeadOffStateByIndex(int n)
          Method to get the Off State of a SignalState at Index n
 int getSignalHeadOnState(String name)
          Method to get the On State of Signal Head
 int getSignalHeadOnStateByIndex(int n)
          Method to get the On State of a SignalState at Index n
 SignalMast getSignalMast()
          Get the SignalMast
 String getSignalMastAppearanceByIndex(int x)
          Method to get a SignalMast Appearance by Index Returns null if there are no Appearances with that index
 String getSignalMastName()
          Get the name of the main Signal Mast
 int getState()
          Provide generic access to internal state.
 String getTurnoutNameByIndex(int x, int pTurnout)
          Gets the Name of the Turnout at index x, for the given Signal Head at index x
 int getTurnoutState(String pSignal, String pTurnout)
          Gets the state of the Turnout for the given Signal Head in the group
 int getTurnoutStateByIndex(int x, int pTurnout)
          Gets the state of the Turnout at index x, for the given Signal Head at index x
 int getTurnoutStateByIndex(int x, String pTurnout)
          Gets the state of the Turnout for the given Signal Head at index x
 boolean isSensorIncluded(String pSignal, String pSensor)
          Inquire if a Sensor is included in the Signal Head Calculation.
 boolean isSignalIncluded(String systemName)
          Method to inquire if a Signal Head is included in this Group
 boolean isSignalMastAppearanceIncluded(String appearance)
          Inquire if a SignalMast Appearance is included.
 boolean isTurnoutIncluded(String pSignal, String pTurnout)
          Inquire if a Turnout is included in the Signal Head Calculation.
 void setEnabled(boolean boo)
          Set enabled status.
 void setSensorTurnoutOper(String pSignal, boolean boo)
          Sets whether the sensors and turnouts should be treated as seperate calculations or as one, when determining if the signal head should be on or off.
 void setSignalHeadAlignSensor(String mHead, String mSensor, int state)
          Method to add a Sensor and its state to a signal head.
 void setSignalHeadAlignTurnout(String mHead, String mTurn, int state)
          Method to add a Turnout and its state to a signal head.
 void setSignalHeadOffState(String name, int state)
          Sets the Off State of the Signal in the Group
 void setSignalHeadOnState(String name, int state)
          Sets the On State of the Signal in the Group
 void setSignalMast(String pName)
          Sets the main Signal Mast to which the Group belongs
 void setState(int state)
          Provide generic access to internal state.
 
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, dispose, getComment, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyKeys, getSystemName, getUserName, removePropertyChangeListener, setComment, setProperty, setUserName, updateListenerRef
 

Field Detail

ONACTIVE

static final int ONACTIVE
See Also:
Constant Field Values

ONINACTIVE

static final int ONINACTIVE
See Also:
Constant Field Values

ONCLOSED

static final int ONCLOSED
See Also:
Constant Field Values

ONTHROWN

static final int ONTHROWN
See Also:
Constant Field Values

log

static final Logger log
Method Detail

setEnabled

void setEnabled(boolean boo)
Set enabled status.


getEnabled

boolean getEnabled()
Get enabled status


setSignalMast

void setSignalMast(String pName)
Sets the main Signal Mast to which the Group belongs


getSignalMastName

String getSignalMastName()
Get the name of the main Signal Mast


getSignalMast

SignalMast getSignalMast()
Get the SignalMast


clearSignalMastAppearance

void clearSignalMastAppearance()
Clear the list of SignalMast Appearances that trigger the group


addSignalMastAppearance

void addSignalMastAppearance(String sppearance)
Add an appearance that can trigger the group activation


getNumSignalMastAppearances

int getNumSignalMastAppearances()

getSignalMastAppearanceByIndex

String getSignalMastAppearanceByIndex(int x)
Method to get a SignalMast Appearance by Index Returns null if there are no Appearances with that index


isSignalMastAppearanceIncluded

boolean isSignalMastAppearanceIncluded(String appearance)
Inquire if a SignalMast Appearance is included.


deleteSignalMastAppearance

void deleteSignalMastAppearance(String appearance)
Remove a SignalMast Appearance from the set of triggers.


addSignalHead

void addSignalHead(NamedBeanHandle<SignalHead> sh)
Add a Signal Head to the Group

Parameters:
sh - The SignalHead as a Named Bean

addSignalHead

void addSignalHead(String pName)
Add a Signal Head to the Group

Parameters:
pName - The SignalHead as a Name

getSignalHeadItemNameByIndex

String getSignalHeadItemNameByIndex(int n)
Method to get a SignalHead by Index Returns null if there are no Signal Heads with that index


getSignalHeadOnStateByIndex

int getSignalHeadOnStateByIndex(int n)
Method to get the On State of a SignalState at Index n

Returns:
-1 if there are less than 'n' SignalHeads defined

getSignalHeadOffStateByIndex

int getSignalHeadOffStateByIndex(int n)
Method to get the Off State of a SignalState at Index n

Returns:
-1 if there are less than 'n' SignalHeads defined

deleteSignalHead

void deleteSignalHead(String pName)
Delete Signal Head by Name


deleteSignalHead

void deleteSignalHead(NamedBeanHandle<SignalHead> sh)
Delete Signal Head by NamedBean


getNumSignalHeadItems

int getNumSignalHeadItems()

isSignalIncluded

boolean isSignalIncluded(String systemName)
Method to inquire if a Signal Head is included in this Group


getSignalHeadOnState

int getSignalHeadOnState(String name)
Method to get the On State of Signal Head

Parameters:
name - The name of the SignalHead we are querying

getSignalHeadOffState

int getSignalHeadOffState(String name)
Method to get the Off State of Signal Head

Parameters:
name - The name of the SignalHead we are querying

setSignalHeadOnState

void setSignalHeadOnState(String name,
                          int state)
Sets the On State of the Signal in the Group

Parameters:
name - The SignalHead Name
state - The Apperance that the SignalHead will change to when the conditions are met.

setSignalHeadOffState

void setSignalHeadOffState(String name,
                           int state)
Sets the Off State of the Signal in the Group

Parameters:
name - The SignalHead Name
state - The Apperance that the SignalHead will change to when the conditions are NOT met.

setSensorTurnoutOper

void setSensorTurnoutOper(String pSignal,
                          boolean boo)
Sets whether the sensors and turnouts should be treated as seperate calculations or as one, when determining if the signal head should be on or off.


getSensorTurnoutOperByIndex

boolean getSensorTurnoutOperByIndex(int x)

getNumSignalHeadTurnoutsByIndex

int getNumSignalHeadTurnoutsByIndex(int x)
Method to get the number of turnouts used to determine the On state for the signalhead at index x

Returns:
-1 if there are less than 'n' SignalHeads defined

setSignalHeadAlignTurnout

void setSignalHeadAlignTurnout(String mHead,
                               String mTurn,
                               int state)
Method to add a Turnout and its state to a signal head.

Parameters:
mHead - SignalHead we are adding the turnout to
mTurn - Turnout as a String either User or System Name
state - The State that the turnout must be set to.

isTurnoutIncluded

boolean isTurnoutIncluded(String pSignal,
                          String pTurnout)
Inquire if a Turnout is included in the Signal Head Calculation.

Parameters:
pSignal - Name of the Signal Head
pTurnout - Name of the Turnout

getTurnoutState

int getTurnoutState(String pSignal,
                    String pTurnout)
Gets the state of the Turnout for the given Signal Head in the group

Parameters:
pSignal - Name of the Signal Head
pTurnout - Name of the Turnout within the Group
Returns:
-1 if the turnout or signal head is invalid

getTurnoutStateByIndex

int getTurnoutStateByIndex(int x,
                           String pTurnout)
Gets the state of the Turnout for the given Signal Head at index x

Parameters:
x - Signal Head at index x
pTurnout - Name of the Turnout within the Group
Returns:
-1 if the turnout or signal head is invalid

getTurnoutStateByIndex

int getTurnoutStateByIndex(int x,
                           int pTurnout)
Gets the state of the Turnout at index x, for the given Signal Head at index x

Parameters:
x - Signal Head at index x
pTurnout - Turnout at index pTurnout
Returns:
-1 if the turnout or signal head is invalid

getTurnoutNameByIndex

String getTurnoutNameByIndex(int x,
                             int pTurnout)
Gets the Name of the Turnout at index x, for the given Signal Head at index x

Parameters:
x - Signal Head at index x
pTurnout - Turnout at index pTurnout
Returns:
null if the turnout or signal head is invalid

setSignalHeadAlignSensor

void setSignalHeadAlignSensor(String mHead,
                              String mSensor,
                              int state)
Method to add a Sensor and its state to a signal head.

Parameters:
mHead - SignalHead we are adding the sensor to
mSensor - Sensor as a String either User or System Name
state - The State that the sensor must be set to.

isSensorIncluded

boolean isSensorIncluded(String pSignal,
                         String pSensor)
Inquire if a Sensor is included in the Signal Head Calculation.

Parameters:
pSignal - Name of the Signal Head
pSensor - Name of the Sensor

getSensorState

int getSensorState(String pSignal,
                   String pSensor)
Gets the state of the Sensor for the given Signal Head in the group

Parameters:
pSignal - Name of the Signal Head
pSensor - Name of the Sensor within the Group
Returns:
-1 if the sensor or signal head is invalid

getSensorStateByIndex

int getSensorStateByIndex(int x,
                          int pSensor)
Gets the state of the Sensor for the given Signal Head at index x

Parameters:
x - Signal Head at index x
pSensor - Name of the Sensor within the Group
Returns:
-1 if the sensor or signal head is invalid

getSensorNameByIndex

String getSensorNameByIndex(int x,
                            int pSensor)
Gets the state of the Sensor at index x, for the given Signal Head at index x

Parameters:
x - Signal Head at index x
pSensor - Sensor at index pTurnout
Returns:
null if the sensor or signal head is invalid

getSensorTurnoutOper

boolean getSensorTurnoutOper(String pSignal)

getNumSignalHeadSensorsByIndex

int getNumSignalHeadSensorsByIndex(int x)
Method to get the number of Sensors used to determine the On state for the signalhead at index x

Returns:
-1 if there are less than 'n' SignalHeads defined

clearSignalTurnout

void clearSignalTurnout(String pSignal)
Delete all Turnouts for a given SignalHead in the group

Parameters:
pSignal - SignalHead Name

clearSignalSensor

void clearSignalSensor(String pSignal)
Delete all Sensors for a given SignalHead in the group

Parameters:
pSignal - SignalHead Name

getState

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 provided to make Jython script access easier to read.

Specified by:
getState in interface NamedBean

setState

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 provided to make Jython script access easier to read.

Specified by:
setState in interface NamedBean


Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads