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, pointListChangedaddedChangedPoints, 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, updateChangedPointsgetExceptionMessage, getId, getName, getPersistentData, getSerialExceptionMessage, initialize, raiseEvent, relinquish, returnToNormal, setPersistentDataprivate 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 DataSourceRTpublic void removeDataPoint(DataPointRT dataPoint)
removeDataPoint in class DataSourceRTprotected void doPoll(long time)
doPoll in class PollingDataSourceprotected void initialize(com.serotonin.modbus4j.ModbusMaster modbusMaster)
public void forcePointRead(DataPointRT dataPoint)
forcePointRead in class DataSourceRTprivate void updatePointValue(DataPointRT dataPoint, ModbusPointLocatorRT pl, java.lang.Object value, long time)
public void terminate()
terminate in interface com.serotonin.util.ILifecycleterminate in class PollingDataSourcepublic void setPointValue(DataPointRT dataPoint, PointValueTime valueTime, SetPointSource source)
setPointValue in class DataSourceRTpublic 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