[Minor] code cleanup

This commit is contained in:
Robert von Burg 2020-06-25 16:27:33 +02:00
parent 517095434c
commit 5461cad1d9
1 changed files with 2 additions and 2 deletions

View File

@ -229,7 +229,7 @@ public class DefaultPlcHandler extends StrolchComponent implements PlcHandler, P
plc = PlcConfigurator.configurePlc(tx, plcClassName, plcAddresses, plcTelegrams, addressesToResourceId); plc = PlcConfigurator.configurePlc(tx, plcClassName, plcAddresses, plcTelegrams, addressesToResourceId);
plc.setConnectionStateChangeListener(this); plc.setConnectionStateChangeListener(this);
plcAddresses.values().forEach(plcAddress -> plc.register(plcAddress, this::asyncUpdateState)); plcAddresses.values().forEach(plcAddress -> plc.register(plcAddress, this::updateState));
if (tx.needsCommit()) if (tx.needsCommit())
tx.commitOnClose(); tx.commitOnClose();
@ -238,7 +238,7 @@ public class DefaultPlcHandler extends StrolchComponent implements PlcHandler, P
return plc; return plc;
} }
private void asyncUpdateState(PlcAddress address, Object value) { private void updateState(PlcAddress address, Object value) {
if (this.asyncAddressUpdate) if (this.asyncAddressUpdate)
getExecutorService("PlcAddressUpdater").submit(() -> updatePlcAddress(address, value)); getExecutorService("PlcAddressUpdater").submit(() -> updatePlcAddress(address, value));
else else