592 lines
30 KiB
Java
592 lines
30 KiB
Java
/*
|
|
* Copyright (c) 2014-2017 Paul Scherrer Institute. All rights reserved.
|
|
*/
|
|
|
|
import ch.psi.pshell.core.Context;
|
|
import ch.psi.pshell.ui.Panel;
|
|
import ch.psi.utils.State;
|
|
import ch.psi.utils.swing.SwingUtils;
|
|
import java.awt.Component;
|
|
import java.util.logging.Level;
|
|
import java.util.logging.Logger;
|
|
import javax.swing.JComponent;
|
|
import javax.swing.JSpinner;
|
|
import javax.swing.JTextField;
|
|
import javax.swing.SwingConstants;
|
|
|
|
/**
|
|
*
|
|
*/
|
|
public class Expert extends Panel {
|
|
|
|
public Expert() {
|
|
initComponents();
|
|
((JSpinner.DefaultEditor)spinnerSegment.getEditor()).getTextField().setHorizontalAlignment(JTextField.RIGHT);
|
|
}
|
|
|
|
//Overridable callbacks
|
|
@Override
|
|
public void onInitialize(int runCount) {
|
|
|
|
}
|
|
|
|
@Override
|
|
public void onStateChange(State state, State former) {
|
|
for (Component c: SwingUtils.getComponentsByType(panelCommands, JComponent.class)){
|
|
c.setEnabled(state == State.Ready);
|
|
}
|
|
buttonHomingHexiposi.setEnabled(state == State.Ready);
|
|
}
|
|
|
|
@Override
|
|
public void onExecutedFile(String fileName, Object result) {
|
|
}
|
|
|
|
//Callback to perform update - in event thread
|
|
@Override
|
|
protected void doUpdate() {
|
|
}
|
|
|
|
void execute(String statement){
|
|
execute(statement, false);
|
|
}
|
|
|
|
void execute(String statement, boolean background){
|
|
execute(statement, background, false);
|
|
}
|
|
|
|
void execute(String statement, boolean background, boolean showReturn){
|
|
try {
|
|
evalAsync(statement, background).handle((ret, ex) -> {
|
|
if (ex != null){
|
|
showException((Exception)ex);
|
|
} else if (showReturn){
|
|
SwingUtils.showMessage(getTopLevel(), "Return", String.valueOf(ret));
|
|
}
|
|
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);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
|
private void initComponents() {
|
|
|
|
panelRobot = new javax.swing.JPanel();
|
|
buttonEnable = new javax.swing.JButton();
|
|
buttonDisable = new javax.swing.JButton();
|
|
jPanel2 = new javax.swing.JPanel();
|
|
buttonPositionsHexiposi = new javax.swing.JButton();
|
|
panelSafety = new javax.swing.JPanel();
|
|
buttonReleasePsys = new javax.swing.JButton();
|
|
buttonEnableAll = new javax.swing.JButton();
|
|
buttonReleaseLocal = new javax.swing.JButton();
|
|
panelCommands = new javax.swing.JPanel();
|
|
buttonMount = new javax.swing.JButton();
|
|
buttonUnmount = new javax.swing.JButton();
|
|
buttonGetDewar = new javax.swing.JButton();
|
|
buttonPutDewar = new javax.swing.JButton();
|
|
buttonGetGonio = new javax.swing.JButton();
|
|
buttonPutGonio = new javax.swing.JButton();
|
|
jPanel5 = new javax.swing.JPanel();
|
|
jLabel4 = new javax.swing.JLabel();
|
|
checkForce = new javax.swing.JCheckBox();
|
|
spinnerSample = new javax.swing.JSpinner();
|
|
spinnerPuck = new javax.swing.JSpinner();
|
|
jLabel1 = new javax.swing.JLabel();
|
|
jLabel2 = new javax.swing.JLabel();
|
|
spinnerSegment = new javax.swing.JSpinner();
|
|
jLabel3 = new javax.swing.JLabel();
|
|
buttonHomingHexiposi = new javax.swing.JButton();
|
|
jPanel3 = new javax.swing.JPanel();
|
|
buttonPuckDetCheck = new javax.swing.JButton();
|
|
buttonPuckDetStop = new javax.swing.JButton();
|
|
buttonPuckDetStart = new javax.swing.JButton();
|
|
|
|
panelRobot.setBorder(javax.swing.BorderFactory.createTitledBorder("Robot"));
|
|
|
|
buttonEnable.setText("Enable");
|
|
buttonEnable.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonEnableActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
buttonDisable.setText("Disable");
|
|
buttonDisable.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonDisableActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
javax.swing.GroupLayout panelRobotLayout = new javax.swing.GroupLayout(panelRobot);
|
|
panelRobot.setLayout(panelRobotLayout);
|
|
panelRobotLayout.setHorizontalGroup(
|
|
panelRobotLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(panelRobotLayout.createSequentialGroup()
|
|
.addContainerGap(78, Short.MAX_VALUE)
|
|
.addGroup(panelRobotLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addComponent(buttonEnable)
|
|
.addComponent(buttonDisable))
|
|
.addContainerGap(79, Short.MAX_VALUE))
|
|
);
|
|
|
|
panelRobotLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonDisable, buttonEnable});
|
|
|
|
panelRobotLayout.setVerticalGroup(
|
|
panelRobotLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(panelRobotLayout.createSequentialGroup()
|
|
.addContainerGap()
|
|
.addComponent(buttonEnable)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addComponent(buttonDisable)
|
|
.addContainerGap())
|
|
);
|
|
|
|
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Hexiposi"));
|
|
|
|
buttonPositionsHexiposi.setText("Positions");
|
|
buttonPositionsHexiposi.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonPositionsHexiposiActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
|
|
jPanel2.setLayout(jPanel2Layout);
|
|
jPanel2Layout.setHorizontalGroup(
|
|
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
|
|
.addContainerGap(76, Short.MAX_VALUE)
|
|
.addComponent(buttonPositionsHexiposi)
|
|
.addContainerGap(74, Short.MAX_VALUE))
|
|
);
|
|
jPanel2Layout.setVerticalGroup(
|
|
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(jPanel2Layout.createSequentialGroup()
|
|
.addContainerGap()
|
|
.addComponent(buttonPositionsHexiposi)
|
|
.addContainerGap())
|
|
);
|
|
|
|
panelSafety.setBorder(javax.swing.BorderFactory.createTitledBorder("Safety"));
|
|
|
|
buttonReleasePsys.setText("Release PSYS");
|
|
buttonReleasePsys.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonReleasePsysActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
buttonEnableAll.setText("Enable Motion");
|
|
buttonEnableAll.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonEnableAllActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
buttonReleaseLocal.setText("Release Local");
|
|
buttonReleaseLocal.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonReleaseLocalActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
javax.swing.GroupLayout panelSafetyLayout = new javax.swing.GroupLayout(panelSafety);
|
|
panelSafety.setLayout(panelSafetyLayout);
|
|
panelSafetyLayout.setHorizontalGroup(
|
|
panelSafetyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(panelSafetyLayout.createSequentialGroup()
|
|
.addContainerGap()
|
|
.addGroup(panelSafetyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
|
.addComponent(buttonEnableAll, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addGroup(panelSafetyLayout.createSequentialGroup()
|
|
.addComponent(buttonReleasePsys)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
|
.addComponent(buttonReleaseLocal)))
|
|
.addContainerGap())
|
|
);
|
|
panelSafetyLayout.setVerticalGroup(
|
|
panelSafetyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(panelSafetyLayout.createSequentialGroup()
|
|
.addContainerGap()
|
|
.addComponent(buttonEnableAll)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
|
.addGroup(panelSafetyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
.addComponent(buttonReleaseLocal)
|
|
.addComponent(buttonReleasePsys))
|
|
.addContainerGap())
|
|
);
|
|
|
|
panelCommands.setBorder(javax.swing.BorderFactory.createTitledBorder("Commands"));
|
|
|
|
buttonMount.setText("Mount");
|
|
buttonMount.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonMountActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
buttonUnmount.setText("Unmount");
|
|
buttonUnmount.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonUnmountActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
buttonGetDewar.setText("Get Dewar");
|
|
buttonGetDewar.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonGetDewarActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
buttonPutDewar.setText("Put Dewar");
|
|
buttonPutDewar.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonPutDewarActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
buttonGetGonio.setText("Get Gonio");
|
|
buttonGetGonio.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonGetGonioActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
buttonPutGonio.setText("Put Gonio");
|
|
buttonPutGonio.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonPutGonioActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
jLabel4.setText("Force:");
|
|
|
|
checkForce.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
|
|
|
|
spinnerSample.setModel(new javax.swing.SpinnerNumberModel(1, 1, 16, 1));
|
|
|
|
spinnerPuck.setModel(new javax.swing.SpinnerNumberModel(1, 1, 5, 1));
|
|
|
|
jLabel1.setText("Segment:");
|
|
|
|
jLabel2.setText("Puck:");
|
|
|
|
spinnerSegment.setModel(new javax.swing.SpinnerListModel(new String[] {"A", "B", "C", "D", "E", "F"}));
|
|
|
|
jLabel3.setText("Sample:");
|
|
|
|
javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
|
|
jPanel5.setLayout(jPanel5Layout);
|
|
jPanel5Layout.setHorizontalGroup(
|
|
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(jPanel5Layout.createSequentialGroup()
|
|
.addContainerGap()
|
|
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addComponent(jLabel3)
|
|
.addComponent(jLabel2)
|
|
.addComponent(jLabel1)
|
|
.addComponent(jLabel4))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addComponent(checkForce)
|
|
.addComponent(spinnerSample, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(spinnerPuck, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(spinnerSegment, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
.addContainerGap())
|
|
);
|
|
|
|
jPanel5Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {jLabel1, jLabel2, jLabel3});
|
|
|
|
jPanel5Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {spinnerPuck, spinnerSample, spinnerSegment});
|
|
|
|
jPanel5Layout.setVerticalGroup(
|
|
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(jPanel5Layout.createSequentialGroup()
|
|
.addGap(0, 0, 0)
|
|
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
|
.addComponent(jLabel1)
|
|
.addComponent(spinnerSegment, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
|
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
|
.addComponent(jLabel2)
|
|
.addComponent(spinnerPuck, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
|
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
|
.addComponent(jLabel3)
|
|
.addComponent(spinnerSample, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
|
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
|
.addComponent(jLabel4)
|
|
.addComponent(checkForce))
|
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
|
);
|
|
|
|
buttonHomingHexiposi.setText("Homing Hexiposi");
|
|
buttonHomingHexiposi.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonHomingHexiposiActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
javax.swing.GroupLayout panelCommandsLayout = new javax.swing.GroupLayout(panelCommands);
|
|
panelCommands.setLayout(panelCommandsLayout);
|
|
panelCommandsLayout.setHorizontalGroup(
|
|
panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(panelCommandsLayout.createSequentialGroup()
|
|
.addContainerGap()
|
|
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
|
.addComponent(buttonHomingHexiposi, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(buttonGetGonio, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(buttonPutGonio, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(buttonMount, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(buttonUnmount, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(buttonGetDewar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(buttonPutDewar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
|
.addGap(18, 18, 18)
|
|
.addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addContainerGap())
|
|
);
|
|
panelCommandsLayout.setVerticalGroup(
|
|
panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(panelCommandsLayout.createSequentialGroup()
|
|
.addGap(18, 18, 18)
|
|
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
|
.addGroup(panelCommandsLayout.createSequentialGroup()
|
|
.addComponent(buttonMount)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addComponent(buttonUnmount)
|
|
.addGap(18, 18, 18)
|
|
.addComponent(buttonGetDewar)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addComponent(buttonPutDewar)
|
|
.addGap(18, 18, 18)
|
|
.addComponent(buttonGetGonio)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addComponent(buttonPutGonio))
|
|
.addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
|
.addGap(18, 18, 18)
|
|
.addComponent(buttonHomingHexiposi)
|
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
|
);
|
|
|
|
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Puck Detection"));
|
|
|
|
buttonPuckDetCheck.setText("Ckeck");
|
|
buttonPuckDetCheck.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonPuckDetCheckActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
buttonPuckDetStop.setText("Stop");
|
|
buttonPuckDetStop.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonPuckDetStopActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
buttonPuckDetStart.setText("Start");
|
|
buttonPuckDetStart.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
buttonPuckDetStartActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
|
|
jPanel3.setLayout(jPanel3Layout);
|
|
jPanel3Layout.setHorizontalGroup(
|
|
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(jPanel3Layout.createSequentialGroup()
|
|
.addContainerGap()
|
|
.addComponent(buttonPuckDetCheck)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(buttonPuckDetStop)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(buttonPuckDetStart)
|
|
.addContainerGap())
|
|
);
|
|
|
|
jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonPuckDetCheck, buttonPuckDetStart, buttonPuckDetStop});
|
|
|
|
jPanel3Layout.setVerticalGroup(
|
|
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(jPanel3Layout.createSequentialGroup()
|
|
.addContainerGap()
|
|
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
|
.addComponent(buttonPuckDetCheck)
|
|
.addComponent(buttonPuckDetStop)
|
|
.addComponent(buttonPuckDetStart))
|
|
.addContainerGap())
|
|
);
|
|
|
|
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.TRAILING)
|
|
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addComponent(panelSafety, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
|
.addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(panelRobot, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
|
.addGap(18, 18, 18)
|
|
.addComponent(panelCommands, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addContainerGap(32, Short.MAX_VALUE))
|
|
);
|
|
layout.setVerticalGroup(
|
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(layout.createSequentialGroup()
|
|
.addContainerGap()
|
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
|
.addComponent(panelCommands, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addGroup(layout.createSequentialGroup()
|
|
.addComponent(panelSafety, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
|
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
|
.addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
|
.addComponent(panelRobot, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
|
);
|
|
}// </editor-fold>//GEN-END:initComponents
|
|
|
|
private void buttonEnableAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonEnableAllActionPerformed
|
|
execute("enable_motion()", true);
|
|
}//GEN-LAST:event_buttonEnableAllActionPerformed
|
|
|
|
private void buttonMountActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonMountActionPerformed
|
|
String segment = (String) spinnerSegment.getValue();
|
|
int puck = (Integer) spinnerPuck.getValue();
|
|
int sample = (Integer) spinnerSample.getValue();
|
|
String force = checkForce.isSelected() ? "True" : "False";
|
|
execute("mount('" + segment + "'," + puck + "," + sample + ", force=" + force + ")");
|
|
|
|
}//GEN-LAST:event_buttonMountActionPerformed
|
|
|
|
private void buttonEnableActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonEnableActionPerformed
|
|
execute("robot.enable()", true);
|
|
}//GEN-LAST:event_buttonEnableActionPerformed
|
|
|
|
private void buttonDisableActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonDisableActionPerformed
|
|
execute("robot.disable()", true);
|
|
}//GEN-LAST:event_buttonDisableActionPerformed
|
|
|
|
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
|
|
|
|
private void buttonHomingHexiposiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonHomingHexiposiActionPerformed
|
|
execute("homing_hexiposi()");
|
|
}//GEN-LAST:event_buttonHomingHexiposiActionPerformed
|
|
|
|
private void buttonPositionsHexiposiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPositionsHexiposiActionPerformed
|
|
this.showDevicePanel("hexiposi");
|
|
}//GEN-LAST:event_buttonPositionsHexiposiActionPerformed
|
|
|
|
private void buttonUnmountActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonUnmountActionPerformed
|
|
String segment = (String) spinnerSegment.getValue();
|
|
int puck = (Integer) spinnerPuck.getValue();
|
|
int sample = (Integer) spinnerSample.getValue();
|
|
String force = checkForce.isSelected() ? "True" : "False";
|
|
execute("unmount('" + segment + "'," + puck + "," + sample + ", force=" + force + ")");
|
|
}//GEN-LAST:event_buttonUnmountActionPerformed
|
|
|
|
private void buttonGetDewarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonGetDewarActionPerformed
|
|
String segment = (String) spinnerSegment.getValue();
|
|
int puck = (Integer) spinnerPuck.getValue();
|
|
int sample = (Integer) spinnerSample.getValue();
|
|
String force = checkForce.isSelected() ? "True" : "False";
|
|
execute("get_dewar('" + segment + "'," + puck + "," + sample + ", force=" + force + ")");
|
|
}//GEN-LAST:event_buttonGetDewarActionPerformed
|
|
|
|
private void buttonPutDewarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPutDewarActionPerformed
|
|
String segment = (String) spinnerSegment.getValue();
|
|
int puck = (Integer) spinnerPuck.getValue();
|
|
int sample = (Integer) spinnerSample.getValue();
|
|
String force = checkForce.isSelected() ? "True" : "False";
|
|
execute("put_dewar('" + segment + "'," + puck + "," + sample + ", force=" + force + ")");
|
|
}//GEN-LAST:event_buttonPutDewarActionPerformed
|
|
|
|
private void buttonGetGonioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonGetGonioActionPerformed
|
|
String force = checkForce.isSelected() ? "True" : "False";
|
|
execute("get_gonio('force=" + force + ")");
|
|
}//GEN-LAST:event_buttonGetGonioActionPerformed
|
|
|
|
private void buttonPutGonioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPutGonioActionPerformed
|
|
String force = checkForce.isSelected() ? "True" : "False";
|
|
execute("put_gonio('force=" + force + ")");
|
|
}//GEN-LAST:event_buttonPutGonioActionPerformed
|
|
|
|
private void buttonPuckDetCheckActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPuckDetCheckActionPerformed
|
|
execute("check_puck_detection()", true, true);
|
|
}//GEN-LAST:event_buttonPuckDetCheckActionPerformed
|
|
|
|
private void buttonPuckDetStopActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPuckDetStopActionPerformed
|
|
execute("stop_puck_detection()", true);
|
|
}//GEN-LAST:event_buttonPuckDetStopActionPerformed
|
|
|
|
private void buttonPuckDetStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonPuckDetStartActionPerformed
|
|
execute("start_puck_detection()", true);
|
|
}//GEN-LAST:event_buttonPuckDetStartActionPerformed
|
|
|
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
|
private javax.swing.JButton buttonDisable;
|
|
private javax.swing.JButton buttonEnable;
|
|
private javax.swing.JButton buttonEnableAll;
|
|
private javax.swing.JButton buttonGetDewar;
|
|
private javax.swing.JButton buttonGetGonio;
|
|
private javax.swing.JButton buttonHomingHexiposi;
|
|
private javax.swing.JButton buttonMount;
|
|
private javax.swing.JButton buttonPositionsHexiposi;
|
|
private javax.swing.JButton buttonPuckDetCheck;
|
|
private javax.swing.JButton buttonPuckDetStart;
|
|
private javax.swing.JButton buttonPuckDetStop;
|
|
private javax.swing.JButton buttonPutDewar;
|
|
private javax.swing.JButton buttonPutGonio;
|
|
private javax.swing.JButton buttonReleaseLocal;
|
|
private javax.swing.JButton buttonReleasePsys;
|
|
private javax.swing.JButton buttonUnmount;
|
|
private javax.swing.JCheckBox checkForce;
|
|
private javax.swing.JLabel jLabel1;
|
|
private javax.swing.JLabel jLabel2;
|
|
private javax.swing.JLabel jLabel3;
|
|
private javax.swing.JLabel jLabel4;
|
|
private javax.swing.JPanel jPanel2;
|
|
private javax.swing.JPanel jPanel3;
|
|
private javax.swing.JPanel jPanel5;
|
|
private javax.swing.JPanel panelCommands;
|
|
private javax.swing.JPanel panelRobot;
|
|
private javax.swing.JPanel panelSafety;
|
|
private javax.swing.JSpinner spinnerPuck;
|
|
private javax.swing.JSpinner spinnerSample;
|
|
private javax.swing.JSpinner spinnerSegment;
|
|
// End of variables declaration//GEN-END:variables
|
|
}
|