Closedown

This commit is contained in:
voulot_d
2017-04-04 09:26:39 +02:00
parent 3c3392b487
commit 62b4c67e22
6 changed files with 111 additions and 34 deletions

View File

@@ -1,10 +1,10 @@
#Tue Apr 04 08:55:11 CEST 2017
#Tue Apr 04 09:20:39 CEST 2017
colormap=Flame
colormapAutomatic=false
colormapMax=1000.0
colormapMin=10.0
flipHorizontally=true
flipVertically=true
flipHorizontally=false
flipVertically=false
grayscale=false
imageHeight=2160
imageWidth=2560

View File

@@ -32,7 +32,7 @@
<Component id="buttonAbort" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="plot" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
@@ -105,7 +105,7 @@
<Component id="spinnerStep" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -137,7 +137,7 @@
<Component id="spinnerLatency" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="latencyLabel" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -155,6 +155,9 @@
</Component>
<Component class="javax.swing.JSpinner" name="spinnerStep">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="5.0" maximum="90.0" minimum="1.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[53, 20]"/>
</Property>
@@ -167,6 +170,9 @@
</Component>
<Component class="javax.swing.JSpinner" name="spinnerStart">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="0.0" maximum="360.0" minimum="-180.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[53, 20]"/>
</Property>
@@ -179,6 +185,9 @@
</Component>
<Component class="javax.swing.JSpinner" name="spinnerSamples">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="1.0" maximum="50.0" minimum="1.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[53, 20]"/>
</Property>
@@ -191,6 +200,9 @@
</Component>
<Component class="javax.swing.JSpinner" name="spinnerLatency">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="0.1" maximum="5.0" minimum="0.0" numberType="java.lang.Double" stepSize="0.01" type="number"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[53, 20]"/>
</Property>
@@ -198,6 +210,9 @@
</Component>
<Component class="javax.swing.JSpinner" name="spinnerStop">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="360.0" maximum="360.0" minimum="-180.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[53, 20]"/>
</Property>
@@ -225,12 +240,12 @@
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" alignment="1" attributes="0">
<Component id="energyLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="spinnerEnergy" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="1" attributes="0">
<Component id="dispersionLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="spinnerDispersion" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
@@ -251,7 +266,7 @@
<Component id="spinnerEnergy" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="energyLabel" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -259,6 +274,9 @@
<SubComponents>
<Component class="javax.swing.JSpinner" name="spinnerDispersion">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="1.0" maximum="10.0" minimum="0.0" numberType="java.lang.Double" stepSize="0.01" type="number"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[53, 20]"/>
</Property>
@@ -271,6 +289,9 @@
</Component>
<Component class="javax.swing.JSpinner" name="spinnerEnergy">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="0.0" maximum="10000.0" minimum="0.0" numberType="java.lang.Double" stepSize="0.1" type="number"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[53, 20]"/>
</Property>

View File

@@ -115,20 +115,25 @@ public class GunScan extends Panel {
stopLabel.setText("Stop:");
spinnerStep.setModel(new javax.swing.SpinnerNumberModel(5.0d, 1.0d, 90.0d, 1.0d));
spinnerStep.setPreferredSize(new java.awt.Dimension(53, 20));
stepLabel.setText("Step:");
spinnerStart.setModel(new javax.swing.SpinnerNumberModel(0.0d, -180.0d, 360.0d, 1.0d));
spinnerStart.setPreferredSize(new java.awt.Dimension(53, 20));
samplesLabel.setText("Nb Samples:");
spinnerSamples.setModel(new javax.swing.SpinnerNumberModel(1.0d, 1.0d, 50.0d, 1.0d));
spinnerSamples.setPreferredSize(new java.awt.Dimension(53, 20));
latencyLabel.setText("Latency:");
spinnerLatency.setModel(new javax.swing.SpinnerNumberModel(0.1d, 0.0d, 5.0d, 0.01d));
spinnerLatency.setPreferredSize(new java.awt.Dimension(53, 20));
spinnerStop.setModel(new javax.swing.SpinnerNumberModel(360.0d, -180.0d, 360.0d, 1.0d));
spinnerStop.setMinimumSize(new java.awt.Dimension(53, 20));
spinnerStop.setPreferredSize(new java.awt.Dimension(53, 20));
@@ -159,7 +164,7 @@ public class GunScan extends Panel {
.addComponent(stepLabel)
.addGap(2, 2, 2)
.addComponent(spinnerStep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -184,15 +189,17 @@ public class GunScan extends Panel {
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(spinnerLatency, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(latencyLabel))
.addContainerGap())
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Beam Parameters"));
spinnerDispersion.setModel(new javax.swing.SpinnerNumberModel(1.0d, 0.0d, 10.0d, 0.01d));
spinnerDispersion.setPreferredSize(new java.awt.Dimension(53, 20));
energyLabel.setText("Energy:");
spinnerEnergy.setModel(new javax.swing.SpinnerNumberModel(0.0d, 0.0d, 10000.0d, 0.1d));
spinnerEnergy.setPreferredSize(new java.awt.Dimension(53, 20));
dispersionLabel.setText("Dispersion:");
@@ -206,11 +213,11 @@ public class GunScan extends Panel {
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(energyLabel)
.addGap(2, 2, 2)
.addGap(0, 0, 0)
.addComponent(spinnerEnergy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(dispersionLabel)
.addGap(2, 2, 2)
.addGap(0, 0, 0)
.addComponent(spinnerDispersion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(20, 20, 20))
);
@@ -225,7 +232,7 @@ public class GunScan extends Panel {
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(spinnerEnergy, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(energyLabel))
.addContainerGap())
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
plot.setTitle("");
@@ -247,7 +254,7 @@ public class GunScan extends Panel {
.addComponent(buttonStart)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonAbort)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(plot, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);

View File

@@ -24,11 +24,11 @@
<EmptySpace max="32767" attributes="0"/>
<Component id="buttonAbort" linkSize="1" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jPanel1" max="32767" attributes="0"/>
<Component id="jPanel1" pref="179" max="32767" attributes="0"/>
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="plot" pref="523" max="32767" attributes="0"/>
<Component id="plot" pref="522" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
@@ -42,7 +42,7 @@
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="45" max="32767" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="buttonStart" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonAbort" alignment="3" min="-2" max="-2" attributes="0"/>
@@ -155,7 +155,7 @@
<Component class="javax.swing.JSpinner" name="spinnerStep">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="5.0" maximum="90.0" minimum="0.1" numberType="java.lang.Double" stepSize="1.0" type="number"/>
<SpinnerModel initial="5.0" maximum="90.0" minimum="1.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
</Property>
</Properties>
</Component>
@@ -174,7 +174,7 @@
<Component class="javax.swing.JSpinner" name="spinnerStop">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="360.0" maximum="360.0" minimum="-45.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
<SpinnerModel initial="180.0" maximum="360.0" minimum="-180.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
</Property>
</Properties>
</Component>
@@ -193,7 +193,7 @@
<Component class="javax.swing.JSpinner" name="spinnerLatency">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="0.1" maximum="1.0" minimum="0.0" numberType="java.lang.Double" stepSize="0.01" type="number"/>
<SpinnerModel initial="0.1" maximum="5.0" minimum="0.0" numberType="java.lang.Double" stepSize="0.01" type="number"/>
</Property>
</Properties>
</Component>
@@ -213,7 +213,7 @@
<Component class="javax.swing.JSpinner" name="spinnerStart">
<Properties>
<Property name="model" type="javax.swing.SpinnerModel" editor="org.netbeans.modules.form.editors2.SpinnerModelEditor">
<SpinnerModel initial="0.0" maximum="360.0" minimum="-45.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
<SpinnerModel initial="0.0" maximum="360.0" minimum="-180.0" numberType="java.lang.Double" stepSize="1.0" type="number"/>
</Property>
</Properties>
</Component>

View File

@@ -128,7 +128,7 @@ public class SchottkyScan extends Panel {
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Parameters"));
spinnerStep.setModel(new javax.swing.SpinnerNumberModel(5.0d, 0.1d, 90.0d, 1.0d));
spinnerStep.setModel(new javax.swing.SpinnerNumberModel(5.0d, 1.0d, 90.0d, 1.0d));
jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
jLabel5.setText("Latency:");
@@ -136,7 +136,7 @@ public class SchottkyScan extends Panel {
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
jLabel1.setText("Start:");
spinnerStop.setModel(new javax.swing.SpinnerNumberModel(360.0d, -45.0d, 360.0d, 1.0d));
spinnerStop.setModel(new javax.swing.SpinnerNumberModel(180.0d, -180.0d, 360.0d, 1.0d));
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
jLabel3.setText("Step:");
@@ -144,14 +144,14 @@ public class SchottkyScan extends Panel {
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
jLabel2.setText("Stop:");
spinnerLatency.setModel(new javax.swing.SpinnerNumberModel(0.1d, 0.0d, 1.0d, 0.01d));
spinnerLatency.setModel(new javax.swing.SpinnerNumberModel(0.1d, 0.0d, 5.0d, 0.01d));
spinnerSamples.setModel(new javax.swing.SpinnerNumberModel(1, 1, 50, 1));
jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
jLabel4.setText("Nb Samples:");
spinnerStart.setModel(new javax.swing.SpinnerNumberModel(0.0d, -45.0d, 360.0d, 1.0d));
spinnerStart.setModel(new javax.swing.SpinnerNumberModel(0.0d, -180.0d, 360.0d, 1.0d));
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
@@ -274,10 +274,10 @@ public class SchottkyScan extends Panel {
.addComponent(buttonStart)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonAbort))
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(plot, javax.swing.GroupLayout.DEFAULT_SIZE, 523, Short.MAX_VALUE)
.addComponent(plot, javax.swing.GroupLayout.DEFAULT_SIZE, 522, Short.MAX_VALUE)
.addContainerGap())
);
@@ -292,7 +292,7 @@ public class SchottkyScan extends Panel {
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(buttonStart)
.addComponent(buttonAbort)))

View File

@@ -626,6 +626,37 @@ public class ScreenPanel extends Panel {
return (Boolean) camera.get("roi_enable");
}
}
public static class CameraPars {
public HashMap parameter;
public Boolean getBackgroundSubtraction() {
if (parameter.get("background_subtration") == null){
return false;
}
return (Boolean) parameter.get("background_subtration");
}
public ArrayList<Integer> getRoi() {
return (ArrayList<Integer>) parameter.get("region_of_interest");
}
public Boolean getRoiEnable() {
ArrayList<Integer> roi = getRoi();
return ((roi != null) && (roi.size()>=4));
}
public HashMap getGoodRegion() {
return (HashMap) parameter.get("good_region");
}
public Double getThresholde() {
return (Double) parameter.get("threshold");
}
}
Thread devicesInitTask;
@@ -694,9 +725,27 @@ public class ScreenPanel extends Panel {
if ((cameraConfigJson == null) && (buttonDirect.isSelected())) {
throw new Exception("Cannot open camera config file: " + configFile.toFile());
}
camera = new PsiCamera(CAMERA_DEVICE_NAME, cameraName);
config = (CameraConfig) JsonSerializer.decode(cameraConfigJson, CameraConfig.class);
CameraPars cameraPars = null;
try{
Path parsFile = Paths.get(CONFIG_FOLDER, cameraName + "_parameters.json");
if (parsFile.toFile().exists()){
String cameraParsJson = new String(Files.readAllBytes(parsFile));
cameraPars = (CameraPars) JsonSerializer.decode(cameraParsJson, CameraPars.class);
boolean roi = cameraPars.getRoiEnable();
camera.getConfig().roiX = roi ? cameraPars.getRoi().get(0) : 0;
camera.getConfig().roiY = roi ? cameraPars.getRoi().get(2) : 0;
camera.getConfig().roiWidth = roi ? cameraPars.getRoi().get(1) : -1;
camera.getConfig().roiHeight =roi ? cameraPars.getRoi().get(3) : -1;
}
} catch (Exception ex){
ex.printStackTrace();
}
camera.getConfig().flipHorizontally = config.getMirrorX();
camera.getConfig().flipVertically = config.getMirrorY();
//camera.getConfig().rotation = config.getRotate();
@@ -713,10 +762,10 @@ public class ScreenPanel extends Panel {
break;
}
camera.getConfig().rotationCrop = false;
camera.getConfig().roiX = config.getRoiEnable() ? config.getRoi().get(0) : 0;
camera.getConfig().roiY = config.getRoiEnable() ? config.getRoi().get(1) : 0;
camera.getConfig().roiWidth = config.getRoiEnable() ? config.getRoi().get(2) : -1;
camera.getConfig().roiHeight = config.getRoiEnable() ? config.getRoi().get(3) : -1;
//camera.getConfig().roiX = config.getRoiEnable() ? config.getRoi().get(0) : 0;
//camera.getConfig().roiY = config.getRoiEnable() ? config.getRoi().get(1) : 0;
//camera.getConfig().roiWidth = config.getRoiEnable() ? config.getRoi().get(2) : -1;
//camera.getConfig().roiHeight = config.getRoiEnable() ? config.getRoi().get(3) : -1;
try {
camera.getConfig().spatialCalOffsetX = config.getCalOffsetX();
camera.getConfig().spatialCalOffsetY = config.getCalOffsetY();