Class ModbusBlockFetcher
-
- All Implemented Interfaces:
public class ModbusBlockFetcherA RegisterBlockFetcher needs to have a Schema, a target RegisterBlock and a ModbusDevice
-
-
Constructor Summary
Constructors Constructor Description ModbusBlockFetcher(SchemaDevice schemaDevice, ModbusDevice modbusDevice)
-
Method Summary
Modifier and Type Method Description final List<ModbusQuery>update(Field field, Long maxAge)We force an immediate update of all registers needed for the provided field which have a maximum age of the provided milliseconds. final List<ModbusQuery>update(Long maxAge)Update all registers related to the needed fields to be updated with a maximum age of the provided milliseconds final List<ModbusQuery>update()Update all registers related to the needed fields to be updated with a maximum age of the provided milliseconds final List<ModbusQuery>calculateModbusQueries(Long maxAge)Determine which sets of registers need to be retrieved again. List<ModbusQuery>calculateModbusQueries(List<Field> fields, Long maxAge)Determine which sets of registers need to be retrieved again for the provided fields. -
-
Constructor Detail
-
ModbusBlockFetcher
ModbusBlockFetcher(SchemaDevice schemaDevice, ModbusDevice modbusDevice)
-
-
Method Detail
-
update
final List<ModbusQuery> update(Field field, Long maxAge)
We force an immediate update of all registers needed for the provided field which have a maximum age of the provided milliseconds. No batching, buffering or any optimization is done.
- Parameters:
field- The field that must be updated- Returns:
A (possibly empty) list of all modbus queries that have been done (with duration and status)
-
update
@JvmOverloads() final List<ModbusQuery> update(Long maxAge)
Update all registers related to the needed fields to be updated with a maximum age of the provided milliseconds
- Parameters:
maxAge- maximum age of the fields in milliseconds- Returns:
A (possibly empty) list of all fetches that have been done (with duration and status)
-
update
@JvmOverloads() final List<ModbusQuery> update()
Update all registers related to the needed fields to be updated with a maximum age of the provided milliseconds
- Returns:
A (possibly empty) list of all fetches that have been done (with duration and status)
-
calculateModbusQueries
final List<ModbusQuery> calculateModbusQueries(Long maxAge)
Determine which sets of registers need to be retrieved again.
- Parameters:
maxAge- The maximum age (in milliseconds) of the data for it to need an update.- Returns:
The list of address ranges that must be retrieved (Sorted by the start address)
-
calculateModbusQueries
List<ModbusQuery> calculateModbusQueries(List<Field> fields, Long maxAge)
Determine which sets of registers need to be retrieved again for the provided fields.
- Parameters:
fields- The list of fields that must be updatedmaxAge- The maximum age (in milliseconds) of the data for it to need an update.- Returns:
The list of address ranges that must be retrieved (Sorted by the start address)
-
-
-
-