field not finished, connection works
This commit is contained in:
@@ -4,20 +4,21 @@ import ch.hevs.isi.core.FloatDataPoint;
|
||||
|
||||
public class FloatRegister extends ModbusRegister{
|
||||
private Float value;
|
||||
private FloatDataPoint dataPoint;
|
||||
private FloatDataPoint fdp;
|
||||
|
||||
public FloatRegister(String label, boolean isOutPut, int address) {
|
||||
this.dataPoint = new FloatDataPoint(label, isOutPut);
|
||||
updateMapOfRegisters(dataPoint,address);
|
||||
this.fdp = new FloatDataPoint(label, isOutPut);
|
||||
value = fdp.getValue();
|
||||
updateMapOfRegisters(fdp,address);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read() {
|
||||
dataPoint.setValue(ModbusAccessor.getMySelf().readFloat(address));
|
||||
fdp.setValue(ModbusAccessor.getMySelf().readFloat(this.getAddress()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write() {
|
||||
ModbusAccessor.getMySelf().writeFloat(address, dataPoint.getValue());
|
||||
ModbusAccessor.getMySelf().writeFloat(this.getAddress(), fdp.getValue());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user