From 8b7d06f6cfa0a95e7a7d67c2bfa36e79e00e24e3 Mon Sep 17 00:00:00 2001 From: gobbo_a Date: Wed, 28 Sep 2016 09:30:04 +0200 Subject: [PATCH] Startup --- devices/CurrentCamera.properties | 12 ++++++------ plugins/ScreenPanel.java | 25 +++++++++++++++++++------ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/devices/CurrentCamera.properties b/devices/CurrentCamera.properties index 7cfc948..07bde24 100644 --- a/devices/CurrentCamera.properties +++ b/devices/CurrentCamera.properties @@ -1,10 +1,10 @@ -#Thu Sep 22 09:23:52 CEST 2016 +#Wed Sep 28 09:24:26 CEST 2016 colormap=Grayscale colormapAutomatic=true colormapMax=0.0 colormapMin=0.0 flipHorizontally=false -flipVertically=true +flipVertically=false grayscale=false imageHeight=1200 imageWidth=1246 @@ -18,9 +18,9 @@ roiY=0 rotation=0.0 rotationCrop=true scale=1.0 -spatialCalOffsetX=-630.0 -spatialCalOffsetY=-612.0 -spatialCalScaleX=26.761819803746654 -spatialCalScaleY=26.595744680851062 +spatialCalOffsetX=NaN +spatialCalOffsetY=NaN +spatialCalScaleX=NaN +spatialCalScaleY=NaN spatialCalUnits=mm transpose=false diff --git a/plugins/ScreenPanel.java b/plugins/ScreenPanel.java index 2caaeee..f0fc455 100644 --- a/plugins/ScreenPanel.java +++ b/plugins/ScreenPanel.java @@ -572,7 +572,7 @@ public class ScreenPanel extends Panel { int profileSize = Math.min(data.getWidth(), data.getHeight())/4; try { - double[] sum = (double[]) Convert.toDouble(data.integrateVertically()); + double[] sum = (double[]) Convert.toDouble(data.integrateVertically(true)); int[] x = Arr.indexesInt(sum.length); DescriptiveStatistics stats = new DescriptiveStatistics(sum); double min = stats.getMin(); @@ -600,7 +600,7 @@ public class ScreenPanel extends Panel { } try { - double[] sum = (double[]) Convert.toDouble(data.integrateHorizontally()); + double[] sum = (double[]) Convert.toDouble(data.integrateHorizontally(true)); int[] x = Arr.indexesInt(sum.length); DescriptiveStatistics stats = new DescriptiveStatistics(sum); double min = stats.getMin(); @@ -1707,9 +1707,12 @@ public class ScreenPanel extends Panel { if (laserOn){ setLaserState(false); } - ((Camtool) camera).captureBackground(5); - if (laserOn){ - setLaserState(true); + try{ + ((Camtool) camera).captureBackground(5); + } finally{ + if (laserOn){ + setLaserState(true); + } } } } @@ -1811,7 +1814,17 @@ public class ScreenPanel extends Panel { setpoint = new ChannelInteger(null, cameraName + ":SET_SCREEN1_POS"); setpoint.initialize(); if (setpoint.read() != index) { - setpoint.write(index); + boolean laserOn = getLaserState(); + if (laserOn){ + setLaserState(false); + } + try{ + setpoint.write(index); + } finally{ + if (laserOn){ + setLaserState(true); + } + } } screen.read(); } catch (Exception ex) {