jmri.jmrix.powerline
Class SerialSensorManager

java.lang.Object
  extended by jmri.managers.AbstractManager
      extended by jmri.managers.AbstractSensorManager
          extended by jmri.jmrix.powerline.SerialSensorManager
All Implemented Interfaces:
PropertyChangeListener, EventListener, AbstractMRListener, SerialListener, Manager, SensorManager
Direct Known Subclasses:
SpecificSensorManager, SpecificSensorManager, SpecificSensorManager, SpecificSensorManager

public abstract class SerialSensorManager
extends AbstractSensorManager
implements SerialListener

Manage the system-specific Sensor implementation.

System names are: Powerline - "PSann", where a is the house code and nn is the unit number without padding.


Field Summary
(package private) static org.slf4j.Logger log
           
(package private)  SerialTrafficController 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
SerialSensorManager(SerialTrafficController tc)
           
 
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.
 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()
          Return the system letter
 void message(SerialMessage r)
          Dummy routine
abstract  void reply(SerialReply r)
          Process a reply to a poll of Sensors of one node
 
Methods inherited from class jmri.managers.AbstractSensorManager
createSystemName, getBySystemName, getByUserName, getDefaultSensorDebounceGoingActive, getDefaultSensorDebounceGoingInActive, getInstanceBySystemName, getSensor, getXMLOrder, newSensor, normalizeSystemName, provideSensor, setDefaultSensorDebounceGoingActive, setDefaultSensorDebounceGoingInActive, typeLetter, updateAll
 
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

tc

SerialTrafficController tc

log

static org.slf4j.Logger log
Constructor Detail

SerialSensorManager

public SerialSensorManager(SerialTrafficController tc)
Method Detail

getSystemPrefix

public String getSystemPrefix()
Return the system letter

Specified by:
getSystemPrefix in interface Manager

dispose

public void dispose()
Description copied from interface: Manager
Free resources when no longer used. Specifically, remove all references to and from this object, so it can be garbage-collected.

Specified by:
dispose in interface Manager
Specified by:
dispose in interface SensorManager
Overrides:
dispose in class AbstractManager

createNewSensor

public Sensor createNewSensor(String systemName,
                              String userName)
Create a new sensor if all checks are passed System name is normalized to ensure uniqueness.

Specified by:
createNewSensor in class AbstractSensorManager
Returns:
new null

message

public void message(SerialMessage r)
Dummy routine

Specified by:
message in interface SerialListener

reply

public abstract void reply(SerialReply r)
Process a reply to a poll of Sensors of one node

Specified by:
reply in interface SerialListener

allowMultipleAdditions

public boolean allowMultipleAdditions(String systemName)
Description copied from class: AbstractSensorManager
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

Specified by:
allowMultipleAdditions in interface SensorManager
Overrides:
allowMultipleAdditions in class AbstractSensorManager

getNextValidAddress

public String getNextValidAddress(String curAddress,
                                  String prefix)
Description copied from interface: SensorManager
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.

Specified by:
getNextValidAddress in interface SensorManager
Overrides:
getNextValidAddress in class AbstractSensorManager
Parameters:
curAddress - - The hardware address of the turnout we which to check.
prefix - - The System Prefix used to make up the systemName


Copyright © 1997-2013 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