|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.loconet.AspectGenerator
public class AspectGenerator
Test implementation of AspectGenerator, ala 1/8 of an SE8.
An AspectGenerator drives specific Aspects to SignalHead objects. The SignalHead objects represent individual signals either on a screen or physical items on the layout.
Note that this class is tightly bound to both the SecurityElement class and a specific SecurityElement object. More thought needs to be given to whether this is the same object, a related one (e.g. common config), or completely separate. This matter for both state and configuration!
At runtime, we reference everything through a SecurityElement referece, at least for now. Eventually, we can listen to messages to decouple this.
Head 0 guards entering the A leg, head 1 guards the B legt, head 2 guards the C leg, head 3 is the 2nd head on the A leg
Simple hard-coded aspect chart: Green is 55MPH and up Flashing yellow is 35 and up Yellow is 15 and up Red is less than 15
The SignalHead are created here if they don't already exist, because instantiating the AspectGenerator is actually creating the connection to the device on the layout. We assume the SE8cSignalHead implementation.
The algorithms in this class are a collaborative effort of Digitrax, Inc and Bob Jacobsen. Some of the message formats are copyright Digitrax, Inc.
| Constructor Summary | |
|---|---|
|
AspectGenerator(int se)
|
protected |
AspectGenerator(SecurityElement pElement)
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
|
protected void |
firePropertyChange(String p,
Object old,
Object n)
|
int |
getHeadState(int num)
Access the state of a specific head |
int |
getNumHeads()
|
String |
getSEName()
|
void |
propertyChange(PropertyChangeEvent e)
The associated SecurityElement has changed state, so update our signal heads |
void |
removePropertyChangeListener(PropertyChangeListener l)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AspectGenerator(SecurityElement pElement)
public AspectGenerator(int se)
| Method Detail |
|---|
public int getHeadState(int num)
num - Head number 0 -> getNumHeads()-1
public String getSEName()
public int getNumHeads()
public void propertyChange(PropertyChangeEvent e)
propertyChange in interface PropertyChangeListenerpublic void addPropertyChangeListener(PropertyChangeListener l)
protected void firePropertyChange(String p,
Object old,
Object n)
public void removePropertyChangeListener(PropertyChangeListener l)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||