This commit is contained in:
@@ -52,10 +52,16 @@ public class Expert extends Panel {
|
||||
}
|
||||
|
||||
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;
|
||||
});
|
||||
@@ -109,6 +115,10 @@ public class Expert extends Panel {
|
||||
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"));
|
||||
|
||||
@@ -166,14 +176,14 @@ public class Expert extends Panel {
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
|
||||
.addContainerGap(76, Short.MAX_VALUE)
|
||||
.addComponent(buttonPositionsHexiposi)
|
||||
.addGap(74, 74, 74))
|
||||
.addContainerGap(74, Short.MAX_VALUE))
|
||||
);
|
||||
jPanel2Layout.setVerticalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addContainerGap(19, Short.MAX_VALUE)
|
||||
.addContainerGap()
|
||||
.addComponent(buttonPositionsHexiposi)
|
||||
.addContainerGap(32, Short.MAX_VALUE))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
panelSafety.setBorder(javax.swing.BorderFactory.createTitledBorder("Safety"));
|
||||
@@ -379,6 +389,56 @@ public class Expert extends Panel {
|
||||
.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(
|
||||
@@ -386,12 +446,14 @@ public class Expert extends Panel {
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(panelRobot, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.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))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.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(44, Short.MAX_VALUE))
|
||||
.addContainerGap(32, Short.MAX_VALUE))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
@@ -404,8 +466,10 @@ public class Expert extends Panel {
|
||||
.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(21, Short.MAX_VALUE))
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
@@ -480,6 +544,18 @@ public class Expert extends Panel {
|
||||
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;
|
||||
@@ -489,6 +565,9 @@ public class Expert extends Panel {
|
||||
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;
|
||||
@@ -500,6 +579,7 @@ public class Expert extends Panel {
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user