This commit is contained in:
@@ -39,12 +39,7 @@ public class MainPanel extends Panel {
|
||||
Controller.createInstance(this);
|
||||
basePlatePanel.setMode(BasePlatePanel.Mode.single);
|
||||
labelRoomTemperature.setVisible(false);
|
||||
buttonExpertCommands.setVisible(false);
|
||||
buttonRecovery.setVisible(false);
|
||||
buttonReleaseLocal.setVisible(false);
|
||||
buttonReleasePsys.setVisible(false);
|
||||
panelViewType.setVisible(false);
|
||||
panelDetection.setVisible(false);
|
||||
setExpertMode(false);
|
||||
setDefaultDetail();
|
||||
}
|
||||
|
||||
@@ -226,7 +221,7 @@ public class MainPanel extends Panel {
|
||||
if (ex != null){
|
||||
showException((Exception)ex);
|
||||
} else if (showReturn){
|
||||
SwingUtils.showMessage(getTopLevel(), "Return", String.valueOf(ret));
|
||||
showMessage("Return", String.valueOf(ret));
|
||||
}
|
||||
return ret;
|
||||
});
|
||||
@@ -236,11 +231,13 @@ public class MainPanel extends Panel {
|
||||
}
|
||||
|
||||
|
||||
void execute(String script, Object args){
|
||||
void execute(String script, Object args, boolean background, boolean showReturn){
|
||||
try {
|
||||
runAsync(script, args).handle((ret, ex) -> {
|
||||
runAsync(script, args, background).handle((ret, ex) -> {
|
||||
if (ex != null){
|
||||
showException((Exception)ex);
|
||||
} else if (showReturn){
|
||||
showMessage("Return", String.valueOf(ret));
|
||||
}
|
||||
return ret;
|
||||
});
|
||||
@@ -284,6 +281,7 @@ public class MainPanel extends Panel {
|
||||
void setExpertMode(boolean expert){
|
||||
buttonExpertCommands.setVisible(expert);
|
||||
buttonRecovery.setVisible(expert);
|
||||
buttonCalibrateImage.setVisible(expert);
|
||||
devicesPanel.setActive(expert);
|
||||
buttonReleaseLocal.setVisible(expert);
|
||||
buttonReleasePsys.setVisible(expert);
|
||||
@@ -311,6 +309,7 @@ public class MainPanel extends Panel {
|
||||
recoveryPlugin = getContext().getPluginManager().loadInitializePlugin(getContext().getSetup().expandPath("{plugins}/Recovery.java"));
|
||||
}
|
||||
|
||||
|
||||
void setDefaultDetail() {
|
||||
JLabel label = new JLabel();
|
||||
label.setIcon(new javax.swing.ImageIcon(getClass().getResource("/apple_transparent_white_100x50.png")));
|
||||
@@ -382,6 +381,7 @@ public class MainPanel extends Panel {
|
||||
checkExpert = new javax.swing.JCheckBox();
|
||||
buttonExpertCommands = new javax.swing.JButton();
|
||||
buttonRecovery = new javax.swing.JButton();
|
||||
buttonCalibrateImage = new javax.swing.JButton();
|
||||
jPanel4 = new javax.swing.JPanel();
|
||||
ledFillingControl = new ch.psi.pshell.swing.Led();
|
||||
ledFillingDewar = new ch.psi.pshell.swing.Led();
|
||||
@@ -757,6 +757,13 @@ public class MainPanel extends Panel {
|
||||
}
|
||||
});
|
||||
|
||||
buttonCalibrateImage.setText("Calibrate");
|
||||
buttonCalibrateImage.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonCalibrateImageActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
|
||||
jPanel5.setLayout(jPanel5Layout);
|
||||
jPanel5Layout.setHorizontalGroup(
|
||||
@@ -768,7 +775,8 @@ public class MainPanel extends Panel {
|
||||
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(buttonExpertCommands, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(checkExpert, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonRecovery, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addComponent(buttonRecovery, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonCalibrateImage, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addContainerGap())
|
||||
);
|
||||
jPanel5Layout.setVerticalGroup(
|
||||
@@ -777,13 +785,15 @@ public class MainPanel extends Panel {
|
||||
.addComponent(devicesPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGap(9, 9, 9))
|
||||
.addGroup(jPanel5Layout.createSequentialGroup()
|
||||
.addGap(35, 35, 35)
|
||||
.addGap(17, 17, 17)
|
||||
.addComponent(checkExpert)
|
||||
.addGap(18, 18, 18)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonExpertCommands)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(buttonRecovery)
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(buttonCalibrateImage)
|
||||
.addGap(49, 49, 49))
|
||||
);
|
||||
|
||||
jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("LN2 Control"));
|
||||
@@ -1246,11 +1256,16 @@ public class MainPanel extends Panel {
|
||||
}
|
||||
}//GEN-LAST:event_buttonRecoveryActionPerformed
|
||||
|
||||
private void buttonCalibrateImageActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCalibrateImageActionPerformed
|
||||
execute("imgproc/CameraCalibration", null, false, true);
|
||||
}//GEN-LAST:event_buttonCalibrateImageActionPerformed
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private ch.psi.mxsc.BasePlatePanel basePlatePanel;
|
||||
private javax.swing.JToggleButton btViewDewar;
|
||||
private javax.swing.JToggleButton btViewRT;
|
||||
private javax.swing.JButton buttonCalibrateImage;
|
||||
private javax.swing.JToggleButton buttonCamera;
|
||||
private javax.swing.JButton buttonClearDet;
|
||||
private javax.swing.JToggleButton buttonDrawing;
|
||||
|
||||
Reference in New Issue
Block a user