|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.managers.AbstractManager
jmri.managers.AbstractSensorManager
jmri.jmrix.nce.NceSensorManager
public class NceSensorManager
Manage the NCE-specific Sensor implementation.
System names are "NSnnn", where nnn is the sensor number without padding.
This class is responsible for generating polling messages for the NceTrafficController, see nextAiuPoll()
| Field Summary | |
|---|---|
(package private) int |
activeAIUMax
|
(package private) int[] |
activeAIUs
|
(package private) NceAIU[] |
aiuArray
|
(package private) int |
aiucab
|
(package private) int |
iName
|
(package private) NceListener |
listener
|
(package private) static org.slf4j.Logger |
log
|
(package private) int |
pin
|
(package private) Thread |
pollThread
|
(package private) String |
prefix
|
(package private) boolean |
stopPolling
|
(package private) NceTrafficController |
tc
|
| Fields inherited from class jmri.managers.AbstractSensorManager |
|---|
sensorDebounceGoingActive, sensorDebounceGoingInActive |
| Fields inherited from class jmri.managers.AbstractManager |
|---|
_tsys, _tuser |
| Fields inherited from interface jmri.Manager |
|---|
AUDIO, BLOCKBOSS, BLOCKS, CONDITIONALS, ENTRYEXIT, IDTAGS, LAYOUTBLOCKS, LIGHTS, LOGIXS, MEMORIES, OBLOCKS, PANELFILES, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTS |
| Constructor Summary | |
|---|---|
NceSensorManager(NceTrafficController tc,
String prefix)
|
|
| Method Summary | |
|---|---|
boolean |
allowMultipleAdditions(String systemName)
A method that determines if it is possible to add a range of sensors in numerical order eg 10 to 30, primarily used to enable/disable the add range box in the add sensor panel |
Sensor |
createNewSensor(String systemName,
String userName)
Internal method to invoke the factory, after all the logic for returning an existing method has been invoked. |
String |
createSystemName(String curAddress,
String prefix)
|
void |
dispose()
Free resources when no longer used. |
String |
getNextValidAddress(String curAddress,
String prefix)
Determine if the address supplied is valid and free, if not then it shall return the next free valid address up to a maximum of 10 address away from the initial address. |
String |
getSystemPrefix()
Provides access to the system prefix string. |
void |
handleSensorMessage(AbstractMRReply r)
Handle an unsolicited sensor (AIU) state message |
NceMessage |
makeAIUPoll(int aiuNo)
|
void |
message(NceMessage r)
|
void |
reply(NceReply r)
Process single received reply from sensor poll |
| Methods inherited from class jmri.managers.AbstractManager |
|---|
addPropertyChangeListener, deregister, firePropertyChange, getBeanBySystemName, getBeanByUserName, getInstanceByUserName, getNamedBean, getNamedBeanList, getSystemNameArray, getSystemNameList, makeSystemName, propertyChange, register, registerSelf, removePropertyChangeListener, systemLetter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jmri.SensorManager |
|---|
getSystemNameList |
| Methods inherited from interface jmri.Manager |
|---|
addPropertyChangeListener, deregister, getBeanBySystemName, getBeanByUserName, getNamedBean, getNamedBeanList, getSystemNameArray, makeSystemName, register, removePropertyChangeListener, systemLetter |
| Field Detail |
|---|
NceTrafficController tc
String prefix
NceAIU[] aiuArray
int[] activeAIUs
int activeAIUMax
Thread pollThread
boolean stopPolling
NceListener listener
int aiucab
int pin
int iName
static org.slf4j.Logger log
| Constructor Detail |
|---|
public NceSensorManager(NceTrafficController tc,
String prefix)
| Method Detail |
|---|
public String getSystemPrefix()
Manager
getSystemPrefix in interface Managerpublic void dispose()
Manager
dispose in interface Managerdispose in interface SensorManagerdispose in class AbstractManager
public Sensor createNewSensor(String systemName,
String userName)
AbstractSensorManager
createNewSensor in class AbstractSensorManagerpublic NceMessage makeAIUPoll(int aiuNo)
public void message(NceMessage r)
message in interface NceListenerpublic void reply(NceReply r)
reply in interface NceListenerpublic void handleSensorMessage(AbstractMRReply r)
r - sensor messagepublic boolean allowMultipleAdditions(String systemName)
AbstractSensorManager
allowMultipleAdditions in interface SensorManagerallowMultipleAdditions in class AbstractSensorManager
public String createSystemName(String curAddress,
String prefix)
throws JmriException
createSystemName in interface SensorManagercreateSystemName in class AbstractSensorManagerJmriException
public String getNextValidAddress(String curAddress,
String prefix)
SensorManager
getNextValidAddress in interface SensorManagergetNextValidAddress in class AbstractSensorManagercurAddress - - The hardware address of the turnout we which to check.prefix - - The System Prefix used to make up the systemName
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||