1411 lines
74 KiB
Java
Executable File
1411 lines
74 KiB
Java
Executable File
/*
|
|
* Copyright (c) 2014-2017 Paul Scherrer Institute. All rights reserved.
|
|
*/
|
|
|
|
import ch.psi.pshell.device.Device;
|
|
import ch.psi.pshell.device.DeviceAdapter;
|
|
import ch.psi.pshell.device.DeviceListener;
|
|
import ch.psi.pshell.epics.ChannelDouble;
|
|
import ch.psi.pshell.epics.ChannelInteger;
|
|
import ch.psi.pshell.epics.Epics;
|
|
import ch.psi.pshell.swing.DevicePanel;
|
|
import ch.psi.pshell.swing.DeviceValueChart;
|
|
import ch.psi.pshell.ui.App;
|
|
import ch.psi.pshell.ui.Panel;
|
|
import ch.psi.pshell.ui.Plugin;
|
|
import ch.psi.utils.Convert;
|
|
import ch.psi.utils.State;
|
|
import ch.psi.utils.swing.SwingUtils;
|
|
import java.awt.Color;
|
|
import java.awt.Dimension;
|
|
import java.awt.Window;
|
|
import java.awt.event.WindowAdapter;
|
|
import java.awt.event.WindowEvent;
|
|
import java.io.IOException;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.logging.Level;
|
|
import java.util.logging.Logger;
|
|
import javax.swing.DefaultComboBoxModel;
|
|
import javax.swing.JComboBox;
|
|
import javax.swing.JDialog;
|
|
import javax.swing.JFrame;
|
|
|
|
/**
|
|
*
|
|
*/
|
|
public class WireScan extends Panel {
|
|
final JComboBox[] bpmCombos;
|
|
final JComboBox[] blmCombos;
|
|
boolean homed;
|
|
boolean parked;
|
|
String currentScannner;
|
|
|
|
public WireScan() {
|
|
initComponents();
|
|
bpmCombos = new JComboBox[]{comboBpm1, comboBpm2, comboBpm3};
|
|
blmCombos = new JComboBox[]{comboBlm1, comboBlm2, comboBlm3};
|
|
}
|
|
|
|
//Overridable callbacks
|
|
@Override
|
|
public void onInitialize(int runCount) {
|
|
try {
|
|
startTimer(1000, 10);
|
|
|
|
DefaultComboBoxModel model = new DefaultComboBoxModel();
|
|
eval("run('Devices/Elements')", true);
|
|
model.addElement("");
|
|
List<String> ret = (List<String>) ((Plugin)this).eval("get_wire_scanners()", true);
|
|
for (String scan: ret){
|
|
model.addElement(scan);
|
|
}
|
|
comboWireScanner.setModel(model);
|
|
eval("run('Devices/WireScanner')", true);
|
|
model = new DefaultComboBoxModel();
|
|
ret = (List<String>) ((Plugin)this).eval("WireScanner.ScanType", true);
|
|
for (String scan: ret){
|
|
model.addElement(scan);
|
|
}
|
|
comboScanType.setModel(model);
|
|
comboWireScannerActionPerformed(null);
|
|
|
|
|
|
ret = (List<String>) ((Plugin)this).eval("get_bpms()", true);
|
|
for (JComboBox cb : bpmCombos){
|
|
model = new DefaultComboBoxModel();
|
|
model.addElement("");
|
|
for (String scan: ret){
|
|
model.addElement(scan);
|
|
}
|
|
cb.setModel(model);
|
|
}
|
|
|
|
ret = (List<String>) ((Plugin)this).eval("get_blms()", true);
|
|
for (JComboBox cb : blmCombos){
|
|
model = new DefaultComboBoxModel();
|
|
model.addElement("");
|
|
for (String scan: ret){
|
|
model.addElement(scan);
|
|
}
|
|
cb.setModel(model);
|
|
}
|
|
|
|
if (App.hasArgument("ws")){
|
|
comboWireScanner.setSelectedItem(App.getArgumentValue("ws"));
|
|
}
|
|
comboWireScannerActionPerformed(null);
|
|
updatePanelRepRate();
|
|
|
|
|
|
} catch (Exception ex) {
|
|
showException(ex);
|
|
}
|
|
|
|
}
|
|
|
|
void updatePanelRepRate() throws Exception{
|
|
if (panelRepRate.getDevice()!=null){
|
|
panelRepRate.getDevice().close();
|
|
}
|
|
int bunch = (Integer)spinnerBunch.getValue();
|
|
Device dev = new ChannelDouble (null, (bunch==2) ? "SIN-TIMAST-TMA:Bunch-2-Appl-Freq-RB" : "SIN-TIMAST-TMA:Bunch-1-Appl-Freq-RB");
|
|
dev.setMonitored(true);
|
|
dev.initialize();
|
|
panelRepRate.setDevice(dev);
|
|
}
|
|
|
|
@Override
|
|
public void onStart() {
|
|
super.onStart();
|
|
}
|
|
|
|
@Override
|
|
public void onStop() {
|
|
try {
|
|
closeDevices();
|
|
} catch (Exception ex) {
|
|
Logger.getLogger(WireScan.class.getName()).log(Level.WARNING, null, ex);
|
|
}
|
|
super.onStop();
|
|
}
|
|
|
|
|
|
@Override
|
|
protected void onTimer(){
|
|
try{
|
|
if (isValidScanner()){
|
|
homed = (Epics.get(currentScannner + ":MOTOR_1_HOMED", Integer.class) == 1);
|
|
if (homed){
|
|
ledHomed.setColor(Color.GREEN);
|
|
} else if (Epics.get(currentScannner + ":MOTOR_1_HOMING", Integer.class) == 1){
|
|
ledHomed.setColor(Color.YELLOW);
|
|
} else {
|
|
ledHomed.setColor(Color.RED);
|
|
}
|
|
} else {
|
|
ledHomed.setColor(Color.darkGray);
|
|
homed = false;
|
|
}
|
|
onStateChange(getState(), getState());
|
|
panelRepRate.getDevice().update();
|
|
|
|
double rr = (Double)panelRepRate.getDevice().take();
|
|
int points = (Integer)spinnerPoints.getValue();
|
|
double velocity_x = Math.abs((Double)spinnerEndX.getValue()-(Double)spinnerStartX.getValue())*rr/points;
|
|
labelVelX.setText(String.format("%1.1f", velocity_x));
|
|
double velocity_y = Math.abs((Double)spinnerEndY.getValue()-(Double)spinnerStartY.getValue())*rr/points;
|
|
labelVelY.setText(String.format("%1.1f", velocity_y));
|
|
|
|
} catch (Exception ex){
|
|
}
|
|
}
|
|
//S20CB01-DWSC440:MOTOR_1_HOME.PROC
|
|
@Override
|
|
public void onStateChange(State state, State former) {
|
|
boolean validWireScan = isValidScanner();
|
|
buttonMoveStart.setEnabled((state==State.Ready) && validWireScan && homed);
|
|
buttonPark.setEnabled((state==State.Ready) && validWireScan && homed);
|
|
buttonParkAll.setEnabled(state==State.Ready);
|
|
buttonScan.setEnabled((state==State.Ready) && validWireScan && homed);
|
|
checkSaveRaw.setEnabled(state==State.Ready);
|
|
buttonAbort.setEnabled(state==State.Busy);
|
|
comboScanType.setEnabled(validWireScan);
|
|
comboAdaptive.setEnabled(validWireScan);
|
|
for (JComboBox cb :bpmCombos){
|
|
cb.setEnabled(validWireScan && !isBackground());
|
|
}
|
|
for (JComboBox cb : blmCombos){
|
|
cb.setEnabled(validWireScan);
|
|
}
|
|
buttonCalibration.setEnabled(validWireScan);
|
|
buttonScannerPanel.setEnabled(validWireScan);
|
|
buttonHoming.setEnabled(validWireScan);
|
|
spinnerPoints.setEnabled(validWireScan && !isBackground());
|
|
spinnerCycles.setEnabled(validWireScan && !isBackground());
|
|
spinnerStartX.setEnabled(validWireScan && isX());
|
|
spinnerEndX.setEnabled(spinnerStartX.isEnabled());
|
|
spinnerStartY.setEnabled(validWireScan && isY());
|
|
spinnerEndY.setEnabled(spinnerStartY.isEnabled());
|
|
spinnerBunch.setEnabled(validWireScan);
|
|
spinnerBackground.setEnabled(validWireScan);
|
|
updateRawButtons();
|
|
}
|
|
|
|
void updateRawButtons(){
|
|
boolean validWireScan = isValidScanner();
|
|
Object sel = comboBlm1.getSelectedItem();
|
|
buttonRaw1.setEnabled(validWireScan && (sel!=null) && (!sel.toString().isEmpty()));
|
|
buttonPMT1.setEnabled(buttonRaw1.isEnabled());
|
|
sel = comboBlm2.getSelectedItem();
|
|
buttonRaw2.setEnabled(validWireScan && (sel!=null) && (!sel.toString().isEmpty()));
|
|
buttonPMT2.setEnabled(buttonRaw2.isEnabled());
|
|
sel = comboBlm3.getSelectedItem();
|
|
buttonRaw3.setEnabled(validWireScan && (sel!=null) && (!sel.toString().isEmpty()));
|
|
buttonPMT3.setEnabled(buttonRaw3.isEnabled());
|
|
}
|
|
|
|
@Override
|
|
public void onExecutedFile(String fileName, Object result) {
|
|
}
|
|
|
|
|
|
//Callback to perform update - in event thread
|
|
@Override
|
|
protected void doUpdate() {
|
|
}
|
|
|
|
boolean isValidScanner(){
|
|
return (currentScannner!=null) && (!currentScannner.isEmpty());
|
|
}
|
|
|
|
void closeDevices() throws Exception{
|
|
if ((currentScannner!=null) && (!currentScannner.isEmpty())){
|
|
try{
|
|
if (panelStatus.getDevice()!=null){
|
|
panelStatus.getDevice().close();
|
|
panelStatus.setDevice(null);
|
|
}
|
|
if (panelPosition.getDevice()!=null){
|
|
panelPosition.getDevice().close();
|
|
panelPosition.setDevice(null);
|
|
}
|
|
labelPosX.setText("");
|
|
labelPosY.setText("");
|
|
boolean moved = Epics.get(currentScannner + ":WIRE_SP", Integer.class) != 0;
|
|
if (parked && moved){
|
|
System.out.println("Parking scanner");
|
|
Epics.putq(currentScannner + ":GARAGE_SEL.PROC", 1);
|
|
Epics.putq(currentScannner + ":INIT.PROC", 1);
|
|
}
|
|
} catch (Exception ex){
|
|
ex.printStackTrace();
|
|
throw ex;
|
|
} finally{
|
|
currentScannner = "" ;
|
|
}
|
|
}
|
|
}
|
|
|
|
int getWireSet(){
|
|
switch (comboScanType.getSelectedIndex()){
|
|
case 0: case 1: case 4:
|
|
return 1;
|
|
case 2: case 3: case 5:
|
|
return 2;
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
boolean isSet(){
|
|
switch (comboScanType.getSelectedIndex()){
|
|
case 4: case 5:
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
boolean isSet1(){
|
|
switch (comboScanType.getSelectedIndex()){
|
|
case 0: case 1: case 4:
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
boolean isX(){
|
|
switch (comboScanType.getSelectedIndex()){
|
|
case 0: case 2: case 4: case 5:
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
boolean isY(){
|
|
switch (comboScanType.getSelectedIndex()){
|
|
case 1: case 3: case 4: case 5:
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
boolean isBackground(){
|
|
switch (comboScanType.getSelectedIndex()){
|
|
case 6: case 7:
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
|
|
|
|
void updatePosition(Double value){
|
|
if (value!=null && !Double.isNaN((Double)value)){
|
|
try {
|
|
List<Double> pos = (List<Double>)eval("get_wire_pos(scanner_info, " + value + ")", true);
|
|
int offset = (getWireSet()-1) *2;
|
|
labelPosX.setText(String.valueOf(Convert.roundDouble(pos.get(0 + offset),1)));
|
|
labelPosY.setText(String.valueOf(Convert.roundDouble(pos.get(1 + offset),1)));
|
|
return;
|
|
} catch (Exception ex) {
|
|
ex.printStackTrace();
|
|
}
|
|
}
|
|
labelPosX.setText("");
|
|
labelPosY.setText("");
|
|
}
|
|
|
|
|
|
JDialog dlgRaw;
|
|
void showBlmRawData(String blm){
|
|
try {
|
|
if ((blm==null) || (blm.isEmpty())){
|
|
return;
|
|
}
|
|
String channel = blm + ":LOSS_SIGNAL_RAW";
|
|
Device dev = Epics.newChannelDevice(channel, channel, null);
|
|
//dev.setPolling(1000);
|
|
dev.setMonitored(true);
|
|
dev.initialize();
|
|
DeviceValueChart chart = new DeviceValueChart();
|
|
dlgRaw= SwingUtils.showDialog((Window)this.getTopLevel(), blm, new Dimension(600,400), chart);
|
|
chart.setDevice(dev);
|
|
chart.setInterval(200);
|
|
dlgRaw.addWindowListener(new WindowAdapter() {
|
|
@Override
|
|
public void windowClosing(WindowEvent e) {
|
|
try {
|
|
dev.close();
|
|
} catch (Exception ex) {
|
|
Logger.getLogger(WireScan.class.getName()).log(Level.WARNING, null, ex);
|
|
}
|
|
}
|
|
});
|
|
} catch (Exception ex) {
|
|
showException(ex);
|
|
}
|
|
}
|
|
|
|
|
|
void showPmtPanel(String blm){
|
|
try {
|
|
if ((blm==null) || (blm.isEmpty())){
|
|
return;
|
|
}
|
|
|
|
eval("run('Devices/Elements')", true);
|
|
String prefix = (String )eval("get_blm_ioc_prefix('" + blm + "')", true);
|
|
if (prefix==null){
|
|
throw new Exception("Unknown BLM IOC");
|
|
}
|
|
String[] tokens = prefix.split(":");
|
|
String ioc = tokens[0];
|
|
String al = tokens[1].substring(0, 3);
|
|
String macro = "DEV=" + ioc + ", INST=$(INST), ALARM=" + al + ", INTV=7";
|
|
String cmd = "caqtdm -macro \"" + macro + "\" S_DI_GPAC_BLM_WS.ui";
|
|
System.out.println(cmd);
|
|
//caqtdm -macro "DEV=SARCL02-DBLM457, INST=$(INST), ALARM=AL0, INTV=7" S_DI_GPAC_BLM_WS.ui
|
|
//caqtdm -macro "DEV=SARCL02-DBLM457, INST=$(INST), ALARM=AL0, INTV=7" S_DI_WSC_EXPERT.ui
|
|
Runtime.getRuntime().exec(new String[]{"bash", "-c", cmd.toString()});
|
|
|
|
} catch (Exception ex) {
|
|
showException(ex);
|
|
}
|
|
}
|
|
|
|
@SuppressWarnings("unchecked")
|
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
|
private void initComponents() {
|
|
|
|
plot = new ch.psi.pshell.plot.LinePlotJFree();
|
|
panelLeft = new javax.swing.JPanel();
|
|
buttonRaw1 = new javax.swing.JButton();
|
|
labelPosY = new javax.swing.JLabel();
|
|
jLabel14 = new javax.swing.JLabel();
|
|
jLabel8 = new javax.swing.JLabel();
|
|
buttonScan = new javax.swing.JButton();
|
|
ledHomed = new ch.psi.pshell.swing.Led();
|
|
comboScanType = new javax.swing.JComboBox();
|
|
spinnerCycles = new javax.swing.JSpinner();
|
|
panelRepRate = new ch.psi.pshell.swing.DeviceValuePanel();
|
|
labelEndY = new javax.swing.JLabel();
|
|
comboBlm1 = new javax.swing.JComboBox();
|
|
jLabel7 = new javax.swing.JLabel();
|
|
jLabel9 = new javax.swing.JLabel();
|
|
buttonMoveStart = new javax.swing.JButton();
|
|
jLabel4 = new javax.swing.JLabel();
|
|
jLabel2 = new javax.swing.JLabel();
|
|
spinnerStartY = new javax.swing.JSpinner();
|
|
buttonParkAll = new javax.swing.JButton();
|
|
panelStatus = new ch.psi.pshell.swing.DeviceValuePanel();
|
|
buttonPark = new javax.swing.JButton();
|
|
panelPosition = new ch.psi.pshell.swing.DeviceValuePanel();
|
|
comboBlm2 = new javax.swing.JComboBox();
|
|
comboBpm3 = new javax.swing.JComboBox();
|
|
spinnerPoints = new javax.swing.JSpinner();
|
|
buttonRaw2 = new javax.swing.JButton();
|
|
comboBlm3 = new javax.swing.JComboBox();
|
|
comboWireScanner = new javax.swing.JComboBox();
|
|
jLabel15 = new javax.swing.JLabel();
|
|
jLabel19 = new javax.swing.JLabel();
|
|
checkSaveRaw = new javax.swing.JCheckBox();
|
|
jLabel20 = new javax.swing.JLabel();
|
|
jLabel12 = new javax.swing.JLabel();
|
|
jLabel5 = new javax.swing.JLabel();
|
|
spinnerEndY = new javax.swing.JSpinner();
|
|
jLabel16 = new javax.swing.JLabel();
|
|
jLabel17 = new javax.swing.JLabel();
|
|
spinnerStartX = new javax.swing.JSpinner();
|
|
jLabel13 = new javax.swing.JLabel();
|
|
jLabel11 = new javax.swing.JLabel();
|
|
buttonCalibration = new javax.swing.JButton();
|
|
labelPosX = new javax.swing.JLabel();
|
|
spinnerBackground = new javax.swing.JSpinner();
|
|
buttonHoming = new javax.swing.JButton();
|
|
jLabel10 = new javax.swing.JLabel();
|
|
comboBpm1 = new javax.swing.JComboBox();
|
|
jLabel3 = new javax.swing.JLabel();
|
|
comboBpm2 = new javax.swing.JComboBox();
|
|
buttonAbort = new javax.swing.JButton();
|
|
jLabel6 = new javax.swing.JLabel();
|
|
labelStartY = new javax.swing.JLabel();
|
|
spinnerEndX = new javax.swing.JSpinner();
|
|
buttonRaw3 = new javax.swing.JButton();
|
|
jLabel18 = new javax.swing.JLabel();
|
|
buttonScannerPanel = new javax.swing.JButton();
|
|
jLabel21 = new javax.swing.JLabel();
|
|
spinnerBunch = new javax.swing.JSpinner();
|
|
jLabel23 = new javax.swing.JLabel();
|
|
labelVelX = new javax.swing.JLabel();
|
|
jLabel24 = new javax.swing.JLabel();
|
|
labelVelY = new javax.swing.JLabel();
|
|
comboAdaptive = new javax.swing.JComboBox();
|
|
jLabel22 = new javax.swing.JLabel();
|
|
checkFilterBeamOk = new javax.swing.JCheckBox();
|
|
buttonPMT1 = new javax.swing.JButton();
|
|
buttonPMT2 = new javax.swing.JButton();
|
|
buttonPMT3 = new javax.swing.JButton();
|
|
|
|
plot.setTitle("");
|
|
|
|
buttonRaw1.setText("Raw");
|
|
buttonRaw1.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonRaw1ActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
labelPosY.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
|
labelPosY.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
|
|
|
|
jLabel14.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel14.setText("Pos y (µm):");
|
|
|
|
jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel8.setText("Points:");
|
|
|
|
buttonScan.setText("Scan");
|
|
buttonScan.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonScanActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
ledHomed.setForeground(java.awt.Color.darkGray);
|
|
ledHomed.setLedSize(18);
|
|
|
|
comboScanType.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
comboScanTypeActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
spinnerCycles.setModel(new javax.swing.SpinnerNumberModel(1, 1, 100, 1));
|
|
|
|
labelEndY.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
labelEndY.setText("End Y (µm):");
|
|
|
|
comboBlm1.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
comboBlm1ActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel7.setText("End X (µm):");
|
|
|
|
jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel9.setText("Cycles:");
|
|
|
|
buttonMoveStart.setText("Go to Start");
|
|
buttonMoveStart.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonMoveStartActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel4.setText("BPM 2:");
|
|
|
|
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel2.setText("Scan Type:");
|
|
|
|
spinnerStartY.setModel(new javax.swing.SpinnerNumberModel(1000.0d, -10000.0d, 10000.0d, 1.0d));
|
|
|
|
buttonParkAll.setText("ParkAll");
|
|
buttonParkAll.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonParkAllActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
buttonPark.setText("Garage");
|
|
buttonPark.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonParkActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
comboBlm2.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
comboBlm2ActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
spinnerPoints.setModel(new javax.swing.SpinnerNumberModel(200, 1, 10000, 1));
|
|
|
|
buttonRaw2.setText("Raw");
|
|
buttonRaw2.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonRaw2ActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
comboBlm3.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
comboBlm3ActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
comboWireScanner.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
comboWireScannerActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
jLabel15.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel15.setText("Trigger(Hz):");
|
|
|
|
jLabel19.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel19.setText("Background:");
|
|
|
|
checkSaveRaw.setText("Save Raw Signal");
|
|
|
|
jLabel20.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel20.setText("Wire Scanner:");
|
|
|
|
jLabel12.setText("Homed:");
|
|
|
|
jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel5.setText("BPM 3:");
|
|
|
|
spinnerEndY.setModel(new javax.swing.SpinnerNumberModel(1000.0d, -10000.0d, 10000.0d, 1.0d));
|
|
|
|
jLabel16.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel16.setText("BLM 3:");
|
|
|
|
jLabel17.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel17.setText("BLM 2:");
|
|
|
|
spinnerStartX.setModel(new javax.swing.SpinnerNumberModel(1000.0d, -10000.0d, 10000.0d, 1.0d));
|
|
|
|
jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel13.setText("Pos x (µm):");
|
|
|
|
jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel11.setText("Pos mot (µm):");
|
|
|
|
buttonCalibration.setText("Calibration");
|
|
buttonCalibration.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonCalibrationActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
labelPosX.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
|
labelPosX.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
|
|
|
|
spinnerBackground.setModel(new javax.swing.SpinnerNumberModel(50, 0, 1000, 1));
|
|
|
|
buttonHoming.setText("Homing");
|
|
buttonHoming.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonHomingActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel10.setText("Scan status:");
|
|
|
|
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel3.setText("BPM 1:");
|
|
|
|
buttonAbort.setText("Abort");
|
|
buttonAbort.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonAbortActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel6.setText("Start X (µm):");
|
|
|
|
labelStartY.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
labelStartY.setText("Start Y (µm):");
|
|
|
|
spinnerEndX.setModel(new javax.swing.SpinnerNumberModel(1000.0d, -10000.0d, 10000.0d, 1.0d));
|
|
|
|
buttonRaw3.setText("Raw");
|
|
buttonRaw3.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonRaw3ActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
jLabel18.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel18.setText("BLM 1:");
|
|
|
|
buttonScannerPanel.setText("Scanner Panel");
|
|
buttonScannerPanel.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonScannerPanelActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
jLabel21.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel21.setText("Bunch:");
|
|
|
|
spinnerBunch.setModel(new javax.swing.SpinnerNumberModel(1, 1, 2, 1));
|
|
spinnerBunch.addChangeListener(new javax.swing.event.ChangeListener() {
|
|
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
|
spinnerBunchStateChanged(evt);
|
|
}
|
|
});
|
|
|
|
jLabel23.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel23.setText("Vel x (µm/s):");
|
|
|
|
labelVelX.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
|
labelVelX.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
|
|
|
|
jLabel24.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel24.setText("Vel y (µm/s):");
|
|
|
|
labelVelY.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
|
labelVelY.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
|
|
|
|
comboAdaptive.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Off", "Gain", "Gain+Range" }));
|
|
comboAdaptive.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
comboAdaptiveActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
jLabel22.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
|
|
jLabel22.setText("Adaptive:");
|
|
|
|
checkFilterBeamOk.setSelected(true);
|
|
checkFilterBeamOk.setText("Filter Beam Ok");
|
|
|
|
buttonPMT1.setText("PMT");
|
|
buttonPMT1.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonPMT1ActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
buttonPMT2.setText("PMT");
|
|
buttonPMT2.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonPMT2ActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
buttonPMT3.setText("PMT");
|
|
buttonPMT3.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonPMT3ActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
javax.swing.GroupLayout panelLeftLayout = new javax.swing.GroupLayout(panelLeft);
|
|
panelLeft.setLayout(panelLeftLayout);
|
|
panelLeftLayout.setHorizontalGroup(
|
|
panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(panelLeftLayout.createSequentialGroup()
|
|
.addGap(0, 0, 0)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(panelLeftLayout.createSequentialGroup()
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addComponent(jLabel10, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(jLabel15, javax.swing.GroupLayout.Alignment.TRAILING)
|
|
.addComponent(jLabel14, javax.swing.GroupLayout.Alignment.TRAILING)
|
|
.addComponent(jLabel13, javax.swing.GroupLayout.Alignment.TRAILING)
|
|
.addComponent(jLabel11, javax.swing.GroupLayout.Alignment.TRAILING)
|
|
.addComponent(jLabel16, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(jLabel17, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(jLabel18, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(jLabel4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(labelStartY, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(jLabel6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(jLabel8, javax.swing.GroupLayout.Alignment.TRAILING)
|
|
.addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(jLabel20, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(jLabel21, javax.swing.GroupLayout.Alignment.TRAILING)
|
|
.addComponent(jLabel23, javax.swing.GroupLayout.Alignment.TRAILING))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addComponent(spinnerBunch, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(spinnerPoints, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(spinnerStartX)
|
|
.addComponent(spinnerStartY))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addComponent(labelEndY)
|
|
.addComponent(jLabel7)
|
|
.addComponent(jLabel9)
|
|
.addComponent(jLabel19))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addComponent(spinnerCycles)
|
|
.addComponent(spinnerBackground, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(spinnerEndX)
|
|
.addComponent(spinnerEndY)))
|
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelLeftLayout.createSequentialGroup()
|
|
.addComponent(buttonPark)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(buttonParkAll)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(buttonMoveStart))
|
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelLeftLayout.createSequentialGroup()
|
|
.addComponent(buttonScan)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(checkSaveRaw)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(buttonAbort))
|
|
.addGroup(panelLeftLayout.createSequentialGroup()
|
|
.addGap(98, 98, 98)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(panelLeftLayout.createSequentialGroup()
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
|
.addComponent(comboBlm3, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(comboBlm2, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(comboBlm1, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelLeftLayout.createSequentialGroup()
|
|
.addComponent(buttonPMT1)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(buttonRaw1))
|
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelLeftLayout.createSequentialGroup()
|
|
.addComponent(buttonPMT2)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(buttonRaw2))
|
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panelLeftLayout.createSequentialGroup()
|
|
.addComponent(buttonPMT3)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(buttonRaw3))))
|
|
.addComponent(comboBpm2, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(comboBpm1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(comboBpm3, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(comboWireScanner, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addGroup(panelLeftLayout.createSequentialGroup()
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(panelLeftLayout.createSequentialGroup()
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addComponent(panelPosition, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(labelPosX, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(labelPosY, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addGroup(panelLeftLayout.createSequentialGroup()
|
|
.addComponent(panelRepRate, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addGap(18, 18, Short.MAX_VALUE)
|
|
.addComponent(jLabel12)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addComponent(ledHomed, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
|
.addGap(18, 18, Short.MAX_VALUE))
|
|
.addGroup(panelLeftLayout.createSequentialGroup()
|
|
.addComponent(checkFilterBeamOk)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
|
.addComponent(buttonHoming, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(buttonScannerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(buttonCalibration, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
|
.addGroup(panelLeftLayout.createSequentialGroup()
|
|
.addComponent(labelVelX, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addComponent(jLabel24)
|
|
.addGroup(panelLeftLayout.createSequentialGroup()
|
|
.addGap(98, 98, 98)
|
|
.addComponent(labelVelY, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))))
|
|
.addComponent(panelStatus, javax.swing.GroupLayout.PREFERRED_SIZE, 324, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addGroup(panelLeftLayout.createSequentialGroup()
|
|
.addComponent(comboScanType, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addComponent(jLabel22)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addComponent(comboAdaptive, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))
|
|
.addGap(0, 0, 0))
|
|
);
|
|
|
|
panelLeftLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel10, jLabel11, jLabel13, jLabel14, jLabel15, jLabel16, jLabel17, jLabel18, jLabel19, jLabel2, jLabel20, jLabel21, jLabel23, jLabel24, jLabel3, jLabel4, jLabel5, jLabel6, jLabel7, jLabel8, jLabel9, labelEndY, labelStartY});
|
|
|
|
panelLeftLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonAbort, buttonMoveStart, buttonPark, buttonParkAll, buttonScan});
|
|
|
|
panelLeftLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonCalibration, buttonScannerPanel});
|
|
|
|
panelLeftLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {labelPosX, labelPosY, labelVelX, labelVelY, panelPosition, panelRepRate});
|
|
|
|
panelLeftLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {spinnerBackground, spinnerCycles, spinnerEndX, spinnerEndY});
|
|
|
|
panelLeftLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {spinnerBunch, spinnerPoints, spinnerStartX, spinnerStartY});
|
|
|
|
panelLeftLayout.setVerticalGroup(
|
|
panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(panelLeftLayout.createSequentialGroup()
|
|
.addGap(0, 0, 0)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
.addComponent(comboWireScanner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(jLabel20))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
.addComponent(comboScanType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(jLabel2)
|
|
.addComponent(comboAdaptive, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(jLabel22))
|
|
.addGap(18, 18, 18)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
|
.addComponent(jLabel8)
|
|
.addComponent(spinnerCycles, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
.addComponent(jLabel9)
|
|
.addComponent(spinnerPoints, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
.addComponent(spinnerBackground, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(jLabel19)
|
|
.addComponent(spinnerBunch, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(jLabel21))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
|
.addComponent(jLabel6)
|
|
.addComponent(jLabel7)
|
|
.addComponent(spinnerEndX, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(spinnerStartX, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
.addComponent(spinnerStartY, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(labelEndY)
|
|
.addComponent(spinnerEndY, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(labelStartY))
|
|
.addGap(18, 18, 18)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
.addComponent(jLabel3)
|
|
.addComponent(comboBpm1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
.addComponent(comboBpm2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(jLabel4))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
.addComponent(comboBpm3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(jLabel5))
|
|
.addGap(18, 18, 18)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
.addComponent(jLabel18)
|
|
.addComponent(comboBlm1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(buttonRaw1)
|
|
.addComponent(buttonPMT1))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
.addComponent(comboBlm2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(jLabel17)
|
|
.addComponent(buttonRaw2)
|
|
.addComponent(buttonPMT2))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
.addComponent(comboBlm3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(jLabel16)
|
|
.addComponent(buttonRaw3)
|
|
.addComponent(buttonPMT3))
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
|
.addGroup(panelLeftLayout.createSequentialGroup()
|
|
.addGap(26, 26, 26)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
|
.addComponent(jLabel11)
|
|
.addComponent(buttonScannerPanel)))
|
|
.addGroup(panelLeftLayout.createSequentialGroup()
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addComponent(checkFilterBeamOk)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(panelPosition, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
|
.addComponent(jLabel13)
|
|
.addComponent(labelPosX)
|
|
.addComponent(buttonCalibration))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
|
.addComponent(jLabel14)
|
|
.addComponent(labelPosY))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
|
.addComponent(jLabel23)
|
|
.addComponent(labelVelX)
|
|
.addComponent(jLabel24)
|
|
.addComponent(labelVelY))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
|
.addComponent(jLabel15)
|
|
.addComponent(panelRepRate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(jLabel12)
|
|
.addComponent(ledHomed, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(buttonHoming))
|
|
.addGap(18, 18, Short.MAX_VALUE)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
|
.addComponent(jLabel10)
|
|
.addComponent(panelStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
.addGap(18, 18, Short.MAX_VALUE)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
.addComponent(buttonPark)
|
|
.addComponent(buttonMoveStart)
|
|
.addComponent(buttonParkAll))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addGroup(panelLeftLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
.addComponent(buttonAbort)
|
|
.addComponent(buttonScan)
|
|
.addComponent(checkSaveRaw))
|
|
.addGap(0, 0, 0))
|
|
);
|
|
|
|
panelLeftLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {labelPosX, labelPosY, labelVelX, labelVelY, panelPosition});
|
|
|
|
panelLeftLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {spinnerBunch, spinnerPoints, spinnerStartX, spinnerStartY});
|
|
|
|
panelLeftLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {spinnerCycles, spinnerEndX, spinnerEndY});
|
|
|
|
panelLeftLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {panelRepRate, panelStatus});
|
|
|
|
panelLeftLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel19, jLabel7, jLabel9, labelEndY});
|
|
|
|
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()
|
|
.addComponent(panelLeft, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addComponent(plot, javax.swing.GroupLayout.DEFAULT_SIZE, 420, Short.MAX_VALUE)
|
|
.addGap(11, 11, 11))
|
|
);
|
|
layout.setVerticalGroup(
|
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(layout.createSequentialGroup()
|
|
.addContainerGap()
|
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addComponent(panelLeft, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(plot, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
|
.addContainerGap())
|
|
);
|
|
}// </editor-fold>//GEN-END:initComponents
|
|
|
|
private void comboWireScannerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboWireScannerActionPerformed
|
|
try {
|
|
closeDevices();
|
|
ledHomed.setColor(Color.darkGray);
|
|
homed = false;
|
|
parked = false;
|
|
currentScannner = comboWireScanner.getSelectedItem().toString();
|
|
|
|
if (currentScannner.isEmpty()){
|
|
for (JComboBox cb : bpmCombos){
|
|
cb.setSelectedItem("");
|
|
}
|
|
for (JComboBox cb : blmCombos){
|
|
cb.setSelectedItem("");
|
|
}
|
|
} else {
|
|
List<String> ret = (List<String>) ((Plugin)this).eval("get_wire_scanners_bpms('" + currentScannner + "')", true);
|
|
comboBpm1.setSelectedItem((ret==null) ? "" : ret.get(0));
|
|
comboBpm2.setSelectedItem((ret==null) ? "" : ret.get(1));
|
|
ret = (List<String>) ((Plugin)this).eval("get_wire_scanners_blms('" + currentScannner + "')", true);
|
|
comboBlm1.setSelectedItem((ret==null) ? "" : ret.get(0));
|
|
comboBlm2.setSelectedItem((ret==null) ? "" : ret.get(1));
|
|
int selection = Epics.get(currentScannner + ":WIRE_SP", Integer.class);
|
|
//comboSelection.setSelectedIndex(selection); //TODO: FIX
|
|
//spinnerPoints.setValue(Epics.get(currentScannner + ":SCAN_VELO_SP", Double.class));
|
|
spinnerCycles.setValue(Epics.get(currentScannner + ":NB_CYCL_SP", Integer.class));
|
|
Device scannerInfo = (Device)eval("new_scan_info_device(None, '" + currentScannner+ "')", true);
|
|
setGlobalVar("scanner_info", scannerInfo);
|
|
panelStatus.setDevice(scannerInfo);
|
|
Device dev = new ChannelDouble (null, currentScannner + ":ENC_1_BS", 3);
|
|
dev.setMonitored(true);
|
|
dev.addListener(new DeviceAdapter() {
|
|
@Override
|
|
public void onValueChanged(Device device, Object value, Object former) {
|
|
updatePosition((Double)value);
|
|
}
|
|
});
|
|
dev.initialize();
|
|
panelPosition.setDevice(dev);
|
|
parked = (selection== 0);
|
|
comboScanTypeActionPerformed(null);
|
|
}
|
|
} catch (Exception ex) {
|
|
try {
|
|
closeDevices();
|
|
} catch (Exception ex1) {
|
|
Logger.getLogger(WireScan.class.getName()).log(Level.SEVERE, null, ex1);
|
|
}
|
|
showException(ex);
|
|
comboWireScanner.setSelectedItem("");
|
|
for (JComboBox cb : bpmCombos){
|
|
cb.setSelectedItem("");
|
|
}
|
|
for (JComboBox cb : blmCombos){
|
|
cb.setSelectedItem("");
|
|
}
|
|
}
|
|
onStateChange(getState(), getState());
|
|
}//GEN-LAST:event_comboWireScannerActionPerformed
|
|
|
|
ChannelDouble channelStartX;
|
|
ChannelDouble channelEndX;
|
|
ChannelDouble channelStartY;
|
|
ChannelDouble channelEndY;
|
|
|
|
private void comboScanTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboScanTypeActionPerformed
|
|
try {
|
|
|
|
if (channelStartX != null){
|
|
channelStartX.close();
|
|
channelStartX = null;
|
|
}
|
|
if (channelEndX != null){
|
|
channelEndX.close();
|
|
channelEndX = null;
|
|
}
|
|
if (channelStartY != null){
|
|
channelStartY.close();
|
|
channelStartY = null;
|
|
}
|
|
if (channelEndY != null){
|
|
channelEndY.close();
|
|
channelEndY = null;
|
|
}
|
|
if (!isBackground()){
|
|
boolean set1 = isSet1();
|
|
channelStartX = new ChannelDouble("Start X", currentScannner + (set1 ? ":W1X" : ":W2X") + "_START_SP");
|
|
channelEndX = new ChannelDouble("End X", currentScannner + (set1 ? ":W1X" : ":W2X") + "_END_SP");
|
|
channelStartY = new ChannelDouble("Start Y", currentScannner + (set1 ? ":W1Y" : ":W2Y") + "_START_SP");
|
|
channelEndY = new ChannelDouble("End X", currentScannner + (set1 ? ":W1Y" : ":W2Y") + "_END_SP");
|
|
channelStartX.initialize(); channelStartX.setMonitored(true);
|
|
channelEndX.initialize(); channelEndX.setMonitored(true);
|
|
channelStartY.initialize(); channelStartY.setMonitored(true);
|
|
channelEndY.initialize(); channelEndY.setMonitored(true);
|
|
|
|
channelStartX.addListener(new DeviceAdapter() {
|
|
@Override
|
|
public void onValueChanged(Device device, Object value, Object former) {
|
|
spinnerStartX.setValue(((Number)value).doubleValue());
|
|
}
|
|
});
|
|
channelEndX.addListener(new DeviceAdapter() {
|
|
@Override
|
|
public void onValueChanged(Device device, Object value, Object former) {
|
|
spinnerEndX.setValue(((Number)value).doubleValue());
|
|
}
|
|
});
|
|
channelStartY.addListener(new DeviceAdapter() {
|
|
@Override
|
|
public void onValueChanged(Device device, Object value, Object former) {
|
|
spinnerStartY.setValue(((Number)value).doubleValue());
|
|
}
|
|
});
|
|
channelEndY.addListener(new DeviceAdapter() {
|
|
@Override
|
|
public void onValueChanged(Device device, Object value, Object former) {
|
|
spinnerEndY.setValue(((Number)value).doubleValue());
|
|
}
|
|
});
|
|
|
|
spinnerStartX.setValue(channelStartX.read());
|
|
spinnerEndX.setValue(channelEndX.read());
|
|
spinnerStartY.setValue(channelStartY.read());
|
|
spinnerEndY.setValue(channelEndY.read());
|
|
}
|
|
} catch (Exception ex) {
|
|
showException(ex);
|
|
}
|
|
try {
|
|
updatePosition((Double) panelPosition.getDevice().take());
|
|
} catch (Exception ex) {
|
|
showException(ex);
|
|
}
|
|
onStateChange(getState(), getState());
|
|
}//GEN-LAST:event_comboScanTypeActionPerformed
|
|
|
|
private void buttonScanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonScanActionPerformed
|
|
try {
|
|
ArrayList parameters = new ArrayList();
|
|
System.out.println("Background: " + isBackground());
|
|
if (isBackground()){
|
|
parameters.add(currentScannner);
|
|
parameters.add(comboScanType.getSelectedItem().toString());
|
|
ArrayList blms = new ArrayList();
|
|
for (JComboBox cb : blmCombos){
|
|
if (!cb.getSelectedItem().toString().isEmpty()){
|
|
blms.add(cb.getSelectedItem().toString());
|
|
}
|
|
}
|
|
parameters.add(blms);
|
|
parameters.add(spinnerBackground.getValue());
|
|
parameters.add(plot);
|
|
parameters.add(checkSaveRaw.isSelected());
|
|
runAsync("Diagnostics/WireScanBackground", parameters).handle((ret, ex) -> {
|
|
if (ex != null) {
|
|
getLogger().info("Exception executing scan: " + ex);
|
|
showException((Exception) ex);
|
|
}
|
|
return ret;
|
|
});
|
|
} else {
|
|
parameters.add(currentScannner);
|
|
parameters.add(comboScanType.getSelectedItem().toString());
|
|
ArrayList range = new ArrayList();
|
|
range.add(spinnerStartX.getValue());
|
|
range.add(spinnerEndX.getValue());
|
|
range.add(spinnerStartY.getValue());
|
|
range.add(spinnerEndY.getValue());
|
|
parameters.add(range);
|
|
parameters.add(spinnerCycles.getValue());
|
|
parameters.add(spinnerPoints.getValue());
|
|
ArrayList bpms = new ArrayList();
|
|
for (JComboBox cb : bpmCombos){
|
|
if (cb.getSelectedItem()!=null && (!cb.getSelectedItem().toString().isEmpty())){
|
|
bpms.add(cb.getSelectedItem().toString());
|
|
}
|
|
}
|
|
parameters.add(bpms);
|
|
ArrayList blms = new ArrayList();
|
|
for (JComboBox cb : blmCombos){
|
|
if ((cb.getSelectedItem()!=null) && (!cb.getSelectedItem().toString().isEmpty())){
|
|
blms.add(cb.getSelectedItem().toString());
|
|
}
|
|
}
|
|
parameters.add(blms);
|
|
parameters.add(spinnerBackground.getValue());
|
|
parameters.add(plot);
|
|
parameters.add(checkSaveRaw.isSelected());
|
|
parameters.add(spinnerBunch.getValue());
|
|
parameters.add(comboAdaptive.getSelectedIndex());
|
|
parameters.add(checkFilterBeamOk.isSelected());
|
|
|
|
|
|
runAsync("Diagnostics/WireScan", parameters).handle((ret, ex) -> {
|
|
if (ex != null) {
|
|
getLogger().info("Exception executing scan: " + ex);
|
|
showException((Exception) ex);
|
|
} else {
|
|
//SwingUtils.showMessage(WireScan.this, "Success", "Data file: \n" + getContext().getDataManager().getLastOutput());
|
|
/*
|
|
JPanel pn = new JPanel(new BorderLayout());
|
|
((BorderLayout) pn.getLayout()).setHgap(5);
|
|
pn.add(new JLabel("Generated data file:"), BorderLayout.NORTH);
|
|
JTextField tf = new JTextField(getContext().getDataManager().getLastOutput());
|
|
tf.setPreferredSize(new Dimension(600, tf.getPreferredSize().height));
|
|
tf.setEditable(false);
|
|
pn.add(tf, BorderLayout.SOUTH);
|
|
JOptionPane.showOptionDialog(WireScan.this, pn, "Success", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, null, null);
|
|
*/
|
|
}
|
|
return ret;
|
|
});
|
|
}
|
|
} catch (Exception ex) {
|
|
showException(ex);
|
|
ex.printStackTrace();
|
|
}
|
|
}//GEN-LAST:event_buttonScanActionPerformed
|
|
|
|
private void buttonAbortActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAbortActionPerformed
|
|
try {
|
|
abort();
|
|
} catch (Exception ex) {
|
|
showException(ex);
|
|
}
|
|
}//GEN-LAST:event_buttonAbortActionPerformed
|
|
|
|
private void buttonMoveStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonMoveStartActionPerformed
|
|
try {
|
|
int type = comboScanType.getSelectedIndex();
|
|
if (isBackground()){
|
|
Epics.putq(currentScannner + ":WIRE_SP", (type==7) ? 5 : 0);
|
|
} else if (isSet1()){
|
|
Epics.putq(currentScannner + ":WIRE_SP", isX() ? 1 : 2);
|
|
} else {
|
|
Epics.putq(currentScannner + ":WIRE_SP", isX() ? 3 : 4);
|
|
}
|
|
Epics.putq(currentScannner + ":INIT.PROC", 1);
|
|
} catch (Exception ex) {
|
|
showException(ex);
|
|
}
|
|
}//GEN-LAST:event_buttonMoveStartActionPerformed
|
|
|
|
private void buttonParkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonParkActionPerformed
|
|
try {
|
|
Epics.putq(currentScannner + ":GARAGE_SEL.PROC", 1);
|
|
Epics.putq(currentScannner + ":INIT.PROC", 1);
|
|
} catch (Exception ex) {
|
|
showException(ex);
|
|
}
|
|
}//GEN-LAST:event_buttonParkActionPerformed
|
|
|
|
//String caqtdm = "caqtdm -noMsg -stylefile sfop.qss -attach";
|
|
//String caqtdm = "startDM -noMsg -stylefile sfop.qss";
|
|
ch.psi.pshell.core.Plugin calibrationPlugin;
|
|
private void buttonCalibrationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCalibrationActionPerformed
|
|
try {
|
|
//String cmd = caqtdm + " -macro 'P=" + comboWireScanner.getSelectedItem() + ":,M=MOTOR_1' /sf/common/config/qt/motorx_all.ui";
|
|
//Runtime.getRuntime().exec(new String[]{"bash", "-c", cmd.toString()});false WireScanCalibration.java
|
|
if (calibrationPlugin!=null){
|
|
getContext().getPluginManager().unloadPlugin(calibrationPlugin);
|
|
}
|
|
calibrationPlugin = getContext().getPluginManager().loadInitializePlugin(getContext().getSetup().expandPath("{plugins}/WireScanCalibration.java"));
|
|
} catch (Exception ex) {
|
|
showException(ex);
|
|
}
|
|
}//GEN-LAST:event_buttonCalibrationActionPerformed
|
|
|
|
private void buttonScannerPanelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonScannerPanelActionPerformed
|
|
try {
|
|
//String cmd = caqtdm + " -macro 'SYS=" + comboWireScanner.getSelectedItem() + "' /sf/common/config/qt/S_DI_WSC_EXPERT.ui";
|
|
String cmd = "caqtdm -macro \"SYS=" + comboWireScanner.getSelectedItem() + "\" S_DI_WSC_EXPERT.ui";
|
|
System.out.println(cmd);
|
|
Runtime.getRuntime().exec(new String[]{"bash", "-c", cmd.toString()});
|
|
} catch (Exception ex) {
|
|
showException(ex);
|
|
}
|
|
|
|
}//GEN-LAST:event_buttonScannerPanelActionPerformed
|
|
|
|
private void buttonHomingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonHomingActionPerformed
|
|
try {
|
|
Epics.putq(currentScannner + ":MOTOR_1_HOME.PROC", 1);
|
|
} catch (Exception ex) {
|
|
showException(ex);
|
|
}
|
|
}//GEN-LAST:event_buttonHomingActionPerformed
|
|
|
|
private void buttonParkAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonParkAllActionPerformed
|
|
try {
|
|
runAsync("Diagnostics/ParkAllWireScanners").handle((ret, ex) -> {
|
|
if (ex != null) {
|
|
getLogger().info("Exception executing scan: " + ex);
|
|
showException((Exception) ex);
|
|
} else {
|
|
SwingUtils.showMessage(getTopLevel(), "Success", "Finished parking wire scanners");
|
|
}
|
|
return ret;
|
|
});
|
|
|
|
} catch (Exception ex) {
|
|
showException(ex);
|
|
}
|
|
}//GEN-LAST:event_buttonParkAllActionPerformed
|
|
|
|
private void buttonRaw1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRaw1ActionPerformed
|
|
showBlmRawData(comboBlm1.getSelectedItem().toString());
|
|
}//GEN-LAST:event_buttonRaw1ActionPerformed
|
|
|
|
private void buttonRaw2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRaw2ActionPerformed
|
|
showBlmRawData(comboBlm2.getSelectedItem().toString());
|
|
}//GEN-LAST:event_buttonRaw2ActionPerformed
|
|
|
|
private void buttonRaw3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRaw3ActionPerformed
|
|
showBlmRawData(comboBlm3.getSelectedItem().toString());
|
|
}//GEN-LAST:event_buttonRaw3ActionPerformed
|
|
|
|
private void comboBlm1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboBlm1ActionPerformed
|
|
updateRawButtons();
|
|
}//GEN-LAST:event_comboBlm1ActionPerformed
|
|
|
|
private void comboBlm3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboBlm3ActionPerformed
|
|
updateRawButtons();
|
|
}//GEN-LAST:event_comboBlm3ActionPerformed
|
|
|
|
private void comboBlm2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboBlm2ActionPerformed
|
|
updateRawButtons();
|
|
}//GEN-LAST:event_comboBlm2ActionPerformed
|
|
|
|
private void comboAdaptiveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboAdaptiveActionPerformed
|
|
// TODO add your handling code here:
|
|
}//GEN-LAST:event_comboAdaptiveActionPerformed
|
|
|
|
private void spinnerBunchStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerBunchStateChanged
|
|
try {
|
|
updatePanelRepRate();
|
|
} catch (Exception ex) {
|
|
showException(ex);
|
|
}
|
|
}//GEN-LAST:event_spinnerBunchStateChanged
|
|
|
|
private void buttonPMT1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPMT1ActionPerformed
|
|
showPmtPanel(comboBlm1.getSelectedItem().toString());
|
|
}//GEN-LAST:event_buttonPMT1ActionPerformed
|
|
|
|
private void buttonPMT2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPMT2ActionPerformed
|
|
showPmtPanel(comboBlm2.getSelectedItem().toString());
|
|
}//GEN-LAST:event_buttonPMT2ActionPerformed
|
|
|
|
private void buttonPMT3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPMT3ActionPerformed
|
|
showPmtPanel(comboBlm3.getSelectedItem().toString());
|
|
}//GEN-LAST:event_buttonPMT3ActionPerformed
|
|
|
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
|
private javax.swing.JButton buttonAbort;
|
|
private javax.swing.JButton buttonCalibration;
|
|
private javax.swing.JButton buttonHoming;
|
|
private javax.swing.JButton buttonMoveStart;
|
|
private javax.swing.JButton buttonPMT1;
|
|
private javax.swing.JButton buttonPMT2;
|
|
private javax.swing.JButton buttonPMT3;
|
|
private javax.swing.JButton buttonPark;
|
|
private javax.swing.JButton buttonParkAll;
|
|
private javax.swing.JButton buttonRaw1;
|
|
private javax.swing.JButton buttonRaw2;
|
|
private javax.swing.JButton buttonRaw3;
|
|
private javax.swing.JButton buttonScan;
|
|
private javax.swing.JButton buttonScannerPanel;
|
|
private javax.swing.JCheckBox checkFilterBeamOk;
|
|
private javax.swing.JCheckBox checkSaveRaw;
|
|
private javax.swing.JComboBox comboAdaptive;
|
|
private javax.swing.JComboBox comboBlm1;
|
|
private javax.swing.JComboBox comboBlm2;
|
|
private javax.swing.JComboBox comboBlm3;
|
|
private javax.swing.JComboBox comboBpm1;
|
|
private javax.swing.JComboBox comboBpm2;
|
|
private javax.swing.JComboBox comboBpm3;
|
|
private javax.swing.JComboBox comboScanType;
|
|
private javax.swing.JComboBox comboWireScanner;
|
|
private javax.swing.JLabel jLabel10;
|
|
private javax.swing.JLabel jLabel11;
|
|
private javax.swing.JLabel jLabel12;
|
|
private javax.swing.JLabel jLabel13;
|
|
private javax.swing.JLabel jLabel14;
|
|
private javax.swing.JLabel jLabel15;
|
|
private javax.swing.JLabel jLabel16;
|
|
private javax.swing.JLabel jLabel17;
|
|
private javax.swing.JLabel jLabel18;
|
|
private javax.swing.JLabel jLabel19;
|
|
private javax.swing.JLabel jLabel2;
|
|
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 jLabel3;
|
|
private javax.swing.JLabel jLabel4;
|
|
private javax.swing.JLabel jLabel5;
|
|
private javax.swing.JLabel jLabel6;
|
|
private javax.swing.JLabel jLabel7;
|
|
private javax.swing.JLabel jLabel8;
|
|
private javax.swing.JLabel jLabel9;
|
|
private javax.swing.JLabel labelEndY;
|
|
private javax.swing.JLabel labelPosX;
|
|
private javax.swing.JLabel labelPosY;
|
|
private javax.swing.JLabel labelStartY;
|
|
private javax.swing.JLabel labelVelX;
|
|
private javax.swing.JLabel labelVelY;
|
|
private ch.psi.pshell.swing.Led ledHomed;
|
|
private javax.swing.JPanel panelLeft;
|
|
private ch.psi.pshell.swing.DeviceValuePanel panelPosition;
|
|
private ch.psi.pshell.swing.DeviceValuePanel panelRepRate;
|
|
private ch.psi.pshell.swing.DeviceValuePanel panelStatus;
|
|
private ch.psi.pshell.plot.LinePlotJFree plot;
|
|
private javax.swing.JSpinner spinnerBackground;
|
|
private javax.swing.JSpinner spinnerBunch;
|
|
private javax.swing.JSpinner spinnerCycles;
|
|
private javax.swing.JSpinner spinnerEndX;
|
|
private javax.swing.JSpinner spinnerEndY;
|
|
private javax.swing.JSpinner spinnerPoints;
|
|
private javax.swing.JSpinner spinnerStartX;
|
|
private javax.swing.JSpinner spinnerStartY;
|
|
// End of variables declaration//GEN-END:variables
|
|
}
|