sige 1 year ago
parent
commit
576d8ed097
  1. 7
      src/src/main/java/com/my/graphiteDigesterBg/diframe/actuator/DiActCameraBasler.java
  2. 2
      src/src/main/java/com/my/graphiteDigesterBg/diframe/actuator/impl/DiActHeaterTokyGteModbusRtuOverTcp.java

7
src/src/main/java/com/my/graphiteDigesterBg/diframe/actuator/DiActCameraBasler.java

@ -12,7 +12,7 @@ public class DiActCameraBasler extends DiActuatorBase {
// channel // channel
protected Integer channel; protected Integer channel;
// camera handle // camera handle
private long cam = 0;
private long cam = -1;
// get pylon // get pylon
private DiComBaslerCamera getPylon() { private DiComBaslerCamera getPylon() {
@ -35,6 +35,10 @@ public class DiActCameraBasler extends DiActuatorBase {
@Override @Override
protected void onEnable() { protected void onEnable() {
if ( -1 != this.cam ) {
return ;
}
var pylon = this.getPylon(); var pylon = this.getPylon();
int count = pylon.enumerateDevices(); int count = pylon.enumerateDevices();
if ( this.index >= count ) { if ( this.index >= count ) {
@ -64,6 +68,7 @@ public class DiActCameraBasler extends DiActuatorBase {
protected void onDisable() { protected void onDisable() {
var pylon = this.getPylon(); var pylon = this.getPylon();
pylon.deviceClose(this.cam); pylon.deviceClose(this.cam);
this.cam = -1;
// pylon.destroyDevice(this.cam); // pylon.destroyDevice(this.cam);
} }

2
src/src/main/java/com/my/graphiteDigesterBg/diframe/actuator/impl/DiActHeaterTokyGteModbusRtuOverTcp.java

@ -139,7 +139,7 @@ public class DiActHeaterTokyGteModbusRtuOverTcp extends DiActuatorBase implement
if (!response.isEmpty()) { if (!response.isEmpty()) {
temperature = response.get(3) << 8 | response.get(4); temperature = response.get(3) << 8 | response.get(4);
} }
LOG.info("[Actuator {}({})] {} get temperature : {}", this.key, this.type, this.name, temperature);
// LOG.info("[Actuator {}({})] {} get temperature : {}", this.key, this.type, this.name, temperature);
return temperature; return temperature;
} }

Loading…
Cancel
Save