public abstract class ModbusDataSource extends PollingDataSource implements com.serotonin.modbus4j.messaging.MessagingExceptionHandler
Modifier and Type | Field and Description |
---|---|
private com.serotonin.modbus4j.BatchRead<ModbusPointLocatorRT> |
batchRead |
static int |
DATA_SOURCE_EXCEPTION_EVENT |
private boolean |
eventRaised |
private org.apache.commons.logging.Log |
LOG |
private com.serotonin.modbus4j.ModbusMaster |
modbusMaster |
static int |
POINT_READ_EXCEPTION_EVENT |
static int |
POINT_WRITE_EXCEPTION_EVENT |
private java.util.Map<java.lang.Integer,DataPointRT> |
slaveMonitors |
private ModbusDataSourceVO<?> |
vo |
dataPoints, pointListChanged
addedChangedPoints, ATTR_DISCONNECTED_KEY, ATTR_UNRELIABLE_KEY, pointListChangeLock, removedPoints
Constructor and Description |
---|
ModbusDataSource(ModbusDataSourceVO<?> vo) |
Modifier and Type | Method and Description |
---|---|
void |
addDataPoint(DataPointRT dataPoint) |
static com.serotonin.modbus4j.locator.BaseLocator<?> |
createModbusLocator(ModbusPointLocatorVO vo) |
protected void |
doPoll(long time) |
void |
forcePointRead(DataPointRT dataPoint) |
protected com.serotonin.web.i18n.LocalizableMessage |
getLocalExceptionMessage(java.lang.Exception e) |
protected void |
initialize(com.serotonin.modbus4j.ModbusMaster modbusMaster) |
static com.serotonin.web.i18n.LocalizableMessage |
localExceptionMessage(java.lang.Exception e) |
void |
receivedException(java.lang.Exception e) |
void |
removeDataPoint(DataPointRT dataPoint) |
void |
setPointValue(DataPointRT dataPoint,
PointValueTime valueTime,
SetPointSource source) |
void |
terminate() |
private void |
updatePointValue(DataPointRT dataPoint,
ModbusPointLocatorRT pl,
java.lang.Object value,
long time) |
beginPolling, joinTermination, scheduleTimeout, setPollingPeriod, updateChangedPoints
getExceptionMessage, getId, getName, getPersistentData, getSerialExceptionMessage, initialize, raiseEvent, relinquish, returnToNormal, setPersistentData
private final org.apache.commons.logging.Log LOG
private boolean eventRaised
public static final int POINT_READ_EXCEPTION_EVENT
public static final int POINT_WRITE_EXCEPTION_EVENT
public static final int DATA_SOURCE_EXCEPTION_EVENT
private com.serotonin.modbus4j.ModbusMaster modbusMaster
private com.serotonin.modbus4j.BatchRead<ModbusPointLocatorRT> batchRead
private final ModbusDataSourceVO<?> vo
private final java.util.Map<java.lang.Integer,DataPointRT> slaveMonitors
public ModbusDataSource(ModbusDataSourceVO<?> vo)
public void addDataPoint(DataPointRT dataPoint)
addDataPoint
in class DataSourceRT
public void removeDataPoint(DataPointRT dataPoint)
removeDataPoint
in class DataSourceRT
protected void doPoll(long time)
doPoll
in class PollingDataSource
protected void initialize(com.serotonin.modbus4j.ModbusMaster modbusMaster)
public void forcePointRead(DataPointRT dataPoint)
forcePointRead
in class DataSourceRT
private void updatePointValue(DataPointRT dataPoint, ModbusPointLocatorRT pl, java.lang.Object value, long time)
public void terminate()
terminate
in interface com.serotonin.util.ILifecycle
terminate
in class PollingDataSource
public void setPointValue(DataPointRT dataPoint, PointValueTime valueTime, SetPointSource source)
setPointValue
in class DataSourceRT
public static com.serotonin.modbus4j.locator.BaseLocator<?> createModbusLocator(ModbusPointLocatorVO vo)
public static com.serotonin.web.i18n.LocalizableMessage localExceptionMessage(java.lang.Exception e)
protected com.serotonin.web.i18n.LocalizableMessage getLocalExceptionMessage(java.lang.Exception e)
public void receivedException(java.lang.Exception e)
receivedException
in interface com.serotonin.modbus4j.messaging.MessagingExceptionHandler