This commit is contained in:
542
plugins/Commands.java
Normal file
542
plugins/Commands.java
Normal file
@@ -0,0 +1,542 @@
|
||||
/*
|
||||
* Copyright (c) 2014-2017 Paul Scherrer Institute. All rights reserved.
|
||||
*/
|
||||
|
||||
import ch.psi.pshell.ui.Panel;
|
||||
import ch.psi.utils.State;
|
||||
import ch.psi.utils.swing.SwingUtils;
|
||||
import java.awt.Component;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JSpinner;
|
||||
import javax.swing.JTextField;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class Commands extends Panel {
|
||||
|
||||
public Commands() {
|
||||
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() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
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() {
|
||||
|
||||
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();
|
||||
jLabel5 = new javax.swing.JLabel();
|
||||
checkDatamatrix = new javax.swing.JCheckBox();
|
||||
buttonMovePark = new javax.swing.JButton();
|
||||
buttonHomingHexiposi = new javax.swing.JButton();
|
||||
buttonMoveHome = new javax.swing.JButton();
|
||||
buttonMoveGonio = new javax.swing.JButton();
|
||||
buttonMoveDewar = new javax.swing.JButton();
|
||||
buttonMoveScanner = new javax.swing.JButton();
|
||||
buttonMoveHeater = new javax.swing.JButton();
|
||||
buttonDry = new javax.swing.JButton();
|
||||
spinnerDryTime = new javax.swing.JSpinner();
|
||||
jLabel6 = new javax.swing.JLabel();
|
||||
jLabel7 = new javax.swing.JLabel();
|
||||
spinnerDrySpeed = new javax.swing.JSpinner();
|
||||
buttonRecover = new javax.swing.JButton();
|
||||
buttonEnableAll = new javax.swing.JButton();
|
||||
|
||||
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:");
|
||||
|
||||
jLabel5.setText("Read DM:");
|
||||
|
||||
checkDatamatrix.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
|
||||
|
||||
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)
|
||||
.addComponent(jLabel5))
|
||||
.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)
|
||||
.addComponent(checkDatamatrix))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
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))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
|
||||
.addComponent(jLabel5)
|
||||
.addComponent(checkDatamatrix))
|
||||
.addGap(0, 0, 0))
|
||||
);
|
||||
|
||||
buttonMovePark.setText("Move Park");
|
||||
buttonMovePark.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonMoveParkActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonHomingHexiposi.setText("Homing Hexiposi");
|
||||
buttonHomingHexiposi.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonHomingHexiposiActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonMoveHome.setText("Move Home");
|
||||
buttonMoveHome.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonMoveHomeActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonMoveGonio.setText("Move Gonio");
|
||||
buttonMoveGonio.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonMoveGonioActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonMoveDewar.setText("Move Dewar");
|
||||
buttonMoveDewar.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonMoveDewarActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonMoveScanner.setText("Move Scanner");
|
||||
buttonMoveScanner.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonMoveScannerActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonMoveHeater.setText("Move Heater");
|
||||
buttonMoveHeater.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonMoveHeaterActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonDry.setText("Dry");
|
||||
buttonDry.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonDryActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
spinnerDryTime.setModel(new javax.swing.SpinnerNumberModel(10.0d, 1.0d, 30.0d, 1.0d));
|
||||
|
||||
jLabel6.setText("Heat time(s):");
|
||||
|
||||
jLabel7.setText("Speed(%):");
|
||||
|
||||
spinnerDrySpeed.setModel(new javax.swing.SpinnerNumberModel(1.0d, 0.1d, 10.0d, 1.0d));
|
||||
|
||||
buttonRecover.setText("Recover");
|
||||
buttonRecover.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonRecoverActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
buttonEnableAll.setText("Enable Motion");
|
||||
buttonEnableAll.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonEnableAllActionPerformed(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(buttonRecover, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonMoveHeater, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonMoveGonio, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonMovePark, 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)
|
||||
.addComponent(buttonDry, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGap(30, 30, 30)
|
||||
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(buttonMoveScanner, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonMoveHome, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonMoveDewar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(panelCommandsLayout.createSequentialGroup()
|
||||
.addComponent(jLabel7)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spinnerDrySpeed, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(panelCommandsLayout.createSequentialGroup()
|
||||
.addComponent(jLabel6)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(spinnerDryTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addComponent(buttonHomingHexiposi, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonEnableAll, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
panelCommandsLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {buttonGetDewar, buttonGetGonio, buttonHomingHexiposi, buttonMount, buttonMoveDewar, buttonMoveGonio, buttonMoveHeater, buttonMoveHome, buttonMovePark, buttonMoveScanner, buttonPutDewar, buttonPutGonio, buttonUnmount});
|
||||
|
||||
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))
|
||||
.addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buttonGetGonio)
|
||||
.addComponent(buttonHomingHexiposi))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(buttonPutGonio)
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buttonMovePark)
|
||||
.addComponent(buttonMoveHome))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buttonMoveGonio)
|
||||
.addComponent(buttonMoveDewar))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buttonMoveHeater)
|
||||
.addComponent(buttonMoveScanner))
|
||||
.addGap(18, 18, 18)
|
||||
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(buttonDry)
|
||||
.addComponent(spinnerDryTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel6))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spinnerDrySpeed, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jLabel7))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(panelCommandsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(buttonEnableAll)
|
||||
.addComponent(buttonRecover))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(panelCommands, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(panelCommands, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
);
|
||||
}// </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";
|
||||
String readDatamatrix = checkDatamatrix.isSelected() ? "True" : "False";
|
||||
execute("mount('" + segment + "'," + puck + "," + sample + ", force=" + force + ", read_dm=" + readDatamatrix + ")");
|
||||
|
||||
}//GEN-LAST:event_buttonMountActionPerformed
|
||||
|
||||
private void buttonHomingHexiposiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonHomingHexiposiActionPerformed
|
||||
execute("homing_hexiposi()");
|
||||
}//GEN-LAST:event_buttonHomingHexiposiActionPerformed
|
||||
|
||||
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 buttonMoveParkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonMoveParkActionPerformed
|
||||
execute("move_park()");
|
||||
}//GEN-LAST:event_buttonMoveParkActionPerformed
|
||||
|
||||
private void buttonMoveHomeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonMoveHomeActionPerformed
|
||||
execute("move_home()");
|
||||
}//GEN-LAST:event_buttonMoveHomeActionPerformed
|
||||
|
||||
private void buttonMoveGonioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonMoveGonioActionPerformed
|
||||
execute("move_gonio()");
|
||||
}//GEN-LAST:event_buttonMoveGonioActionPerformed
|
||||
|
||||
private void buttonMoveDewarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonMoveDewarActionPerformed
|
||||
execute("move_dewar()");
|
||||
}//GEN-LAST:event_buttonMoveDewarActionPerformed
|
||||
|
||||
private void buttonMoveScannerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonMoveScannerActionPerformed
|
||||
execute("move_scanner()");
|
||||
}//GEN-LAST:event_buttonMoveScannerActionPerformed
|
||||
|
||||
private void buttonMoveHeaterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonMoveHeaterActionPerformed
|
||||
execute("move_heater()");
|
||||
}//GEN-LAST:event_buttonMoveHeaterActionPerformed
|
||||
|
||||
private void buttonDryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonDryActionPerformed
|
||||
double dryTime = (Double) spinnerDryTime.getValue();
|
||||
double streamTime = (Double) spinnerDrySpeed.getValue();
|
||||
|
||||
execute("dry(" + dryTime + ", " + streamTime + ")");
|
||||
}//GEN-LAST:event_buttonDryActionPerformed
|
||||
|
||||
private void buttonRecoverActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRecoverActionPerformed
|
||||
execute("robot_recover()");
|
||||
}//GEN-LAST:event_buttonRecoverActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton buttonDry;
|
||||
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 buttonMoveDewar;
|
||||
private javax.swing.JButton buttonMoveGonio;
|
||||
private javax.swing.JButton buttonMoveHeater;
|
||||
private javax.swing.JButton buttonMoveHome;
|
||||
private javax.swing.JButton buttonMovePark;
|
||||
private javax.swing.JButton buttonMoveScanner;
|
||||
private javax.swing.JButton buttonPutDewar;
|
||||
private javax.swing.JButton buttonPutGonio;
|
||||
private javax.swing.JButton buttonRecover;
|
||||
private javax.swing.JButton buttonUnmount;
|
||||
private javax.swing.JCheckBox checkDatamatrix;
|
||||
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.JLabel jLabel5;
|
||||
private javax.swing.JLabel jLabel6;
|
||||
private javax.swing.JLabel jLabel7;
|
||||
private javax.swing.JPanel jPanel5;
|
||||
private javax.swing.JPanel panelCommands;
|
||||
private javax.swing.JSpinner spinnerDrySpeed;
|
||||
private javax.swing.JSpinner spinnerDryTime;
|
||||
private javax.swing.JSpinner spinnerPuck;
|
||||
private javax.swing.JSpinner spinnerSample;
|
||||
private javax.swing.JSpinner spinnerSegment;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
Reference in New Issue
Block a user