This commit is contained in:
+43
-15
@@ -54,9 +54,9 @@ public class Commands extends Panel {
|
||||
for (Component c: SwingUtils.getComponentsByType(this, JComponent.class)){
|
||||
c.setEnabled(enabled);
|
||||
}
|
||||
spinnerSegment.setEnabled(enabled && !checkAuxiliary.isSelected());
|
||||
spinnerSegment.setEnabled(enabled && !checkAuxiliary.isSelected() && !checkRoomTemp.isSelected());
|
||||
spinnerPuck.setEnabled(enabled && !checkAuxiliary.isSelected());
|
||||
buttonScanPuck.setEnabled(enabled && !checkAuxiliary.isSelected());
|
||||
buttonScanPuck.setEnabled(enabled && !checkAuxiliary.isSelected()&& !checkRoomTemp.isSelected());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -110,7 +110,15 @@ public class Commands extends Panel {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
String getSegment(){
|
||||
if (checkAuxiliary.isSelected()){
|
||||
return "X";
|
||||
}
|
||||
if (checkRoomTemp.isSelected()){
|
||||
return "R";
|
||||
}
|
||||
return (String) spinnerSegment.getValue();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
@@ -142,6 +150,7 @@ public class Commands extends Panel {
|
||||
buttonScanPin = new javax.swing.JButton();
|
||||
buttonScanPuck = new javax.swing.JButton();
|
||||
checkAuxiliary = new javax.swing.JCheckBox();
|
||||
checkRoomTemp = new javax.swing.JCheckBox();
|
||||
jPanel1 = new javax.swing.JPanel();
|
||||
buttonGripperScan = new javax.swing.JButton();
|
||||
buttonTrash = new javax.swing.JButton();
|
||||
@@ -341,6 +350,13 @@ public class Commands extends Panel {
|
||||
}
|
||||
});
|
||||
|
||||
checkRoomTemp.setText("Room Temperature");
|
||||
checkRoomTemp.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
checkRoomTempActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout pnTransferLayout = new javax.swing.GroupLayout(pnTransfer);
|
||||
pnTransfer.setLayout(pnTransferLayout);
|
||||
pnTransferLayout.setHorizontalGroup(
|
||||
@@ -348,13 +364,18 @@ public class Commands extends Panel {
|
||||
.addGroup(pnTransferLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(pnTransferLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(buttonMount, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(buttonUnmount, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(buttonScanPin, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(buttonScanPuck, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(checkAuxiliary))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(pnTransferLayout.createSequentialGroup()
|
||||
.addComponent(checkRoomTemp)
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addGroup(pnTransferLayout.createSequentialGroup()
|
||||
.addGroup(pnTransferLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(buttonMount, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(buttonUnmount, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(buttonScanPin, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(buttonScanPuck, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(checkAuxiliary))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE)
|
||||
.addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
@@ -376,7 +397,9 @@ public class Commands extends Panel {
|
||||
.addComponent(buttonScanPuck)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(checkAuxiliary)))
|
||||
.addContainerGap())
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(checkRoomTemp)
|
||||
.addContainerGap(13, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Gripper"));
|
||||
@@ -726,7 +749,7 @@ public class Commands extends Panel {
|
||||
}//GEN-LAST:event_buttonEnableAllActionPerformed
|
||||
|
||||
private void buttonMountActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonMountActionPerformed
|
||||
String segment = checkAuxiliary.isSelected() ? "X" : (String) spinnerSegment.getValue();
|
||||
String segment = getSegment();
|
||||
int puck = checkAuxiliary.isSelected() ? 1 :(Integer) spinnerPuck.getValue();
|
||||
int sample = (Integer) spinnerSample.getValue();
|
||||
String force = checkForce.isSelected() ? "True" : "False";
|
||||
@@ -740,7 +763,7 @@ public class Commands extends Panel {
|
||||
}//GEN-LAST:event_buttonMoveAuxActionPerformed
|
||||
|
||||
private void buttonUnmountActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonUnmountActionPerformed
|
||||
String segment = checkAuxiliary.isSelected() ? "X" : (String) spinnerSegment.getValue();
|
||||
String segment = getSegment();
|
||||
int puck = checkAuxiliary.isSelected() ? 1 :(Integer) spinnerPuck.getValue();
|
||||
int sample = (Integer) spinnerSample.getValue();
|
||||
String force = checkForce.isSelected() ? "True" : "False";
|
||||
@@ -822,7 +845,7 @@ public class Commands extends Panel {
|
||||
}//GEN-LAST:event_buttonResetPuckIdsActionPerformed
|
||||
|
||||
private void buttonScanPinActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonScanPinActionPerformed
|
||||
String segment = checkAuxiliary.isSelected() ? "X" : (String) spinnerSegment.getValue();
|
||||
String segment = getSegment();
|
||||
int puck = checkAuxiliary.isSelected() ? 1 :(Integer) spinnerPuck.getValue();
|
||||
int sample = (Integer) spinnerSample.getValue();
|
||||
String force = checkForce.isSelected() ? "True" : "False";
|
||||
@@ -830,7 +853,7 @@ public class Commands extends Panel {
|
||||
}//GEN-LAST:event_buttonScanPinActionPerformed
|
||||
|
||||
private void buttonScanPuckActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonScanPuckActionPerformed
|
||||
String segment = checkAuxiliary.isSelected() ? "X" : (String) spinnerSegment.getValue();
|
||||
String segment = getSegment();
|
||||
int puck = checkAuxiliary.isSelected() ? 1 :(Integer) spinnerPuck.getValue();
|
||||
String force = checkForce.isSelected() ? "True" : "False";
|
||||
execute("scan_puck('" + segment + "'," + puck + ", force=" + force + ")", false, true);
|
||||
@@ -858,6 +881,10 @@ public class Commands extends Panel {
|
||||
execute("trash()");
|
||||
}//GEN-LAST:event_buttonTrashActionPerformed
|
||||
|
||||
private void checkRoomTempActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkRoomTempActionPerformed
|
||||
onStateChange(getState(), null);
|
||||
}//GEN-LAST:event_checkRoomTempActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JButton buttonClearSampleDb;
|
||||
private javax.swing.JButton buttonDry;
|
||||
@@ -887,6 +914,7 @@ public class Commands extends Panel {
|
||||
private javax.swing.JCheckBox checkAuxiliary;
|
||||
private javax.swing.JCheckBox checkDatamatrix;
|
||||
private javax.swing.JCheckBox checkForce;
|
||||
private javax.swing.JCheckBox checkRoomTemp;
|
||||
private javax.swing.JCheckBox ckeckParkOnDry;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
|
||||
Reference in New Issue
Block a user