From 71a3ceb3b747b0d8951dcbb644a1af558f6df98e Mon Sep 17 00:00:00 2001 From: sfop Date: Fri, 26 Aug 2016 16:06:27 +0200 Subject: [PATCH] Closedown --- devices/CurrentCamera.properties | 6 +++--- plugins/Cameras.java | 11 ++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/devices/CurrentCamera.properties b/devices/CurrentCamera.properties index ad086a0..d1971e7 100644 --- a/devices/CurrentCamera.properties +++ b/devices/CurrentCamera.properties @@ -1,4 +1,4 @@ -#Fri Aug 26 15:50:34 CEST 2016 +#Fri Aug 26 16:05:48 CEST 2016 colormap=Grayscale colormapAutomatic=false colormapMax=255.0 @@ -6,8 +6,8 @@ colormapMin=0.0 flipHorizontally=false flipVertically=false grayscale=false -imageHeight=2160 -imageWidth=2560 +imageHeight=1628 +imageWidth=1280 invert=false rescaleFactor=1.0 rescaleOffset=0.0 diff --git a/plugins/Cameras.java b/plugins/Cameras.java index 324e6bd..13b02b0 100644 --- a/plugins/Cameras.java +++ b/plugins/Cameras.java @@ -138,6 +138,8 @@ public class Cameras extends Panel { if (camera!=null){ camera.close(); camera = null; + renderer.setDevice(null); + renderer.clear(); } try{ Path configFile= Paths.get(configFolder, cameraName + ".json"); @@ -175,9 +177,12 @@ public class Cameras extends Panel { camera.addListener(new ImageListener() { @Override public void onImage(Object o, BufferedImage bi, Data data) { - if ((renderer.getReticle()!=null) && (bi!=null)){ - renderer.getReticle().setSize(new Dimension(bi.getWidth(), bi.getHeight())); - } + if (renderer.getReticle()!=null){ + if (bi==null){ + return; + } + renderer.getReticle().setSize(new Dimension(bi.getWidth(), bi.getHeight())); + } camera.removeListener(this); } @Override