From 02002b583878c7d087afabbba6f896cee5939a2b Mon Sep 17 00:00:00 2001 From: gobbo_a Date: Mon, 12 Jun 2017 08:33:26 +0200 Subject: [PATCH] Startup --- devices/CurrentCamera.properties | 14 ++++++------- devices/camtool.properties | 10 ++++----- plugins/ScreenPanelDev.form | 16 +++++++-------- plugins/ScreenPanelDev.java | 35 +++++++++++++++++--------------- 4 files changed, 39 insertions(+), 36 deletions(-) diff --git a/devices/CurrentCamera.properties b/devices/CurrentCamera.properties index 5b71bc8..c6a0163 100644 --- a/devices/CurrentCamera.properties +++ b/devices/CurrentCamera.properties @@ -1,16 +1,16 @@ -#Fri Jun 09 16:13:40 CEST 2017 +#Mon Jun 12 08:32:43 CEST 2017 colormap=Flame -colormapAutomatic=true -colormapMax=6000.0 +colormapAutomatic=false +colormapMax=739.0 colormapMin=0.0 flipHorizontally=false flipVertically=false grayscale=false -imageHeight=1024 -imageWidth=1280 +imageHeight=2148 +imageWidth=2272 invert=false -regionStartX=1 -regionStartY=1 +regionStartX=129 +regionStartY=7 rescaleFactor=1.0 rescaleOffset=0.0 roiHeight=-1 diff --git a/devices/camtool.properties b/devices/camtool.properties index 8cbf852..ec2c0d9 100644 --- a/devices/camtool.properties +++ b/devices/camtool.properties @@ -1,4 +1,4 @@ -#Wed Jun 07 11:34:07 CEST 2017 +#Fri Jun 09 16:25:46 CEST 2017 colormap=Flame colormapAutomatic=true colormapMax=578.797 @@ -18,9 +18,9 @@ roiY=0 rotation=0.0 rotationCrop=false scale=1.0 -spatialCalOffsetX=-161.48788305646764 -spatialCalOffsetY=-158.49842396964675 -spatialCalScaleX=-14.255081084280302 -spatialCalScaleY=-13.524936230776813 +spatialCalOffsetX=-50.03909304143862 +spatialCalOffsetY=-50.048875855327466 +spatialCalScaleX=-1.0 +spatialCalScaleY=-1.0 spatialCalUnits=mm transpose=false diff --git a/plugins/ScreenPanelDev.form b/plugins/ScreenPanelDev.form index b3e0f52..1f6a4ec 100644 --- a/plugins/ScreenPanelDev.form +++ b/plugins/ScreenPanelDev.form @@ -297,13 +297,13 @@ - - - - + + + + - + @@ -478,7 +478,7 @@ - + @@ -812,7 +812,7 @@ - + @@ -829,7 +829,7 @@ - + diff --git a/plugins/ScreenPanelDev.java b/plugins/ScreenPanelDev.java index a8afb67..0509a45 100644 --- a/plugins/ScreenPanelDev.java +++ b/plugins/ScreenPanelDev.java @@ -612,10 +612,10 @@ public class ScreenPanelDev extends Panel { calibrationDialolg = null; } - //boolean was_camtool = false; + boolean was_camtool = false; if (camera != null) { //camera.removeAllListeners(); - //was_camtool = camera instanceof Camtool; + was_camtool = camera instanceof Camtool; camera.close(); camera = null; } @@ -679,11 +679,12 @@ public class ScreenPanelDev extends Panel { System.out.println("Camera initialization OK"); if (camera instanceof Camtool) { //Managing no background exception. Can be done in a better way? - //if (changed || !was_camtool) { - ((Camtool) camera).startPipeline(cameraName, null); - ((Camtool) camera).setBackgroundSubtraction(checkBackground.isSelected()); + if (changed) { + ((Camtool) camera).startPipeline(cameraName, null); updateCamtoolControls(); - //} else { + } else { + ((Camtool) camera).startPipeline(cameraName, null, checkBackground.isSelected(), null, null, null); + } // HashMap gr = null; // if (goodRegion){ // gr = new HashMap<>(); @@ -692,6 +693,7 @@ public class ScreenPanelDev extends Panel { // } // ((Camtool) camera).startPipeline(cameraName, null, checkBackground.isSelected(), null, checkThreshold.isSelected() ? (Double) spinnerThreshold.getValue() : null, gr); //} + checkThreshold.setEnabled(true); checkGoodRegion.setEnabled(true); @@ -704,6 +706,7 @@ public class ScreenPanelDev extends Panel { } else { camera.setPolling(polling); } + camera.setBackgroundEnabled(checkBackground.isSelected()); } buttonReticle.setEnabled(camera.getConfig().isCalibrated()); @@ -914,6 +917,7 @@ public class ScreenPanelDev extends Panel { if ((camera != null) && (camera instanceof Camtool)) { updatingCamtoolControls = true; try { + checkBackground.setSelected(((Camtool) camera).getBackgroundSubtraction()); Double threshold = ((Camtool) camera).getThreshold(); checkThreshold.setSelected(threshold != null); spinnerThreshold.setValue((threshold == null) ? 0 : threshold); @@ -922,8 +926,7 @@ public class ScreenPanelDev extends Panel { if (gr != null){ spinnerGrThreshold.setValue(gr.get("threshold")); spinnerGrScale.setValue(gr.get("gfscale")); - } - checkBackground.setSelected(((Camtool) camera).getBackgroundSubtraction()); + } } catch (Exception ex) { } goodRegion = checkGoodRegion.isSelected(); @@ -2229,7 +2232,7 @@ public class ScreenPanelDev extends Panel { .addComponent(buttonFullRange) .addComponent(buttonManual) .addComponent(comboColormap, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addComponent(labelMax) @@ -2433,7 +2436,7 @@ public class ScreenPanelDev extends Panel { .addGroup(panelScreen2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelScreen2Layout.createSequentialGroup() .addComponent(checkGoodRegion) - .addGap(18, 18, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(labelGrScale) .addGap(2, 2, 2) .addComponent(spinnerGrScale, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) @@ -2447,7 +2450,7 @@ public class ScreenPanelDev extends Panel { .addGap(0, 0, Short.MAX_VALUE)) .addGroup(panelScreen2Layout.createSequentialGroup() .addComponent(checkThreshold) - .addGap(18, 18, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(spinnerThreshold, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); @@ -2482,13 +2485,13 @@ public class ScreenPanelDev extends Panel { .addGroup(jPanel4Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) - .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(panelScreen, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(panelScreen1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, 0, Short.MAX_VALUE) + .addComponent(panelScreen, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 0, Short.MAX_VALUE) + .addComponent(panelScreen1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 0, Short.MAX_VALUE) + .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 0, Short.MAX_VALUE) .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(pauseSelection, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) - .addComponent(panelScreen2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(panelScreen2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 0, Short.MAX_VALUE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel4Layout.setVerticalGroup(