This commit is contained in:
gac-S_Changer
2018-10-17 11:44:20 +02:00
parent 3d86c27140
commit b75f7d0ac8
10 changed files with 152 additions and 67 deletions

View File

@@ -161,9 +161,10 @@
<Component id="buttonMount" linkSize="11" alignment="0" min="-2" pref="100" max="-2" attributes="0"/>
<Component id="buttonUnmount" linkSize="11" alignment="0" min="-2" pref="100" max="-2" attributes="0"/>
<Component id="buttonScanPin" linkSize="11" alignment="0" min="-2" pref="100" max="-2" attributes="0"/>
<Component id="buttonScanPin1" alignment="0" min="-2" pref="100" max="-2" attributes="0"/>
<Component id="buttonScanPuck" alignment="0" min="-2" pref="100" max="-2" attributes="0"/>
<Component id="checkAuxiliary" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" pref="31" max="32767" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="jPanel5" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
@@ -171,19 +172,21 @@
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="buttonMount" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="buttonUnmount" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="buttonScanPin" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="buttonScanPin1" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jPanel5" min="-2" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<Component id="buttonMount" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonUnmount" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonScanPin" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="buttonScanPuck" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="checkAuxiliary" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@@ -205,7 +208,7 @@
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel3" linkSize="1" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel2" linkSize="1" alignment="0" min="-2" max="-2" attributes="0"/>
@@ -213,7 +216,7 @@
<Component id="jLabel4" linkSize="1" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" linkSize="1" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="spinnerPuck" linkSize="9" alignment="0" min="-2" pref="100" max="-2" attributes="0"/>
<Component id="checkForce" min="-2" max="-2" attributes="0"/>
@@ -221,7 +224,7 @@
<Component id="spinnerSample" linkSize="9" alignment="0" min="-2" pref="100" max="-2" attributes="0"/>
<Component id="spinnerSegment" linkSize="9" alignment="0" min="-2" pref="100" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -248,12 +251,11 @@
<Component id="jLabel4" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="checkForce" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="2" attributes="0">
<Component id="jLabel5" alignment="2" min="-2" max="-2" attributes="0"/>
<Component id="checkDatamatrix" alignment="2" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="0" max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -355,12 +357,20 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonScanPinActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="buttonScanPin1">
<Component class="javax.swing.JButton" name="buttonScanPuck">
<Properties>
<Property name="text" type="java.lang.String" value="Scan Puck"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonScanPin1ActionPerformed"/>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="buttonScanPuckActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="checkAuxiliary">
<Properties>
<Property name="text" type="java.lang.String" value="Auxiliary"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="checkAuxiliaryActionPerformed"/>
</Events>
</Component>
</SubComponents>

View File

@@ -50,10 +50,13 @@ public class Commands extends Panel {
@Override
public void onStateChange(State state, State former) {
boolean enabled = (state == State.Ready);
for (Component c: SwingUtils.getComponentsByType(this, JComponent.class)){
c.setEnabled(state == State.Ready);
c.setEnabled(enabled);
}
buttonMoveAux.setEnabled(state == State.Ready);
spinnerSegment.setEnabled(enabled && !checkAuxiliary.isSelected());
spinnerPuck.setEnabled(enabled && !checkAuxiliary.isSelected());
buttonScanPuck.setEnabled(enabled && !checkAuxiliary.isSelected());
}
@Override
@@ -135,7 +138,8 @@ public class Commands extends Panel {
checkDatamatrix = new javax.swing.JCheckBox();
buttonUnmount = new javax.swing.JButton();
buttonScanPin = new javax.swing.JButton();
buttonScanPin1 = new javax.swing.JButton();
buttonScanPuck = new javax.swing.JButton();
checkAuxiliary = new javax.swing.JCheckBox();
pnLowLevel = new javax.swing.JPanel();
buttonMovePark = new javax.swing.JButton();
buttonMoveCold = new javax.swing.JButton();
@@ -297,11 +301,10 @@ public class Commands extends Panel {
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(jLabel4)
.addComponent(checkForce))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
.addComponent(jLabel5)
.addComponent(checkDatamatrix))
.addGap(0, 0, 0))
.addComponent(checkDatamatrix)))
);
buttonUnmount.setText("Unmount");
@@ -318,10 +321,17 @@ public class Commands extends Panel {
}
});
buttonScanPin1.setText("Scan Puck");
buttonScanPin1.addActionListener(new java.awt.event.ActionListener() {
buttonScanPuck.setText("Scan Puck");
buttonScanPuck.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonScanPin1ActionPerformed(evt);
buttonScanPuckActionPerformed(evt);
}
});
checkAuxiliary.setText("Auxiliary");
checkAuxiliary.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
checkAuxiliaryActionPerformed(evt);
}
});
@@ -335,8 +345,9 @@ public class Commands extends Panel {
.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(buttonScanPin1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 31, Short.MAX_VALUE)
.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)
.addContainerGap())
);
@@ -348,15 +359,17 @@ public class Commands extends Panel {
.addGroup(pnTransferLayout.createSequentialGroup()
.addContainerGap()
.addGroup(pnTransferLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(pnTransferLayout.createSequentialGroup()
.addComponent(buttonMount)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonUnmount)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonScanPin)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(buttonScanPuck)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(buttonScanPin1))
.addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(checkAuxiliary)))
.addContainerGap())
);
@@ -633,8 +646,8 @@ public class Commands extends Panel {
}//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();
String segment = checkAuxiliary.isSelected() ? "X" : (String) spinnerSegment.getValue();
int puck = checkAuxiliary.isSelected() ? 1 :(Integer) spinnerPuck.getValue();
int sample = (Integer) spinnerSample.getValue();
String force = checkForce.isSelected() ? "True" : "False";
String readDatamatrix = checkDatamatrix.isSelected() ? "True" : "False";
@@ -647,8 +660,8 @@ public class Commands extends Panel {
}//GEN-LAST:event_buttonMoveAuxActionPerformed
private void buttonUnmountActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonUnmountActionPerformed
String segment = (String) spinnerSegment.getValue();
int puck = (Integer) spinnerPuck.getValue();
String segment = checkAuxiliary.isSelected() ? "X" : (String) spinnerSegment.getValue();
int puck = checkAuxiliary.isSelected() ? 1 :(Integer) spinnerPuck.getValue();
int sample = (Integer) spinnerSample.getValue();
String force = checkForce.isSelected() ? "True" : "False";
execute("unmount('" + segment + "'," + puck + "," + sample + ", force=" + force + ")");
@@ -729,19 +742,19 @@ public class Commands extends Panel {
}//GEN-LAST:event_buttonResetPuckIdsActionPerformed
private void buttonScanPinActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonScanPinActionPerformed
String segment = (String) spinnerSegment.getValue();
int puck = (Integer) spinnerPuck.getValue();
String segment = checkAuxiliary.isSelected() ? "X" : (String) spinnerSegment.getValue();
int puck = checkAuxiliary.isSelected() ? 1 :(Integer) spinnerPuck.getValue();
int sample = (Integer) spinnerSample.getValue();
String force = checkForce.isSelected() ? "True" : "False";
execute("scan_pin('" + segment + "'," + puck + "," + sample + ", force=" + force + ")", false, true);
}//GEN-LAST:event_buttonScanPinActionPerformed
private void buttonScanPin1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonScanPin1ActionPerformed
String segment = (String) spinnerSegment.getValue();
int puck = (Integer) spinnerPuck.getValue();
private void buttonScanPuckActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonScanPuckActionPerformed
String segment = checkAuxiliary.isSelected() ? "X" : (String) spinnerSegment.getValue();
int puck = checkAuxiliary.isSelected() ? 1 :(Integer) spinnerPuck.getValue();
String force = checkForce.isSelected() ? "True" : "False";
execute("scan_puck('" + segment + "'," + puck + ", force=" + force + ")", false, true);
}//GEN-LAST:event_buttonScanPin1ActionPerformed
}//GEN-LAST:event_buttonScanPuckActionPerformed
private void buttonGetAuxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonGetAuxActionPerformed
int sample = (Integer) spinnerSample.getValue();
@@ -753,6 +766,10 @@ public class Commands extends Panel {
execute("put_aux('" + sample + ")");
}//GEN-LAST:event_buttonPutAuxActionPerformed
private void checkAuxiliaryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkAuxiliaryActionPerformed
onStateChange(getState(), null);
}//GEN-LAST:event_checkAuxiliaryActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton buttonClearSampleDb;
private javax.swing.JButton buttonDry;
@@ -775,8 +792,9 @@ public class Commands extends Panel {
private javax.swing.JButton buttonRecover;
private javax.swing.JButton buttonResetPuckIds;
private javax.swing.JButton buttonScanPin;
private javax.swing.JButton buttonScanPin1;
private javax.swing.JButton buttonScanPuck;
private javax.swing.JButton buttonUnmount;
private javax.swing.JCheckBox checkAuxiliary;
private javax.swing.JCheckBox checkDatamatrix;
private javax.swing.JCheckBox checkForce;
private javax.swing.JCheckBox ckeckParkOnDry;