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