This commit is contained in:
sfop
2016-09-01 14:38:54 +02:00
parent bfdafa1135
commit 23f0aabfa7
3 changed files with 22 additions and 12 deletions

View File

@@ -182,6 +182,7 @@ public class Cameras extends Panel {
try {
if (checkCamtool.isSelected()) {
camera = new Camtool("CurrentCamera", cameraName, false, true);
} else {
camera = new PsiCamera("CurrentCamera", cameraName);
config = (CameraConfig) JsonSerializer.decode(cameraConfigJson, CameraConfig.class);
@@ -210,15 +211,17 @@ public class Cameras extends Panel {
} catch (Exception ex) {
config = null;
showException(ex);
}
camera.initialize();
if (camera instanceof Camtool){
double[] origin = ((Camtool)camera).origin.read();
camera.getConfig().spatialCalOffsetX = origin[0];
camera.getConfig().spatialCalOffsetY = origin[1];
}
camera.getConfig().save();
camera.initialize();
camera.setPolling(500);
camera.setMonitored(true);
camera.getDevice().setMonitored(true);
camera.getDevice().setPolling(500);
camera.setPolling(-500);
//camera.setMonitored(true);
renderer.setDevice(camera);
renderer.setShowReticle(true);
renderer.setAutoScroll(true);
@@ -261,6 +264,7 @@ public class Cameras extends Panel {
final public ChannelInteger channelRun;
final public ChannelInteger channelLatch;
final public ChannelDouble channelTimestamp;
final public ChannelDoubleArray origin;
final public ChannelDouble posX, posY;
final public ChannelDoubleArray profileX, profileY;
final public ChannelIntegerArray shape;
@@ -291,6 +295,7 @@ public class Cameras extends Panel {
profileX = new ChannelDoubleArray(name + " profile x", dataPrefix + "profile.x");
profileY = new ChannelDoubleArray(name + " profile y", dataPrefix + "profile.y");
shape = new ChannelIntegerArray(name + " shape", dataPrefix + (roi ? "roi.output.shape" : "image.shape"));
origin = new ChannelDoubleArray(name + " origin X", roi ? (dataPrefix + "roi.origin_out") : (prefix+"origin"));
bgEnable = new ChannelInteger(name + " bg enable", this.prefix + "pipeline.bg.enabled");
bgCapture = new ChannelInteger(name + " bg capture", this.prefix + "pipeline.bg.capture");
bgCaptureRemain = new ChannelInteger(name + " bg capture remain", this.prefix + "pipeline.bg.capture_remain");
@@ -342,9 +347,10 @@ public class Cameras extends Panel {
profileX.initialize();
profileY.initialize();
shape.initialize();
origin.initialize();
bgEnable.initialize();
bgCapture.initialize();
bgCaptureRemain.initialize();
bgCaptureRemain.initialize();
int[] s = shape.read();
getConfig().imageHeight = s[0];