public class SineDataModel extends AbstractBaseDataModel
executor
Constructor and Description |
---|
SineDataModel(int size) |
Modifier and Type | Method and Description |
---|---|
BackgroundIterator |
createBackgroundIterator()
Create a new background iterator
If the implementation does not support background transmissions, null may be returned. |
void |
forAllAsdu(java.util.function.Consumer<ASDUAddress> function,
Runnable ifNoneFound)
A method that will call the provided function for each known ASDU
address
|
protected void |
handleWriteCommand(MirrorCommand mirrorCommand) |
protected Value<?> |
performRead(ASDUAddress asduAddress,
InformationObjectAddress address) |
protected Void |
performReadAll(DataListener listener) |
protected Object |
proceedBackgroundScan(AtomicInteger positionRef) |
com.google.common.util.concurrent.ListenableFuture<Value<?>> |
read(ASDUAddress asduAddress,
InformationObjectAddress address)
Read a specific value
The future will be called with the result of the read operation. |
com.google.common.util.concurrent.ListenableFuture<Void> |
readAll(ASDUAddress asduAddress,
Runnable prepare,
DataListener listener)
Read all values from the internal structures
The data will not be returned by the future, but pushed to the DataListener . |
protected void |
update() |
void |
writeCommand(ASDUHeader header,
InformationObjectAddress informationObjectAddress,
boolean state,
byte type,
MirrorCommand mirrorCommand,
boolean execute) |
void |
writeFloatValue(ASDUHeader header,
InformationObjectAddress informationObjectAddress,
float value,
byte type,
MirrorCommand mirrorCommand,
boolean execute) |
void |
writeScaledValue(ASDUHeader header,
InformationObjectAddress informationObjectAddress,
short value,
byte type,
MirrorCommand mirrorCommand,
boolean execute) |
disposeSubscription, getNumberOfSubscriptions, notifyChangeBoolean, notifyChangeBoolean, notifyChangeFloat, notifyChangeFloat, start, stop, subscribe
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forAllAsdu
protected void update()
public com.google.common.util.concurrent.ListenableFuture<Value<?>> read(ASDUAddress asduAddress, InformationObjectAddress address)
DataModel
null
.address
- the address to readnull
if the data model
instantly decide that the value cannot be readprotected Value<?> performRead(ASDUAddress asduAddress, InformationObjectAddress address)
public com.google.common.util.concurrent.ListenableFuture<Void> readAll(ASDUAddress asduAddress, Runnable prepare, DataListener listener)
DataModel
DataListener
.asduAddress
- the ASDU common addressprepare
- a runnable that will be called before the actual processing,
from the same thread the listener will be called. But only
when the request actually can be processed. If the runnable
was called, the method must not return null
.listener
- the data receivernull
if the ASDU address was unknown.protected Void performReadAll(DataListener listener)
public void forAllAsdu(java.util.function.Consumer<ASDUAddress> function, Runnable ifNoneFound)
DataModel
Note that the ASDUs must not change until each function call has been completed.
The function call can be performed asynchronously.
function
- the function to call for each known ASDU addressifNoneFound
- will be called if there are no known common ASDU addresses,
may be null
public BackgroundIterator createBackgroundIterator()
DataModel
null
may be returned. null
protected Object proceedBackgroundScan(AtomicInteger positionRef)
public void writeCommand(ASDUHeader header, InformationObjectAddress informationObjectAddress, boolean state, byte type, MirrorCommand mirrorCommand, boolean execute)
public void writeFloatValue(ASDUHeader header, InformationObjectAddress informationObjectAddress, float value, byte type, MirrorCommand mirrorCommand, boolean execute)
public void writeScaledValue(ASDUHeader header, InformationObjectAddress informationObjectAddress, short value, byte type, MirrorCommand mirrorCommand, boolean execute)
protected void handleWriteCommand(MirrorCommand mirrorCommand)