This commit is contained in:
gac-S_Changer
2018-06-08 16:27:07 +02:00
parent 01528ae2b1
commit eb45f26d1c
6 changed files with 703 additions and 164 deletions

View File

@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ch.psi</groupId>
<artifactId>MXSC</artifactId>
<version>1.9.0</version>
<version>1.10.0</version>
<packaging>jar</packaging>
<dependencies>
<dependency>

View File

@@ -4,19 +4,20 @@
package ch.psi.mxsc;
import ch.psi.pshell.core.Context;
import ch.psi.pshell.core.DevicePool;
import ch.psi.pshell.core.DevicePoolListener;
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.ProcessVariableBase;
import ch.psi.pshell.device.ReadbackDevice;
import ch.psi.pshell.ui.Panel;
import ch.psi.utils.State;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.script.ScriptException;
import javax.swing.JComponent;
@@ -28,7 +29,7 @@ public class Controller {
static Controller instance;
final BasePlate basePlate;
final /*Panel*/ MainPanel mainFrame;
Device hexaposi;
Device hexiposi;
public static Controller getInstance() {
return instance;
@@ -69,7 +70,7 @@ public class Controller {
}
void onInitialize(int runCount) {
GenericDevice former = getMainFrame().getDevice("BasePlate");
GenericDevice former = getDevice("BasePlate");
if (former != null) {
getMainFrame().removeDevice(former);
}
@@ -101,13 +102,17 @@ public class Controller {
detection = new EseraDetection((Device) getMainFrame().getDevice(PUCK_ESERA_DEVICE));
}
}
hexaposi = (Device) getMainFrame().getDevice("hexiposi");
hexaposi.addListener(new DeviceAdapter() {
@Override
public void onValueChanged(Device device, Object value, Object former) {
updateView();
}
});
hexiposi = (Device) getMainFrame().getDevice("hexiposi");
if (hexiposi!=null){
hexiposi.addListener(new DeviceAdapter() {
@Override
public void onValueChanged(Device device, Object value, Object former) {
updateView();
}
});
} else {
Logger.getLogger(Controller.class.getName()).log(Level.SEVERE, "No hexiposi detected.");
}
}
final PuckState[] puckState;
@@ -145,7 +150,7 @@ public class Controller {
}
public String getHexiposiPosition() {
return (String) ((ReadbackDevice) hexaposi).getReadback().take();
return (String) ((ReadbackDevice) hexiposi).getReadback().take();
}
public Boolean isLedRoomTemp() {
@@ -203,5 +208,16 @@ public class Controller {
onPuckPressed(sample.getPuck());
}
GenericDevice getDevice(String name){
return getMainFrame().getDevice(name);
}
DevicePool getDevicePool(){
return getMainFrame().getContext().getDevicePool();
}
Context getContext(){
return getMainFrame().getContext();
}
}

View File

@@ -0,0 +1,156 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
<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">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="ledRobot" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel24" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="ledWago" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel25" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="ledLaser" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel26" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="ledCamera" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel27" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="ledHexiposi" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel28" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="ledBarcodeReader" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel29" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="ledPuckDetection" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel30" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="ledRobot" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel24" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="ledWago" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel25" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="ledLaser" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel26" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="ledCamera" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel27" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<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="jLabel28" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="ledBarcodeReader" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel29" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="ledPuckDetection" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel30" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel24">
<Properties>
<Property name="text" type="java.lang.String" value="Robot"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.Led" name="ledRobot">
</Component>
<Component class="ch.psi.pshell.swing.Led" name="ledWago">
</Component>
<Component class="javax.swing.JLabel" name="jLabel25">
<Properties>
<Property name="text" type="java.lang.String" value="Wago"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel26">
<Properties>
<Property name="text" type="java.lang.String" value="Laser"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.Led" name="ledLaser">
</Component>
<Component class="javax.swing.JLabel" name="jLabel27">
<Properties>
<Property name="text" type="java.lang.String" value="Camera"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.Led" name="ledCamera">
</Component>
<Component class="javax.swing.JLabel" name="jLabel28">
<Properties>
<Property name="text" type="java.lang.String" value="Hexiposi"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.Led" name="ledHexiposi">
</Component>
<Component class="javax.swing.JLabel" name="jLabel29">
<Properties>
<Property name="text" type="java.lang.String" value="Barcode Reader"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.Led" name="ledBarcodeReader">
</Component>
<Component class="javax.swing.JLabel" name="jLabel30">
<Properties>
<Property name="text" type="java.lang.String" value="Puck Detection"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.Led" name="ledPuckDetection">
</Component>
</SubComponents>
</Form>

View File

@@ -0,0 +1,230 @@
package ch.psi.mxsc;
import ch.psi.pshell.device.Device;
import ch.psi.pshell.device.DeviceAdapter;
import ch.psi.pshell.device.GenericDevice;
import ch.psi.pshell.imaging.Data;
import ch.psi.pshell.imaging.ImageListener;
import ch.psi.pshell.swing.Led;
import ch.psi.utils.State;
import java.awt.Color;
import java.awt.image.BufferedImage;
/**
*
*/
public class DevicesPanel extends javax.swing.JPanel {
GenericDevice robot;
GenericDevice hexiposi;
GenericDevice microscan;
GenericDevice wago;
GenericDevice laser;
GenericDevice puck_detection;
GenericDevice img;
/**
* Creates new form DevicesPanel
*/
public DevicesPanel() {
initComponents();
}
GenericDevice[] getDevices(){
return new GenericDevice[]{robot, hexiposi, microscan, wago, laser, puck_detection};
}
final DeviceAdapter deviceListener = new DeviceAdapter() {
@Override
public void onStateChanged(Device device, State state, State former) {
update();
}
};
void initialize(){
for (GenericDevice dev : getDevices()){
if (dev!=null){
dev.removeListener(deviceListener);
}
}
robot = Controller.getInstance().getDevice("robot");
hexiposi = Controller.getInstance().getDevice("hexiposi");
microscan = Controller.getInstance().getDevice("microscan");
wago = Controller.getInstance().getDevice("wago");
laser = Controller.getInstance().getDevice("ue");
puck_detection = Controller.getInstance().getDevice("puck_detection");
img = Controller.getInstance().getDevice("img");
update();
for (GenericDevice dev : getDevices()){
if (dev!=null){
dev.addListener(deviceListener);
}
}
}
void update(){
setLedState(ledBarcodeReader, microscan);
setLedState(ledCamera, img);
setLedState(ledHexiposi, hexiposi);
setLedState(ledLaser, laser);
setLedState(ledPuckDetection, puck_detection);
setLedState(ledRobot, robot);
setLedState(ledWago, wago);
}
void setLedState(Led led, GenericDevice dev){
if ((dev==null) || (dev.getState()==null)){
led.setColor(Color.black);
} else {
switch (dev.getState()){
case Ready:
led.setColor(Color.green);
break;
case Initializing:
case Paused:
case Busy:
case Disabled:
led.setColor(Color.orange);
break;
case Invalid:
case Closing:
case Fault:
case Offline:
led.setColor(Color.red);
break;
default:
led.setColor(Color.darkGray);
break;
}
}
}
/**
* 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() {
jLabel24 = new javax.swing.JLabel();
ledRobot = new ch.psi.pshell.swing.Led();
ledWago = new ch.psi.pshell.swing.Led();
jLabel25 = new javax.swing.JLabel();
jLabel26 = new javax.swing.JLabel();
ledLaser = new ch.psi.pshell.swing.Led();
jLabel27 = new javax.swing.JLabel();
ledCamera = new ch.psi.pshell.swing.Led();
jLabel28 = new javax.swing.JLabel();
ledHexiposi = new ch.psi.pshell.swing.Led();
jLabel29 = new javax.swing.JLabel();
ledBarcodeReader = new ch.psi.pshell.swing.Led();
jLabel30 = new javax.swing.JLabel();
ledPuckDetection = new ch.psi.pshell.swing.Led();
jLabel24.setText("Robot");
jLabel25.setText("Wago");
jLabel26.setText("Laser");
jLabel27.setText("Camera");
jLabel28.setText("Hexiposi");
jLabel29.setText("Barcode Reader");
jLabel30.setText("Puck Detection");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(ledRobot, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel24))
.addGroup(layout.createSequentialGroup()
.addComponent(ledWago, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel25))
.addGroup(layout.createSequentialGroup()
.addComponent(ledLaser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel26))
.addGroup(layout.createSequentialGroup()
.addComponent(ledCamera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel27))
.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(jLabel28))
.addGroup(layout.createSequentialGroup()
.addComponent(ledBarcodeReader, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel29))
.addGroup(layout.createSequentialGroup()
.addComponent(ledPuckDetection, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel30)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(ledRobot, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel24))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(ledWago, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel25))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(ledLaser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel26))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(ledCamera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel27))
.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(jLabel28))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.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(jLabel29))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(ledPuckDetection, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel30))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel24;
private javax.swing.JLabel jLabel25;
private javax.swing.JLabel jLabel26;
private javax.swing.JLabel jLabel27;
private javax.swing.JLabel jLabel28;
private javax.swing.JLabel jLabel29;
private javax.swing.JLabel jLabel30;
private ch.psi.pshell.swing.Led ledBarcodeReader;
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 ledPuckDetection;
private ch.psi.pshell.swing.Led ledRobot;
private ch.psi.pshell.swing.Led ledWago;
// End of variables declaration//GEN-END:variables
}

View File

@@ -33,7 +33,7 @@
<Component id="jPanel4" max="32767" attributes="0"/>
<EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
<Component id="jPanel13" max="32767" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jPanel6" max="32767" attributes="0"/>
<EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
<Component id="jPanel7" max="32767" attributes="0"/>
@@ -50,9 +50,9 @@
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="roomTempBasePlatePanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jPanel5" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="panelDewar" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jPanel2" max="32767" attributes="0"/>
@@ -70,7 +70,7 @@
</Group>
<Component id="jPanel13" linkSize="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -101,7 +101,7 @@
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jPanel11" linkSize="3" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<EmptySpace pref="375" max="32767" attributes="0"/>
<Component id="panelDet" linkSize="3" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
</Group>
@@ -117,10 +117,10 @@
<Component id="buttonPuckDet" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonClearDet" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="273" max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="jPanel11" max="32767" attributes="0"/>
<Component id="panelDet" max="32767" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="panelDet" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="jPanel11" alignment="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
</Group>
@@ -179,6 +179,11 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel20" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="ledLidControlActive5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel23" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
</Group>
@@ -207,6 +212,11 @@
<Component id="ledLidControlActive1" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel15" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="ledLidControlActive5" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel23" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</DimensionLayout>
@@ -264,6 +274,19 @@
<Property name="ledSize" type="int" value="20"/>
</Properties>
</Component>
<Component class="ch.psi.pshell.swing.Led" name="ledLidControlActive5">
<Properties>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="2d" green="98" red="c0" type="rgb"/>
</Property>
<Property name="ledSize" type="int" value="20"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel23">
<Properties>
<Property name="text" type="java.lang.String" value="Offline"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="buttonClearDet">
@@ -309,7 +332,7 @@
<Component id="jLabel22" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="textDetImage" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<EmptySpace pref="18" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -427,11 +450,11 @@
<Group type="103" groupAlignment="0" attributes="0">
<Component id="progressLN2" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<EmptySpace pref="53" max="32767" attributes="0"/>
<EmptySpace pref="44" max="32767" attributes="0"/>
<Component id="jSeparator1" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="53" max="32767" attributes="0"/>
<EmptySpace pref="40" max="32767" attributes="0"/>
<Component id="jSeparator2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
@@ -530,7 +553,7 @@
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
<TitledBorder title="Robot Arm"/>
<TitledBorder title="Devices"/>
</Border>
</Property>
</Properties>
@@ -538,20 +561,26 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="devicesPanel" min="-2" pref="102" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="buttonExpert" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<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">
<EmptySpace max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonExpert" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="devicesPanel" pref="0" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="9" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
@@ -564,6 +593,8 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonExpertActionPerformed"/>
</Events>
</Component>
<Component class="ch.psi.mxsc.DevicesPanel" name="devicesPanel">
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel4">
@@ -622,7 +653,7 @@
<Component id="jLabel14" min="-2" max="-2" attributes="0"/>
<Component id="deviceValuePanel1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="23" max="32767" attributes="0"/>
<EmptySpace pref="31" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -707,7 +738,7 @@
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="buttonInitHexiposi" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="18" max="32767" attributes="0"/>
<EmptySpace pref="26" max="32767" attributes="0"/>
</Group>
<Component id="jPanel9" alignment="0" max="32767" attributes="0"/>
</Group>
@@ -818,7 +849,7 @@
<Component id="led7" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel10" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="26" max="32767" attributes="0"/>
<EmptySpace pref="34" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -900,7 +931,7 @@
<Component id="jLabel13" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="textSample" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="26" max="32767" attributes="0"/>
<EmptySpace pref="34" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -981,7 +1012,7 @@
<Component id="led15" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel18" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="52" max="32767" attributes="0"/>
<EmptySpace pref="60" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -1030,31 +1061,36 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="ledAirPressure" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="ledN2Pressure" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="ledLocalSafety" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="ledPsysSafety" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="ledAirPressure" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel24" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabell21" min="-2" max="-2" attributes="0"/>
<Component id="jLabel26" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="buttonReleaseLocal" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="buttonReleasePsys" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="ledN2Pressure" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel25" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="ledLocalSafety" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel26" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="ledPsysSafety" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabell21" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel25" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel24" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
<EmptySpace pref="38" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -1075,11 +1111,13 @@
<Group type="103" groupAlignment="3" attributes="0">
<Component id="ledLocalSafety" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel26" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="buttonReleaseLocal" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" 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="buttonReleasePsys" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
@@ -1114,6 +1152,22 @@
</Component>
<Component class="ch.psi.pshell.swing.Led" name="ledPsysSafety">
</Component>
<Component class="javax.swing.JButton" name="buttonReleaseLocal">
<Properties>
<Property name="text" type="java.lang.String" value="Release"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonReleaseLocalActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonReleasePsys">
<Properties>
<Property name="text" type="java.lang.String" value="Release"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonReleasePsysActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>

View File

@@ -4,10 +4,8 @@
package ch.psi.mxsc;
import ch.psi.pshell.core.Context;
import ch.psi.pshell.device.Device;
import ch.psi.pshell.device.DeviceAdapter;
import ch.psi.pshell.device.DeviceListener;
import ch.psi.pshell.imaging.Renderer;
import ch.psi.pshell.imaging.RendererMode;
import ch.psi.pshell.imaging.Source;
@@ -15,18 +13,10 @@ import ch.psi.pshell.ui.Panel;
import ch.psi.utils.State;
import ch.psi.utils.swing.SwingUtils;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dialog;
import java.awt.Dimension;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.Map;
import java.util.HashMap;
import javax.script.ScriptException;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.TitledBorder;
/**
@@ -48,70 +38,77 @@ public class MainPanel extends Panel {
public void onInitialize(int runCount) {
Controller.getInstance().onInitialize(runCount);
basePlatePanel.setDevice((Device) getDevice("BasePlate"));
basePlatePanel.getDevice().setSelectable(true);
((Device) getDevice("dewar_level")).addListener(new DeviceAdapter() {
@Override
public void onValueChanged(Device device, Object value, Object former) {
updateLevel(value);
}
});
updateLevel(((Device) getDevice("dewar_level")).take());
((Device) getDevice("filling_dewar")).addListener(new DeviceAdapter() {
@Override
public void onValueChanged(Device device, Object value, Object former) {
updateFillingDeware(value);
}
});
updateFillingDeware(((Device) getDevice("filling_dewar")).take());
((Device) getDevice("ln2_main_power")).addListener(new DeviceAdapter() {
@Override
public void onValueChanged(Device device, Object value, Object former) {
updateFillingControl(value);
}
});
updateFillingControl(((Device) getDevice("ln2_main_power")).take());
((Device) getDevice("hexiposi")).addListener(new DeviceAdapter() {
@Override
public void onStateChanged(Device device, State state, State former) {
updateHexiposiState(state);
}
});
updateHexiposiState(((Device) getDevice("hexiposi")).getState());
((Device) getDevice("air_pressure_ok")).addListener(new DeviceAdapter() {
@Override
public void onValueChanged(Device device, Object value, Object former) {
updateAirPressure(value);
}
});
updateAirPressure(((Device) getDevice("air_pressure_ok")).take());
basePlatePanel.getDevice().setSelectable(true);
try{
devicesPanel.initialize();
((Device) getDevice("dewar_level")).addListener(new DeviceAdapter() {
@Override
public void onValueChanged(Device device, Object value, Object former) {
updateLevel(value);
}
});
updateLevel(((Device) getDevice("dewar_level")).take());
((Device) getDevice("n2_pressure_ok")).addListener(new DeviceAdapter() {
@Override
public void onValueChanged(Device device, Object value, Object former) {
updateN2Pressure(value);
}
});
updateN2Pressure(((Device) getDevice("n2_pressure_ok")).take());
((Device) getDevice("filling_dewar")).addListener(new DeviceAdapter() {
@Override
public void onValueChanged(Device device, Object value, Object former) {
updateFillingDeware(value);
}
});
updateFillingDeware(((Device) getDevice("filling_dewar")).take());
((Device) getDevice("feedback_local_safety")).addListener(new DeviceAdapter() {
@Override
public void onValueChanged(Device device, Object value, Object former) {
updateLocalSafety(value);
}
});
updateLocalSafety(((Device) getDevice("feedback_local_safety")).take());
((Device) getDevice("ln2_main_power")).addListener(new DeviceAdapter() {
@Override
public void onValueChanged(Device device, Object value, Object former) {
updateFillingControl(value);
}
});
updateFillingControl(((Device) getDevice("ln2_main_power")).take());
((Device) getDevice("hexiposi")).addListener(new DeviceAdapter() {
@Override
public void onStateChanged(Device device, State state, State former) {
updateHexiposiState(state);
}
});
updateHexiposiState(((Device) getDevice("hexiposi")).getState());
((Device) getDevice("air_pressure_ok")).addListener(new DeviceAdapter() {
@Override
public void onValueChanged(Device device, Object value, Object former) {
updateAirPressure(value);
}
});
updateAirPressure(((Device) getDevice("air_pressure_ok")).take());
((Device) getDevice("n2_pressure_ok")).addListener(new DeviceAdapter() {
@Override
public void onValueChanged(Device device, Object value, Object former) {
updateN2Pressure(value);
}
});
updateN2Pressure(((Device) getDevice("n2_pressure_ok")).take());
((Device) getDevice("feedback_local_safety")).addListener(new DeviceAdapter() {
@Override
public void onValueChanged(Device device, Object value, Object former) {
updateLocalSafety(value);
}
});
updateLocalSafety(((Device) getDevice("feedback_local_safety")).take());
((Device) getDevice("feedback_psys_safety")).addListener(new DeviceAdapter() {
@Override
public void onValueChanged(Device device, Object value, Object former) {
updatePsysSafety(value);
}
});
updatePsysSafety(((Device) getDevice("feedback_psys_safety")).take());
} catch (Exception ex){
this.getLogger().log(Level.SEVERE,null, ex);
}
updateCameraView();
((Device) getDevice("feedback_psys_safety")).addListener(new DeviceAdapter() {
@Override
public void onValueChanged(Device device, Object value, Object former) {
updatePsysSafety(value);
}
});
updatePsysSafety(((Device) getDevice("feedback_psys_safety")).take());
}
void updateLevel(Object value){
@@ -198,8 +195,40 @@ public class MainPanel extends Panel {
}
}
void updateCameraView(){
Source source = buttonCamera.isSelected() ? (Source)this.getDevice("img"): null;
basePlatePanel.setCameraView(source);
}
void execute(String statement){
execute(statement, false);
}
void execute(String statement, boolean background){
try {
evalAsync(statement, background).handle((ret, ex) -> {
if (ex != null){
showException((Exception)ex);
}
return ret;
});
} catch (Exception ex) {
showException(ex);
}
}
void execute(String script, Object args){
try {
runAsync(script, args).handle((ret, ex) -> {
if (ex != null){
showException((Exception)ex);
}
return ret;
});
} catch (Exception ex) {
showException(ex);
}
}
/** This method is called from within the constructor to
* initialize the form.
@@ -222,6 +251,8 @@ public class MainPanel extends Panel {
jLabel19 = new javax.swing.JLabel();
ledLidControlActive4 = new ch.psi.pshell.swing.Led();
ledLidControlActive3 = new ch.psi.pshell.swing.Led();
ledLidControlActive5 = new ch.psi.pshell.swing.Led();
jLabel23 = new javax.swing.JLabel();
buttonClearDet = new javax.swing.JButton();
panelDet = new javax.swing.JPanel();
jLabel21 = new javax.swing.JLabel();
@@ -242,6 +273,7 @@ public class MainPanel extends Panel {
roomTempBasePlatePanel1 = new ch.psi.mxsc.RoomTempBasePlatePanel();
jPanel5 = new javax.swing.JPanel();
buttonExpert = new javax.swing.JButton();
devicesPanel = new ch.psi.mxsc.DevicesPanel();
jPanel4 = new javax.swing.JPanel();
ledFillingControl = new ch.psi.pshell.swing.Led();
ledFillingDewar = new ch.psi.pshell.swing.Led();
@@ -286,6 +318,8 @@ public class MainPanel extends Panel {
ledLocalSafety = new ch.psi.pshell.swing.Led();
jLabell21 = new javax.swing.JLabel();
ledPsysSafety = new ch.psi.pshell.swing.Led();
buttonReleaseLocal = new javax.swing.JButton();
buttonReleasePsys = new javax.swing.JButton();
basePlatePanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Dewar"));
@@ -325,6 +359,11 @@ public class MainPanel extends Panel {
ledLidControlActive3.setForeground(new java.awt.Color(128, 192, 192));
ledLidControlActive3.setLedSize(20);
ledLidControlActive5.setForeground(new java.awt.Color(192, 152, 45));
ledLidControlActive5.setLedSize(20);
jLabel23.setText("Offline");
javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
jPanel11.setLayout(jPanel11Layout);
jPanel11Layout.setHorizontalGroup(
@@ -347,7 +386,11 @@ public class MainPanel extends Panel {
.addGroup(jPanel11Layout.createSequentialGroup()
.addComponent(ledLidControlActive4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel20)))
.addComponent(jLabel20))
.addGroup(jPanel11Layout.createSequentialGroup()
.addComponent(ledLidControlActive5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel23)))
.addGap(4, 4, 4))
);
jPanel11Layout.setVerticalGroup(
@@ -368,7 +411,11 @@ public class MainPanel extends Panel {
.addGap(0, 0, 0)
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(ledLidControlActive1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel15)))
.addComponent(jLabel15))
.addGap(0, 0, Short.MAX_VALUE)
.addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(ledLidControlActive5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel23)))
);
buttonClearDet.setText("Clear");
@@ -418,7 +465,7 @@ public class MainPanel extends Panel {
.addComponent(jLabel22)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(textDetImage, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(18, Short.MAX_VALUE))
);
javax.swing.GroupLayout basePlatePanelLayout = new javax.swing.GroupLayout(basePlatePanel);
@@ -436,7 +483,7 @@ public class MainPanel extends Panel {
.addComponent(buttonClearDet, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addGroup(basePlatePanelLayout.createSequentialGroup()
.addComponent(jPanel11, 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, 375, Short.MAX_VALUE)
.addComponent(panelDet, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(4, 4, 4))))
);
@@ -451,10 +498,10 @@ public class MainPanel extends Panel {
.addComponent(buttonPuckDet)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonClearDet)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 273, Short.MAX_VALUE)
.addGroup(basePlatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(panelDet, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(basePlatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(panelDet, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jPanel11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(4, 4, 4))
);
@@ -501,11 +548,11 @@ public class MainPanel extends Panel {
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(progressLN2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap(53, Short.MAX_VALUE)
.addContainerGap(44, Short.MAX_VALUE)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 53, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 40, Short.MAX_VALUE)
.addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
@@ -558,7 +605,7 @@ public class MainPanel extends Panel {
roomTempBasePlatePanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("RT Humidifier Lid States"));
jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Robot Arm"));
jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Devices"));
buttonExpert.setText("Expert ");
buttonExpert.addActionListener(new java.awt.event.ActionListener() {
@@ -571,17 +618,22 @@ public class MainPanel extends Panel {
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
.addContainerGap()
.addComponent(devicesPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonExpert)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap()
.addComponent(buttonExpert)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel5Layout.createSequentialGroup()
.addComponent(devicesPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
.addGap(9, 9, 9))
);
jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("LN2 Control"));
@@ -633,7 +685,7 @@ public class MainPanel extends Panel {
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel14)
.addComponent(deviceValuePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(23, Short.MAX_VALUE))
.addContainerGap(31, Short.MAX_VALUE))
);
jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Lid Motion Control"));
@@ -699,7 +751,7 @@ public class MainPanel extends Panel {
.addComponent(jLabel7))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(buttonInitHexiposi)
.addContainerGap(18, Short.MAX_VALUE))
.addContainerGap(26, Short.MAX_VALUE))
.addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
@@ -747,7 +799,7 @@ public class MainPanel extends Panel {
.addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(led7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel10))
.addContainerGap(26, Short.MAX_VALUE))
.addContainerGap(34, Short.MAX_VALUE))
);
jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder("Robot Gripper"));
@@ -803,7 +855,7 @@ public class MainPanel extends Panel {
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel13)
.addComponent(textSample, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(26, Short.MAX_VALUE))
.addContainerGap(34, Short.MAX_VALUE))
);
jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder("RT Humidifier Box"));
@@ -840,7 +892,7 @@ public class MainPanel extends Panel {
.addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(led15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel18))
.addContainerGap(52, Short.MAX_VALUE))
.addContainerGap(60, Short.MAX_VALUE))
);
panelDewar.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Dewar Light", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.DEFAULT_POSITION));
@@ -861,30 +913,47 @@ public class MainPanel extends Panel {
jLabell21.setText("Psys Safety");
buttonReleaseLocal.setText("Release");
buttonReleaseLocal.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonReleaseLocalActionPerformed(evt);
}
});
buttonReleasePsys.setText("Release");
buttonReleasePsys.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonReleasePsysActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
jPanel13.setLayout(jPanel13Layout);
jPanel13Layout.setHorizontalGroup(
jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel13Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(ledAirPressure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(ledN2Pressure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(ledLocalSafety, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(ledPsysSafety, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel13Layout.createSequentialGroup()
.addComponent(ledAirPressure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel24))
.addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabell21)
.addComponent(jLabel26))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(buttonReleaseLocal)
.addComponent(buttonReleasePsys))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(jPanel13Layout.createSequentialGroup()
.addComponent(ledN2Pressure, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel25))
.addGroup(jPanel13Layout.createSequentialGroup()
.addComponent(ledLocalSafety, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel26))
.addGroup(jPanel13Layout.createSequentialGroup()
.addComponent(ledPsysSafety, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabell21)))
.addContainerGap(38, Short.MAX_VALUE))
.addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel25)
.addComponent(jLabel24))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
);
jPanel13Layout.setVerticalGroup(
jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -900,11 +969,13 @@ public class MainPanel extends Panel {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(ledLocalSafety, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel26))
.addComponent(jLabel26)
.addComponent(buttonReleaseLocal))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(ledPsysSafety, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabell21)))
.addComponent(jLabell21)
.addComponent(buttonReleasePsys)))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
@@ -926,7 +997,7 @@ public class MainPanel extends Panel {
.addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
@@ -966,8 +1037,7 @@ public class MainPanel extends Panel {
private void buttonCameraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCameraActionPerformed
try{
Source source = buttonCamera.isSelected() ? (Source)this.getDevice("img"): null;
basePlatePanel.setCameraView(source);
updateCameraView();
} catch (Exception ex) {
showException(ex);
}
@@ -1031,6 +1101,14 @@ public class MainPanel extends Panel {
}
}//GEN-LAST:event_buttonClearDetActionPerformed
private void buttonReleaseLocalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonReleaseLocalActionPerformed
execute("release_local()", true);
}//GEN-LAST:event_buttonReleaseLocalActionPerformed
private void buttonReleasePsysActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonReleasePsysActionPerformed
execute("release_psys()", true);
}//GEN-LAST:event_buttonReleasePsysActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private ch.psi.mxsc.BasePlatePanel basePlatePanel;
@@ -1039,7 +1117,10 @@ public class MainPanel extends Panel {
private javax.swing.JButton buttonExpert;
private javax.swing.JButton buttonInitHexiposi;
private javax.swing.JButton buttonPuckDet;
private javax.swing.JButton buttonReleaseLocal;
private javax.swing.JButton buttonReleasePsys;
private ch.psi.pshell.swing.DeviceValuePanel deviceValuePanel1;
private ch.psi.mxsc.DevicesPanel devicesPanel;
private ch.psi.mxsc.HexiposiPanel hexiposiPanel;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
@@ -1056,6 +1137,7 @@ public class MainPanel extends Panel {
private javax.swing.JLabel jLabel20;
private javax.swing.JLabel jLabel21;
private javax.swing.JLabel jLabel22;
private javax.swing.JLabel jLabel23;
private javax.swing.JLabel jLabel24;
private javax.swing.JLabel jLabel25;
private javax.swing.JLabel jLabel26;
@@ -1095,6 +1177,7 @@ public class MainPanel extends Panel {
private ch.psi.pshell.swing.Led ledLidControlActive2;
private ch.psi.pshell.swing.Led ledLidControlActive3;
private ch.psi.pshell.swing.Led ledLidControlActive4;
private ch.psi.pshell.swing.Led ledLidControlActive5;
private ch.psi.pshell.swing.Led ledLidInitialized;
private ch.psi.pshell.swing.Led ledLocalSafety;
private ch.psi.pshell.swing.Led ledN2Pressure;