24 lines
607 B
Java
24 lines
607 B
Java
|
package ch.hevs.isi.field;
|
||
|
|
||
|
import ch.hevs.isi.core.BooleanDataPoint;
|
||
|
|
||
|
public class BooleanRegister extends ModbusRegister{
|
||
|
private boolean value;
|
||
|
private BooleanDataPoint bdp;
|
||
|
|
||
|
public BooleanRegister(String label, boolean isOutput, int address){
|
||
|
this.bdp = new BooleanDataPoint(label, isOutput);
|
||
|
updateMapOfRegisters(bdp, address);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void read() {
|
||
|
bdp.setValue(ModbusAccessor.getMySelf().readBoolean(address));
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void write() {
|
||
|
ModbusAccessor.getMySelf().writeBoolean(address, bdp.getValue());
|
||
|
}
|
||
|
}
|