Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0031959230 | ||
|
|
114c800ac2 | ||
| 45cb47eb71 | |||
| 83a1ae739d | |||
|
|
795026b34e | ||
|
|
9b4179478b | ||
|
|
249e9e3855 | ||
|
|
5f19b8ac42 | ||
|
|
3141f7bcb0 | ||
|
|
2863a6a88a | ||
|
|
80c828036d | ||
|
|
41936ef6f7 | ||
|
|
31d3ceee2b | ||
|
|
2062b4ba1d | ||
|
|
c7ceebb211 | ||
|
|
ac75b13444 | ||
|
|
a838cb3e74 | ||
|
|
91871fe741 | ||
|
|
611f89bc27 | ||
|
|
0a50a512b9 | ||
|
|
518d2f1221 | ||
|
|
b2557c14b1 |
18
nb-configuration.xml
Normal file
18
nb-configuration.xml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project-shared-configuration>
|
||||||
|
<!--
|
||||||
|
This file contains additional configuration written by modules in the NetBeans IDE.
|
||||||
|
The configuration is intended to be shared among all the users of project and
|
||||||
|
therefore it is assumed to be part of version control checkout.
|
||||||
|
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
|
||||||
|
-->
|
||||||
|
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
|
||||||
|
<!--
|
||||||
|
Properties that influence various parts of the IDE, especially code formatting and the like.
|
||||||
|
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
|
||||||
|
That way multiple projects can share the same settings (useful for formatting rules for example).
|
||||||
|
Any value defined here will override the pom.xml file value but is only applicable to the current project.
|
||||||
|
-->
|
||||||
|
<org-netbeans-modules-javascript2-requirejs.enabled>true</org-netbeans-modules-javascript2-requirejs.enabled>
|
||||||
|
</properties>
|
||||||
|
</project-shared-configuration>
|
||||||
101
nbactions.xml
101
nbactions.xml
@@ -1,46 +1,55 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<actionName>run</actionName>
|
<actionName>run</actionName>
|
||||||
<packagings>
|
<packagings>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
</packagings>
|
</packagings>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>process-classes</goal>
|
<goal>process-classes</goal>
|
||||||
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
|
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<properties>
|
<properties>
|
||||||
<exec.args>-classpath %classpath ch.psi.pshell.ui.App -p=ch.psi.mxsc.MainPanel -home=C:\dev\pshell\home -r</exec.args>
|
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
|
||||||
<exec.executable>java</exec.executable>
|
<exec.executable>java</exec.executable>
|
||||||
</properties>
|
<exec.appArgs>-p ch.psi.mxsc.MainPanel -u=true -home=D:\Dev\pshell\home -r 6d</exec.appArgs>
|
||||||
</action>
|
<exec.vmArgs></exec.vmArgs>
|
||||||
<action>
|
<exec.mainClass>ch.psi.pshell.workbench.App</exec.mainClass>
|
||||||
<actionName>debug</actionName>
|
</properties>
|
||||||
<packagings>
|
</action>
|
||||||
<packaging>jar</packaging>
|
<action>
|
||||||
</packagings>
|
<actionName>debug</actionName>
|
||||||
<goals>
|
<packagings>
|
||||||
<goal>process-classes</goal>
|
<packaging>jar</packaging>
|
||||||
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
|
</packagings>
|
||||||
</goals>
|
<goals>
|
||||||
<properties>
|
<goal>process-classes</goal>
|
||||||
<exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath ch.psi.pshell.ui.App -p=ch.psi.mxsc.MainPanel -home=C:\dev\pshell\home -r</exec.args>
|
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
|
||||||
<exec.executable>java</exec.executable>
|
</goals>
|
||||||
<jpda.listen>true</jpda.listen>
|
<properties>
|
||||||
</properties>
|
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
|
||||||
</action>
|
<exec.executable>java</exec.executable>
|
||||||
<action>
|
<jpda.listen>true</jpda.listen>
|
||||||
<actionName>profile</actionName>
|
<exec.vmArgs>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</exec.vmArgs>
|
||||||
<packagings>
|
<exec.appArgs>-p ch.psi.mxsc.MainPanel -u=true -home=D:\Dev\pshell\home -r 6d</exec.appArgs>
|
||||||
<packaging>jar</packaging>
|
<exec.mainClass>ch.psi.pshell.workbench.App</exec.mainClass>
|
||||||
</packagings>
|
</properties>
|
||||||
<goals>
|
</action>
|
||||||
<goal>process-classes</goal>
|
<action>
|
||||||
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
|
<actionName>profile</actionName>
|
||||||
</goals>
|
<packagings>
|
||||||
<properties>
|
<packaging>jar</packaging>
|
||||||
<exec.args>-classpath %classpath ch.psi.pshell.ui.App -p=ch.psi.mxsc.MainPanel -home=C:\dev\pshell\home -r</exec.args>
|
</packagings>
|
||||||
<exec.executable>java</exec.executable>
|
<goals>
|
||||||
</properties>
|
<goal>process-classes</goal>
|
||||||
</action>
|
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
|
||||||
</actions>
|
</goals>
|
||||||
|
<properties>
|
||||||
|
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
|
||||||
|
<exec.executable>java</exec.executable>
|
||||||
|
<exec.appArgs>-p ch.psi.mxsc.MainPanel -u=true -home=D:\Dev\pshell\home -r 6d</exec.appArgs>
|
||||||
|
<exec.vmArgs></exec.vmArgs>
|
||||||
|
<exec.mainClass>ch.psi.pshell.workbench.App</exec.mainClass>
|
||||||
|
</properties>
|
||||||
|
</action>
|
||||||
|
</actions>
|
||||||
|
|||||||
164
pom.xml
164
pom.xml
@@ -1,80 +1,86 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>ch.psi</groupId>
|
<groupId>ch.psi</groupId>
|
||||||
<artifactId>MXSC</artifactId>
|
<artifactId>MXSC</artifactId>
|
||||||
<version>1.19.0</version>
|
<version>2.0.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>${project.groupId}</groupId>
|
<groupId>${project.groupId}</groupId>
|
||||||
<artifactId>pshell</artifactId>
|
<artifactId>pshell-workbench</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.zeromq</groupId>
|
<groupId>org.zeromq</groupId>
|
||||||
<artifactId>jeromq</artifactId>
|
<artifactId>jeromq</artifactId>
|
||||||
<version>0.5.3</version>
|
<version>0.5.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<maven.compiler.source>11</maven.compiler.source>
|
<maven.compiler.source>21</maven.compiler.source>
|
||||||
<maven.compiler.target>11</maven.compiler.target>
|
<maven.compiler.target>21</maven.compiler.target>
|
||||||
</properties>
|
</properties>
|
||||||
<repositories>
|
<repositories>
|
||||||
|
<repository>
|
||||||
<repository>
|
<id>jcenter</id>
|
||||||
<id>jcenter</id>
|
<name>jcenter</name>
|
||||||
<name>jcenter</name>
|
<url>https://jcenter.bintray.com/</url>
|
||||||
<url>https://jcenter.bintray.com/</url>
|
</repository>
|
||||||
</repository>
|
<repository>
|
||||||
<repository>
|
<id>bintray-hltools</id>
|
||||||
<id>bintray-hltools</id>
|
<name>bintray</name>
|
||||||
<name>bintray</name>
|
<url>https://dl.bintray.com/paulscherrerinstitute/hltools</url>
|
||||||
<url>https://dl.bintray.com/paulscherrerinstitute/hltools</url>
|
</repository>
|
||||||
</repository>
|
<!--
|
||||||
<repository>
|
<repository>
|
||||||
<id>imagej</id>
|
<id>imagej</id>
|
||||||
<name>imagej</name>
|
<name>imagej</name>
|
||||||
<url>http://maven.imagej.net/content/repositories/public</url>
|
<url>http://maven.imagej.net/content/repositories/public</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
-->
|
||||||
<id>libs-snapshots-local</id>
|
<repository>
|
||||||
<name>libs-snapshots-local</name>
|
<id>libs-snapshots-local</id>
|
||||||
<url>https://artifacts.psi.ch/artifactory/libs-snapshots-local/</url>
|
<name>libs-snapshots-local</name>
|
||||||
</repository>
|
<url>https://artifacts.psi.ch/artifactory/libs-snapshots-local/</url>
|
||||||
<repository>
|
</repository>
|
||||||
<id>scijava-pub</id>
|
<repository>
|
||||||
<name>scijava-pub</name>
|
<id>scijava-pub</id>
|
||||||
<url>https://maven.scijava.org/content/repositories/public/</url>
|
<name>scijava-pub</name>
|
||||||
</repository>
|
<url>https://maven.scijava.org/content/repositories/public/</url>
|
||||||
<repository>
|
</repository>
|
||||||
<id>scijava</id>
|
<repository>
|
||||||
<name>scijava</name>
|
<id>scijava</id>
|
||||||
<url>https://maven.scijava.org/</url>
|
<name>scijava</name>
|
||||||
</repository>
|
<url>https://maven.scijava.org/</url>
|
||||||
<repository>
|
</repository>
|
||||||
<id>releases</id>
|
<repository>
|
||||||
<name>releases</name>
|
<id>jetbrains</id>
|
||||||
<url>https://artifacts.psi.ch/artifactory/releases</url>
|
<name>jetbrains</name>
|
||||||
</repository>
|
<url>https://packages.jetbrains.team/maven/p/ij/intellij-dependencies/</url>
|
||||||
</repositories>
|
</repository>
|
||||||
<name>MXSC</name>
|
<repository>
|
||||||
|
<id>releases</id>
|
||||||
<build>
|
<name>releases</name>
|
||||||
<!-- To remove the version numnber from jar
|
<url>https://artifacts.psi.ch/artifactory/releases</url>
|
||||||
<finalName>${project.name}</finalName>
|
</repository>
|
||||||
-->
|
</repositories>
|
||||||
<plugins>
|
<name>MXSC</name>
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<build>
|
||||||
<artifactId>maven-jar-plugin</artifactId>
|
<!-- To remove the version numnber from jar
|
||||||
<version>2.3.1</version>
|
<finalName>${project.name}</finalName>
|
||||||
<configuration>
|
-->
|
||||||
<outputDirectory>../../config/mxsc/plugins</outputDirectory>
|
<plugins>
|
||||||
</configuration>
|
<plugin>
|
||||||
</plugin>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
</plugins>
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
</build>
|
<version>2.3.1</version>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>../pshell/home/plugins</outputDirectory>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
</project>
|
</project>
|
||||||
@@ -20,9 +20,15 @@ public class BarcodeMatcher {
|
|||||||
String one = "Astx-0023";
|
String one = "Astx-0023";
|
||||||
String two = "ASTX_0023";
|
String two = "ASTX_0023";
|
||||||
String three = "Astx-0032";
|
String three = "Astx-0032";
|
||||||
|
String four = "Astx0032";
|
||||||
|
String five = "E-07";
|
||||||
|
String six = "E07";
|
||||||
|
|
||||||
System.out.println("one == two: " + matchBarcodes(one, two));
|
System.out.println("one == two: " + matchBarcodes(one, two));
|
||||||
System.out.println("one == three: " + matchBarcodes(one, three));
|
System.out.println("one == three: " + matchBarcodes(one, three));
|
||||||
System.out.println("two == three: " + matchBarcodes(two, three));
|
System.out.println("two == three: " + matchBarcodes(two, three));
|
||||||
|
System.out.println("three == four: " + matchBarcodes(three, four));
|
||||||
|
System.out.println("five == six: " + matchBarcodes(six, five));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ public class BasePlate extends DeviceBase {
|
|||||||
final static PointDouble[] pucksPosition =
|
final static PointDouble[] pucksPosition =
|
||||||
(MainPanel.BASE_PLATE_LAYOUT == BasePlateLayout.normal) ? pucksPositionNormal :
|
(MainPanel.BASE_PLATE_LAYOUT == BasePlateLayout.normal) ? pucksPositionNormal :
|
||||||
( (MainPanel.BASE_PLATE_LAYOUT == BasePlateLayout.sf) ? pucksPositionSf :
|
( (MainPanel.BASE_PLATE_LAYOUT == BasePlateLayout.sf) ? pucksPositionSf :
|
||||||
((MainPanel.BASE_PLATE_LAYOUT == BasePlateLayout.rt) ? pucksPositionRt : pucksPosition6s)
|
((MainPanel.BASE_PLATE_LAYOUT == BasePlateLayout.rt) ? pucksPositionRt : pucksPositionNormal)
|
||||||
);
|
);
|
||||||
|
|
||||||
final static int numberOfPucks = pucksPosition.length;
|
final static int numberOfPucks = pucksPosition.length;
|
||||||
@@ -166,11 +166,6 @@ public class BasePlate extends DeviceBase {
|
|||||||
new Puck(this, i);
|
new Puck(this, i);
|
||||||
}
|
}
|
||||||
getPucks()[0].setSelected(true);
|
getPucks()[0].setSelected(true);
|
||||||
if (MainPanel.BASE_PLATE_LAYOUT == BasePlateLayout.x06da){
|
|
||||||
for (int i = 20; i< 30; i++){
|
|
||||||
getPucks()[i].setEnabled(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -286,7 +281,7 @@ public class BasePlate extends DeviceBase {
|
|||||||
public void clearId(String id) {
|
public void clearId(String id) {
|
||||||
for (Device d : getChildren()) {
|
for (Device d : getChildren()) {
|
||||||
if (d instanceof Puck) {
|
if (d instanceof Puck) {
|
||||||
if ((id == null) || id.equals(((Puck) d).getId())) {
|
if ((id == null) || Puck.isSameId(id, ((Puck) d).getId())) {
|
||||||
((Puck) d).setId(null);
|
((Puck) d).setId(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
package ch.psi.mxsc;
|
package ch.psi.mxsc;
|
||||||
|
|
||||||
|
import ch.psi.pshell.app.MainFrame;
|
||||||
import ch.psi.pshell.imaging.Utils;
|
import ch.psi.pshell.imaging.Utils;
|
||||||
import ch.psi.utils.swing.MainFrame;
|
import java.awt.BasicStroke;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
|
import java.awt.Stroke;
|
||||||
import java.awt.geom.Ellipse2D;
|
import java.awt.geom.Ellipse2D;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -60,6 +62,17 @@ public class BasePlateGraphics {
|
|||||||
top,
|
top,
|
||||||
bottom
|
bottom
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rectangle imageRoi;
|
||||||
|
|
||||||
|
public void setImageRoi( Rectangle roi){
|
||||||
|
this.imageRoi = roi;
|
||||||
|
}
|
||||||
|
|
||||||
|
Point detection;
|
||||||
|
public void setDetection( Point detection){
|
||||||
|
this.detection = detection;
|
||||||
|
}
|
||||||
|
|
||||||
void draw(Graphics2D g, Rectangle plotRect, boolean drawSamples, boolean drawIds, boolean drawContour, DrawMode mode, BufferedImage img) {
|
void draw(Graphics2D g, Rectangle plotRect, boolean drawSamples, boolean drawIds, boolean drawContour, DrawMode mode, BufferedImage img) {
|
||||||
if (mode != DrawMode.fill){
|
if (mode != DrawMode.fill){
|
||||||
@@ -85,7 +98,19 @@ public class BasePlateGraphics {
|
|||||||
this.plotRect = plotRect;
|
this.plotRect = plotRect;
|
||||||
this.drawContour = drawContour;
|
this.drawContour = drawContour;
|
||||||
boundingBox = new Rectangle((int)(plotRect.x+plotRect.width*0.05), (int)(plotRect.y+plotRect.height * 0.05), (int)(plotRect.width*0.90), (int)(plotRect.height*0.90));
|
boundingBox = new Rectangle((int)(plotRect.x+plotRect.width*0.05), (int)(plotRect.y+plotRect.height * 0.05), (int)(plotRect.width*0.90), (int)(plotRect.height*0.90));
|
||||||
|
int center_x=0, center_y=0;
|
||||||
if (img!=null){
|
if (img!=null){
|
||||||
|
Point detection = this.detection;
|
||||||
|
if (imageRoi!=null){
|
||||||
|
img = img.getSubimage(imageRoi.x, imageRoi.y, imageRoi.width, imageRoi.height);
|
||||||
|
if (detection!=null){
|
||||||
|
//detection = new Point(detection.x-imageRoi.x, detection.y-imageRoi.y);
|
||||||
|
center_x = detection.x * boundingBox.width / img.getWidth() + boundingBox.x;
|
||||||
|
center_y = detection.y * boundingBox.height / img.getHeight() + boundingBox.y;
|
||||||
|
center_x -= imageRoi.x * boundingBox.width / img.getWidth();
|
||||||
|
center_y -= imageRoi.y * boundingBox.height / img.getHeight();
|
||||||
|
}
|
||||||
|
}
|
||||||
img = Utils.stretch(img, boundingBox.width, boundingBox.height);
|
img = Utils.stretch(img, boundingBox.width, boundingBox.height);
|
||||||
g.setClip(new Ellipse2D.Float(boundingBox.x, boundingBox.y, boundingBox.width, boundingBox.height));
|
g.setClip(new Ellipse2D.Float(boundingBox.x, boundingBox.y, boundingBox.width, boundingBox.height));
|
||||||
g.drawImage(img, boundingBox.x, boundingBox.y, null);
|
g.drawImage(img, boundingBox.x, boundingBox.y, null);
|
||||||
@@ -104,6 +129,16 @@ public class BasePlateGraphics {
|
|||||||
for (PuckGraphics pg : puckGraphics) {
|
for (PuckGraphics pg : puckGraphics) {
|
||||||
pg.draw(g, null, drawSamples, drawIds, drawBackground) ;
|
pg.draw(g, null, drawSamples, drawIds, drawBackground) ;
|
||||||
}
|
}
|
||||||
|
if (img!=null){
|
||||||
|
if (detection!=null){
|
||||||
|
int size=25;
|
||||||
|
g.setColor(new Color(86, 193, 255));
|
||||||
|
g.setStroke(new BasicStroke(2f));
|
||||||
|
g.drawLine(center_x-size, center_y, center_x+size, center_y);
|
||||||
|
g.drawLine(center_x, center_y-size, center_x, center_y+size);
|
||||||
|
//g.drawOval(center_x-size, center_y-size, 2*size, 2*size);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import ch.psi.pshell.imaging.Data;
|
|||||||
import ch.psi.pshell.imaging.ImageListener;
|
import ch.psi.pshell.imaging.ImageListener;
|
||||||
import ch.psi.pshell.imaging.Source;
|
import ch.psi.pshell.imaging.Source;
|
||||||
import ch.psi.pshell.swing.DevicePanel;
|
import ch.psi.pshell.swing.DevicePanel;
|
||||||
import ch.psi.utils.State;
|
import ch.psi.pshell.utils.State;
|
||||||
import ch.psi.utils.swing.SwingUtils;
|
import ch.psi.pshell.swing.SwingUtils;
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Graphics;
|
import java.awt.Graphics;
|
||||||
@@ -225,7 +225,7 @@ public class BasePlatePanel extends DevicePanel {
|
|||||||
ImageListener imageListener = new ImageListener() {
|
ImageListener imageListener = new ImageListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onImage(Object origin, BufferedImage image, Data data) {
|
public void onImage(Object origin, BufferedImage image, Data data) {
|
||||||
img = image;
|
img = (source == null )? null : image;
|
||||||
repaint();
|
repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,14 +235,16 @@ public class BasePlatePanel extends DevicePanel {
|
|||||||
repaint();
|
repaint();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
void setCameraView(Source source){
|
void setCameraView(Source source){
|
||||||
img = null;
|
|
||||||
if (this.source!=null){
|
if (this.source!=null){
|
||||||
this.source.removeListener(imageListener);
|
this.source.removeListener(imageListener);
|
||||||
}
|
}
|
||||||
this.source = source;
|
this.source = source;
|
||||||
if (source!=null){
|
if (source!=null){
|
||||||
source.addListener(imageListener);
|
source.addListener(imageListener);
|
||||||
|
img = source.getOutput();
|
||||||
|
} else {
|
||||||
|
img = null;
|
||||||
}
|
}
|
||||||
repaint();
|
repaint();
|
||||||
}
|
}
|
||||||
@@ -434,6 +436,18 @@ public class BasePlatePanel extends DevicePanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void pointPuck(Puck puck){
|
||||||
|
if (puck != null){
|
||||||
|
puck.setPointed(true);
|
||||||
|
} else {
|
||||||
|
for (Puck p : getDevice().getPucks()) {
|
||||||
|
p.setPointed(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
repaint();
|
||||||
|
}
|
||||||
|
|
||||||
void onPuckPressed(MouseEvent e, Puck puck){
|
void onPuckPressed(MouseEvent e, Puck puck){
|
||||||
if (getSelectionMode()!=SelectionMode.None){
|
if (getSelectionMode()!=SelectionMode.None){
|
||||||
if (TOGGLE_SELECTION){
|
if (TOGGLE_SELECTION){
|
||||||
|
|||||||
@@ -3,28 +3,32 @@
|
|||||||
*/
|
*/
|
||||||
package ch.psi.mxsc;
|
package ch.psi.mxsc;
|
||||||
|
|
||||||
|
import ch.psi.mxsc.Puck.Detection;
|
||||||
import ch.psi.mxsc.Puck.PuckType;
|
import ch.psi.mxsc.Puck.PuckType;
|
||||||
import ch.psi.pshell.core.CommandInfo;
|
import ch.psi.pshell.sequencer.CommandInfo;
|
||||||
import ch.psi.pshell.core.Context;
|
import ch.psi.pshell.framework.Context;
|
||||||
import ch.psi.pshell.core.DevicePool;
|
import ch.psi.pshell.devices.DevicePool;
|
||||||
import ch.psi.pshell.core.DevicePoolListener;
|
import ch.psi.pshell.devices.DevicePoolListener;
|
||||||
import ch.psi.pshell.core.JsonSerializer;
|
import ch.psi.pshell.utils.EncoderJson;
|
||||||
import ch.psi.pshell.device.Device;
|
import ch.psi.pshell.device.Device;
|
||||||
import ch.psi.pshell.device.DeviceAdapter;
|
|
||||||
import ch.psi.pshell.device.DeviceListener;
|
import ch.psi.pshell.device.DeviceListener;
|
||||||
import ch.psi.pshell.device.GenericDevice;
|
import ch.psi.pshell.device.GenericDevice;
|
||||||
import ch.psi.pshell.device.ReadbackDevice;
|
import ch.psi.pshell.app.App;
|
||||||
import ch.psi.pshell.ui.App;
|
import ch.psi.pshell.framework.Panel;
|
||||||
import ch.psi.pshell.ui.Panel;
|
import ch.psi.pshell.framework.Setup;
|
||||||
import ch.psi.utils.Arr;
|
import ch.psi.pshell.sequencer.Sequencer;
|
||||||
import ch.psi.utils.Audio;
|
import ch.psi.pshell.utils.Arr;
|
||||||
import ch.psi.utils.Chrono;
|
import ch.psi.pshell.utils.Audio;
|
||||||
import ch.psi.utils.State;
|
import ch.psi.pshell.utils.Chrono;
|
||||||
import ch.psi.utils.swing.SwingUtils;
|
import ch.psi.pshell.utils.State;
|
||||||
|
import ch.psi.pshell.swing.SwingUtils;
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
|
import java.awt.event.WindowAdapter;
|
||||||
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Random;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
@@ -56,10 +60,9 @@ public class Controller {
|
|||||||
final BasePlate basePlate;
|
final BasePlate basePlate;
|
||||||
RoomTemperatureBasePlate roomTemperatureBasePlate;
|
RoomTemperatureBasePlate roomTemperatureBasePlate;
|
||||||
static /*Panel*/ MainPanel mainFrame;
|
static /*Panel*/ MainPanel mainFrame;
|
||||||
Device hexiposi;
|
|
||||||
Device barcode_reader;
|
Device barcode_reader;
|
||||||
Device barcode_reader_puck;
|
Device barcode_reader_puck;
|
||||||
Device puck_detection;
|
PuckDetection puck_detection;
|
||||||
JDialog dialogAskPuckDatamatrix;
|
JDialog dialogAskPuckDatamatrix;
|
||||||
String currentMountedSample;
|
String currentMountedSample;
|
||||||
PuckLoadingDialog dialogPuckLoading;
|
PuckLoadingDialog dialogPuckLoading;
|
||||||
@@ -74,7 +77,7 @@ public class Controller {
|
|||||||
|
|
||||||
static void createInstance(Panel mainFrame) {
|
static void createInstance(Panel mainFrame) {
|
||||||
Controller.mainFrame = (MainPanel) mainFrame;
|
Controller.mainFrame = (MainPanel) mainFrame;
|
||||||
System.setProperty(GenericDevice.PROPERTY_CONFIG_PATH, Context.getInstance().getSetup().getDevicesPath());
|
//### System.setProperty(GenericDevice.PROPERTY_CONFIG_PATH, Setup.getDevicesPath());
|
||||||
if (isRt()){
|
if (isRt()){
|
||||||
instance = new ControllerRT(mainFrame);
|
instance = new ControllerRT(mainFrame);
|
||||||
} else {
|
} else {
|
||||||
@@ -87,7 +90,7 @@ public class Controller {
|
|||||||
Dialog
|
Dialog
|
||||||
}
|
}
|
||||||
|
|
||||||
final PuckMountMode puckMountMode = App.hasArgument("direct") ? PuckMountMode.Direct : PuckMountMode.Dialog;
|
final PuckMountMode puckMountMode = App.hasAdditionalArgument("direct") ? PuckMountMode.Direct : PuckMountMode.Dialog;
|
||||||
|
|
||||||
enum PuckSensorAccess {
|
enum PuckSensorAccess {
|
||||||
RaspberryPi,
|
RaspberryPi,
|
||||||
@@ -137,7 +140,7 @@ public class Controller {
|
|||||||
puckState = new PuckState[NUMBER_OF_PUCKS];
|
puckState = new PuckState[NUMBER_OF_PUCKS];
|
||||||
for (int i = 0; i < NUMBER_OF_PUCKS; i++) {
|
for (int i = 0; i < NUMBER_OF_PUCKS; i++) {
|
||||||
puckState[i] = new PuckState(i + 1);
|
puckState[i] = new PuckState(i + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Controller(Panel mainFrame) {
|
private Controller(Panel mainFrame) {
|
||||||
@@ -146,11 +149,10 @@ public class Controller {
|
|||||||
clearPuckStates();
|
clearPuckStates();
|
||||||
|
|
||||||
basePlate.addListener(basePlateListener);
|
basePlate.addListener(basePlateListener);
|
||||||
roomTemperatureBasePlate = new RoomTemperatureBasePlate();
|
roomTemperatureBasePlate = new RoomTemperatureBasePlate();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final DeviceListener basePlateListener = new DeviceAdapter() {
|
final DeviceListener basePlateListener = new DeviceListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onValueChanged(Device device, Object value, Object former) {
|
public void onValueChanged(Device device, Object value, Object former) {
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
@@ -205,7 +207,7 @@ public class Controller {
|
|||||||
basePlate.addListener(basePlateListener);
|
basePlate.addListener(basePlateListener);
|
||||||
|
|
||||||
if (puckSensorAccess == PuckSensorAccess.Esera) {
|
if (puckSensorAccess == PuckSensorAccess.Esera) {
|
||||||
getMainFrame().getContext().getDevicePool().addListener(new DevicePoolListener() {
|
Context.getDevicePool().addListener(new DevicePoolListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onDeviceAdded(GenericDevice dev) {
|
public void onDeviceAdded(GenericDevice dev) {
|
||||||
if (dev.getName().equals(PUCK_ESERA_DEVICE)) {
|
if (dev.getName().equals(PUCK_ESERA_DEVICE)) {
|
||||||
@@ -239,16 +241,15 @@ public class Controller {
|
|||||||
@Override
|
@Override
|
||||||
public void onDeviceRemoved(GenericDevice dev) {
|
public void onDeviceRemoved(GenericDevice dev) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
updateDevices();
|
updateDevices();
|
||||||
updatePuckTypes();
|
updatePuckTypes();
|
||||||
clearSamplesTable();
|
clearSamplesTable();
|
||||||
refreshSamplesTable();
|
refreshSamplesTable();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Sample getMountedSample() throws Exception{
|
public Sample getMountedSample() throws Exception{
|
||||||
String mountedSample = (String) Context.getInstance().evalLineBackground("get_setting('mounted_sample_position')");
|
String mountedSample = (String) Context.getSequencer().evalLineBackground("get_setting('mounted_sample_position')");
|
||||||
checkMountedSampleChange(currentMountedSample, mountedSample);
|
checkMountedSampleChange(currentMountedSample, mountedSample);
|
||||||
currentMountedSample = mountedSample;
|
currentMountedSample = mountedSample;
|
||||||
Sample sample = basePlate.getSampleByName(currentMountedSample);
|
Sample sample = basePlate.getSampleByName(currentMountedSample);
|
||||||
@@ -256,9 +257,9 @@ public class Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void resetMountedSample() throws Exception{
|
public void resetMountedSample() throws Exception{
|
||||||
String mountedSample = (String) Context.getInstance().evalLineBackground("get_setting('mounted_sample_position')");
|
String mountedSample = (String) Context.getSequencer().evalLineBackground("get_setting('mounted_sample_position')");
|
||||||
checkMountedSampleChange(currentMountedSample, null);
|
checkMountedSampleChange(currentMountedSample, null);
|
||||||
Context.getInstance().evalLineBackground("set_setting('mounted_sample_position', None)");
|
Context.getSequencer().evalLineBackground("set_setting('mounted_sample_position', None)");
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkMountedSampleChange(String former, String current){
|
void checkMountedSampleChange(String former, String current){
|
||||||
@@ -293,9 +294,8 @@ public class Controller {
|
|||||||
|
|
||||||
void onTimer() {
|
void onTimer() {
|
||||||
try {
|
try {
|
||||||
setPuckLoading(getPuckLoading());
|
//setPuckLoading(null);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
setPuckLoading(false);
|
|
||||||
Logger.getLogger(Controller.class.getName()).log(Level.WARNING, null, ex);
|
Logger.getLogger(Controller.class.getName()).log(Level.WARNING, null, ex);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@@ -305,14 +305,8 @@ public class Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final DeviceListener hexiposiListener = new DeviceAdapter() {
|
|
||||||
@Override
|
|
||||||
public void onValueChanged(Device device, Object value, Object former) {
|
|
||||||
updateView();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
final DeviceListener barcodeReaderListener = new DeviceAdapter() {
|
final DeviceListener barcodeReaderListener = new DeviceListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onValueChanged(Device device, Object value, Object former) {
|
public void onValueChanged(Device device, Object value, Object former) {
|
||||||
if (value != null) { //Keep last value
|
if (value != null) { //Keep last value
|
||||||
@@ -326,7 +320,7 @@ public class Controller {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
final DeviceListener barcodeReaderPuckListener = new DeviceAdapter() {
|
final DeviceListener barcodeReaderPuckListener = new DeviceListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onValueChanged(Device device, Object value, Object former) {
|
public void onValueChanged(Device device, Object value, Object former) {
|
||||||
if (value != null) { //Keep last value
|
if (value != null) { //Keep last value
|
||||||
@@ -336,32 +330,18 @@ public class Controller {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
final DeviceListener puckDetectionListener = new DeviceAdapter() {
|
final DeviceListener puckDetectionListener = new DeviceListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onValueChanged(Device device, Object value, Object former) {
|
public void onValueChanged(Device device, Object value, Object former) {
|
||||||
if (value != null) { //Keep last value
|
if (puck_detection.isEnabled()){
|
||||||
onPuckDetectionChanged();
|
if (value != null) { //Keep last value
|
||||||
|
onPuckDetectionChanged();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void updateDevices() {
|
void updateDevices() {
|
||||||
if (hexiposi != null) {
|
|
||||||
hexiposi.removeListener(hexiposiListener);
|
|
||||||
}
|
|
||||||
if (barcode_reader != null) {
|
|
||||||
hexiposi.removeListener(barcodeReaderListener);
|
|
||||||
}
|
|
||||||
if (puck_detection != null) {
|
|
||||||
hexiposi.removeListener(puckDetectionListener);
|
|
||||||
}
|
|
||||||
hexiposi = (Device) getMainFrame().getDevice("hexiposi");
|
|
||||||
if (hexiposi != null) {
|
|
||||||
hexiposi.addListener(hexiposiListener);
|
|
||||||
} else {
|
|
||||||
Logger.getLogger(Controller.class.getName()).log(Level.SEVERE, "No hexiposi detected.");
|
|
||||||
}
|
|
||||||
mainFrame.hexiposiPanel.setDevice(hexiposi);
|
|
||||||
barcode_reader = (Device) getDevice("barcode_reader");
|
barcode_reader = (Device) getDevice("barcode_reader");
|
||||||
if (barcode_reader != null) {
|
if (barcode_reader != null) {
|
||||||
barcode_reader.addListener(barcodeReaderListener);
|
barcode_reader.addListener(barcodeReaderListener);
|
||||||
@@ -374,12 +354,13 @@ public class Controller {
|
|||||||
} else {
|
} else {
|
||||||
Logger.getLogger(Controller.class.getName()).log(Level.SEVERE, "No barcode_reader_puck detected.");
|
Logger.getLogger(Controller.class.getName()).log(Level.SEVERE, "No barcode_reader_puck detected.");
|
||||||
}
|
}
|
||||||
puck_detection = (Device) getDevice("puck_detection");
|
puck_detection = (PuckDetection) getDevice("puck_detection");
|
||||||
if (puck_detection != null) {
|
if (puck_detection != null) {
|
||||||
puck_detection.addListener(puckDetectionListener);
|
puck_detection.addListener(puckDetectionListener);
|
||||||
} else {
|
} else {
|
||||||
Logger.getLogger(Controller.class.getName()).log(Level.SEVERE, "No puck_detection detected.");
|
Logger.getLogger(Controller.class.getName()).log(Level.SEVERE, "No puck_detection detected.");
|
||||||
}
|
}
|
||||||
|
checkPuckDetectionEnabling();
|
||||||
}
|
}
|
||||||
|
|
||||||
PuckState[] puckState;
|
PuckState[] puckState;
|
||||||
@@ -428,44 +409,78 @@ public class Controller {
|
|||||||
}
|
}
|
||||||
updateView();
|
updateView();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getHexiposiPosition() {
|
|
||||||
try {
|
|
||||||
return (String) ((ReadbackDevice) hexiposi).getReadback().take();
|
|
||||||
} catch (Exception ex) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSelectedPuck(Puck puck) {
|
|
||||||
return ("" + puck.getSegment()).equalsIgnoreCase(getHexiposiPosition());
|
public List<Puck> getFreePucks() {
|
||||||
}
|
|
||||||
|
|
||||||
public List<Puck> getSelectedPucks() {
|
|
||||||
List<Puck> ret = new ArrayList<>();
|
List<Puck> ret = new ArrayList<>();
|
||||||
for (int i = 0; i < NUMBER_OF_PUCKS; i++) {
|
for (Puck p : basePlate.getPucks()) {
|
||||||
if (isSelectedPuck(basePlate.getPucks()[i])) {
|
if (!p.isDisabled() && (p.getDetection() == Detection.Empty )) {
|
||||||
ret.add(basePlate.getPucks()[i]);
|
ret.add(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Puck getFreePuck(){
|
||||||
|
List<Puck> pucks = getFreePucks();
|
||||||
|
if (pucks.isEmpty()){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Random random = new Random();
|
||||||
|
return pucks.get(random.nextInt(pucks.size()));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public Boolean isLedRoomTemp() {
|
public Boolean isLedRoomTemp() {
|
||||||
try {
|
try {
|
||||||
return getMainFrame().eval("is_led_room_temp()", true).equals(true);
|
if (getMainFrame().getState().isInitialized()){
|
||||||
} catch (Exception ex) {
|
return getMainFrame().eval("is_led_room_temp()", true).equals(true);
|
||||||
return null;
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean isRoomTemp() {
|
public Boolean isRoomTemp() {
|
||||||
try {
|
try {
|
||||||
return getMainFrame().eval("is_room_temp()", true).equals(true);
|
if (getMainFrame().getState().isInitialized()){
|
||||||
|
return getMainFrame().eval("is_room_temp()", true).equals(true);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean isServiceMode() {
|
||||||
|
try {
|
||||||
|
if (getMainFrame().getState().isInitialized()){
|
||||||
|
return getMainFrame().eval("is_service_mode()", true).equals(true);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Boolean isDoorClosed() {
|
||||||
|
try {
|
||||||
|
if (getMainFrame().getState().isInitialized()){
|
||||||
|
return getMainFrame().eval("is_door_closed()", true).equals(true);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setServiceMode(boolean value){
|
||||||
|
try{
|
||||||
|
String state = value ? "True" : "False";
|
||||||
|
getMainFrame().evalAsync("set_service_mode(" + state + ")");
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
return null;
|
Logger.getLogger(Controller.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Boolean isBarcodeReaderScanPucks() {
|
public Boolean isBarcodeReaderScanPucks() {
|
||||||
try {
|
try {
|
||||||
@@ -483,14 +498,6 @@ public class Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean getPuckLoading() {
|
|
||||||
try {
|
|
||||||
return getMainFrame().eval("is_puck_loading()", true).equals(true);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getWorkingMode() {
|
public String getWorkingMode() {
|
||||||
try {
|
try {
|
||||||
return String.valueOf(getMainFrame().eval("robot.working_mode", true));
|
return String.valueOf(getMainFrame().eval("robot.working_mode", true));
|
||||||
@@ -531,11 +538,11 @@ public class Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void imageDetectPucks() throws Context.ContextStateException {
|
public void imageDetectPucks() throws Sequencer.StateException {
|
||||||
imageDetectPucks(null, null, null);
|
imageDetectPucks(null, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void imageDetectPucks(JComponent plot, JComponent renderer, JComponent text) throws Context.ContextStateException {
|
public void imageDetectPucks(JComponent plot, JComponent renderer, JComponent text) throws Sequencer.StateException {
|
||||||
Map args = new HashMap();
|
Map args = new HashMap();
|
||||||
args.put("PLOT", plot);
|
args.put("PLOT", plot);
|
||||||
args.put("RENDERER", renderer);
|
args.put("RENDERER", renderer);
|
||||||
@@ -552,7 +559,7 @@ public class Controller {
|
|||||||
updateView();
|
updateView();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearImageDetection() throws Context.ContextStateException, ScriptException, IOException, InterruptedException {
|
public void clearImageDetection() throws Sequencer.StateException, ScriptException, IOException, InterruptedException {
|
||||||
Map<String, List<String>> map = (Map<String, List<String>>) getMainFrame().eval("clear_detection(None)");
|
Map<String, List<String>> map = (Map<String, List<String>>) getMainFrame().eval("clear_detection(None)");
|
||||||
setImageDetection(map);
|
setImageDetection(map);
|
||||||
}
|
}
|
||||||
@@ -627,11 +634,7 @@ public class Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DevicePool getDevicePool() {
|
DevicePool getDevicePool() {
|
||||||
return getMainFrame().getContext().getDevicePool();
|
return Context.getDevicePool();
|
||||||
}
|
|
||||||
|
|
||||||
Context getContext() {
|
|
||||||
return getMainFrame().getContext();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
State getState() {
|
State getState() {
|
||||||
@@ -662,13 +665,13 @@ public class Controller {
|
|||||||
//synchronized(samplesTableLock){
|
//synchronized(samplesTableLock){
|
||||||
SwingUtilities.invokeLater(() -> {
|
SwingUtilities.invokeLater(() -> {
|
||||||
try {
|
try {
|
||||||
if (Context.getInstance().getState().isInitialized()) {
|
if (Context.getSequencer().getState().isInitialized()) {
|
||||||
String json = (String) Context.getInstance().evalLineBackground("get_samples_info()");
|
String json = (String) Context.getSequencer().evalLineBackground("get_samples_info()");
|
||||||
if (!json.equals(samplesTableJson)) {
|
if (!json.equals(samplesTableJson)) {
|
||||||
samplesTableJson = json;
|
samplesTableJson = json;
|
||||||
|
|
||||||
//SamplesInfo sampleInfo = (SamplesInfo) JsonSerializer.decode(json, SampleInfo.class);
|
//SamplesInfo sampleInfo = (SamplesInfo) EncoderJson.decode(json, SampleInfo.class);
|
||||||
SampleInfo[] samples = (SampleInfo[]) JsonSerializer.decode(json, SampleInfo[].class);
|
SampleInfo[] samples = (SampleInfo[]) EncoderJson.decode(json, SampleInfo[].class);
|
||||||
|
|
||||||
Object[][] sampleData = new Object[samples.length][];
|
Object[][] sampleData = new Object[samples.length][];
|
||||||
for (int i = 0; i < samples.length; i++) {
|
for (int i = 0; i < samples.length; i++) {
|
||||||
@@ -691,19 +694,32 @@ public class Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////// Puck Loading /////////////////////////////////
|
////////////////////// Puck Loading /////////////////////////////////
|
||||||
Boolean puckLoading;
|
boolean puckLoading;
|
||||||
Puck.Detection[] currentDetection;
|
Puck.Detection[] currentDetection;
|
||||||
boolean puckReaderOk = true;
|
boolean puckReaderOk = true;
|
||||||
|
String insertedPuckDatamatrix;
|
||||||
|
Puck removedPuck;
|
||||||
|
|
||||||
void setPuckLoading(Boolean value) {
|
//true->load
|
||||||
if (value == null) {
|
//false->unload
|
||||||
value = false;
|
//null->finish transfer mode
|
||||||
}
|
void setPuckLoading(boolean load) {
|
||||||
if (value != puckLoading) {
|
if (load != puckLoading) {
|
||||||
|
if (load){
|
||||||
|
if (isDoorClosed()){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
insertedPuckDatamatrix = null;
|
||||||
|
removedPuck = null;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
setLaserPos((Puck)null);
|
||||||
|
}
|
||||||
if ((dialogAskPuckDatamatrix != null) && (dialogAskPuckDatamatrix.isShowing())) {
|
if ((dialogAskPuckDatamatrix != null) && (dialogAskPuckDatamatrix.isShowing())) {
|
||||||
dialogAskPuckDatamatrix.setVisible(false);
|
dialogAskPuckDatamatrix.setVisible(false);
|
||||||
}
|
}
|
||||||
puckLoading = value;
|
hideDialogPuckLoading();
|
||||||
|
puckLoading = load;
|
||||||
onPuckScanned(null);
|
onPuckScanned(null);
|
||||||
Device reader = getPuckBarcodeReader();
|
Device reader = getPuckBarcodeReader();
|
||||||
if (reader != null) {
|
if (reader != null) {
|
||||||
@@ -713,7 +729,7 @@ public class Controller {
|
|||||||
if (puckReaderOk) {
|
if (puckReaderOk) {
|
||||||
Logger.getLogger(Controller.class.getName()).warning("Communication failure: " + name);
|
Logger.getLogger(Controller.class.getName()).warning("Communication failure: " + name);
|
||||||
}
|
}
|
||||||
puckLoading = null;
|
puckLoading = false;
|
||||||
puckReaderOk = false;
|
puckReaderOk = false;
|
||||||
} else {
|
} else {
|
||||||
if (!puckReaderOk) {
|
if (!puckReaderOk) {
|
||||||
@@ -741,15 +757,42 @@ public class Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPuckLoading() {
|
public boolean isPuckLoading() {
|
||||||
if (puckLoading == null) {
|
try {
|
||||||
return false;
|
if (isPuckDetectionLoading()){
|
||||||
|
if (!puck_detection.isEnabled()){
|
||||||
|
//Does not process load events if checking missing pucks before re-enabling detection
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (IOException ex) {
|
||||||
|
Logger.getLogger(Controller.class.getName()).log(Level.WARNING, null, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
return puckLoading;
|
return puckLoading;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setLaserPos(String pos){
|
||||||
|
try {
|
||||||
|
getMainFrame().evalAsync("set_laser_pos(" + ((pos==null) ? "" : ("'" + pos + "'") ) + ")" ,true);
|
||||||
|
getMainFrame().basePlatePanel.pointPuck((pos==null) ? null : basePlate.getPuckByName(pos));
|
||||||
|
} catch (Sequencer.StateException ex) {
|
||||||
|
Logger.getLogger(Controller.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setLaserPos(Puck puck){
|
||||||
|
if (puck==null){
|
||||||
|
setLaserPos((String)null);
|
||||||
|
} else {
|
||||||
|
setLaserPos(puck.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void playSound(String name) {
|
void playSound(String name) {
|
||||||
try {
|
try {
|
||||||
Audio.playFile(new File(Context.getInstance().getSetup().expandPath("{home}/sounds/" + name + ".wav")), false);
|
Audio.playFile(new File(Setup.expandPath("{home}/sounds/" + name + ".wav")), false);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Logger.getLogger(Controller.class.getName()).log(Level.FINE, null, ex);
|
Logger.getLogger(Controller.class.getName()).log(Level.FINE, null, ex);
|
||||||
}
|
}
|
||||||
@@ -761,51 +804,35 @@ public class Controller {
|
|||||||
System.out.println("Detected Puck: " + datamatrix);
|
System.out.println("Detected Puck: " + datamatrix);
|
||||||
onPuckScanned(datamatrix);
|
onPuckScanned(datamatrix);
|
||||||
}
|
}
|
||||||
|
removedPuck = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSampleBarcode(String datamatrix) {
|
public void onSampleBarcode(String datamatrix) {
|
||||||
getMainFrame().setSampleDatamatrix(datamatrix);
|
getMainFrame().setSampleDatamatrix(datamatrix);
|
||||||
System.out.println("Detected Sample: " + datamatrix);
|
System.out.println("Detected Sample: " + datamatrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
void onPuckDetectionChanged() {
|
void onPuckDetectionChanged() {
|
||||||
if (isPuckLoading()) {
|
if (isPuckLoading()) {
|
||||||
Puck.Detection[] detection = basePlate.getDetection();
|
Puck.Detection[] detection = basePlate.getDetection();
|
||||||
for (int i = 0; i < Controller.NUMBER_OF_PUCKS; i++) {
|
for (int i = 0; i < Controller.NUMBER_OF_PUCKS; i++) {
|
||||||
Puck puck = basePlate.getPucks()[i];
|
Puck puck = basePlate.getPucks()[i];
|
||||||
//Only manage pucks for current hexiposi position
|
|
||||||
if (isSelectedPuck(puck)) {
|
boolean detectedPuckInserted = (currentDetection[i] != Puck.Detection.Present) && (detection[i] == Puck.Detection.Present);
|
||||||
boolean detectedPuckInserted = (currentDetection[i] != Puck.Detection.Present) && (detection[i] == Puck.Detection.Present);
|
boolean detectedPuckRemoved = (currentDetection[i] != Puck.Detection.Empty) && (detection[i] == Puck.Detection.Empty);
|
||||||
boolean detectedPuckRemoved = (currentDetection[i] != Puck.Detection.Empty) && (detection[i] == Puck.Detection.Empty);
|
if (detectedPuckInserted) {
|
||||||
if (detectedPuckInserted) {
|
onPuckMounted(puck);
|
||||||
onPuckInserted(puck);
|
} else if (detectedPuckRemoved) {
|
||||||
|
onPuckUnmounted(puck);
|
||||||
} else if (detectedPuckRemoved) {
|
|
||||||
playSound("unmounted");
|
|
||||||
onPuckUnmounted(puck);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
currentDetection = detection;
|
currentDetection = detection;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void onPuckInserted(Puck puck) {
|
public void linkPuckDatamatrix(Puck puck, String datamatrix, boolean showMessage) {
|
||||||
playSound("mounted");
|
|
||||||
String datamatrix = getMainFrame().getPuckDatamatrix();
|
|
||||||
logPuckDetectionChange(puck, true);
|
|
||||||
onPuckScanned(null);
|
|
||||||
onPuckMounted(puck, datamatrix);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onPuckRemoved(Puck puck) {
|
|
||||||
playSound("unmounted");
|
|
||||||
logPuckDetectionChange(puck, false);
|
|
||||||
onPuckUnmounted(puck);
|
|
||||||
}
|
|
||||||
|
|
||||||
void linkPuckDatamatrix(Puck puck, String datamatrix, boolean showMessage) {
|
|
||||||
// if ( ((puck.getId()==null) && (datamatrix!=null)) ||
|
// if ( ((puck.getId()==null) && (datamatrix!=null)) ||
|
||||||
// (puck.getId()!=null) && (!puck.getId().equals(datamatrix))){
|
// (puck.getId()!=null) && (!puck.getId().equals(datamatrix))){
|
||||||
String puckName = (puck == null) ? "" : puck.getName();
|
String puckName = (puck == null) ? "" : puck.getName();
|
||||||
@@ -817,7 +844,7 @@ public class Controller {
|
|||||||
System.out.println("Setting datamatrix '" + datamatrix + "' to puck: " + puckName);
|
System.out.println("Setting datamatrix '" + datamatrix + "' to puck: " + puckName);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Context.getInstance().evalLineBackground("set_puck_datamatrix('" + puckName + "','" + datamatrix + "')");
|
Context.getSequencer().evalLineBackground("set_puck_datamatrix('" + puckName + "','" + datamatrix + "')");
|
||||||
if (puck != null) {
|
if (puck != null) {
|
||||||
puck.setId(datamatrix);
|
puck.setId(datamatrix);
|
||||||
} else {
|
} else {
|
||||||
@@ -840,7 +867,7 @@ public class Controller {
|
|||||||
|
|
||||||
Map getPuckDatamatrix() {
|
Map getPuckDatamatrix() {
|
||||||
try {
|
try {
|
||||||
return (Map) Context.getInstance().evalLineBackground("get_puck_datamatrix()");
|
return (Map) Context.getSequencer().evalLineBackground("get_puck_datamatrix()");
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -848,11 +875,20 @@ public class Controller {
|
|||||||
|
|
||||||
Map getPuckDatamatrixInfo() {
|
Map getPuckDatamatrixInfo() {
|
||||||
try {
|
try {
|
||||||
return (Map) Context.getInstance().evalLineBackground("get_puck_datamatrix_info()");
|
return (Map) Context.getSequencer().evalLineBackground("get_puck_datamatrix_info()");
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String getPuckFromDatamatrix(String dm){
|
||||||
|
try {
|
||||||
|
return (String) Context.getSequencer().evalLineBackground("get_puck_from_datamatrix('" + dm + "')");
|
||||||
|
} catch (Exception ex) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void askPuckDatamatrix(Puck puck) {
|
void askPuckDatamatrix(Puck puck) {
|
||||||
if ((dialogAskPuckDatamatrix != null) && (dialogAskPuckDatamatrix.isShowing())) {
|
if ((dialogAskPuckDatamatrix != null) && (dialogAskPuckDatamatrix.isShowing())) {
|
||||||
@@ -914,15 +950,86 @@ public class Controller {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Boolean puckDetectionLoading;
|
||||||
|
public boolean isPuckDetectionLoading() throws IOException{
|
||||||
|
if (puckDetectionLoading==null){
|
||||||
|
puckDetectionLoading = "loading".equals(Context.getSetting("puck_detection"));
|
||||||
|
}
|
||||||
|
return puckDetectionLoading;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
boolean showingPuckLoadingDialog;
|
||||||
|
public void checkPuckDetectionEnabling(){
|
||||||
|
try{
|
||||||
|
showingPuckLoadingDialog = (dialogPuckLoading != null) && (dialogPuckLoading.isShowing());
|
||||||
|
if ( isPuckDetectionLoading()){
|
||||||
|
if (showingPuckLoadingDialog){
|
||||||
|
var werePresent = new ArrayList<String>();
|
||||||
|
Puck[] pucks = basePlate.getPucks();
|
||||||
|
for (Puck p : pucks){
|
||||||
|
if (p.getDetection() == Puck.Detection.Present){
|
||||||
|
werePresent.add(p.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
puck_detection.applyCache();
|
||||||
|
|
||||||
|
|
||||||
void showDialogPuckLoading() {
|
var present = new ArrayList<String>();
|
||||||
|
for (Puck p : pucks){
|
||||||
|
if (p.getDetection() == Puck.Detection.Present){
|
||||||
|
present.add(p.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var removed = new ArrayList<>(werePresent);
|
||||||
|
removed.removeAll(present);
|
||||||
|
|
||||||
|
if (removed.size()>0){
|
||||||
|
PuckDetectionErrorDialog dlg = new PuckDetectionErrorDialog(dialogPuckLoading, false);
|
||||||
|
dlg.initialize(removed);
|
||||||
|
dlg.setLocationRelativeTo(dialogPuckLoading);
|
||||||
|
dlg.setVisible(true);
|
||||||
|
for (String address: removed){
|
||||||
|
Puck puck = basePlate.getPuckByName(address);
|
||||||
|
clearPuckMountedSample(puck);
|
||||||
|
Controller.getInstance().linkPuckDatamatrix(puck, null, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
puck_detection.setEnabled(showingPuckLoadingDialog);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Logger.getLogger(Controller.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void showDialogPuckLoading(boolean load) {
|
||||||
if ((dialogPuckLoading != null) && (dialogPuckLoading.isVisible())) {
|
if ((dialogPuckLoading != null) && (dialogPuckLoading.isVisible())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dialogPuckLoading = new PuckLoadingDialog(mainFrame.getTopLevel(), false);
|
dialogPuckLoading = new PuckLoadingDialog(mainFrame.getTopLevel(), load, false);
|
||||||
dialogPuckLoading.setLocationRelativeTo(mainFrame);
|
dialogPuckLoading.setLocationRelativeTo(mainFrame);
|
||||||
dialogPuckLoading.setVisible(true);
|
dialogPuckLoading.setVisible(true);
|
||||||
|
checkPuckDetectionEnabling();
|
||||||
|
|
||||||
|
dialogPuckLoading.addWindowListener(new WindowAdapter() {
|
||||||
|
@Override
|
||||||
|
public void windowClosing(WindowEvent e) {
|
||||||
|
try{
|
||||||
|
setPuckLoading(false);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Logger.getLogger(Controller.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void windowClosed(WindowEvent e) {
|
||||||
|
checkPuckDetectionEnabling();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void hideDialogPuckLoading() {
|
void hideDialogPuckLoading() {
|
||||||
@@ -930,69 +1037,99 @@ public class Controller {
|
|||||||
dialogPuckLoading.setVisible(false);
|
dialogPuckLoading.setVisible(false);
|
||||||
dialogPuckLoading.dispose();
|
dialogPuckLoading.dispose();
|
||||||
dialogPuckLoading = null;
|
dialogPuckLoading = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
List puckInfo = (List) getMainFrame().eval("get_puck_info()", true);
|
||||||
|
Context.getSequencer().sendEvent("DewarContentUpdate", puckInfo);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Logger.getLogger(Controller.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void onPuckLoadingModeChange(boolean puckLoadMode) {
|
public void onPuckLoadingModeChange(boolean puckLoadMode) {
|
||||||
if (puckMountMode == PuckMountMode.Dialog) {
|
if ( hasLoadDialog()) {
|
||||||
if (puckLoadMode) {
|
if (puckLoadMode) {
|
||||||
showDialogPuckLoading();
|
showDialogPuckLoading(puckLoadMode);
|
||||||
|
mainFrame.setViewDesign();
|
||||||
} else {
|
} else {
|
||||||
hideDialogPuckLoading();
|
hideDialogPuckLoading();
|
||||||
|
mainFrame.setViewCamera();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void onPuckScanned(String datamatrix) {
|
public void onPuckScanned(String datamatrix) {
|
||||||
if (isPuckLoading()) {
|
if (isPuckLoading()) {
|
||||||
getMainFrame().setPuckDatamatrix(datamatrix);
|
getMainFrame().setPuckDatamatrix(datamatrix);
|
||||||
if (puckMountMode == PuckMountMode.Dialog) {
|
if ( hasLoadDialog()) {
|
||||||
showDialogPuckLoading();
|
showDialogPuckLoading(puckLoading);
|
||||||
dialogPuckLoading.onPuckScanned(datamatrix);
|
dialogPuckLoading.onPuckScanned(datamatrix);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
getMainFrame().setPuckDatamatrix(null);
|
getMainFrame().setPuckDatamatrix(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void onPuckMounted(Puck puck, String datamatrix) {
|
public boolean hasLoadDialog(){
|
||||||
if (isPuckLoading()) {
|
return(puckMountMode == PuckMountMode.Dialog);
|
||||||
if (puckMountMode == PuckMountMode.Dialog) {
|
|
||||||
showDialogPuckLoading();
|
|
||||||
dialogPuckLoading.onPuckMounted(puck, datamatrix);
|
|
||||||
} else {
|
|
||||||
if (!datamatrix.isEmpty()) {
|
|
||||||
linkPuckDatamatrix(puck, datamatrix, true);
|
|
||||||
} else {
|
|
||||||
askPuckDatamatrix(puck);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void onPuckUnmounted(Puck puck) {
|
public void onPuckMounted(Puck puck) {
|
||||||
if (isPuckLoading()) {
|
String datamatrix = getMainFrame().getPuckDatamatrix();
|
||||||
try{
|
Logger.getLogger(Controller.class.getName()).info("Mounted puck: " + puck.getName() + " - datamatrix:" + datamatrix);
|
||||||
Sample sample = getMountedSample();
|
playSound("mounted");
|
||||||
if ((sample!=null) && (sample.getPuck() == puck)){
|
logPuckDetectionChange(puck, true);
|
||||||
resetMountedSample();
|
onPuckScanned(null);
|
||||||
sample.setLoaded(false);
|
if ((datamatrix==null) || (datamatrix.isBlank())){
|
||||||
SwingUtilities.invokeLater(()->{;
|
if (puck == removedPuck){
|
||||||
getMainFrame().refresh();
|
datamatrix = insertedPuckDatamatrix;
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Logger.getLogger(Controller.class.getName()).log(Level.WARNING, null, ex);
|
|
||||||
}
|
}
|
||||||
if (puckMountMode == PuckMountMode.Dialog) {
|
}
|
||||||
showDialogPuckLoading();
|
|
||||||
dialogPuckLoading.onPuckUnmounted(puck);
|
if ((datamatrix != null) && (!datamatrix.isEmpty())) {
|
||||||
} else {
|
Controller.getInstance().linkPuckDatamatrix(puck, datamatrix, !hasLoadDialog());
|
||||||
linkPuckDatamatrix(puck, null, true);
|
}
|
||||||
|
|
||||||
|
if (hasLoadDialog()) {
|
||||||
|
showDialogPuckLoading(puckLoading);
|
||||||
|
dialogPuckLoading.onPuckMounted(puck, datamatrix);
|
||||||
|
} else {
|
||||||
|
if ((datamatrix == null) || (datamatrix.isEmpty())){
|
||||||
|
askPuckDatamatrix(puck);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
insertedPuckDatamatrix = datamatrix;
|
||||||
|
removedPuck = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onPuckUnmounted(Puck puck) {
|
||||||
|
Logger.getLogger(Controller.class.getName()).info("Unmounted puck: " + puck.getName());
|
||||||
|
playSound("unmounted");
|
||||||
|
clearPuckMountedSample(puck);
|
||||||
|
Controller.getInstance().linkPuckDatamatrix(puck, null, !hasLoadDialog());
|
||||||
|
if ( hasLoadDialog()) {
|
||||||
|
showDialogPuckLoading(puckLoading);
|
||||||
|
dialogPuckLoading.onPuckUnmounted(puck);
|
||||||
|
}
|
||||||
|
removedPuck = puck;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clearPuckMountedSample(Puck puck){
|
||||||
|
try{
|
||||||
|
Sample sample = getMountedSample();
|
||||||
|
if ((sample!=null) && (sample.getPuck() == puck)){
|
||||||
|
resetMountedSample();
|
||||||
|
sample.setLoaded(false);
|
||||||
|
SwingUtilities.invokeLater(()->{;
|
||||||
|
getMainFrame().refresh();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Logger.getLogger(Controller.class.getName()).log(Level.WARNING, null, ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void logSampleMounted(String former, String current){
|
void logSampleMounted(String former, String current){
|
||||||
logEvent((current!=null) ? "Sample Mounted" : "Sample Unmounted", former, current);
|
logEvent((current!=null) ? "Sample Mounted" : "Sample Unmounted", former, current);
|
||||||
}
|
}
|
||||||
@@ -1004,7 +1141,7 @@ public class Controller {
|
|||||||
void logStateChange(State state){
|
void logStateChange(State state){
|
||||||
String command = "";
|
String command = "";
|
||||||
if (state==State.Busy){
|
if (state==State.Busy){
|
||||||
CommandInfo info = Context.getInstance().getCommandManager().getCurrentCommand(true);
|
CommandInfo info = Context.getCommandBus().getCurrentCommand(true);
|
||||||
if (info != null){
|
if (info != null){
|
||||||
command = (info.script != null) ? info.script : info.command;
|
command = (info.script != null) ? info.script : info.command;
|
||||||
}
|
}
|
||||||
@@ -1015,7 +1152,7 @@ public class Controller {
|
|||||||
public void logEvent(String... event){
|
public void logEvent(String... event){
|
||||||
try{
|
try{
|
||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
Path path = Paths.get(Context.getInstance().getSetup().getOutputPath(), "events", Chrono.getTimeStr(now,"YYYYMMdd") + ".txt");
|
Path path = Paths.get(Setup.getOutputPath(), "events", Chrono.getTimeStr(now,"YYYYMMdd") + ".txt");
|
||||||
path.toFile().getParentFile().mkdirs();
|
path.toFile().getParentFile().mkdirs();
|
||||||
|
|
||||||
String[] data = new String[]{
|
String[] data = new String[]{
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ package ch.psi.mxsc;
|
|||||||
|
|
||||||
import static ch.psi.mxsc.Controller.NUMBER_OF_PUCKS;
|
import static ch.psi.mxsc.Controller.NUMBER_OF_PUCKS;
|
||||||
import static ch.psi.mxsc.Controller.instance;
|
import static ch.psi.mxsc.Controller.instance;
|
||||||
import ch.psi.pshell.core.Context;
|
import ch.psi.pshell.framework.Context;
|
||||||
import ch.psi.pshell.device.Device;
|
import ch.psi.pshell.device.Device;
|
||||||
import ch.psi.pshell.device.DeviceAdapter;
|
import ch.psi.pshell.device.DeviceListener;
|
||||||
import ch.psi.pshell.device.DeviceListener;
|
import ch.psi.pshell.device.DeviceListener;
|
||||||
import ch.psi.pshell.device.GenericDevice;
|
import ch.psi.pshell.device.GenericDevice;
|
||||||
import ch.psi.pshell.ui.Panel;
|
import ch.psi.pshell.framework.Panel;
|
||||||
import ch.psi.utils.State;
|
import ch.psi.pshell.utils.State;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ public class ControllerRT extends Controller{
|
|||||||
@Override
|
@Override
|
||||||
public void onStateChange(State state, State former) {
|
public void onStateChange(State state, State former) {
|
||||||
if ((state == State.Ready)&&(former==State.Initializing)) {
|
if ((state == State.Ready)&&(former==State.Initializing)) {
|
||||||
PuckDetection puckDetection = this.getContext().getDevicePool().getByName("puckDetection", PuckDetection.class);
|
PuckDetection puckDetection = this.Context.getDevicePool().getByName("puckDetection", PuckDetection.class);
|
||||||
if (puckDetection!=null){
|
if (puckDetection!=null){
|
||||||
getMainFrame().removeDevice(puckDetection, true);
|
getMainFrame().removeDevice(puckDetection, true);
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,7 @@ public class ControllerRT extends Controller{
|
|||||||
public Boolean isRoomTempEnabled() {
|
public Boolean isRoomTempEnabled() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
final DeviceListener basePlateListener = new DeviceAdapter() {
|
final DeviceListener basePlateListener = new DeviceListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onValueChanged(Device device, Object value, Object former) {
|
public void onValueChanged(Device device, Object value, Object former) {
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
|
|||||||
@@ -39,11 +39,6 @@
|
|||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="labelCamera" min="-2" max="-2" attributes="0"/>
|
<Component id="labelCamera" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<Group type="102" alignment="0" attributes="0">
|
|
||||||
<Component id="ledHexiposi" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
|
||||||
<Component id="labelHexiposi" min="-2" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<Component id="ledBarcodeReader" min="-2" max="-2" attributes="0"/>
|
<Component id="ledBarcodeReader" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
@@ -93,11 +88,6 @@
|
|||||||
<Component id="labelCamera" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="labelCamera" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
|
||||||
<Component id="ledHexiposi" alignment="3" min="-2" max="-2" attributes="0"/>
|
|
||||||
<Component id="labelHexiposi" alignment="3" min="-2" max="-2" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
<Component id="ledBarcodeReader" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="ledBarcodeReader" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="labelReader" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="labelReader" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
@@ -179,20 +169,6 @@
|
|||||||
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="ledCameraMouseClicked"/>
|
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="ledCameraMouseClicked"/>
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="ch.psi.mxsc.HyperlinkLabel" name="labelHexiposi">
|
|
||||||
<Properties>
|
|
||||||
<Property name="text" type="java.lang.String" value="Hexiposi"/>
|
|
||||||
<Property name="active" type="boolean" value="true"/>
|
|
||||||
</Properties>
|
|
||||||
<Events>
|
|
||||||
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="labelHexiposiMouseClicked"/>
|
|
||||||
</Events>
|
|
||||||
</Component>
|
|
||||||
<Component class="ch.psi.pshell.swing.Led" name="ledHexiposi">
|
|
||||||
<Events>
|
|
||||||
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="labelHexiposiMouseClicked"/>
|
|
||||||
</Events>
|
|
||||||
</Component>
|
|
||||||
<Component class="ch.psi.mxsc.HyperlinkLabel" name="labelReader">
|
<Component class="ch.psi.mxsc.HyperlinkLabel" name="labelReader">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Barcode Reader"/>
|
<Property name="text" type="java.lang.String" value="Barcode Reader"/>
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
package ch.psi.mxsc;
|
package ch.psi.mxsc;
|
||||||
|
|
||||||
import ch.psi.pshell.core.DevicePoolListener;
|
import ch.psi.pshell.devices.DevicePoolListener;
|
||||||
import ch.psi.pshell.device.Device;
|
import ch.psi.pshell.device.Device;
|
||||||
import ch.psi.pshell.device.DeviceAdapter;
|
import ch.psi.pshell.device.DeviceListener;
|
||||||
import ch.psi.pshell.device.GenericDevice;
|
import ch.psi.pshell.device.GenericDevice;
|
||||||
import ch.psi.pshell.swing.DevicePanel;
|
import ch.psi.pshell.swing.DevicePanel;
|
||||||
import ch.psi.pshell.swing.Led;
|
import ch.psi.pshell.swing.Led;
|
||||||
import ch.psi.utils.State;
|
import ch.psi.pshell.swing.MonitoredPanel;
|
||||||
import ch.psi.utils.swing.SwingUtils;
|
import ch.psi.pshell.utils.State;
|
||||||
|
import ch.psi.pshell.swing.SwingUtils;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Window;
|
import java.awt.Window;
|
||||||
|
|
||||||
@@ -17,7 +18,6 @@ import java.awt.Window;
|
|||||||
public class DevicesPanel extends javax.swing.JPanel {
|
public class DevicesPanel extends javax.swing.JPanel {
|
||||||
|
|
||||||
GenericDevice robot;
|
GenericDevice robot;
|
||||||
GenericDevice hexiposi;
|
|
||||||
GenericDevice barcode_reader;
|
GenericDevice barcode_reader;
|
||||||
GenericDevice barcode_reader_puck;
|
GenericDevice barcode_reader_puck;
|
||||||
GenericDevice wago;
|
GenericDevice wago;
|
||||||
@@ -37,10 +37,10 @@ public class DevicesPanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GenericDevice[] getDevices(){
|
GenericDevice[] getDevices(){
|
||||||
return new GenericDevice[]{robot, hexiposi, barcode_reader, barcode_reader_puck, wago, laser, puck_detection, sm};
|
return new GenericDevice[]{robot, barcode_reader, barcode_reader_puck, wago, laser, puck_detection, sm};
|
||||||
}
|
}
|
||||||
|
|
||||||
final DeviceAdapter deviceListener = new DeviceAdapter() {
|
final DeviceListener deviceListener = new DeviceListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onStateChanged(Device device, State state, State former) {
|
public void onStateChanged(Device device, State state, State former) {
|
||||||
update();
|
update();
|
||||||
@@ -69,7 +69,6 @@ public class DevicesPanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
robot = Controller.getInstance().getDevice("robot");
|
robot = Controller.getInstance().getDevice("robot");
|
||||||
hexiposi = Controller.getInstance().getDevice("hexiposi");
|
|
||||||
barcode_reader = Controller.getInstance().getDevice("barcode_reader");
|
barcode_reader = Controller.getInstance().getDevice("barcode_reader");
|
||||||
barcode_reader_puck = Controller.getInstance().getDevice("barcode_reader_puck");
|
barcode_reader_puck = Controller.getInstance().getDevice("barcode_reader_puck");
|
||||||
wago = Controller.getInstance().getDevice("wago");
|
wago = Controller.getInstance().getDevice("wago");
|
||||||
@@ -94,7 +93,6 @@ public class DevicesPanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
setLedState(ledCamera, img);
|
setLedState(ledCamera, img);
|
||||||
setLedState(ledMonitorCamera, monitor_cam);
|
setLedState(ledMonitorCamera, monitor_cam);
|
||||||
setLedState(ledHexiposi, hexiposi);
|
|
||||||
setLedState(ledLaser, laser);
|
setLedState(ledLaser, laser);
|
||||||
setLedState(ledPuckDetection, puck_detection);
|
setLedState(ledPuckDetection, puck_detection);
|
||||||
setLedState(ledRobot, robot);
|
setLedState(ledRobot, robot);
|
||||||
@@ -131,10 +129,10 @@ public class DevicesPanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DevicePanel showDevicePanel(String device){
|
MonitoredPanel showDevicePanel(String device){
|
||||||
if (isActive()){
|
if (isActive()){
|
||||||
try{
|
try{
|
||||||
DevicePanel ret = Controller.getInstance().getMainFrame().showDevicePanel(device);
|
MonitoredPanel ret = Controller.getInstance().getMainFrame().showDevicePanel(device);
|
||||||
Controller.getInstance().getMainFrame().onExpertCommand(SwingUtils.getWindow(ret));
|
Controller.getInstance().getMainFrame().onExpertCommand(SwingUtils.getWindow(ret));
|
||||||
return ret;
|
return ret;
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
@@ -160,7 +158,6 @@ public class DevicesPanel extends javax.swing.JPanel {
|
|||||||
active = value;
|
active = value;
|
||||||
labelCamera.setActive(value);
|
labelCamera.setActive(value);
|
||||||
labelMonitorCamera.setActive(value);
|
labelMonitorCamera.setActive(value);
|
||||||
labelHexiposi.setActive(value);
|
|
||||||
labelLaser.setActive(value);
|
labelLaser.setActive(value);
|
||||||
labelPuckDetection.setActive(value);
|
labelPuckDetection.setActive(value);
|
||||||
labelReader.setActive(value);
|
labelReader.setActive(value);
|
||||||
@@ -190,8 +187,6 @@ public class DevicesPanel extends javax.swing.JPanel {
|
|||||||
ledLaser = new ch.psi.pshell.swing.Led();
|
ledLaser = new ch.psi.pshell.swing.Led();
|
||||||
labelCamera = new ch.psi.mxsc.HyperlinkLabel();
|
labelCamera = new ch.psi.mxsc.HyperlinkLabel();
|
||||||
ledCamera = new ch.psi.pshell.swing.Led();
|
ledCamera = new ch.psi.pshell.swing.Led();
|
||||||
labelHexiposi = new ch.psi.mxsc.HyperlinkLabel();
|
|
||||||
ledHexiposi = new ch.psi.pshell.swing.Led();
|
|
||||||
labelReader = new ch.psi.mxsc.HyperlinkLabel();
|
labelReader = new ch.psi.mxsc.HyperlinkLabel();
|
||||||
ledBarcodeReader = new ch.psi.pshell.swing.Led();
|
ledBarcodeReader = new ch.psi.pshell.swing.Led();
|
||||||
labelPuckDetection = new ch.psi.mxsc.HyperlinkLabel();
|
labelPuckDetection = new ch.psi.mxsc.HyperlinkLabel();
|
||||||
@@ -257,20 +252,6 @@ public class DevicesPanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
labelHexiposi.setText("Hexiposi");
|
|
||||||
labelHexiposi.setActive(true);
|
|
||||||
labelHexiposi.addMouseListener(new java.awt.event.MouseAdapter() {
|
|
||||||
public void mouseClicked(java.awt.event.MouseEvent evt) {
|
|
||||||
labelHexiposiMouseClicked(evt);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
ledHexiposi.addMouseListener(new java.awt.event.MouseAdapter() {
|
|
||||||
public void mouseClicked(java.awt.event.MouseEvent evt) {
|
|
||||||
labelHexiposiMouseClicked(evt);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
labelReader.setText("Barcode Reader");
|
labelReader.setText("Barcode Reader");
|
||||||
labelReader.setActive(true);
|
labelReader.setActive(true);
|
||||||
labelReader.addMouseListener(new java.awt.event.MouseAdapter() {
|
labelReader.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||||
@@ -350,10 +331,6 @@ public class DevicesPanel extends javax.swing.JPanel {
|
|||||||
.addComponent(ledCamera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(ledCamera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(labelCamera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
.addComponent(labelCamera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
.addGroup(layout.createSequentialGroup()
|
|
||||||
.addComponent(ledHexiposi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
||||||
.addComponent(labelHexiposi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addComponent(ledBarcodeReader, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(ledBarcodeReader, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
@@ -392,10 +369,6 @@ public class DevicesPanel extends javax.swing.JPanel {
|
|||||||
.addComponent(ledCamera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(ledCamera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addComponent(labelCamera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
.addComponent(labelCamera, 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)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
||||||
.addComponent(ledHexiposi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addComponent(labelHexiposi, 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(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
.addComponent(ledBarcodeReader, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(ledBarcodeReader, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addComponent(labelReader, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
.addComponent(labelReader, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
@@ -415,10 +388,6 @@ public class DevicesPanel extends javax.swing.JPanel {
|
|||||||
);
|
);
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
private void labelHexiposiMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_labelHexiposiMouseClicked
|
|
||||||
showDevicePanel("hexiposi");
|
|
||||||
}//GEN-LAST:event_labelHexiposiMouseClicked
|
|
||||||
|
|
||||||
private void ledRobotMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ledRobotMouseClicked
|
private void ledRobotMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ledRobotMouseClicked
|
||||||
showDevicePanel("robot");
|
showDevicePanel("robot");
|
||||||
}//GEN-LAST:event_ledRobotMouseClicked
|
}//GEN-LAST:event_ledRobotMouseClicked
|
||||||
@@ -428,7 +397,7 @@ public class DevicesPanel extends javax.swing.JPanel {
|
|||||||
}//GEN-LAST:event_labelSmartMagnetMouseClicked
|
}//GEN-LAST:event_labelSmartMagnetMouseClicked
|
||||||
|
|
||||||
private void ledCameraMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ledCameraMouseClicked
|
private void ledCameraMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ledCameraMouseClicked
|
||||||
showDevicePanel("img camera");
|
showDevicePanel("cam");
|
||||||
}//GEN-LAST:event_ledCameraMouseClicked
|
}//GEN-LAST:event_ledCameraMouseClicked
|
||||||
|
|
||||||
private void ledLaserMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ledLaserMouseClicked
|
private void ledLaserMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ledLaserMouseClicked
|
||||||
@@ -440,9 +409,9 @@ public class DevicesPanel extends javax.swing.JPanel {
|
|||||||
}//GEN-LAST:event_labelWagoMouseClicked
|
}//GEN-LAST:event_labelWagoMouseClicked
|
||||||
|
|
||||||
private void labelReaderMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_labelReaderMouseClicked
|
private void labelReaderMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_labelReaderMouseClicked
|
||||||
DevicePanel dp1 = showDevicePanel("barcode_reader");
|
MonitoredPanel dp1 = showDevicePanel("barcode_reader");
|
||||||
if (Controller.getInstance().getDevicePool().getByName("barcode_reader_puck")!=null){
|
if (Controller.getInstance().getDevicePool().getByName("barcode_reader_puck")!=null){
|
||||||
DevicePanel dp2 = showDevicePanel("barcode_reader_puck");
|
MonitoredPanel dp2 = showDevicePanel("barcode_reader_puck");
|
||||||
if ((dp1!=null)&& (dp2!=null)){
|
if ((dp1!=null)&& (dp2!=null)){
|
||||||
Window parent = ((Window )dp2.getTopLevelAncestor());
|
Window parent = ((Window )dp2.getTopLevelAncestor());
|
||||||
parent.setLocation(parent.getX()+80, parent.getY()+40);
|
parent.setLocation(parent.getX()+80, parent.getY()+40);
|
||||||
@@ -461,7 +430,6 @@ public class DevicesPanel extends javax.swing.JPanel {
|
|||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private ch.psi.mxsc.HyperlinkLabel labelCamera;
|
private ch.psi.mxsc.HyperlinkLabel labelCamera;
|
||||||
private ch.psi.mxsc.HyperlinkLabel labelHexiposi;
|
|
||||||
private ch.psi.mxsc.HyperlinkLabel labelLaser;
|
private ch.psi.mxsc.HyperlinkLabel labelLaser;
|
||||||
private ch.psi.mxsc.HyperlinkLabel labelMonitorCamera;
|
private ch.psi.mxsc.HyperlinkLabel labelMonitorCamera;
|
||||||
private ch.psi.mxsc.HyperlinkLabel labelPuckDetection;
|
private ch.psi.mxsc.HyperlinkLabel labelPuckDetection;
|
||||||
@@ -471,7 +439,6 @@ public class DevicesPanel extends javax.swing.JPanel {
|
|||||||
private ch.psi.mxsc.HyperlinkLabel labelWago;
|
private ch.psi.mxsc.HyperlinkLabel labelWago;
|
||||||
private ch.psi.pshell.swing.Led ledBarcodeReader;
|
private ch.psi.pshell.swing.Led ledBarcodeReader;
|
||||||
private ch.psi.pshell.swing.Led ledCamera;
|
private ch.psi.pshell.swing.Led ledCamera;
|
||||||
private ch.psi.pshell.swing.Led ledHexiposi;
|
|
||||||
private ch.psi.pshell.swing.Led ledLaser;
|
private ch.psi.pshell.swing.Led ledLaser;
|
||||||
private ch.psi.pshell.swing.Led ledMonitorCamera;
|
private ch.psi.pshell.swing.Led ledMonitorCamera;
|
||||||
private ch.psi.pshell.swing.Led ledPuckDetection;
|
private ch.psi.pshell.swing.Led ledPuckDetection;
|
||||||
|
|||||||
@@ -1,58 +1,58 @@
|
|||||||
package ch.psi.mxsc;
|
package ch.psi.mxsc;
|
||||||
|
|
||||||
import static ch.psi.mxsc.Controller.NUMBER_OF_PUCKS;
|
import static ch.psi.mxsc.Controller.NUMBER_OF_PUCKS;
|
||||||
import ch.psi.pshell.device.Device;
|
import ch.psi.pshell.device.Device;
|
||||||
import ch.psi.pshell.device.DeviceAdapter;
|
import ch.psi.pshell.device.DeviceListener;
|
||||||
import ch.psi.utils.State;
|
import ch.psi.pshell.utils.State;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EseraDetection implements AutoCloseable{
|
public class EseraDetection implements AutoCloseable{
|
||||||
final Device device;
|
final Device device;
|
||||||
|
|
||||||
public EseraDetection(Device device){
|
public EseraDetection(Device device){
|
||||||
this.device = device;
|
this.device = device;
|
||||||
if (device!=null){
|
if (device!=null){
|
||||||
device.addListener(listener);
|
device.addListener(listener);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DeviceAdapter listener = new DeviceAdapter(){
|
DeviceListener listener = new DeviceListener(){
|
||||||
@Override
|
@Override
|
||||||
public void onStateChanged(Device device, State state, State former) {
|
public void onStateChanged(Device device, State state, State former) {
|
||||||
if (!state.isInitialized()){
|
if (!state.isInitialized()){
|
||||||
Controller.getInstance().clearPuckStates();
|
Controller.getInstance().clearPuckStates();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onValueChanged(Device device, Object value, Object former) {
|
public void onValueChanged(Device device, Object value, Object former) {
|
||||||
if ((value == null) || !(value instanceof List)){
|
if ((value == null) || !(value instanceof List)){
|
||||||
Controller.getInstance().clearPuckStates();
|
Controller.getInstance().clearPuckStates();
|
||||||
} else {
|
} else {
|
||||||
List l = (List)value;
|
List l = (List)value;
|
||||||
PuckState[] puckState = Controller.getInstance().getPuckStates();
|
PuckState[] puckState = Controller.getInstance().getPuckStates();
|
||||||
for (int i=0; i<NUMBER_OF_PUCKS; i++ ){
|
for (int i=0; i<NUMBER_OF_PUCKS; i++ ){
|
||||||
try{
|
try{
|
||||||
List det = (List) l.get(i);
|
List det = (List) l.get(i);
|
||||||
puckState[i].set((det.get(0).equals(0)) ? 1 : 0, (det.get(1).equals(0)) ? 1 : 0);
|
puckState[i].set((det.get(0).equals(0)) ? 1 : 0, (det.get(1).equals(0)) ? 1 : 0);
|
||||||
} catch (Exception ex){
|
} catch (Exception ex){
|
||||||
puckState[i].clear();
|
puckState[i].clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Controller.getInstance().updateView();
|
Controller.getInstance().updateView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
if (device!=null){
|
if (device!=null){
|
||||||
device.removeListener(listener);
|
device.removeListener(listener);
|
||||||
}
|
}
|
||||||
Controller.getInstance().clearPuckStates();
|
Controller.getInstance().clearPuckStates();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,173 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
|
|
||||||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
|
||||||
<NonVisualComponents>
|
|
||||||
<Component class="javax.swing.Box$Filler" name="filler9">
|
|
||||||
<Properties>
|
|
||||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
|
||||||
<Dimension value="[32767, 32767]"/>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
<AuxValues>
|
|
||||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.Glue"/>
|
|
||||||
</AuxValues>
|
|
||||||
</Component>
|
|
||||||
</NonVisualComponents>
|
|
||||||
<AuxValues>
|
|
||||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
|
||||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
|
||||||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
|
||||||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
|
||||||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
|
||||||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
|
||||||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
|
||||||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
|
||||||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
|
||||||
</AuxValues>
|
|
||||||
|
|
||||||
<Layout>
|
|
||||||
<DimensionLayout dim="0">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<EmptySpace min="0" pref="73" max="32767" attributes="0"/>
|
|
||||||
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
|
|
||||||
<Component id="circlePanel2" alignment="1" pref="73" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
<DimensionLayout dim="1">
|
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
|
||||||
<EmptySpace min="0" pref="71" max="32767" attributes="0"/>
|
|
||||||
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
|
|
||||||
<Group type="102" alignment="0" attributes="0">
|
|
||||||
<Component id="circlePanel2" min="-2" pref="71" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</Group>
|
|
||||||
</DimensionLayout>
|
|
||||||
</Layout>
|
|
||||||
<SubComponents>
|
|
||||||
<Container class="ch.psi.mxsc.CirclePanel" name="circlePanel2">
|
|
||||||
|
|
||||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridLayout">
|
|
||||||
<Property name="columns" type="int" value="3"/>
|
|
||||||
<Property name="rows" type="int" value="5"/>
|
|
||||||
</Layout>
|
|
||||||
<SubComponents>
|
|
||||||
<Component class="javax.swing.Box$Filler" name="filler8">
|
|
||||||
<Properties>
|
|
||||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
|
||||||
<Dimension value="[32767, 32767]"/>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
<AuxValues>
|
|
||||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.Glue"/>
|
|
||||||
</AuxValues>
|
|
||||||
</Component>
|
|
||||||
<Component class="ch.psi.pshell.swing.Led" name="ledD">
|
|
||||||
<Properties>
|
|
||||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
|
||||||
</Properties>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.Box$Filler" name="filler7">
|
|
||||||
</Component>
|
|
||||||
<Component class="ch.psi.pshell.swing.Led" name="ledC">
|
|
||||||
<Properties>
|
|
||||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
|
||||||
</Properties>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.Box$Filler" name="filler6">
|
|
||||||
<Properties>
|
|
||||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
|
||||||
<Dimension value="[32767, 32767]"/>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
<AuxValues>
|
|
||||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.Glue"/>
|
|
||||||
</AuxValues>
|
|
||||||
</Component>
|
|
||||||
<Component class="ch.psi.pshell.swing.Led" name="ledE">
|
|
||||||
<Properties>
|
|
||||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
|
||||||
</Properties>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.Box$Filler" name="filler10">
|
|
||||||
<Properties>
|
|
||||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
|
||||||
<Dimension value="[32767, 32767]"/>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
<AuxValues>
|
|
||||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.Glue"/>
|
|
||||||
</AuxValues>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.JLabel" name="textPosition">
|
|
||||||
<Properties>
|
|
||||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
|
||||||
<Font name="Monospaced" size="14" style="0"/>
|
|
||||||
</Property>
|
|
||||||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
|
||||||
<Color blue="0" green="80" red="0" type="rgb"/>
|
|
||||||
</Property>
|
|
||||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
|
||||||
</Properties>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.Box$Filler" name="filler4">
|
|
||||||
<Properties>
|
|
||||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
|
||||||
<Dimension value="[32767, 32767]"/>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
<AuxValues>
|
|
||||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.Glue"/>
|
|
||||||
</AuxValues>
|
|
||||||
</Component>
|
|
||||||
<Component class="ch.psi.pshell.swing.Led" name="ledB">
|
|
||||||
<Properties>
|
|
||||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
|
||||||
</Properties>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.Box$Filler" name="filler3">
|
|
||||||
<Properties>
|
|
||||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
|
||||||
<Dimension value="[32767, 32767]"/>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
<AuxValues>
|
|
||||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.Glue"/>
|
|
||||||
</AuxValues>
|
|
||||||
</Component>
|
|
||||||
<Component class="ch.psi.pshell.swing.Led" name="ledF">
|
|
||||||
<Properties>
|
|
||||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
|
||||||
</Properties>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.Box$Filler" name="filler2">
|
|
||||||
<Properties>
|
|
||||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
|
||||||
<Dimension value="[32767, 32767]"/>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
<AuxValues>
|
|
||||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.Glue"/>
|
|
||||||
</AuxValues>
|
|
||||||
</Component>
|
|
||||||
<Component class="ch.psi.pshell.swing.Led" name="ledA">
|
|
||||||
<Properties>
|
|
||||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
|
||||||
</Properties>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.Box$Filler" name="filler1">
|
|
||||||
<Properties>
|
|
||||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
|
||||||
<Dimension value="[32767, 32767]"/>
|
|
||||||
</Property>
|
|
||||||
</Properties>
|
|
||||||
<AuxValues>
|
|
||||||
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.Glue"/>
|
|
||||||
</AuxValues>
|
|
||||||
</Component>
|
|
||||||
</SubComponents>
|
|
||||||
</Container>
|
|
||||||
</SubComponents>
|
|
||||||
</Form>
|
|
||||||
@@ -1,143 +0,0 @@
|
|||||||
package ch.psi.mxsc;
|
|
||||||
|
|
||||||
import ch.psi.pshell.device.DiscretePositionerBase;
|
|
||||||
import ch.psi.pshell.swing.DevicePanel;
|
|
||||||
import java.awt.Color;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class HexiposiPanel extends DevicePanel {
|
|
||||||
|
|
||||||
final Color COLOR_ON = Color.GREEN; //new Color(51,102,255);
|
|
||||||
final Color COLOR_OFF = Color.BLACK;
|
|
||||||
|
|
||||||
public HexiposiPanel() {
|
|
||||||
initComponents();
|
|
||||||
//setDeviceName("hexiposi");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DiscretePositionerBase getDevice(){
|
|
||||||
return (DiscretePositionerBase) super.getDevice();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDeviceReadbackChanged(Object value) {
|
|
||||||
ledA.setColor("A".equals(value) ? COLOR_ON: COLOR_OFF);
|
|
||||||
ledB.setColor("B".equals(value) ? COLOR_ON: COLOR_OFF);
|
|
||||||
ledC.setColor("C".equals(value) ? COLOR_ON: COLOR_OFF);
|
|
||||||
ledD.setColor("D".equals(value) ? COLOR_ON: COLOR_OFF);
|
|
||||||
ledE.setColor("E".equals(value) ? COLOR_ON: COLOR_OFF);
|
|
||||||
ledF.setColor("F".equals(value) ? COLOR_ON: COLOR_OFF);
|
|
||||||
if ((value==null) || (value.toString().trim().isEmpty()) || (value.toString().equalsIgnoreCase("Unknown"))){
|
|
||||||
textPosition.setText("");
|
|
||||||
} else {
|
|
||||||
textPosition.setText((value.toString()).substring(0, 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
repaint();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method is called from within the constructor to initialize the form.
|
|
||||||
* WARNING: Do NOT modify this code. The content of this method is always
|
|
||||||
* regenerated by the Form Editor.
|
|
||||||
*/
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
|
||||||
private void initComponents() {
|
|
||||||
|
|
||||||
filler9 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 32767));
|
|
||||||
circlePanel2 = new ch.psi.mxsc.CirclePanel();
|
|
||||||
filler8 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 32767));
|
|
||||||
ledD = new ch.psi.pshell.swing.Led();
|
|
||||||
filler7 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0));
|
|
||||||
ledC = new ch.psi.pshell.swing.Led();
|
|
||||||
filler6 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 32767));
|
|
||||||
ledE = new ch.psi.pshell.swing.Led();
|
|
||||||
filler10 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 32767));
|
|
||||||
textPosition = new javax.swing.JLabel();
|
|
||||||
filler4 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 32767));
|
|
||||||
ledB = new ch.psi.pshell.swing.Led();
|
|
||||||
filler3 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 32767));
|
|
||||||
ledF = new ch.psi.pshell.swing.Led();
|
|
||||||
filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 32767));
|
|
||||||
ledA = new ch.psi.pshell.swing.Led();
|
|
||||||
filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 32767));
|
|
||||||
|
|
||||||
circlePanel2.setLayout(new java.awt.GridLayout(5, 3));
|
|
||||||
circlePanel2.add(filler8);
|
|
||||||
|
|
||||||
ledD.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
|
||||||
circlePanel2.add(ledD);
|
|
||||||
circlePanel2.add(filler7);
|
|
||||||
|
|
||||||
ledC.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
|
||||||
circlePanel2.add(ledC);
|
|
||||||
circlePanel2.add(filler6);
|
|
||||||
|
|
||||||
ledE.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
|
||||||
circlePanel2.add(ledE);
|
|
||||||
circlePanel2.add(filler10);
|
|
||||||
|
|
||||||
textPosition.setFont(new java.awt.Font("Monospaced", 0, 14)); // NOI18N
|
|
||||||
textPosition.setForeground(new java.awt.Color(0, 128, 0));
|
|
||||||
textPosition.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
|
||||||
circlePanel2.add(textPosition);
|
|
||||||
circlePanel2.add(filler4);
|
|
||||||
|
|
||||||
ledB.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
|
||||||
circlePanel2.add(ledB);
|
|
||||||
circlePanel2.add(filler3);
|
|
||||||
|
|
||||||
ledF.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
|
||||||
circlePanel2.add(ledF);
|
|
||||||
circlePanel2.add(filler2);
|
|
||||||
|
|
||||||
ledA.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
|
||||||
circlePanel2.add(ledA);
|
|
||||||
circlePanel2.add(filler1);
|
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
|
||||||
this.setLayout(layout);
|
|
||||||
layout.setHorizontalGroup(
|
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addGap(0, 73, Short.MAX_VALUE)
|
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addComponent(circlePanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 73, Short.MAX_VALUE))
|
|
||||||
);
|
|
||||||
layout.setVerticalGroup(
|
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addGap(0, 71, Short.MAX_VALUE)
|
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
||||||
.addGroup(layout.createSequentialGroup()
|
|
||||||
.addComponent(circlePanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
||||||
.addGap(0, 0, Short.MAX_VALUE)))
|
|
||||||
);
|
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
|
||||||
|
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
|
||||||
private ch.psi.mxsc.CirclePanel circlePanel2;
|
|
||||||
private javax.swing.Box.Filler filler1;
|
|
||||||
private javax.swing.Box.Filler filler10;
|
|
||||||
private javax.swing.Box.Filler filler2;
|
|
||||||
private javax.swing.Box.Filler filler3;
|
|
||||||
private javax.swing.Box.Filler filler4;
|
|
||||||
private javax.swing.Box.Filler filler6;
|
|
||||||
private javax.swing.Box.Filler filler7;
|
|
||||||
private javax.swing.Box.Filler filler8;
|
|
||||||
private javax.swing.Box.Filler filler9;
|
|
||||||
private ch.psi.pshell.swing.Led ledA;
|
|
||||||
private ch.psi.pshell.swing.Led ledB;
|
|
||||||
private ch.psi.pshell.swing.Led ledC;
|
|
||||||
private ch.psi.pshell.swing.Led ledD;
|
|
||||||
private ch.psi.pshell.swing.Led ledE;
|
|
||||||
private ch.psi.pshell.swing.Led ledF;
|
|
||||||
private javax.swing.JLabel textPosition;
|
|
||||||
// End of variables declaration//GEN-END:variables
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
<Form version="1.6" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
<Form version="1.6" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||||
|
<NonVisualComponents>
|
||||||
|
<Component class="javax.swing.ButtonGroup" name="buttonGroup1">
|
||||||
|
</Component>
|
||||||
|
</NonVisualComponents>
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
<Dimension value="[1030, 530]"/>
|
<Dimension value="[1030, 530]"/>
|
||||||
@@ -31,7 +35,7 @@
|
|||||||
<Group type="102" alignment="1" attributes="0">
|
<Group type="102" alignment="1" attributes="0">
|
||||||
<Component id="panelTop" max="32767" attributes="0"/>
|
<Component id="panelTop" max="32767" attributes="0"/>
|
||||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||||
<Component id="panelBottom" pref="80" max="32767" attributes="0"/>
|
<Component id="panelBottom" pref="66" max="32767" attributes="0"/>
|
||||||
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
@@ -89,14 +93,14 @@
|
|||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="1" attributes="0">
|
<Group type="102" alignment="1" attributes="0">
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||||
<Component id="panelDetection" linkSize="23" min="-2" max="-2" attributes="0"/>
|
<Component id="panelLegend" linkSize="30" max="32767" attributes="0"/>
|
||||||
<Component id="panelLegend" min="-2" max="-2" attributes="0"/>
|
<Component id="panelDetection" linkSize="30" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace pref="234" max="32767" attributes="0"/>
|
<EmptySpace pref="242" max="32767" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||||
<Component id="panelHexiposi" alignment="1" min="-2" max="-2" attributes="0"/>
|
<Component id="panelCover" linkSize="30" max="32767" attributes="0"/>
|
||||||
<Component id="panelViewType" linkSize="23" alignment="1" min="-2" max="-2" attributes="0"/>
|
<Component id="panelViewType" linkSize="30" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
@@ -112,7 +116,7 @@
|
|||||||
<EmptySpace max="32767" attributes="0"/>
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="panelLegend" linkSize="7" alignment="1" max="32767" attributes="0"/>
|
<Component id="panelLegend" linkSize="7" alignment="1" max="32767" attributes="0"/>
|
||||||
<Component id="panelHexiposi" linkSize="7" alignment="1" min="-2" max="-2" attributes="0"/>
|
<Component id="panelCover" linkSize="7" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
@@ -161,7 +165,7 @@
|
|||||||
<Component id="jLabel23" min="-2" max="-2" attributes="0"/>
|
<Component id="jLabel23" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
<EmptySpace pref="30" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
@@ -269,7 +273,7 @@
|
|||||||
<Properties>
|
<Properties>
|
||||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||||
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
||||||
<TitledBorder title="Detection"/>
|
<TitledBorder title="Sample Transfer"/>
|
||||||
</Border>
|
</Border>
|
||||||
</Property>
|
</Property>
|
||||||
</Properties>
|
</Properties>
|
||||||
@@ -278,51 +282,39 @@
|
|||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<EmptySpace pref="26" max="32767" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
<Component id="buttonSampleLoad" pref="90" max="32767" attributes="0"/>
|
||||||
<Component id="buttonClearDet" linkSize="4" max="32767" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="buttonPuckDet" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<EmptySpace pref="26" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="1" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
<Component id="buttonPuckDet" min="-2" max="-2" attributes="0"/>
|
<Component id="buttonSampleLoad" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
|
||||||
<Component id="buttonClearDet" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
</Layout>
|
</Layout>
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Component class="javax.swing.JButton" name="buttonClearDet">
|
<Component class="javax.swing.JButton" name="buttonSampleLoad">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Clear"/>
|
<Property name="text" type="java.lang.String" value="Load"/>
|
||||||
|
<Property name="enabled" type="boolean" value="false"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonClearDetActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonSampleLoadActionPerformed"/>
|
||||||
</Events>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.JButton" name="buttonPuckDet">
|
|
||||||
<Properties>
|
|
||||||
<Property name="text" type="java.lang.String" value="Start"/>
|
|
||||||
</Properties>
|
|
||||||
<Events>
|
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonPuckDetActionPerformed"/>
|
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Container>
|
</Container>
|
||||||
<Container class="javax.swing.JPanel" name="panelHexiposi">
|
<Container class="javax.swing.JPanel" name="panelCover">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
|
||||||
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
|
||||||
<TitledBorder title="Cover"/>
|
<TitledBorder title="Cover Detection"/>
|
||||||
</Border>
|
</Border>
|
||||||
</Property>
|
</Property>
|
||||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||||
@@ -333,42 +325,70 @@
|
|||||||
<Layout>
|
<Layout>
|
||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="1" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<EmptySpace pref="14" max="32767" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="2" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="buttonDetectCover" alignment="2" min="-2" max="-2" attributes="0"/>
|
<Component id="jLabel1" max="32767" attributes="0"/>
|
||||||
<Component id="hexiposiPanel" alignment="2" min="-2" max="-2" attributes="0"/>
|
<Component id="textCoverDet" max="32767" attributes="0"/>
|
||||||
|
<Component id="jLabel2" alignment="0" max="32767" attributes="0"/>
|
||||||
|
<Component id="textCoverCache" alignment="0" pref="90" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace pref="15" max="32767" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<EmptySpace pref="18" max="32767" attributes="0"/>
|
<EmptySpace pref="12" max="32767" attributes="0"/>
|
||||||
<Component id="hexiposiPanel" min="-2" max="-2" attributes="0"/>
|
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace pref="13" max="32767" attributes="0"/>
|
|
||||||
<Component id="buttonDetectCover" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="textCoverCache" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="unrelated" pref="18" max="32767" attributes="0"/>
|
||||||
|
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Component id="textCoverDet" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace pref="12" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
</Layout>
|
</Layout>
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Component class="ch.psi.mxsc.HexiposiPanel" name="hexiposiPanel">
|
<Component class="javax.swing.JLabel" name="jLabel1">
|
||||||
<AuxValues>
|
|
||||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
|
||||||
</AuxValues>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.JButton" name="buttonDetectCover">
|
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Image"/>
|
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||||
|
<Property name="text" type="java.lang.String" value="Image:"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="textCoverDet">
|
||||||
|
<Properties>
|
||||||
|
<Property name="editable" type="boolean" value="false"/>
|
||||||
|
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||||
|
<Property name="disabledTextColor" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="0" green="0" red="0" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="enabled" type="boolean" value="false"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonDetectCoverActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="textCoverDetActionPerformed"/>
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||||
|
<Properties>
|
||||||
|
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||||
|
<Property name="text" type="java.lang.String" value="Cleared:"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JTextField" name="textCoverCache">
|
||||||
|
<Properties>
|
||||||
|
<Property name="editable" type="boolean" value="false"/>
|
||||||
|
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||||
|
<Property name="disabledTextColor" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||||
|
<Color blue="0" green="0" red="0" type="rgb"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="enabled" type="boolean" value="false"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Container>
|
</Container>
|
||||||
<Container class="javax.swing.JPanel" name="panelViewType">
|
<Container class="javax.swing.JPanel" name="panelViewType">
|
||||||
@@ -384,12 +404,12 @@
|
|||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="1" attributes="0">
|
<Group type="102" alignment="1" attributes="0">
|
||||||
<EmptySpace pref="21" max="32767" attributes="0"/>
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="2" attributes="0">
|
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||||
<Component id="buttonDrawing" linkSize="25" alignment="2" min="-2" max="-2" attributes="0"/>
|
<Component id="buttonCamera" max="32767" attributes="0"/>
|
||||||
<Component id="buttonCamera" linkSize="25" alignment="2" min="-2" max="-2" attributes="0"/>
|
<Component id="buttonDrawing" pref="90" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace pref="21" max="32767" attributes="0"/>
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
@@ -408,7 +428,11 @@
|
|||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Component class="javax.swing.JToggleButton" name="buttonCamera">
|
<Component class="javax.swing.JToggleButton" name="buttonCamera">
|
||||||
<Properties>
|
<Properties>
|
||||||
|
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||||
|
<ComponentRef name="buttonGroup1"/>
|
||||||
|
</Property>
|
||||||
<Property name="text" type="java.lang.String" value="Image"/>
|
<Property name="text" type="java.lang.String" value="Image"/>
|
||||||
|
<Property name="enabled" type="boolean" value="false"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonCameraActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonCameraActionPerformed"/>
|
||||||
@@ -416,8 +440,11 @@
|
|||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JToggleButton" name="buttonDrawing">
|
<Component class="javax.swing.JToggleButton" name="buttonDrawing">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="selected" type="boolean" value="true"/>
|
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||||
|
<ComponentRef name="buttonGroup1"/>
|
||||||
|
</Property>
|
||||||
<Property name="text" type="java.lang.String" value="Design"/>
|
<Property name="text" type="java.lang.String" value="Design"/>
|
||||||
|
<Property name="enabled" type="boolean" value="false"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonDrawingActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonDrawingActionPerformed"/>
|
||||||
@@ -473,7 +500,7 @@
|
|||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="progressLN2" pref="411" max="32767" attributes="0"/>
|
<Component id="progressLN2" pref="428" max="32767" attributes="0"/>
|
||||||
<Group type="102" alignment="1" attributes="0">
|
<Group type="102" alignment="1" attributes="0">
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
|
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
|
||||||
@@ -613,21 +640,27 @@
|
|||||||
<Component id="ledPsysSafety" alignment="0" min="-2" max="-2" attributes="0"/>
|
<Component id="ledPsysSafety" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="ledManualMode" alignment="0" min="-2" max="-2" attributes="0"/>
|
<Component id="ledManualMode" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="ledDryer" alignment="0" min="-2" max="-2" attributes="0"/>
|
<Component id="ledDryer" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="ledServiceMode" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="jLabel24" alignment="0" min="-2" max="-2" attributes="0"/>
|
|
||||||
<Component id="jLabel25" alignment="0" min="-2" max="-2" attributes="0"/>
|
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<Component id="jLabel29" min="-2" max="-2" attributes="0"/>
|
<Component id="jLabel29" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace type="separate" max="32767" attributes="0"/>
|
<EmptySpace type="separate" max="32767" attributes="0"/>
|
||||||
<Component id="panelHeaterTemp" min="-2" pref="50" max="-2" attributes="0"/>
|
<Component id="panelHeaterTemp" min="-2" pref="50" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
|
<Component id="jLabel24" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="jLabel25" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="jLabel26" alignment="0" min="-2" max="-2" attributes="0"/>
|
<Component id="jLabel26" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="jLabell21" alignment="0" min="-2" max="-2" attributes="0"/>
|
<Component id="jLabell21" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="labelRoomTemperature" alignment="0" min="-2" max="-2" attributes="0"/>
|
<Component id="labelRoomTemperature" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="labelManualMode" alignment="0" min="-2" max="-2" attributes="0"/>
|
<Component id="labelManualMode" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="jLabel27" alignment="0" min="-2" max="-2" attributes="0"/>
|
<Component id="jLabel27" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="labelManualMode1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="checkService" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
@@ -642,14 +675,22 @@
|
|||||||
<DimensionLayout dim="1">
|
<DimensionLayout dim="1">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<EmptySpace min="0" pref="7" max="32767" attributes="0"/>
|
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
|
<Component id="ledManualMode" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="labelManualMode" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="1" attributes="0">
|
<Group type="103" groupAlignment="1" attributes="0">
|
||||||
<Group type="102" attributes="0">
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Component id="ledServiceMode" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="ledManualMode" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="labelManualMode1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="labelManualMode" alignment="3" min="-2" max="-2" attributes="0"/>
|
</Group>
|
||||||
</Group>
|
<Component id="checkService" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="1" attributes="0">
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
<Component id="ledRoomTemperature" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="ledRoomTemperature" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="labelRoomTemperature" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="labelRoomTemperature" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
@@ -660,7 +701,7 @@
|
|||||||
<Component id="jLabel29" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="jLabel29" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
<Component id="panelHeaterTemp" min="-2" max="-2" attributes="0"/>
|
<Component id="panelHeaterTemp" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
@@ -687,13 +728,13 @@
|
|||||||
<Component id="ledPsysSafety" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="ledPsysSafety" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="jLabell21" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="jLabell21" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace pref="11" max="32767" attributes="0"/>
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<Component id="buttonRelease" min="-2" max="-2" attributes="0"/>
|
<Component id="buttonRelease" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<Component id="filler1" pref="35" max="32767" attributes="0"/>
|
<Component id="filler1" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
@@ -791,6 +832,18 @@
|
|||||||
<Property name="text" type="java.lang.String" value="Dryer"/>
|
<Property name="text" type="java.lang.String" value="Dryer"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
</Component>
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="labelManualMode1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Service Mode"/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Component class="ch.psi.pshell.swing.Led" name="ledServiceMode">
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JCheckBox" name="checkService">
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkServiceActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Container>
|
</Container>
|
||||||
<Container class="javax.swing.JPanel" name="panelDatamatrix">
|
<Container class="javax.swing.JPanel" name="panelDatamatrix">
|
||||||
@@ -896,7 +949,7 @@
|
|||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||||
<Component id="panelDetail" pref="112" max="32767" attributes="0"/>
|
<Component id="panelDetail" pref="125" max="32767" attributes="0"/>
|
||||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||||
<Component id="panelDevices" min="-2" pref="280" max="-2" attributes="0"/>
|
<Component id="panelDevices" min="-2" pref="280" max="-2" attributes="0"/>
|
||||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||||
@@ -1005,8 +1058,8 @@
|
|||||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||||
<Component id="devicesPanel" min="-2" max="-2" attributes="0"/>
|
<Component id="devicesPanel" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace pref="26" max="32767" attributes="0"/>
|
<EmptySpace pref="26" max="32767" attributes="0"/>
|
||||||
<Component id="panelExpert" min="-2" pref="93" max="-2" attributes="0"/>
|
<Component id="panelExpert" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace pref="27" max="32767" attributes="0"/>
|
<EmptySpace pref="26" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
@@ -1016,9 +1069,9 @@
|
|||||||
<EmptySpace pref="10" max="32767" attributes="0"/>
|
<EmptySpace pref="10" max="32767" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Component id="panelExpert" max="32767" attributes="0"/>
|
<Component id="panelExpert" max="32767" attributes="0"/>
|
||||||
<Component id="devicesPanel" pref="236" max="32767" attributes="0"/>
|
<Component id="devicesPanel" pref="238" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace pref="11" max="32767" attributes="0"/>
|
<EmptySpace pref="9" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
@@ -1034,19 +1087,13 @@
|
|||||||
<Layout>
|
<Layout>
|
||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" attributes="0">
|
<Component id="checkExpert" alignment="0" min="-2" pref="92" max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
<Component id="buttonExpertCommands" linkSize="28" alignment="0" max="32767" attributes="0"/>
|
||||||
<Component id="buttonExpertCommands" linkSize="28" max="32767" attributes="0"/>
|
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||||
<Component id="buttonRecovery" linkSize="28" max="32767" attributes="0"/>
|
<Component id="buttonRecovery" linkSize="28" max="32767" attributes="0"/>
|
||||||
<Component id="buttonCalibrateImage" linkSize="28" max="32767" attributes="0"/>
|
<Component id="buttonConfig" linkSize="28" pref="85" max="32767" attributes="0"/>
|
||||||
<Component id="buttonCalibrateCover" linkSize="28" max="32767" attributes="0"/>
|
<Component id="buttonDetectionCalibrate" alignment="0" max="32767" attributes="0"/>
|
||||||
<Component id="buttonConfig" linkSize="28" min="-2" pref="85" max="-2" attributes="0"/>
|
<Component id="buttonDetectionExposure" min="-2" pref="92" max="-2" attributes="0"/>
|
||||||
</Group>
|
|
||||||
<EmptySpace max="32767" attributes="0"/>
|
|
||||||
</Group>
|
|
||||||
<Group type="102" alignment="0" attributes="0">
|
|
||||||
<Component id="checkExpert" min="-2" pref="92" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
@@ -1055,17 +1102,17 @@
|
|||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||||
<Component id="checkExpert" min="-2" max="-2" attributes="0"/>
|
<Component id="checkExpert" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace type="separate" pref="26" max="32767" attributes="0"/>
|
<EmptySpace type="unrelated" max="32767" attributes="0"/>
|
||||||
<Component id="buttonExpertCommands" min="-2" max="-2" attributes="0"/>
|
<Component id="buttonExpertCommands" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
<Component id="buttonRecovery" min="-2" max="-2" attributes="0"/>
|
<Component id="buttonRecovery" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
<Component id="buttonCalibrateImage" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
|
||||||
<Component id="buttonCalibrateCover" min="-2" max="-2" attributes="0"/>
|
|
||||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
|
||||||
<Component id="buttonConfig" min="-2" max="-2" attributes="0"/>
|
<Component id="buttonConfig" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="buttonDetectionCalibrate" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
|
<Component id="buttonDetectionExposure" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
@@ -1080,22 +1127,6 @@
|
|||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkExpertActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkExpertActionPerformed"/>
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="buttonCalibrateImage">
|
|
||||||
<Properties>
|
|
||||||
<Property name="text" type="java.lang.String" value="Calibrate"/>
|
|
||||||
</Properties>
|
|
||||||
<Events>
|
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonCalibrateImageActionPerformed"/>
|
|
||||||
</Events>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.JButton" name="buttonCalibrateCover">
|
|
||||||
<Properties>
|
|
||||||
<Property name="text" type="java.lang.String" value="Cover Ref"/>
|
|
||||||
</Properties>
|
|
||||||
<Events>
|
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonCalibrateCoverActionPerformed"/>
|
|
||||||
</Events>
|
|
||||||
</Component>
|
|
||||||
<Component class="javax.swing.JButton" name="buttonExpertCommands">
|
<Component class="javax.swing.JButton" name="buttonExpertCommands">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Commands"/>
|
<Property name="text" type="java.lang.String" value="Commands"/>
|
||||||
@@ -1120,6 +1151,22 @@
|
|||||||
<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="buttonConfigActionPerformed"/>
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="buttonDetectionCalibrate">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Calibrate"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonDetectionCalibrateActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JButton" name="buttonDetectionExposure">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Detection"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonDetectionExposureActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Container>
|
</Container>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
@@ -1170,7 +1217,7 @@
|
|||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||||
<Component id="panelTableSamples" alignment="1" max="32767" attributes="0"/>
|
<Component id="panelTableSamples" alignment="1" pref="676" max="32767" attributes="0"/>
|
||||||
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
@@ -1179,7 +1226,7 @@
|
|||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||||
<Component id="panelTableSamples" pref="126" max="32767" attributes="0"/>
|
<Component id="panelTableSamples" pref="43" max="32767" attributes="0"/>
|
||||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,92 +1,92 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014 Paul Scherrer Institute. All rights reserved.
|
* Copyright (c) 2014 Paul Scherrer Institute. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package ch.psi.mxsc;
|
package ch.psi.mxsc;
|
||||||
|
|
||||||
import ch.psi.mxsc.BasePlatePanel;
|
import ch.psi.mxsc.BasePlatePanel;
|
||||||
import ch.psi.mxsc.Controller;
|
import ch.psi.mxsc.Controller;
|
||||||
import ch.psi.pshell.device.Device;
|
import ch.psi.pshell.device.Device;
|
||||||
import ch.psi.pshell.ui.Panel;
|
import ch.psi.pshell.framework.Panel;
|
||||||
import ch.psi.utils.swing.SwingUtils;
|
import ch.psi.pshell.swing.SwingUtils;
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class MainPanelTest extends Panel {
|
class MainPanelTest extends Panel {
|
||||||
/** Creates new form Panel */
|
/** Creates new form Panel */
|
||||||
|
|
||||||
public MainPanelTest() {
|
public MainPanelTest() {
|
||||||
initComponents();
|
initComponents();
|
||||||
SwingUtils.setEnumCombo(comboMode, BasePlatePanel.Mode.class);
|
SwingUtils.setEnumCombo(comboMode, BasePlatePanel.Mode.class);
|
||||||
comboMode.setSelectedItem(basePlatePanel.getMode());
|
comboMode.setSelectedItem(basePlatePanel.getMode());
|
||||||
setPersistedComponents(new Component[]{comboMode});
|
setPersistedComponents(new Component[]{comboMode});
|
||||||
Controller.createInstance(this);
|
Controller.createInstance(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitialize(int runCount) {
|
public void onInitialize(int runCount) {
|
||||||
Controller.getInstance().onInitialize(runCount);
|
Controller.getInstance().onInitialize(runCount);
|
||||||
basePlatePanel.setDevice((Device) getDevice("BasePlate"));
|
basePlatePanel.setDevice((Device) getDevice("BasePlate"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** This method is called from within the constructor to
|
/** This method is called from within the constructor to
|
||||||
* initialize the form.
|
* initialize the form.
|
||||||
* WARNING: Do NOT modify this code. The content of this method is
|
* WARNING: Do NOT modify this code. The content of this method is
|
||||||
* always regenerated by the Form Editor.
|
* always regenerated by the Form Editor.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
|
|
||||||
basePlatePanel = new ch.psi.mxsc.BasePlatePanel();
|
basePlatePanel = new ch.psi.mxsc.BasePlatePanel();
|
||||||
comboMode = new javax.swing.JComboBox<>();
|
comboMode = new javax.swing.JComboBox<>();
|
||||||
|
|
||||||
comboMode.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
comboMode.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||||
comboMode.addActionListener(new java.awt.event.ActionListener() {
|
comboMode.addActionListener(new java.awt.event.ActionListener() {
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
comboModeActionPerformed(evt);
|
comboModeActionPerformed(evt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
javax.swing.GroupLayout basePlatePanelLayout = new javax.swing.GroupLayout(basePlatePanel);
|
javax.swing.GroupLayout basePlatePanelLayout = new javax.swing.GroupLayout(basePlatePanel);
|
||||||
basePlatePanel.setLayout(basePlatePanelLayout);
|
basePlatePanel.setLayout(basePlatePanelLayout);
|
||||||
basePlatePanelLayout.setHorizontalGroup(
|
basePlatePanelLayout.setHorizontalGroup(
|
||||||
basePlatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
basePlatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, basePlatePanelLayout.createSequentialGroup()
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, basePlatePanelLayout.createSequentialGroup()
|
||||||
.addGap(0, 386, Short.MAX_VALUE)
|
.addGap(0, 386, Short.MAX_VALUE)
|
||||||
.addComponent(comboMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
.addComponent(comboMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||||
);
|
);
|
||||||
basePlatePanelLayout.setVerticalGroup(
|
basePlatePanelLayout.setVerticalGroup(
|
||||||
basePlatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
basePlatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(basePlatePanelLayout.createSequentialGroup()
|
.addGroup(basePlatePanelLayout.createSequentialGroup()
|
||||||
.addComponent(comboMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(comboMode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addGap(0, 280, Short.MAX_VALUE))
|
.addGap(0, 280, Short.MAX_VALUE))
|
||||||
);
|
);
|
||||||
|
|
||||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||||
this.setLayout(layout);
|
this.setLayout(layout);
|
||||||
layout.setHorizontalGroup(
|
layout.setHorizontalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(basePlatePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.addComponent(basePlatePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
);
|
);
|
||||||
layout.setVerticalGroup(
|
layout.setVerticalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addComponent(basePlatePanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.addComponent(basePlatePanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
);
|
);
|
||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
private void comboModeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboModeActionPerformed
|
private void comboModeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboModeActionPerformed
|
||||||
basePlatePanel.setMode((BasePlatePanel.Mode) comboMode.getSelectedItem());
|
basePlatePanel.setMode((BasePlatePanel.Mode) comboMode.getSelectedItem());
|
||||||
}//GEN-LAST:event_comboModeActionPerformed
|
}//GEN-LAST:event_comboModeActionPerformed
|
||||||
|
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private ch.psi.mxsc.BasePlatePanel basePlatePanel;
|
private ch.psi.mxsc.BasePlatePanel basePlatePanel;
|
||||||
private javax.swing.JComboBox<String> comboMode;
|
private javax.swing.JComboBox<String> comboMode;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package ch.psi.mxsc;
|
package ch.psi.mxsc;
|
||||||
|
|
||||||
|
|
||||||
import ch.psi.utils.swing.StandardDialog;
|
import ch.psi.pshell.swing.StandardDialog;
|
||||||
import ch.psi.utils.swing.SwingUtils;
|
import ch.psi.pshell.swing.SwingUtils;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@@ -132,12 +132,12 @@ public class Puck extends DeviceBase {
|
|||||||
10, 9, 8};
|
10, 9, 8};
|
||||||
|
|
||||||
static final int[] ADDRESSES_6D = new int[]{
|
static final int[] ADDRESSES_6D = new int[]{
|
||||||
|
1, 2, 3, 4, 5,
|
||||||
|
6, 7, 8, 9, 10,
|
||||||
21, 22, 23, 24, 25,
|
21, 22, 23, 24, 25,
|
||||||
26, 27, 28, 29, 30,
|
26, 27, 28, 29, 30,
|
||||||
11, 12, 13, 14, 15,
|
11, 12, 13, 14, 15,
|
||||||
16, 17, 18, 19, 20,
|
16, 17, 18, 19, 20,
|
||||||
1, 2, 3, 4, 5,
|
|
||||||
6, 7, 8, 9, 10,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static final double[] ANGLES_NORMAL = new double[]{
|
static final double[] ANGLES_NORMAL = new double[]{
|
||||||
@@ -173,13 +173,13 @@ public class Puck extends DeviceBase {
|
|||||||
|
|
||||||
static final Character[] SEGMENTS = (MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.normal) ? SEGMENTS_NORMAL : (
|
static final Character[] SEGMENTS = (MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.normal) ? SEGMENTS_NORMAL : (
|
||||||
(MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.sf) ? SEGMENTS_SF : (
|
(MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.sf) ? SEGMENTS_SF : (
|
||||||
(MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.rt) ? SEGMENTS_RT : SEGMENTS_6D
|
(MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.rt) ? SEGMENTS_RT : SEGMENTS_NORMAL
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
static final int[] NUMBERS = (MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.normal) ? NUMBERS_NORMAL : (
|
static final int[] NUMBERS = (MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.normal) ? NUMBERS_NORMAL : (
|
||||||
(MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.sf) ? NUMBERS_SF :
|
(MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.sf) ? NUMBERS_SF :
|
||||||
((MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.rt) ? NUMBERS_RT : NUMBERS_6D)
|
((MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.rt) ? NUMBERS_RT : NUMBERS_NORMAL)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ public class Puck extends DeviceBase {
|
|||||||
|
|
||||||
static final double[] ANGLES = (MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.normal) ? ANGLES_NORMAL : (
|
static final double[] ANGLES = (MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.normal) ? ANGLES_NORMAL : (
|
||||||
(MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.sf) ? ANGLES_SF :
|
(MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.sf) ? ANGLES_SF :
|
||||||
((MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.rt) ? ANGLES_RT : ANGLES_6D)
|
((MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.rt) ? ANGLES_RT : ANGLES_NORMAL)
|
||||||
);
|
);
|
||||||
|
|
||||||
final static PointDouble referencePosition = new PointDouble(0.0, -66.9 - 0.2);
|
final static PointDouble referencePosition = new PointDouble(0.0, -66.9 - 0.2);
|
||||||
@@ -331,23 +331,6 @@ public class Puck extends DeviceBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean isSegmentSelected() {
|
|
||||||
/*
|
|
||||||
switch(Integer.valueOf(Controller.getInstance().getHexaposiPosition())){
|
|
||||||
case 1: return getSegment()=='A';
|
|
||||||
case 2: return getSegment()=='B';
|
|
||||||
case 3: return getSegment()=='C';
|
|
||||||
case 4: return getSegment()=='D';
|
|
||||||
case 5: return getSegment()=='E';
|
|
||||||
case 6: return getSegment()=='F';
|
|
||||||
}
|
|
||||||
} catch(Exception ex){
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
*/
|
|
||||||
return ("" + getSegment()).equalsIgnoreCase(Controller.getInstance().getHexiposiPosition());
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getIndex() {
|
public int getIndex() {
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
@@ -355,21 +338,41 @@ public class Puck extends DeviceBase {
|
|||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
//return "XXX000" + index;
|
//return "XXX000" + index;
|
||||||
|
if (getDetection()!=Detection.Present){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(String value) {
|
public void setId(String value) {
|
||||||
for (Device d : getParent().getChildren()) {
|
if (value!=null){
|
||||||
if (d instanceof Puck) {
|
for (Device d : getParent().getChildren()) {
|
||||||
if (((Puck)d).getId() != null){
|
if (d instanceof Puck) {
|
||||||
if (((Puck)d).getId().equals(value)){
|
if (((Puck)d).getId() != null){
|
||||||
((Puck)d).setId(null);
|
if (isSameId (((Puck)d).getId(), value)){
|
||||||
|
((Puck)d).setId(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
id = value;
|
id = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isSameId(String id1, String id2){
|
||||||
|
if ((id1==null) || (id2==null)){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return id1.equals(id2) || BarcodeMatcher.matchBarcodes(id1,id2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean hasSameId(Puck p1, Puck p2){
|
||||||
|
return isSameId(p1.getId(), p2.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasSameId(Puck p){
|
||||||
|
return isSameId(getId(), p.getId());
|
||||||
|
}
|
||||||
|
|
||||||
public char getSegment() {
|
public char getSegment() {
|
||||||
return segment;
|
return segment;
|
||||||
@@ -387,6 +390,7 @@ public class Puck extends DeviceBase {
|
|||||||
return (getSegment() - new Character('A')) * BasePlate.numberOfPucksPerSegments + getNumber() - 1;
|
return (getSegment() - new Character('A')) * BasePlate.numberOfPucksPerSegments + getNumber() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
boolean enabled;
|
boolean enabled;
|
||||||
|
|
||||||
public boolean isEnabled() {
|
public boolean isEnabled() {
|
||||||
@@ -396,6 +400,7 @@ public class Puck extends DeviceBase {
|
|||||||
public void setEnabled(boolean value) {
|
public void setEnabled(boolean value) {
|
||||||
enabled = value;
|
enabled = value;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
public enum Detection {
|
public enum Detection {
|
||||||
Empty,
|
Empty,
|
||||||
@@ -449,6 +454,26 @@ public class Puck extends DeviceBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean pointed;
|
||||||
|
|
||||||
|
public boolean isPointed() {
|
||||||
|
return pointed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPointed(boolean value) {
|
||||||
|
if (value != pointed) {
|
||||||
|
if (value == true) {
|
||||||
|
for (Device d : getParent().getChildren()) {
|
||||||
|
if (d instanceof Puck puck) {
|
||||||
|
puck.pointed = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pointed = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public int getNumberOfSamples() {
|
public int getNumberOfSamples() {
|
||||||
return numberOfSamples;
|
return numberOfSamples;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
package ch.psi.mxsc;
|
package ch.psi.mxsc;
|
||||||
|
|
||||||
import ch.psi.pshell.core.JsonSerializer;
|
import ch.psi.pshell.utils.EncoderJson;
|
||||||
import ch.psi.pshell.device.DeviceBase;
|
import ch.psi.pshell.device.DeviceBase;
|
||||||
import ch.psi.pshell.device.ReadonlyAsyncRegisterBase;
|
import ch.psi.pshell.device.ReadonlyAsyncRegisterBase;
|
||||||
import ch.psi.pshell.device.ReadonlyRegisterBase;
|
import ch.psi.pshell.device.ReadonlyRegisterBase;
|
||||||
import ch.psi.utils.Chrono;
|
import ch.psi.pshell.utils.Chrono;
|
||||||
import ch.psi.utils.State;
|
import ch.psi.pshell.utils.State;
|
||||||
import ch.psi.utils.Threading;
|
import ch.psi.pshell.utils.Threading;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
@@ -17,6 +17,7 @@ public class PuckDetection extends DeviceBase {
|
|||||||
public volatile Chrono chrono;
|
public volatile Chrono chrono;
|
||||||
boolean debug;
|
boolean debug;
|
||||||
public static final int TIMEOUT = 10000;
|
public static final int TIMEOUT = 10000;
|
||||||
|
boolean enabled = true;
|
||||||
|
|
||||||
public PuckDetection(String name, String server) {
|
public PuckDetection(String name, String server) {
|
||||||
super(name);
|
super(name);
|
||||||
@@ -70,9 +71,10 @@ public class PuckDetection extends DeviceBase {
|
|||||||
if (chrono.isTimeout(TIMEOUT)) {
|
if (chrono.isTimeout(TIMEOUT)) {
|
||||||
if (!isSimulated()) {
|
if (!isSimulated()) {
|
||||||
setState(State.Offline);
|
setState(State.Offline);
|
||||||
if (Controller.getInstance() != null) {
|
getLogger().severe("Puck Detection Timeout");
|
||||||
Controller.getInstance().clearPuckStates();
|
//if (Controller.getInstance() != null) {
|
||||||
}
|
// Controller.getInstance().clearPuckStates();
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
@@ -128,12 +130,12 @@ public class PuckDetection extends DeviceBase {
|
|||||||
if (debug) {
|
if (debug) {
|
||||||
System.out.println(contents);
|
System.out.println(contents);
|
||||||
}
|
}
|
||||||
processMessage(contents);
|
|
||||||
|
if (isEnabled() || (take() == null)){
|
||||||
if (Controller.getInstance() != null) {
|
processMessage(contents);
|
||||||
Controller.getInstance().updateView();
|
|
||||||
}
|
}
|
||||||
setState(State.Ready);
|
setState(State.Ready);
|
||||||
|
setCache(contents);
|
||||||
if (chrono != null){
|
if (chrono != null){
|
||||||
updateTime.update(chrono.getEllapsed());
|
updateTime.update(chrono.getEllapsed());
|
||||||
}
|
}
|
||||||
@@ -158,11 +160,18 @@ public class PuckDetection extends DeviceBase {
|
|||||||
setState(State.Offline);
|
setState(State.Offline);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void applyCache(){
|
||||||
|
Object cache = take();
|
||||||
|
if (cache instanceof String contents){
|
||||||
|
processMessage(contents);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void processMessage(String str) {
|
void processMessage(String str) {
|
||||||
try {
|
try {
|
||||||
//System.out.println(str);
|
//System.out.println(str);
|
||||||
List<List> detection = (List) JsonSerializer.decode(str, List.class);
|
List<List> detection = (List) EncoderJson.decode(str, List.class);
|
||||||
|
|
||||||
int address = 1;
|
int address = 1;
|
||||||
for (List<List> bus : detection) {
|
for (List<List> bus : detection) {
|
||||||
@@ -176,11 +185,13 @@ public class PuckDetection extends DeviceBase {
|
|||||||
}
|
}
|
||||||
address++;
|
address++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setCache(str);
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
getLogger().log(Level.INFO, null, ex);
|
getLogger().log(Level.INFO, null, ex);
|
||||||
}
|
}
|
||||||
|
if (Controller.getInstance() != null) {
|
||||||
|
Controller.getInstance().updateView();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public PuckState getPuckState(int id) throws Exception {
|
public PuckState getPuckState(int id) throws Exception {
|
||||||
@@ -215,6 +226,14 @@ public class PuckDetection extends DeviceBase {
|
|||||||
thread = null;
|
thread = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setEnabled(boolean value){
|
||||||
|
enabled = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEnabled(){
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException, InterruptedException {
|
public static void main(String[] args) throws IOException, InterruptedException {
|
||||||
//PuckDetection pd = new PuckDetection("PD", "129.129.110.99:5556");
|
//PuckDetection pd = new PuckDetection("PD", "129.129.110.99:5556");
|
||||||
|
|||||||
149
src/main/java/ch/psi/mxsc/PuckDetectionErrorDialog.form
Normal file
149
src/main/java/ch/psi/mxsc/PuckDetectionErrorDialog.form
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<Form version="1.6" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
|
||||||
|
<Properties>
|
||||||
|
<Property name="defaultCloseOperation" type="int" value="2"/>
|
||||||
|
</Properties>
|
||||||
|
<SyntheticProperties>
|
||||||
|
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||||
|
<SyntheticProperty name="generateCenter" type="boolean" value="false"/>
|
||||||
|
</SyntheticProperties>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
|
||||||
|
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
|
||||||
|
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
|
||||||
|
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
|
||||||
|
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout>
|
||||||
|
<DimensionLayout dim="0">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="panelTable" alignment="0" pref="0" max="32767" attributes="0"/>
|
||||||
|
<Group type="102" attributes="0">
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Component id="labelSuggestion" pref="802" max="32767" attributes="0"/>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||||
|
<Component id="buttonOk" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<Component id="labelSuggestion1" pref="802" max="32767" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
<DimensionLayout dim="1">
|
||||||
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="labelSuggestion" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="labelSuggestion1" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="panelTable" pref="172" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace type="separate" min="-2" max="-2" attributes="0"/>
|
||||||
|
<Component id="buttonOk" min="-2" max="-2" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
|
</Group>
|
||||||
|
</DimensionLayout>
|
||||||
|
</Layout>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JLabel" name="labelSuggestion">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Lucida Grande" size="24" style="0"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||||
|
<Property name="text" type="java.lang.String" value="The following pucks were not detected "/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
<Container class="javax.swing.JScrollPane" name="panelTable">
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||||
|
</AuxValues>
|
||||||
|
|
||||||
|
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||||
|
<SubComponents>
|
||||||
|
<Component class="javax.swing.JTable" name="table">
|
||||||
|
<Properties>
|
||||||
|
<Property name="autoCreateRowSorter" type="boolean" value="true"/>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Lucida Grande" size="30" style="0"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
|
||||||
|
<Table columnCount="4" rowCount="0">
|
||||||
|
<Column editable="false" title="User" type="java.lang.String"/>
|
||||||
|
<Column editable="false" title="Dewar" type="java.lang.String"/>
|
||||||
|
<Column editable="false" title="Puck Id/Datamatrix" type="java.lang.String"/>
|
||||||
|
<Column editable="false" title="Puck Position" type="java.lang.String"/>
|
||||||
|
</Table>
|
||||||
|
</Property>
|
||||||
|
<Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor">
|
||||||
|
<TableColumnModel selectionModel="0">
|
||||||
|
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
|
||||||
|
<Title/>
|
||||||
|
<Editor/>
|
||||||
|
<Renderer/>
|
||||||
|
</Column>
|
||||||
|
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
|
||||||
|
<Title/>
|
||||||
|
<Editor/>
|
||||||
|
<Renderer/>
|
||||||
|
</Column>
|
||||||
|
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
|
||||||
|
<Title/>
|
||||||
|
<Editor/>
|
||||||
|
<Renderer/>
|
||||||
|
</Column>
|
||||||
|
<Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true">
|
||||||
|
<Title/>
|
||||||
|
<Editor/>
|
||||||
|
<Renderer/>
|
||||||
|
</Column>
|
||||||
|
</TableColumnModel>
|
||||||
|
</Property>
|
||||||
|
<Property name="rowHeight" type="int" value="40"/>
|
||||||
|
<Property name="selectionMode" type="int" value="0"/>
|
||||||
|
<Property name="selectionModel" type="javax.swing.ListSelectionModel" editor="org.netbeans.modules.form.editors2.JTableSelectionModelEditor">
|
||||||
|
<JTableSelectionModel selectionMode="0"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor">
|
||||||
|
<TableHeader reorderingAllowed="false" resizingAllowed="true"/>
|
||||||
|
</Property>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tableMouseReleased"/>
|
||||||
|
<EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="tableKeyReleased"/>
|
||||||
|
</Events>
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||||
|
</AuxValues>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Container>
|
||||||
|
<Component class="javax.swing.JButton" name="buttonOk">
|
||||||
|
<Properties>
|
||||||
|
<Property name="text" type="java.lang.String" value="Ok"/>
|
||||||
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonOkActionPerformed"/>
|
||||||
|
</Events>
|
||||||
|
</Component>
|
||||||
|
<Component class="javax.swing.JLabel" name="labelSuggestion1">
|
||||||
|
<Properties>
|
||||||
|
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||||
|
<Font name="Lucida Grande" size="24" style="0"/>
|
||||||
|
</Property>
|
||||||
|
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||||
|
<Property name="text" type="java.lang.String" value="and must be manually removed."/>
|
||||||
|
</Properties>
|
||||||
|
</Component>
|
||||||
|
</SubComponents>
|
||||||
|
</Form>
|
||||||
207
src/main/java/ch/psi/mxsc/PuckDetectionErrorDialog.java
Normal file
207
src/main/java/ch/psi/mxsc/PuckDetectionErrorDialog.java
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
|
||||||
|
package ch.psi.mxsc;
|
||||||
|
|
||||||
|
import ch.psi.pshell.swing.StandardDialog;
|
||||||
|
import ch.psi.pshell.swing.SwingUtils;
|
||||||
|
import ch.psi.pshell.utils.Str;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Frame;
|
||||||
|
import java.awt.Window;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import javax.swing.JDialog;
|
||||||
|
import javax.swing.table.DefaultTableModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class PuckDetectionErrorDialog extends JDialog {
|
||||||
|
final DefaultTableModel model;
|
||||||
|
|
||||||
|
final int INDEX_USER = 0;
|
||||||
|
final int INDEX_DEWAR = 1;
|
||||||
|
final int INDEX_DATAMATRIX = 2;
|
||||||
|
final int INDEX_POSITION = 3;
|
||||||
|
|
||||||
|
public PuckDetectionErrorDialog(JDialog parent, boolean modal) {
|
||||||
|
super(parent, "Puck Detection Error", modal);
|
||||||
|
initComponents();
|
||||||
|
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
|
||||||
|
model = (DefaultTableModel) table.getModel();
|
||||||
|
table.getTableHeader().setFont(table.getTableHeader().getFont().deriveFont(16.0f));
|
||||||
|
panelTable.getVerticalScrollBar().setPreferredSize(new Dimension(30, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initializePucks(List<Puck> failing) {
|
||||||
|
List<String> names = failing.stream().map(Puck::getName).toList();
|
||||||
|
initialize(names);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initialize(List<String> failing) {
|
||||||
|
Map dms = Controller.getInstance().getPuckDatamatrixInfo();
|
||||||
|
if (dms == null) {
|
||||||
|
dms = new HashMap();
|
||||||
|
}
|
||||||
|
Object[] keys = dms.keySet().toArray();
|
||||||
|
|
||||||
|
model.setRowCount(failing.size());
|
||||||
|
for (int i=0; i< failing.size(); i++) {
|
||||||
|
String pos = failing.get(i);
|
||||||
|
model.setValueAt(failing.get(i), i, INDEX_POSITION);
|
||||||
|
for (int j=0; j< keys.length; j++) {
|
||||||
|
Map info = (Map) dms.get(keys[j]);
|
||||||
|
String address = Str.toString(info.getOrDefault("address", ""));
|
||||||
|
if (pos.equals(address)){
|
||||||
|
model.setValueAt(keys[j], i, INDEX_DATAMATRIX);
|
||||||
|
model.setValueAt(info.getOrDefault("dewar", ""), i, INDEX_DEWAR);
|
||||||
|
model.setValueAt(info.getOrDefault("user", ""), i, INDEX_USER);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateLaser(){
|
||||||
|
try{
|
||||||
|
int sel = table.getSelectedRow();
|
||||||
|
if (sel>=0){
|
||||||
|
String pos = model.getValueAt(sel, INDEX_POSITION).toString();
|
||||||
|
Puck puck = Controller.getInstance().getPuck(pos);
|
||||||
|
if (puck!=null){
|
||||||
|
Controller.getInstance().setLaserPos(pos);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Controller.getInstance().setLaserPos((Puck)null);
|
||||||
|
} catch (Exception ex){
|
||||||
|
SwingUtils.showException(this,ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is called from within the constructor to initialize the form.
|
||||||
|
* WARNING: Do NOT modify this code. The content of this method is always
|
||||||
|
* regenerated by the Form Editor.
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
|
private void initComponents() {
|
||||||
|
|
||||||
|
labelSuggestion = new javax.swing.JLabel();
|
||||||
|
panelTable = new javax.swing.JScrollPane();
|
||||||
|
table = new javax.swing.JTable();
|
||||||
|
buttonOk = new javax.swing.JButton();
|
||||||
|
labelSuggestion1 = new javax.swing.JLabel();
|
||||||
|
|
||||||
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
|
|
||||||
|
labelSuggestion.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N
|
||||||
|
labelSuggestion.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||||
|
labelSuggestion.setText("The following pucks were not detected ");
|
||||||
|
|
||||||
|
table.setAutoCreateRowSorter(true);
|
||||||
|
table.setFont(new java.awt.Font("Lucida Grande", 0, 30)); // NOI18N
|
||||||
|
table.setModel(new javax.swing.table.DefaultTableModel(
|
||||||
|
new Object [][] {
|
||||||
|
|
||||||
|
},
|
||||||
|
new String [] {
|
||||||
|
"User", "Dewar", "Puck Id/Datamatrix", "Puck Position"
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
Class[] types = new Class [] {
|
||||||
|
java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
|
||||||
|
};
|
||||||
|
boolean[] canEdit = new boolean [] {
|
||||||
|
false, false, false, false
|
||||||
|
};
|
||||||
|
|
||||||
|
public Class getColumnClass(int columnIndex) {
|
||||||
|
return types [columnIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isCellEditable(int rowIndex, int columnIndex) {
|
||||||
|
return canEdit [columnIndex];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
table.setRowHeight(40);
|
||||||
|
table.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
|
||||||
|
table.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
|
||||||
|
table.getTableHeader().setReorderingAllowed(false);
|
||||||
|
table.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||||
|
public void mouseReleased(java.awt.event.MouseEvent evt) {
|
||||||
|
tableMouseReleased(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
table.addKeyListener(new java.awt.event.KeyAdapter() {
|
||||||
|
public void keyReleased(java.awt.event.KeyEvent evt) {
|
||||||
|
tableKeyReleased(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
panelTable.setViewportView(table);
|
||||||
|
|
||||||
|
buttonOk.setText("Ok");
|
||||||
|
buttonOk.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
buttonOkActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
labelSuggestion1.setFont(new java.awt.Font("Lucida Grande", 0, 24)); // NOI18N
|
||||||
|
labelSuggestion1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||||
|
labelSuggestion1.setText("and must be manually removed.");
|
||||||
|
|
||||||
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||||
|
getContentPane().setLayout(layout);
|
||||||
|
layout.setHorizontalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(panelTable, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addContainerGap()
|
||||||
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addComponent(labelSuggestion, javax.swing.GroupLayout.DEFAULT_SIZE, 802, Short.MAX_VALUE)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addGap(0, 0, Short.MAX_VALUE)
|
||||||
|
.addComponent(buttonOk)
|
||||||
|
.addGap(0, 0, Short.MAX_VALUE))
|
||||||
|
.addComponent(labelSuggestion1, javax.swing.GroupLayout.DEFAULT_SIZE, 802, Short.MAX_VALUE))
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
layout.setVerticalGroup(
|
||||||
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(labelSuggestion)
|
||||||
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
|
.addComponent(labelSuggestion1)
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addComponent(panelTable, javax.swing.GroupLayout.DEFAULT_SIZE, 172, Short.MAX_VALUE)
|
||||||
|
.addGap(18, 18, 18)
|
||||||
|
.addComponent(buttonOk)
|
||||||
|
.addContainerGap())
|
||||||
|
);
|
||||||
|
|
||||||
|
pack();
|
||||||
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
|
private void buttonOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonOkActionPerformed
|
||||||
|
setVisible(false);
|
||||||
|
}//GEN-LAST:event_buttonOkActionPerformed
|
||||||
|
|
||||||
|
private void tableKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tableKeyReleased
|
||||||
|
updateLaser();
|
||||||
|
}//GEN-LAST:event_tableKeyReleased
|
||||||
|
|
||||||
|
private void tableMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tableMouseReleased
|
||||||
|
updateLaser();
|
||||||
|
}//GEN-LAST:event_tableMouseReleased
|
||||||
|
|
||||||
|
|
||||||
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JButton buttonOk;
|
||||||
|
private javax.swing.JLabel labelSuggestion;
|
||||||
|
private javax.swing.JLabel labelSuggestion1;
|
||||||
|
private javax.swing.JScrollPane panelTable;
|
||||||
|
javax.swing.JTable table;
|
||||||
|
// End of variables declaration//GEN-END:variables
|
||||||
|
}
|
||||||
@@ -3,8 +3,8 @@ package ch.psi.mxsc;
|
|||||||
import ch.psi.mxsc.Puck.PuckType;
|
import ch.psi.mxsc.Puck.PuckType;
|
||||||
import ch.psi.pshell.imaging.DimensionDouble;
|
import ch.psi.pshell.imaging.DimensionDouble;
|
||||||
import ch.psi.pshell.imaging.PointDouble;
|
import ch.psi.pshell.imaging.PointDouble;
|
||||||
import ch.psi.utils.swing.MainFrame;
|
import ch.psi.pshell.app.MainFrame;
|
||||||
import ch.psi.utils.swing.SwingUtils;
|
import ch.psi.pshell.swing.SwingUtils;
|
||||||
import java.awt.BasicStroke;
|
import java.awt.BasicStroke;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
@@ -88,7 +88,7 @@ public class PuckGraphics {
|
|||||||
if (MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.rt){
|
if (MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.rt){
|
||||||
return puck.isSelected();
|
return puck.isSelected();
|
||||||
}
|
}
|
||||||
return puck.isSelected() || puck.isSegmentSelected();
|
return puck.isSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
Color getEmptyColor(){
|
Color getEmptyColor(){
|
||||||
@@ -237,9 +237,7 @@ public class PuckGraphics {
|
|||||||
if (MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.rt){
|
if (MainPanel.BASE_PLATE_LAYOUT == MainPanel.BasePlateLayout.rt){
|
||||||
selectedWidth = 3;
|
selectedWidth = 3;
|
||||||
}
|
}
|
||||||
return drawBackground ?
|
return normalWidth;
|
||||||
puck.isSegmentSelected() ? selectedWidth : normalWidth :
|
|
||||||
puck.isSegmentSelected() ? selectedWidth : normalWidth;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int getReferenceDrawSize() {
|
int getReferenceDrawSize() {
|
||||||
@@ -317,6 +315,14 @@ public class PuckGraphics {
|
|||||||
g.drawOval(pu.x - unipuckSize / 2, pu.y - unipuckSize / 2, unipuckSize, unipuckSize);
|
g.drawOval(pu.x - unipuckSize / 2, pu.y - unipuckSize / 2, unipuckSize, unipuckSize);
|
||||||
g.drawOval(pm.x - minispineSize / 2, pm.y - minispineSize / 2, minispineSize, minispineSize);
|
g.drawOval(pm.x - minispineSize / 2, pm.y - minispineSize / 2, minispineSize, minispineSize);
|
||||||
}
|
}
|
||||||
|
//Draw pointed
|
||||||
|
|
||||||
|
if (puck.isPointed()){
|
||||||
|
Point pos = getDrawPosition();
|
||||||
|
int pointerSize = 8;
|
||||||
|
g.setColor(Color.red);
|
||||||
|
g.fillOval(pos.x - pointerSize / 2, pos.y - pointerSize / 2, pointerSize, pointerSize);
|
||||||
|
}
|
||||||
|
|
||||||
//Draw text
|
//Draw text
|
||||||
String id = puck.getId();
|
String id = puck.getId();
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<DimensionLayout dim="0">
|
<DimensionLayout dim="0">
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||||
@@ -32,7 +32,6 @@
|
|||||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<Component id="labelSuggestion" max="32767" attributes="0"/>
|
<Component id="labelSuggestion" max="32767" attributes="0"/>
|
||||||
<Component id="panelTable" pref="484" max="32767" attributes="0"/>
|
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<Component id="jLabel1" linkSize="1" min="-2" max="-2" attributes="0"/>
|
<Component id="jLabel1" linkSize="1" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
@@ -45,8 +44,12 @@
|
|||||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||||
<Component id="textDetectedPuck" max="32767" attributes="0"/>
|
<Component id="textDetectedPuck" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
|
<Group type="102" alignment="0" attributes="0">
|
||||||
|
<Component id="panelTable" pref="531" max="32767" attributes="0"/>
|
||||||
|
<EmptySpace min="-2" pref="14" max="-2" attributes="0"/>
|
||||||
|
</Group>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<Component id="labelStatus" alignment="0" max="32767" attributes="0"/>
|
<Component id="labelStatus" alignment="0" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
@@ -115,7 +118,8 @@
|
|||||||
<Font name="Lucida Grande" size="30" style="0"/>
|
<Font name="Lucida Grande" size="30" style="0"/>
|
||||||
</Property>
|
</Property>
|
||||||
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
|
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
|
||||||
<Table columnCount="3" rowCount="0">
|
<Table columnCount="4" rowCount="0">
|
||||||
|
<Column editable="false" title="User" type="java.lang.String"/>
|
||||||
<Column editable="false" title="Dewar" type="java.lang.String"/>
|
<Column editable="false" title="Dewar" type="java.lang.String"/>
|
||||||
<Column editable="false" title="Puck Id/Datamatrix" type="java.lang.String"/>
|
<Column editable="false" title="Puck Id/Datamatrix" type="java.lang.String"/>
|
||||||
<Column editable="false" title="Puck Position" type="java.lang.String"/>
|
<Column editable="false" title="Puck Position" type="java.lang.String"/>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package ch.psi.mxsc;
|
package ch.psi.mxsc;
|
||||||
|
|
||||||
import ch.psi.pshell.core.Context;
|
|
||||||
import ch.psi.pshell.swing.DataPanel;
|
import ch.psi.pshell.swing.DataPanel;
|
||||||
import ch.psi.utils.swing.MainFrame;
|
import ch.psi.pshell.app.MainFrame;
|
||||||
import ch.psi.utils.swing.SwingUtils;
|
import ch.psi.pshell.framework.Setup;
|
||||||
|
import ch.psi.pshell.swing.SwingUtils;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
@@ -22,19 +22,22 @@ import javax.swing.table.DefaultTableModel;
|
|||||||
public class PuckLoadingDialog extends JDialog {
|
public class PuckLoadingDialog extends JDialog {
|
||||||
Path dialogPersistPath;
|
Path dialogPersistPath;
|
||||||
DefaultTableModel model;
|
DefaultTableModel model;
|
||||||
|
final boolean load;
|
||||||
|
|
||||||
final int INDEX_DEWAR = 0;
|
final int INDEX_USER = 0;
|
||||||
final int INDEX_DATAMATRIX = 1;
|
final int INDEX_DEWAR = 1;
|
||||||
final int INDEX_POSITION = 2;
|
final int INDEX_DATAMATRIX = 2;
|
||||||
|
final int INDEX_POSITION = 3;
|
||||||
/**
|
/**
|
||||||
* Creates new form PuckLoadingDialog
|
* Creates new form PuckLoadingDialog
|
||||||
*/
|
*/
|
||||||
public PuckLoadingDialog(java.awt.Frame parent, boolean modal) {
|
public PuckLoadingDialog(java.awt.Frame parent, boolean load, boolean modal) {
|
||||||
super(parent, "Puck Loading", modal);
|
super(parent, load ? "Puck Loading" : "Puck Unloading", modal);
|
||||||
initComponents();
|
initComponents();
|
||||||
|
this.load = load;
|
||||||
this.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
|
this.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
|
||||||
this.setName("PuckLoadingDialog");
|
this.setName("PuckLoadingDialog");
|
||||||
dialogPersistPath = Paths.get(Context.getInstance().getSetup().getContextPath(), getClass().getSimpleName());
|
dialogPersistPath = Paths.get(Setup.getContextPath(), getClass().getSimpleName());
|
||||||
setStatusLabel(null,-1);
|
setStatusLabel(null,-1);
|
||||||
setSugestionLabel(null,-1);
|
setSugestionLabel(null,-1);
|
||||||
model = (DefaultTableModel) table.getModel();
|
model = (DefaultTableModel) table.getModel();
|
||||||
@@ -73,15 +76,17 @@ public class PuckLoadingDialog extends JDialog {
|
|||||||
if (keys.length != model.getRowCount()){
|
if (keys.length != model.getRowCount()){
|
||||||
model.setRowCount(keys.length);
|
model.setRowCount(keys.length);
|
||||||
}
|
}
|
||||||
for (int i=0; i< keys.length; i++) {
|
for (int i=0; i< keys.length; i++) {
|
||||||
model.setValueAt(keys[i], i, INDEX_DATAMATRIX);
|
model.setValueAt(keys[i], i, INDEX_DATAMATRIX);
|
||||||
try{
|
try{
|
||||||
Map info = (Map) dms.get(keys[i]);
|
Map info = (Map) dms.get(keys[i]);
|
||||||
model.setValueAt(info.get("address"), i, INDEX_POSITION);
|
model.setValueAt(info.get("address"), i, INDEX_POSITION);
|
||||||
model.setValueAt(info.get("dewar"), i, INDEX_DEWAR);
|
model.setValueAt(info.get("dewar"), i, INDEX_DEWAR);
|
||||||
|
model.setValueAt(info.get("user"), i, INDEX_USER);
|
||||||
} catch (Exception ex){
|
} catch (Exception ex){
|
||||||
model.setValueAt("Unknown", i, INDEX_POSITION);
|
model.setValueAt("Unknown", i, INDEX_POSITION);
|
||||||
model.setValueAt("Unknown", i, INDEX_DEWAR);
|
model.setValueAt("Unknown", i, INDEX_DEWAR);
|
||||||
|
model.setValueAt("Unknown", i, INDEX_USER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -90,9 +95,17 @@ public class PuckLoadingDialog extends JDialog {
|
|||||||
textScannedDatamatrix.setText((datamatrix == null) ? "" : datamatrix.trim());
|
textScannedDatamatrix.setText((datamatrix == null) ? "" : datamatrix.trim());
|
||||||
if ((datamatrix != null) && (!datamatrix.isEmpty())){
|
if ((datamatrix != null) && (!datamatrix.isEmpty())){
|
||||||
setStatusLabel("Scanned puck " + datamatrix, 5000);
|
setStatusLabel("Scanned puck " + datamatrix, 5000);
|
||||||
makeVisible(datamatrix);
|
makeVisible(datamatrix);
|
||||||
|
String loadedPuck = Controller.getInstance().getPuckFromDatamatrix(datamatrix);
|
||||||
|
if ((loadedPuck!=null) && !loadedPuck.isBlank()){
|
||||||
|
Controller.getInstance().setLaserPos(loadedPuck);
|
||||||
|
} else {
|
||||||
|
Puck puck = Controller.getInstance().getFreePuck();
|
||||||
|
Controller.getInstance().setLaserPos(puck.getName());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
setStatusLabel(null, -1);
|
setStatusLabel(null, -1);
|
||||||
|
Controller.getInstance().setLaserPos((Puck)null);
|
||||||
}
|
}
|
||||||
setSugestionLabel(null, -1);
|
setSugestionLabel(null, -1);
|
||||||
buttonSet.setEnabled(false);
|
buttonSet.setEnabled(false);
|
||||||
@@ -103,8 +116,8 @@ public class PuckLoadingDialog extends JDialog {
|
|||||||
Puck detectedPuck;
|
Puck detectedPuck;
|
||||||
String detectedDatamatrix;
|
String detectedDatamatrix;
|
||||||
void onPuckMounted(Puck puck, String datamatrix){
|
void onPuckMounted(Puck puck, String datamatrix){
|
||||||
|
Controller.getInstance().setLaserPos((Puck)null);
|
||||||
if ((datamatrix != null) && (!datamatrix.isEmpty())) {
|
if ((datamatrix != null) && (!datamatrix.isEmpty())) {
|
||||||
Controller.getInstance().linkPuckDatamatrix(puck, datamatrix, false);
|
|
||||||
setStatusLabel("Mounted puck " + datamatrix + " at " + puck.getName(), 5000);
|
setStatusLabel("Mounted puck " + datamatrix + " at " + puck.getName(), 5000);
|
||||||
setSugestionLabel(null, -1);
|
setSugestionLabel(null, -1);
|
||||||
buttonSet.setEnabled(false);
|
buttonSet.setEnabled(false);
|
||||||
@@ -125,8 +138,7 @@ public class PuckLoadingDialog extends JDialog {
|
|||||||
void onPuckUnmounted(Puck puck){
|
void onPuckUnmounted(Puck puck){
|
||||||
if (puck == detectedPuck){
|
if (puck == detectedPuck){
|
||||||
|
|
||||||
}
|
}
|
||||||
Controller.getInstance().linkPuckDatamatrix(puck, null, false);
|
|
||||||
setStatusLabel("Unmounted puck from "+ puck.getName(), 5000);
|
setStatusLabel("Unmounted puck from "+ puck.getName(), 5000);
|
||||||
if (puck == detectedPuck){
|
if (puck == detectedPuck){
|
||||||
buttonSet.setEnabled(false);
|
buttonSet.setEnabled(false);
|
||||||
@@ -249,14 +261,14 @@ public class PuckLoadingDialog extends JDialog {
|
|||||||
|
|
||||||
},
|
},
|
||||||
new String [] {
|
new String [] {
|
||||||
"Dewar", "Puck Id/Datamatrix", "Puck Position"
|
"User", "Dewar", "Puck Id/Datamatrix", "Puck Position"
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
Class[] types = new Class [] {
|
Class[] types = new Class [] {
|
||||||
java.lang.String.class, java.lang.String.class, java.lang.String.class
|
java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
|
||||||
};
|
};
|
||||||
boolean[] canEdit = new boolean [] {
|
boolean[] canEdit = new boolean [] {
|
||||||
false, false, false
|
false, false, false, false
|
||||||
};
|
};
|
||||||
|
|
||||||
public Class getColumnClass(int columnIndex) {
|
public Class getColumnClass(int columnIndex) {
|
||||||
@@ -318,7 +330,6 @@ public class PuckLoadingDialog extends JDialog {
|
|||||||
.addComponent(buttonSet, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE)
|
.addComponent(buttonSet, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addGap(0, 0, Short.MAX_VALUE))
|
.addGap(0, 0, Short.MAX_VALUE))
|
||||||
.addComponent(labelSuggestion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.addComponent(labelSuggestion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
.addComponent(panelTable, javax.swing.GroupLayout.DEFAULT_SIZE, 484, Short.MAX_VALUE)
|
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addComponent(jLabel1)
|
.addComponent(jLabel1)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
@@ -328,7 +339,10 @@ public class PuckLoadingDialog extends JDialog {
|
|||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addComponent(jLabel2)
|
.addComponent(jLabel2)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||||
.addComponent(textDetectedPuck)))
|
.addComponent(textDetectedPuck))
|
||||||
|
.addGroup(layout.createSequentialGroup()
|
||||||
|
.addComponent(panelTable, javax.swing.GroupLayout.DEFAULT_SIZE, 531, Short.MAX_VALUE)
|
||||||
|
.addGap(14, 14, 14)))
|
||||||
.addContainerGap())
|
.addContainerGap())
|
||||||
.addComponent(labelStatus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
.addComponent(labelStatus, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||||
);
|
);
|
||||||
@@ -413,7 +427,7 @@ public class PuckLoadingDialog extends JDialog {
|
|||||||
/* Create and display the dialog */
|
/* Create and display the dialog */
|
||||||
java.awt.EventQueue.invokeLater(new Runnable() {
|
java.awt.EventQueue.invokeLater(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
PuckLoadingDialog dialog = new PuckLoadingDialog(new javax.swing.JFrame(), true);
|
PuckLoadingDialog dialog = new PuckLoadingDialog(new javax.swing.JFrame(), true, true);
|
||||||
dialog.addWindowListener(new java.awt.event.WindowAdapter() {
|
dialog.addWindowListener(new java.awt.event.WindowAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void windowClosing(java.awt.event.WindowEvent e) {
|
public void windowClosing(java.awt.event.WindowEvent e) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ package ch.psi.mxsc;
|
|||||||
|
|
||||||
import ch.psi.pshell.device.Device;
|
import ch.psi.pshell.device.Device;
|
||||||
import ch.psi.pshell.swing.DevicePanel;
|
import ch.psi.pshell.swing.DevicePanel;
|
||||||
import ch.psi.utils.State;
|
import ch.psi.pshell.utils.State;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Graphics;
|
import java.awt.Graphics;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
|
|||||||
@@ -1,102 +1,104 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014 Paul Scherrer Institute. All rights reserved.
|
* Copyright (c) 2014 Paul Scherrer Institute. All rights reserved.
|
||||||
*/
|
*/
|
||||||
package ch.psi.mxsc;
|
package ch.psi.mxsc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class PuckState {
|
public class PuckState {
|
||||||
|
|
||||||
public final int id;
|
public final int id;
|
||||||
public boolean online;
|
public boolean online;
|
||||||
public SwitchState mecSwitch;
|
public SwitchState mecSwitch;
|
||||||
public SwitchState indSwitch;
|
public SwitchState indSwitch;
|
||||||
|
|
||||||
public enum SwitchState{
|
public enum SwitchState{
|
||||||
On,
|
On,
|
||||||
Off,
|
Off,
|
||||||
Error;
|
Error;
|
||||||
static SwitchState fromInt(int value){
|
static SwitchState fromInt(int value){
|
||||||
switch (value){
|
switch (value){
|
||||||
case 1: return SwitchState.On;
|
case 1: return SwitchState.On;
|
||||||
case 0: return SwitchState.Off;
|
case 0: return SwitchState.Off;
|
||||||
default: return SwitchState.Error;
|
default: return SwitchState.Error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PuckState(int id) {
|
PuckState(int id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
BasePlate getBasePlate() {
|
BasePlate getBasePlate() {
|
||||||
if (Controller.getInstance() == null) {
|
if (Controller.getInstance() == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return Controller.getInstance().basePlate;
|
return Controller.getInstance().basePlate;
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear() {
|
void clear() {
|
||||||
online = false;
|
online = false;
|
||||||
mecSwitch = SwitchState.Off;
|
mecSwitch = SwitchState.Off;
|
||||||
indSwitch = SwitchState.Off;
|
indSwitch = SwitchState.Off;
|
||||||
BasePlate basePlate = getBasePlate();
|
BasePlate basePlate = getBasePlate();
|
||||||
if (basePlate != null) {
|
if (basePlate != null) {
|
||||||
basePlate.getPucks()[id - 1].detection = Puck.Detection.Empty;
|
basePlate.getPucks()[id - 1].detection = Puck.Detection.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean set(int mecSwitch, int indSwitch) {
|
boolean set(int mecSwitch, int indSwitch) {
|
||||||
online = true;
|
online = true;
|
||||||
//TODO: Handle -1 value: error
|
//TODO: Handle -1 value: error
|
||||||
SwitchState mec = SwitchState.fromInt(mecSwitch);
|
SwitchState mec = SwitchState.fromInt(mecSwitch);
|
||||||
SwitchState ind = SwitchState.fromInt(indSwitch);
|
SwitchState ind = SwitchState.fromInt(indSwitch);
|
||||||
boolean changed = (mec != this.mecSwitch) || (mec != this.mecSwitch);
|
boolean changed = (mec != this.mecSwitch) || (ind != this.indSwitch);
|
||||||
this.mecSwitch = mec;
|
this.mecSwitch = mec;
|
||||||
this.indSwitch = ind;
|
this.indSwitch = ind;
|
||||||
|
|
||||||
BasePlate basePlate = getBasePlate();
|
BasePlate basePlate = getBasePlate();
|
||||||
if (basePlate != null) {
|
if (basePlate != null) {
|
||||||
Puck puck = basePlate.getPucks()[id - 1];
|
Puck puck = basePlate.getPucks()[id - 1];
|
||||||
switch(puck.getDetectionMode()){
|
Puck.Detection detection = Puck.Detection.Offline;
|
||||||
case Mechanical:
|
switch(puck.getDetectionMode()){
|
||||||
if (this.mecSwitch ==SwitchState.On ) {
|
case Mechanical:
|
||||||
basePlate.getPucks()[id - 1].detection = Puck.Detection.Present;
|
if (this.mecSwitch ==SwitchState.On ) {
|
||||||
} else if (this.mecSwitch ==SwitchState.Off ) {
|
detection = Puck.Detection.Present;
|
||||||
basePlate.getPucks()[id - 1].detection = Puck.Detection.Empty;
|
} else if (this.mecSwitch ==SwitchState.Off ) {
|
||||||
} else {
|
detection = Puck.Detection.Empty;
|
||||||
basePlate.getPucks()[id - 1].detection = Puck.Detection.Error;
|
} else {
|
||||||
}
|
detection = Puck.Detection.Error;
|
||||||
break;
|
}
|
||||||
|
break;
|
||||||
case Inductive:
|
|
||||||
if (this.indSwitch ==SwitchState.On ) {
|
case Inductive:
|
||||||
basePlate.getPucks()[id - 1].detection = Puck.Detection.Present;
|
if (this.indSwitch ==SwitchState.On ) {
|
||||||
} else if (this.indSwitch ==SwitchState.Off ) {
|
detection = Puck.Detection.Present;
|
||||||
basePlate.getPucks()[id - 1].detection = Puck.Detection.Empty;
|
} else if (this.indSwitch ==SwitchState.Off ) {
|
||||||
} else {
|
detection = Puck.Detection.Empty;
|
||||||
basePlate.getPucks()[id - 1].detection = Puck.Detection.Error;
|
} else {
|
||||||
}
|
detection = Puck.Detection.Error;
|
||||||
break;
|
}
|
||||||
|
break;
|
||||||
case Both:
|
|
||||||
if ((this.mecSwitch != this.indSwitch) ||(this.mecSwitch == SwitchState.Error) ||(this.mecSwitch == SwitchState.Error)) {
|
case Both:
|
||||||
basePlate.getPucks()[id - 1].detection = Puck.Detection.Error;
|
if ((this.mecSwitch != this.indSwitch) ||(this.mecSwitch == SwitchState.Error) ||(this.mecSwitch == SwitchState.Error)) {
|
||||||
} else if (this.mecSwitch ==SwitchState.On ) {
|
detection = Puck.Detection.Error;
|
||||||
basePlate.getPucks()[id - 1].detection = Puck.Detection.Present;
|
} else if (this.mecSwitch ==SwitchState.On ) {
|
||||||
} else {
|
detection = Puck.Detection.Present;
|
||||||
basePlate.getPucks()[id - 1].detection = Puck.Detection.Empty;
|
} else {
|
||||||
}
|
detection = Puck.Detection.Empty;
|
||||||
break;
|
}
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
return changed;
|
puck.detection = detection;
|
||||||
}
|
}
|
||||||
|
return changed;
|
||||||
@Override
|
}
|
||||||
public String toString() {
|
|
||||||
return "Online = " + online + "\ns1 = " + mecSwitch + "\ns2 = " + indSwitch;
|
@Override
|
||||||
}
|
public String toString() {
|
||||||
|
return "Online = " + online + "\ns1 = " + mecSwitch + "\ns2 = " + indSwitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package ch.psi.mxsc;
|
package ch.psi.mxsc;
|
||||||
|
|
||||||
import ch.psi.utils.swing.SwingUtils;
|
import ch.psi.pshell.swing.SwingUtils;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ public class SampleInfo extends HashMap {
|
|||||||
|
|
||||||
Object[] getData() {
|
Object[] getData() {
|
||||||
return new Object[]{
|
return new Object[]{
|
||||||
//getStr("userName"), getStr("dewarName"),
|
//), getStr("dewarName"), getEnum("puckType", PuckType.class, PuckType.Unknown)
|
||||||
getStr("puckName"), getEnum("puckType", PuckType.class, PuckType.Unknown), getStr("puckBarcode"), getStr("puckAddress"),
|
getStr("puckName"), getStr("userName"), getStr("puckBarcode"), getStr("puckAddress"),
|
||||||
getStr("sampleName"), getInt("samplePosition"), getStr("sampleBarcode"), getEnum("sampleStatus", SampleStatus.class, SampleStatus.Unknown), getInt("sampleMountCount")
|
getStr("sampleName"), getInt("samplePosition"), getStr("sampleBarcode"), getEnum("sampleStatus", SampleStatus.class, SampleStatus.Unknown), getInt("sampleMountCount")
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user