Package nl.basjes.modbus.schema.fetcher
Class OptimizingRegisterBlockFetcher
-
- All Implemented Interfaces:
public final class OptimizingRegisterBlockFetcher extends RegisterBlockFetcher
-
-
Field Summary
Fields Modifier and Type Field Description private IntegerallowedGapReadSizeprivate final List<Field>neededFields
-
Constructor Summary
Constructors Constructor Description OptimizingRegisterBlockFetcher(SchemaDevice schemaDevice, ModbusDevice modbusDevice)
-
Method Summary
Modifier and Type Method Description final IntegergetAllowedGapReadSize()How many registers may needlessly be read to optimize fetching final UnitsetAllowedGapReadSize(Integer allowedGapReadSize)List<RegisterBlockFetcher.FetchBatch>calculateFetchBatches(Long maxAge)Determine which sets of registers need to be retrieved again. -
Methods inherited from class nl.basjes.modbus.schema.fetcher.RegisterBlockFetcher
getNeededFields, initialize, need, needAll, unNeed, unNeedAll, update, update, updateAll, updateAll -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
OptimizingRegisterBlockFetcher
OptimizingRegisterBlockFetcher(SchemaDevice schemaDevice, ModbusDevice modbusDevice)
-
-
Method Detail
-
getAllowedGapReadSize
final Integer getAllowedGapReadSize()
How many registers may needlessly be read to optimize fetching
-
setAllowedGapReadSize
final Unit setAllowedGapReadSize(Integer allowedGapReadSize)
-
calculateFetchBatches
List<RegisterBlockFetcher.FetchBatch> calculateFetchBatches(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)
-
-
-
-