|
||||||||||
| 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.maple.SerialSensorManager
public class SerialSensorManager
Manage the specific Sensor implementation.
System names are "KSnnnn", where nnnn is the sensor number without padding.
Sensors are numbered from 1.
This is a SerialListener to handle the replies to poll messages. Those are forwarded to the specific SerialNode object corresponding to their origin for processing of the data.
| Field Summary | |
|---|---|
(package private) static SerialSensorManager |
_instance
|
(package private) int |
address
|
(package private) int |
iName
|
(package private) static org.slf4j.Logger |
log
|
(package private) static int |
SENSORSPERUA
Number of sensors per UA in the naming scheme. |
(package private) int |
sysNode
|
| 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 | |
|---|---|
SerialSensorManager()
|
|
| 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)
Create a new sensor if all checks are passed System name is normalized to ensure uniqueness. |
String |
createSystemName(String curAddress,
String prefix)
|
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()
Return the system letter |
static SerialSensorManager |
instance()
static function returning the SerialSensorManager instance to use. |
void |
message(SerialMessage r)
Dummy routine |
void |
registerSensorsForNode(SerialNode node)
Method to register any orphan Sensors when a new Serial Node is created |
void |
reply(SerialReply r)
Process a reply to a poll of Sensors of one panel node |
| Methods inherited from class jmri.managers.AbstractManager |
|---|
addPropertyChangeListener, deregister, dispose, 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 |
|---|
dispose, getSystemNameList |
| Methods inherited from interface jmri.Manager |
|---|
addPropertyChangeListener, deregister, getBeanBySystemName, getBeanByUserName, getNamedBean, getNamedBeanList, getSystemNameArray, makeSystemName, register, removePropertyChangeListener, systemLetter |
| Field Detail |
|---|
static final int SENSORSPERUA
The first UA (node address) uses sensors from 1 to SENSORSPERUA-1, the second from SENSORSPERUA+1 to SENSORSPERUA+(SENSORSPERUA-1), etc.
Must be more than, and is generally one more than,
SerialNode.MAXSENSORS
static SerialSensorManager _instance
int sysNode
int address
int iName
static org.slf4j.Logger log
| Constructor Detail |
|---|
public SerialSensorManager()
| Method Detail |
|---|
public String getSystemPrefix()
getSystemPrefix in interface Manager
public Sensor createNewSensor(String systemName,
String userName)
createNewSensor in class AbstractSensorManagerpublic void message(SerialMessage r)
message in interface SerialListenerpublic void reply(SerialReply r)
reply in interface SerialListenerpublic void registerSensorsForNode(SerialNode node)
public static SerialSensorManager instance()
public 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 | |||||||||