From 44ebfb505c18088e5c265e6cd1a97c58a59bc990 Mon Sep 17 00:00:00 2001 From: sfop Date: Thu, 16 Mar 2017 17:02:11 +0100 Subject: [PATCH] Startup --- devices/CurrentCamera.properties | 20 ++++++++++---------- plugins/ScreenPanel.java | 15 ++++++++++++--- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/devices/CurrentCamera.properties b/devices/CurrentCamera.properties index 4187214..18ab776 100644 --- a/devices/CurrentCamera.properties +++ b/devices/CurrentCamera.properties @@ -1,13 +1,13 @@ -#Thu Mar 16 10:22:37 CET 2017 +#Thu Mar 16 16:57:17 CET 2017 colormap=Grayscale -colormapAutomatic=true -colormapMax=0.0 -colormapMin=0.0 +colormapAutomatic=false +colormapMax=124.459 +colormapMin=83.269 flipHorizontally=false flipVertically=false grayscale=false -imageHeight=1024 -imageWidth=1280 +imageHeight=1200 +imageWidth=1246 invert=false rescaleFactor=1.0 rescaleOffset=0.0 @@ -19,9 +19,9 @@ rotation=0.0 rotationCrop=false scale=1.0 serverURL=localhost\:10000 -spatialCalOffsetX=-50.0 -spatialCalOffsetY=-50.0 -spatialCalScaleX=-1.0 -spatialCalScaleY=-1.0 +spatialCalOffsetX=8751.115234375 +spatialCalOffsetY=16090.42578125 +spatialCalScaleX=-26.761820720381525 +spatialCalScaleY=-26.595745478002502 spatialCalUnits=mm transpose=false diff --git a/plugins/ScreenPanel.java b/plugins/ScreenPanel.java index 3d22523..0c82fe8 100644 --- a/plugins/ScreenPanel.java +++ b/plugins/ScreenPanel.java @@ -2258,18 +2258,27 @@ public class ScreenPanel extends Panel { private void buttonGrabBackgroundActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonGrabBackgroundActionPerformed try { - if (camera instanceof Camtool) { + if ((camera!=null) && (camera instanceof Camtool)) { if (SwingUtils.showOption(getTopLevel(), "Background", "Do you want to capture background now?", OptionType.YesNo) == OptionResult.Yes) { boolean laserOn = getLaserState(); + boolean rendering = (!camera.isClosed()); + if (rendering){ + camera.close(); + } if (laserOn) { setLaserState(false); } - try { - ((Camtool) camera).grabBackground(null, 5); + try{ + System.out.println("Grabbing background for: " + cameraName); + ((Camtool) camera).grabBackground(cameraName, 5); } finally { if (laserOn) { setLaserState(true); } + if (rendering){ + comboCamerasActionPerformed(null); + } + updateStop(); } SwingUtils.showMessage(getTopLevel(), "Success", "Success capturing background", 5000); }