1
0
This repository has been archived on 2024-01-25. You can view files and clone it, but cannot push or open issues or pull requests.

25 lines
693 B
Java
Raw Normal View History

package ch.hevs.isi.field;
import ch.hevs.isi.core.BooleanDataPoint;
2023-05-30 11:31:01 +02:00
import ch.hevs.isi.core.DataPoint;
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);
2023-05-26 16:11:02 +02:00
value = bdp.getValue();
updateMapOfRegisters(bdp, address);
}
@Override
public void read() {
2023-05-26 16:11:02 +02:00
bdp.setValue(ModbusAccessor.getMySelf().readBoolean(this.getAddress()));
}
@Override
public void write() {
2023-05-26 16:11:02 +02:00
ModbusAccessor.getMySelf().writeBoolean(this.getAddress(), bdp.getValue());
}
}