Startup
This commit is contained in:
@@ -188,9 +188,9 @@
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="comboCameras" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="buttonConfig" linkSize="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonArgs" linkSize="3" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="buttonSetup" linkSize="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonConfig" linkSize="3" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="buttonStop" linkSize="3" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
@@ -210,8 +210,8 @@
|
||||
<Component id="comboCameras" linkSize="2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="textState" linkSize="2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonArgs" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonConfig" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonSetup" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonStop" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
@@ -243,12 +243,12 @@
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="comboCamerasActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonSetup">
|
||||
<Component class="javax.swing.JButton" name="buttonConfig">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Setup"/>
|
||||
<Property name="text" type="java.lang.String" value="Config"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonSetupActionPerformed"/>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonConfigActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||
@@ -256,12 +256,12 @@
|
||||
<Property name="text" type="java.lang.String" value="Camera:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonConfig">
|
||||
<Component class="javax.swing.JButton" name="buttonArgs">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Config"/>
|
||||
<Property name="text" type="java.lang.String" value="Setup"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonConfigActionPerformed"/>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonArgsActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="buttonStop">
|
||||
@@ -454,31 +454,33 @@
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spinnerMax" linkSize="7" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="103" alignment="1" groupAlignment="0" attributes="0">
|
||||
<Component id="buttonAutomatic" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonFullRange" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonManual" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spinnerMin" linkSize="7" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="checkHistogram" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonTemperature" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonRainbow" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonGrayscale" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="checkHistogram" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="buttonAutomatic" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonFullRange" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonManual" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jLabel4" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="spinnerMin" linkSize="7" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerMax" linkSize="7" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="jPanel8" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@@ -487,71 +489,34 @@
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="2" attributes="0">
|
||||
<Component id="buttonAutomatic" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonGrayscale" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="2" attributes="0">
|
||||
<Component id="buttonFullRange" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonRainbow" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="2" attributes="0">
|
||||
<Component id="buttonManual" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonTemperature" alignment="2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="buttonAutomatic" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="buttonFullRange" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="buttonManual" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerMin" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerMax" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="jPanel8" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerMin" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spinnerMax" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="checkHistogram" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="checkHistogram" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JRadioButton" name="buttonGrayscale">
|
||||
<Properties>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="buttonGroup2"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Grayscale"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="onChangeColormap"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JRadioButton" name="buttonRainbow">
|
||||
<Properties>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="buttonGroup2"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Rainbow"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="onChangeColormap"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JRadioButton" name="buttonTemperature">
|
||||
<Properties>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="buttonGroup2"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Temperature"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="onChangeColormap"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JRadioButton" name="buttonFullRange">
|
||||
<Properties>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
@@ -631,6 +596,109 @@
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkHistogramActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Container class="javax.swing.JPanel" name="jPanel8">
|
||||
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="103" alignment="1" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="buttonGrayscale" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonInverted" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="20" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="buttonFlame" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="103" alignment="1" groupAlignment="0" attributes="0">
|
||||
<Component id="buttonTemperature" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="buttonRainbow" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="buttonGrayscale" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="buttonInverted" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="buttonFlame" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="buttonRainbow" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="buttonTemperature" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JRadioButton" name="buttonInverted">
|
||||
<Properties>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="buttonGroup2"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Inverted"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="onChangeColormap"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JRadioButton" name="buttonFlame">
|
||||
<Properties>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="buttonGroup2"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Flame"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="onChangeColormap"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JRadioButton" name="buttonTemperature">
|
||||
<Properties>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="buttonGroup2"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Temperature"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="onChangeColormap"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JRadioButton" name="buttonRainbow">
|
||||
<Properties>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="buttonGroup2"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Rainbow"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="onChangeColormap"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JRadioButton" name="buttonGrayscale">
|
||||
<Properties>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="buttonGroup2"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Grayscale"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="onChangeColormap"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JPanel" name="jPanel5">
|
||||
|
||||
@@ -45,6 +45,7 @@ import ch.psi.pshell.swing.ValueSelection.ValueSelectionListener;
|
||||
import ch.psi.utils.Arr;
|
||||
import ch.psi.utils.ArrayProperties;
|
||||
import ch.psi.utils.Convert;
|
||||
import ch.psi.utils.TcpClient;
|
||||
import ch.psi.utils.swing.Editor.EditorDialog;
|
||||
import ch.psi.utils.swing.MainFrame;
|
||||
import ch.psi.utils.swing.SwingUtils.OptionResult;
|
||||
@@ -58,6 +59,7 @@ import java.awt.Rectangle;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.FileInputStream;
|
||||
import java.net.ServerSocket;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
@@ -103,6 +105,8 @@ public class ScreenPanel extends Panel {
|
||||
Overlay errorOverlay;
|
||||
boolean requestCameraListUpdate;
|
||||
Integer localServerPort;
|
||||
Process privateServer;
|
||||
String serverUrl;
|
||||
|
||||
Double getCamtoolDouble(String name) {
|
||||
return (Double) Convert.toDouble(((Camtool) camera).getValue(name));
|
||||
@@ -176,16 +180,25 @@ public class ScreenPanel extends Panel {
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (App.hasArgument("priv_srv")) {
|
||||
localServerPort = 1000;
|
||||
try {
|
||||
try(ServerSocket s = new ServerSocket(0)){
|
||||
localServerPort = s.getLocalPort();
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (App.hasArgument("srv_port")) {
|
||||
localServerPort = Integer.valueOf(App.getArgumentValue("srv_port"));
|
||||
}
|
||||
|
||||
if (App.hasArgument("srv_url")) {
|
||||
serverUrl = App.getArgumentValue("srv_url");
|
||||
}
|
||||
|
||||
if (App.hasArgument("calc")) {
|
||||
useCamtoolStats = false;
|
||||
@@ -213,6 +226,7 @@ public class ScreenPanel extends Panel {
|
||||
@Override
|
||||
public void onSelectionFinished(Renderer renderer, Overlay overlay) {
|
||||
try {
|
||||
renderer.setShowReticle(false);
|
||||
Rectangle roi = overlay.isFixed() ? renderer.toImageCoord(overlay.getBounds()) : overlay.getBounds();
|
||||
if (((Camtool) camera).isRoiEnabled()) {
|
||||
int[] cur = ((Camtool) camera).getRoi();
|
||||
@@ -222,7 +236,7 @@ public class ScreenPanel extends Panel {
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
} finally {
|
||||
renderer.removeListener(this);
|
||||
renderer.removeListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,10 +255,11 @@ public class ScreenPanel extends Panel {
|
||||
renderer.abortSelection();
|
||||
if (camera instanceof Camtool) {
|
||||
try {
|
||||
renderer.setShowReticle(false);
|
||||
((Camtool) camera).resetRoi();
|
||||
} catch (IOException ex) {
|
||||
showException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -298,14 +313,64 @@ public class ScreenPanel extends Panel {
|
||||
buttonCamtool.setSelected(!direct);
|
||||
buttonDirect.setSelected(direct);
|
||||
}
|
||||
if (App.hasArgument("priv_srv")) {
|
||||
try {
|
||||
System.out.println("Starting camtool server on port: " + localServerPort);
|
||||
//Was creating sub-processes which cannot be destroyed.
|
||||
//String cmd = "cam_server";
|
||||
//cmd = "source /opt/gfa/python\n" + cmd;
|
||||
//privateServer = Runtime.getRuntime().exec(new String[]{"bash", "-c", cmd});
|
||||
String cmd = "/opt/gfa/python-3.5/2.4.1/bin/python /opt/gfa/python-3.5/latest/bin/cam_server";
|
||||
cmd = cmd + " -p " + localServerPort + " -b " + CONFIG_FOLDER;
|
||||
privateServer = Runtime.getRuntime().exec(cmd);
|
||||
//System.out.println("pid = " + Sys.getPid(privateServer));
|
||||
long start = System.currentTimeMillis();
|
||||
while (true){
|
||||
try (TcpClient c = new TcpClient("localhost", localServerPort)){
|
||||
try{
|
||||
c.connect();
|
||||
System.out.println("Connected to camtool server on port: " + localServerPort);
|
||||
break;
|
||||
} catch (Exception ex){
|
||||
}
|
||||
}
|
||||
Thread.sleep(10);
|
||||
if ((System.currentTimeMillis() - start) > 5000){
|
||||
errorOverlay = new Text(renderer.getPenErrorText(), "Error connecting to server at port " + localServerPort , new Font("Verdana", Font.PLAIN, 12), new Point(20, 20));
|
||||
renderer.addOverlay(errorOverlay);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
if (camera != null) {
|
||||
camera.close();
|
||||
camera = null;
|
||||
}
|
||||
try{
|
||||
if (camera != null) {
|
||||
camera.close();
|
||||
camera = null;
|
||||
}
|
||||
if (privateServer!=null){
|
||||
System.out.println("Closing camtool server");
|
||||
//int pid = Sys.getPid(privateServer);
|
||||
privateServer.destroyForcibly();
|
||||
//if (pid>0){
|
||||
// System.out.println("Killing pid = " + pid);
|
||||
// Runtime.getRuntime().exec("kill " + pid);
|
||||
//
|
||||
//}
|
||||
privateServer = null;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
@@ -365,7 +430,7 @@ public class ScreenPanel extends Panel {
|
||||
|
||||
DefaultComboBoxModel getCameraListFromCamtool() throws IOException, InterruptedException {
|
||||
DefaultComboBoxModel model = new DefaultComboBoxModel();
|
||||
Camtool camtool = (localServerPort != null) ? new Camtool(CAMERA_DEVICE_NAME, "localhost:"+localServerPort) : new Camtool(CAMERA_DEVICE_NAME);
|
||||
Camtool camtool = newCamtool();
|
||||
try {
|
||||
camtool.initialize();
|
||||
List<String> cameras = camtool.getCameras();
|
||||
@@ -379,6 +444,13 @@ public class ScreenPanel extends Panel {
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
Camtool newCamtool(){
|
||||
if (serverUrl!=null){
|
||||
return new Camtool(CAMERA_DEVICE_NAME, serverUrl);
|
||||
}
|
||||
return (localServerPort != null) ? new Camtool(CAMERA_DEVICE_NAME, "localhost:"+localServerPort) : new Camtool(CAMERA_DEVICE_NAME);
|
||||
}
|
||||
|
||||
boolean updatingCameraSelection;
|
||||
|
||||
@@ -414,16 +486,22 @@ public class ScreenPanel extends Panel {
|
||||
}
|
||||
}
|
||||
|
||||
final Object lockOverlays = new Object();
|
||||
|
||||
void manageFit(BufferedImage bi, Data data) {
|
||||
Overlay[] fo = ((bi == null) || (!showFit)) ? null : getFitOverlays(data);
|
||||
renderer.updateOverlays(fo, fitOv);
|
||||
fitOv = fo;
|
||||
synchronized(lockOverlays){
|
||||
renderer.updateOverlays(fo, fitOv);
|
||||
fitOv = fo;
|
||||
}
|
||||
}
|
||||
|
||||
void manageUserOverlays(BufferedImage bi, Data data) {
|
||||
Overlay[] fo = (bi == null) ? null : getUserOverlays(data);
|
||||
renderer.updateOverlays(fo, userOv);
|
||||
userOv = fo;
|
||||
synchronized(lockOverlays){
|
||||
renderer.updateOverlays(fo, userOv);
|
||||
userOv = fo;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -523,7 +601,6 @@ public class ScreenPanel extends Panel {
|
||||
|
||||
void setCamera(String cameraName) throws IOException, InterruptedException {
|
||||
System.out.println("Setting camera: " + cameraName + " [" + (buttonCamtool.isSelected() ? "camtool" : "direct") + "]");
|
||||
//renderer.removeOverlay(errorOverlay);
|
||||
parseUserOverlays();
|
||||
errorOverlay = null;
|
||||
buttonGrabBackground.setEnabled(false);
|
||||
@@ -569,9 +646,8 @@ public class ScreenPanel extends Panel {
|
||||
Path configFile = Paths.get(CONFIG_FOLDER, cameraName + ".json");
|
||||
cameraConfigJson = configFile.toFile().exists() ? new String(Files.readAllBytes(configFile)) : null;
|
||||
|
||||
if (buttonCamtool.isSelected()) {
|
||||
//camera = new Camtool(CAMTOOL_DEVICE_NAME, "gfa-lc6-64:8080");
|
||||
camera = new Camtool(CAMERA_DEVICE_NAME);
|
||||
if (buttonCamtool.isSelected()) {
|
||||
camera = newCamtool();
|
||||
camera.getConfig().flipHorizontally = false;
|
||||
camera.getConfig().flipVertically = false;
|
||||
camera.getConfig().rotation = 0.0;
|
||||
@@ -610,7 +686,7 @@ public class ScreenPanel extends Panel {
|
||||
camera.getConfig().spatialCalOffsetX = config.getCalOffsetX();
|
||||
camera.getConfig().spatialCalOffsetY = config.getCalOffsetY();
|
||||
camera.getConfig().spatialCalScaleX = -config.getScaleX();
|
||||
camera.getConfig().spatialCalScaleY = -config.getScaleY();
|
||||
camera.getConfig().spatialCalScaleY = -config.getScaleY();
|
||||
} catch (Exception ex) {
|
||||
camera.getConfig().spatialCalOffsetX = Double.NaN;
|
||||
camera.getConfig().spatialCalOffsetY = Double.NaN;
|
||||
@@ -635,26 +711,32 @@ public class ScreenPanel extends Panel {
|
||||
buttonGrabBackground.setEnabled(true);
|
||||
|
||||
((Camtool) camera).startReceiver();
|
||||
} else {
|
||||
if (camera.getConfig() instanceof PsiCamera.PsiCameraConfig){
|
||||
if (camera.getConfig().isCalibrated()){
|
||||
camera.getConfig().spatialCalOffsetX += ((PsiCamera.PsiCameraConfig)camera.getConfig()).regionStartX;
|
||||
camera.getConfig().spatialCalOffsetY += ((PsiCamera.PsiCameraConfig)camera.getConfig()).regionStartY;
|
||||
}
|
||||
}
|
||||
if (polling <= 0) {
|
||||
camera.setMonitored(true);
|
||||
} else {
|
||||
camera.setPolling(polling);
|
||||
}
|
||||
}
|
||||
|
||||
buttonReticle.setEnabled(camera.getConfig().isCalibrated());
|
||||
camera.getConfig().save();
|
||||
polling = -250;
|
||||
if (polling <= 0) {
|
||||
camera.setMonitored(true);
|
||||
} else {
|
||||
camera.setPolling(-polling);
|
||||
}
|
||||
camera.getConfig().save();
|
||||
renderer.setDevice(camera);
|
||||
renderer.setAutoScroll(true);
|
||||
renderer.setMarker(marker);
|
||||
firstImage = true;
|
||||
imageSize = null;
|
||||
|
||||
camera.addListener(new ImageListener() {
|
||||
@Override
|
||||
public void onImage(Object o, BufferedImage bi, Data data) {
|
||||
if (bi != null) {
|
||||
if (firstImage) {
|
||||
if ((imageSize== null) || imageSize.width!=bi.getWidth() || imageSize.height!=bi.getHeight()) {
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -664,7 +746,7 @@ public class ScreenPanel extends Panel {
|
||||
checkReticle();
|
||||
}
|
||||
});
|
||||
firstImage = false;
|
||||
imageSize = new Dimension (bi.getWidth(), bi.getHeight());
|
||||
}
|
||||
renderer.setProfileSize(Math.min(bi.getWidth(), bi.getHeight()));
|
||||
}
|
||||
@@ -709,6 +791,7 @@ public class ScreenPanel extends Panel {
|
||||
//checkReticle();
|
||||
onTimer();
|
||||
}
|
||||
onChangeColormap(null);
|
||||
|
||||
if (changed) {
|
||||
comboScreen.setModel(new DefaultComboBoxModel());
|
||||
@@ -757,7 +840,7 @@ public class ScreenPanel extends Panel {
|
||||
|
||||
}
|
||||
|
||||
volatile Boolean firstImage;
|
||||
volatile Dimension imageSize;
|
||||
|
||||
void checkReticle() {
|
||||
if ((renderer.getDevice() != null) && (camera != null) && (camera.getConfig().isCalibrated()) && buttonReticle.isSelected()) {
|
||||
@@ -828,6 +911,12 @@ public class ScreenPanel extends Panel {
|
||||
case Temperature:
|
||||
buttonTemperature.setSelected(true);
|
||||
break;
|
||||
case Flame:
|
||||
buttonFlame.setSelected(true);
|
||||
break;
|
||||
case Inverted:
|
||||
buttonInverted.setSelected(true);
|
||||
break;
|
||||
default:
|
||||
buttonGroup2.clearSelection();
|
||||
|
||||
@@ -892,7 +981,7 @@ public class ScreenPanel extends Panel {
|
||||
}
|
||||
|
||||
textState.setText((camera == null) ? "" : camera.getState().toString());
|
||||
buttonConfig.setEnabled(camera != null);
|
||||
buttonArgs.setEnabled(camera != null);
|
||||
if (App.hasArgument("s")) {
|
||||
try {
|
||||
((Source) getDevice("image")).initialize();
|
||||
@@ -1471,9 +1560,9 @@ public class ScreenPanel extends Panel {
|
||||
textState = new javax.swing.JTextField();
|
||||
jLabel2 = new javax.swing.JLabel();
|
||||
comboCameras = new javax.swing.JComboBox();
|
||||
buttonSetup = new javax.swing.JButton();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
buttonConfig = new javax.swing.JButton();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
buttonArgs = new javax.swing.JButton();
|
||||
buttonStop = new javax.swing.JButton();
|
||||
renderer = new ch.psi.pshell.imaging.Renderer();
|
||||
jPanel4 = new javax.swing.JPanel();
|
||||
@@ -1485,9 +1574,6 @@ public class ScreenPanel extends Panel {
|
||||
buttonZoom05 = new javax.swing.JRadioButton();
|
||||
buttonZoom2 = new javax.swing.JRadioButton();
|
||||
jPanel2 = new javax.swing.JPanel();
|
||||
buttonGrayscale = new javax.swing.JRadioButton();
|
||||
buttonRainbow = new javax.swing.JRadioButton();
|
||||
buttonTemperature = new javax.swing.JRadioButton();
|
||||
buttonFullRange = new javax.swing.JRadioButton();
|
||||
buttonManual = new javax.swing.JRadioButton();
|
||||
jLabel3 = new javax.swing.JLabel();
|
||||
@@ -1496,6 +1582,12 @@ public class ScreenPanel extends Panel {
|
||||
spinnerMax = new javax.swing.JSpinner();
|
||||
buttonAutomatic = new javax.swing.JRadioButton();
|
||||
checkHistogram = new javax.swing.JCheckBox();
|
||||
jPanel8 = new javax.swing.JPanel();
|
||||
buttonInverted = new javax.swing.JRadioButton();
|
||||
buttonFlame = new javax.swing.JRadioButton();
|
||||
buttonTemperature = new javax.swing.JRadioButton();
|
||||
buttonRainbow = new javax.swing.JRadioButton();
|
||||
buttonGrayscale = new javax.swing.JRadioButton();
|
||||
jPanel5 = new javax.swing.JPanel();
|
||||
buttonCamtool = new javax.swing.JRadioButton();
|
||||
buttonDirect = new javax.swing.JRadioButton();
|
||||
@@ -1610,19 +1702,19 @@ public class ScreenPanel extends Panel {
|
||||
}
|
||||
});
|
||||
|
||||
buttonSetup.setText("Setup");
|
||||
buttonSetup.addActionListener(new java.awt.event.ActionListener() {
|
||||
buttonConfig.setText("Config");
|
||||
buttonConfig.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonSetupActionPerformed(evt);
|
||||
buttonConfigActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
jLabel1.setText("Camera:");
|
||||
|
||||
buttonConfig.setText("Config");
|
||||
buttonConfig.addActionListener(new java.awt.event.ActionListener() {
|
||||
buttonArgs.setText("Setup");
|
||||
buttonArgs.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonConfigActionPerformed(evt);
|
||||
buttonArgsActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1641,12 +1733,12 @@ public class ScreenPanel extends Panel {
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(jLabel1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(comboCameras, 0, 178, Short.MAX_VALUE)
|
||||
.addComponent(comboCameras, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(buttonArgs)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(buttonConfig)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(buttonSetup)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(buttonStop)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(jLabel2)
|
||||
@@ -1655,7 +1747,7 @@ public class ScreenPanel extends Panel {
|
||||
.addGap(0, 0, 0))
|
||||
);
|
||||
|
||||
jPanel6Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonConfig, buttonSetup, buttonStop});
|
||||
jPanel6Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonArgs, buttonConfig, buttonStop});
|
||||
|
||||
jPanel6Layout.setVerticalGroup(
|
||||
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
@@ -1666,8 +1758,8 @@ public class ScreenPanel extends Panel {
|
||||
.addComponent(comboCameras, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel2)
|
||||
.addComponent(textState, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(buttonArgs)
|
||||
.addComponent(buttonConfig)
|
||||
.addComponent(buttonSetup)
|
||||
.addComponent(buttonStop))
|
||||
.addGap(0, 0, 0))
|
||||
);
|
||||
@@ -1784,30 +1876,6 @@ public class ScreenPanel extends Panel {
|
||||
|
||||
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Colormap"));
|
||||
|
||||
buttonGroup2.add(buttonGrayscale);
|
||||
buttonGrayscale.setText("Grayscale");
|
||||
buttonGrayscale.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
onChangeColormap(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonGroup2.add(buttonRainbow);
|
||||
buttonRainbow.setText("Rainbow");
|
||||
buttonRainbow.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
onChangeColormap(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonGroup2.add(buttonTemperature);
|
||||
buttonTemperature.setText("Temperature");
|
||||
buttonTemperature.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
onChangeColormap(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonGroup3.add(buttonFullRange);
|
||||
buttonFullRange.setText("Full range");
|
||||
buttonFullRange.addActionListener(new java.awt.event.ActionListener() {
|
||||
@@ -1861,31 +1929,106 @@ public class ScreenPanel extends Panel {
|
||||
}
|
||||
});
|
||||
|
||||
buttonGroup2.add(buttonInverted);
|
||||
buttonInverted.setText("Inverted");
|
||||
buttonInverted.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
onChangeColormap(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonGroup2.add(buttonFlame);
|
||||
buttonFlame.setText("Flame");
|
||||
buttonFlame.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
onChangeColormap(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonGroup2.add(buttonTemperature);
|
||||
buttonTemperature.setText("Temperature");
|
||||
buttonTemperature.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
onChangeColormap(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonGroup2.add(buttonRainbow);
|
||||
buttonRainbow.setText("Rainbow");
|
||||
buttonRainbow.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
onChangeColormap(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonGroup2.add(buttonGrayscale);
|
||||
buttonGrayscale.setText("Grayscale");
|
||||
buttonGrayscale.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
onChangeColormap(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
|
||||
jPanel8.setLayout(jPanel8Layout);
|
||||
jPanel8Layout.setHorizontalGroup(
|
||||
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel8Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
|
||||
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(buttonGrayscale)
|
||||
.addComponent(buttonInverted))
|
||||
.addGap(20, 20, 20))
|
||||
.addComponent(buttonFlame))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(buttonTemperature)
|
||||
.addComponent(buttonRainbow)))
|
||||
.addGap(0, 0, 0))
|
||||
);
|
||||
jPanel8Layout.setVerticalGroup(
|
||||
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel8Layout.createSequentialGroup()
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(buttonGrayscale)
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(buttonInverted)
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(buttonFlame)
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(buttonRainbow)
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(buttonTemperature)
|
||||
.addGap(0, 0, 0))
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
|
||||
jPanel2.setLayout(jPanel2Layout);
|
||||
jPanel2Layout.setHorizontalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addComponent(jLabel4)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spinnerMax, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(buttonAutomatic)
|
||||
.addComponent(buttonFullRange)
|
||||
.addComponent(buttonManual)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addComponent(jLabel3)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spinnerMin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(checkHistogram)
|
||||
.addComponent(buttonTemperature)
|
||||
.addComponent(buttonRainbow)
|
||||
.addComponent(buttonGrayscale))
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addComponent(checkHistogram)
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(buttonAutomatic)
|
||||
.addComponent(buttonFullRange)
|
||||
.addComponent(buttonManual)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel4)
|
||||
.addComponent(jLabel3))
|
||||
.addGap(2, 2, 2)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(spinnerMin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(spinnerMax, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
@@ -1894,28 +2037,25 @@ public class ScreenPanel extends Panel {
|
||||
jPanel2Layout.setVerticalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addGap(4, 4, 4)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
||||
.addComponent(buttonAutomatic)
|
||||
.addComponent(buttonGrayscale))
|
||||
.addGap(0, 0, 0)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
||||
.addComponent(buttonFullRange)
|
||||
.addComponent(buttonRainbow))
|
||||
.addGap(0, 0, 0)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
||||
.addComponent(buttonManual)
|
||||
.addComponent(buttonTemperature))
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addComponent(buttonAutomatic)
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(buttonFullRange)
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(buttonManual)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel3)
|
||||
.addComponent(spinnerMin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel4)
|
||||
.addComponent(spinnerMax, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel3)
|
||||
.addComponent(spinnerMin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel4)
|
||||
.addComponent(spinnerMax, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(checkHistogram))
|
||||
.addContainerGap())
|
||||
.addComponent(checkHistogram))
|
||||
);
|
||||
|
||||
jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Source"));
|
||||
@@ -2166,7 +2306,7 @@ public class ScreenPanel extends Panel {
|
||||
}
|
||||
}//GEN-LAST:event_comboCamerasActionPerformed
|
||||
|
||||
private void buttonConfigActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonConfigActionPerformed
|
||||
private void buttonArgsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonArgsActionPerformed
|
||||
try {
|
||||
if (camera != null) {
|
||||
TextEditor editor = new TextEditor();
|
||||
@@ -2181,9 +2321,9 @@ public class ScreenPanel extends Panel {
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
}//GEN-LAST:event_buttonConfigActionPerformed
|
||||
}//GEN-LAST:event_buttonArgsActionPerformed
|
||||
|
||||
private void buttonSetupActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSetupActionPerformed
|
||||
private void buttonConfigActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonConfigActionPerformed
|
||||
try {
|
||||
if (camera != null) {
|
||||
this.showDeviceConfigDialog(camera, false);
|
||||
@@ -2191,7 +2331,7 @@ public class ScreenPanel extends Panel {
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
}//GEN-LAST:event_buttonSetupActionPerformed
|
||||
}//GEN-LAST:event_buttonConfigActionPerformed
|
||||
|
||||
private void buttonPauseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPauseActionPerformed
|
||||
try {
|
||||
@@ -2320,18 +2460,19 @@ public class ScreenPanel extends Panel {
|
||||
ColormapSource source = (ColormapSource) camera;
|
||||
Color colorReticule = new Color(16, 16, 16);
|
||||
Color colorMarker = new Color(128, 128, 128);
|
||||
if (buttonGrayscale.isSelected()) {
|
||||
if (buttonGrayscale.isSelected() || buttonInverted.isSelected()) {
|
||||
colorReticule = new Color(0, 192, 0);
|
||||
colorMarker = new Color(64, 255, 64);
|
||||
source.getConfig().colormap = Colormap.Grayscale;
|
||||
}
|
||||
if (buttonTemperature.isSelected()) {
|
||||
source.getConfig().colormap = buttonGrayscale.isSelected() ? Colormap.Grayscale : Colormap.Inverted;
|
||||
} else if (buttonFlame.isSelected()) {
|
||||
colorReticule = new Color(0, 192, 0);
|
||||
colorMarker = new Color(64, 255, 64);
|
||||
source.getConfig().colormap = Colormap.Flame;
|
||||
} else if (buttonTemperature.isSelected()) {
|
||||
source.getConfig().colormap = Colormap.Temperature;
|
||||
}
|
||||
if (buttonRainbow.isSelected()) {
|
||||
} else if (buttonRainbow.isSelected()) {
|
||||
source.getConfig().colormap = Colormap.Rainbow;
|
||||
}
|
||||
|
||||
renderer.setPenReticle(new Pen(colorReticule));
|
||||
renderer.setPenProfile(new Pen(colorReticule, 0));
|
||||
renderer.setPenMarker(new Pen(colorMarker, 2));
|
||||
@@ -2516,11 +2657,13 @@ public class ScreenPanel extends Panel {
|
||||
}//GEN-LAST:event_buttonStopActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton buttonArgs;
|
||||
private javax.swing.JRadioButton buttonAutomatic;
|
||||
private javax.swing.JRadioButton buttonCamtool;
|
||||
private javax.swing.JButton buttonConfig;
|
||||
private javax.swing.JRadioButton buttonDirect;
|
||||
private javax.swing.JToggleButton buttonFit;
|
||||
private javax.swing.JRadioButton buttonFlame;
|
||||
private javax.swing.JRadioButton buttonFullRange;
|
||||
private javax.swing.JButton buttonGrabBackground;
|
||||
private javax.swing.JRadioButton buttonGrayscale;
|
||||
@@ -2528,13 +2671,13 @@ public class ScreenPanel extends Panel {
|
||||
private javax.swing.ButtonGroup buttonGroup2;
|
||||
private javax.swing.ButtonGroup buttonGroup3;
|
||||
private javax.swing.ButtonGroup buttonGroup4;
|
||||
private javax.swing.JRadioButton buttonInverted;
|
||||
private javax.swing.JRadioButton buttonManual;
|
||||
private javax.swing.JToggleButton buttonMarker;
|
||||
private javax.swing.JToggleButton buttonPause;
|
||||
private javax.swing.JRadioButton buttonRainbow;
|
||||
private javax.swing.JToggleButton buttonReticle;
|
||||
private javax.swing.JToggleButton buttonSave;
|
||||
private javax.swing.JButton buttonSetup;
|
||||
private javax.swing.JButton buttonStop;
|
||||
private javax.swing.JRadioButton buttonTemperature;
|
||||
private javax.swing.JRadioButton buttonZoom025;
|
||||
@@ -2560,6 +2703,7 @@ public class ScreenPanel extends Panel {
|
||||
private javax.swing.JPanel jPanel5;
|
||||
private javax.swing.JPanel jPanel6;
|
||||
private javax.swing.JPanel jPanel7;
|
||||
private javax.swing.JPanel jPanel8;
|
||||
private javax.swing.JProgressBar jProgressBar1;
|
||||
private javax.swing.JPanel panelScreen;
|
||||
private javax.swing.JPanel panelScreen1;
|
||||
|
||||
Reference in New Issue
Block a user