Display of cover position cache
This commit is contained in:
@@ -74,10 +74,12 @@ public class MainPanel extends Panel {
|
||||
Boolean manualMode;
|
||||
Boolean roomTemperature;
|
||||
public final String PUCK_LOADING_STATUS = "Puck loading";
|
||||
public final String PUCK_UNLOADING_STATUS = "Puck unloading";
|
||||
StatusBar statusBar;
|
||||
JPopupMenu samplePopupMenu;
|
||||
JMenuItem menuMountSample;
|
||||
JMenuItem menuUnmoountSample;
|
||||
boolean doorsHaveOpened;
|
||||
|
||||
|
||||
public enum BasePlateLayout {
|
||||
@@ -408,6 +410,7 @@ public class MainPanel extends Panel {
|
||||
((Device) getDevice("feedback_psys_safety")).addListener(new DeviceAdapter() {
|
||||
@Override
|
||||
public void onValueChanged(Device device, Object value, Object former) {
|
||||
doorsHaveOpened = Boolean.FALSE.equals(value);
|
||||
updatePsysSafety(value);
|
||||
}
|
||||
});
|
||||
@@ -453,6 +456,15 @@ public class MainPanel extends Panel {
|
||||
Controller.getInstance().onStateChange(state, former);
|
||||
}
|
||||
|
||||
public void setViewCamera(){
|
||||
buttonCamera.setSelected(true);
|
||||
SwingUtilities.invokeLater(()->{updateCameraView();});
|
||||
}
|
||||
public void setViewDesign(){
|
||||
buttonDrawing.setSelected(true);
|
||||
SwingUtilities.invokeLater(()->{updateCameraView();});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onTimer() {
|
||||
try {
|
||||
@@ -488,10 +500,11 @@ public class MainPanel extends Panel {
|
||||
|
||||
Controller.getInstance().onTimer();
|
||||
if (getState() == State.Ready) {
|
||||
if (Boolean.TRUE.equals(Controller.getInstance().isPuckLoading())) {
|
||||
setStatus(PUCK_LOADING_STATUS);
|
||||
Boolean puckLoading = Controller.getInstance().isPuckLoading();
|
||||
if (puckLoading==null){
|
||||
setStatus("Ready");
|
||||
} else {
|
||||
setStatus("Ready");
|
||||
setStatus(puckLoading ? PUCK_LOADING_STATUS : PUCK_UNLOADING_STATUS);
|
||||
}
|
||||
} else {
|
||||
status = null;
|
||||
@@ -580,7 +593,7 @@ public class MainPanel extends Panel {
|
||||
ledDryer.setColor(Color.GREEN);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void updatePsysSafety(Object value) {
|
||||
if ((value == null) || !(value instanceof Boolean)) {
|
||||
ledPsysSafety.setColor(Color.BLACK);
|
||||
@@ -591,7 +604,15 @@ public class MainPanel extends Panel {
|
||||
} else {
|
||||
ledPsysSafety.setColor(Color.RED);
|
||||
}
|
||||
}
|
||||
if (!Boolean.TRUE.equals(value)){
|
||||
try {
|
||||
Controller.getInstance().setPuckLoading(null);
|
||||
} catch (Exception ex) {
|
||||
getLogger().log(Level.WARNING, null, ex);
|
||||
}
|
||||
}
|
||||
buttonSampleLoad.setEnabled(!Boolean.TRUE.equals(value));
|
||||
}
|
||||
|
||||
void updateMode(Object value) {
|
||||
if ((value != null) && (value instanceof Map)) {
|
||||
@@ -1005,9 +1026,24 @@ public class MainPanel extends Panel {
|
||||
if ((value!=null) && (value instanceof String) && ((String)value).toLowerCase().startsWith("no cover")){
|
||||
textCoverDet.setText("No Cover");
|
||||
} else {
|
||||
textCoverDet.setText((fmm==null) ? "" :fmm.x + ", " + fmm.y);
|
||||
textCoverDet.setText((fmm==null) ? "" :fmm.x + ", " + fmm.y);
|
||||
if ( getState().isReady() &&
|
||||
!checkExpert.isSelected() &&
|
||||
Boolean.FALSE.equals(Controller.getInstance().isDoorClosed())){
|
||||
try{
|
||||
if ((fmm!=null)){
|
||||
Controller.getInstance().setPuckLoading(null);
|
||||
} else {
|
||||
if (doorsHaveOpened){
|
||||
doorsHaveOpened=false;
|
||||
Controller.getInstance().setPuckLoading(true);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
getLogger().log(Level.WARNING, null, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String text;
|
||||
try {
|
||||
List cache = (List)eval("get_cover_location_cache()", true);
|
||||
@@ -1031,10 +1067,6 @@ public class MainPanel extends Panel {
|
||||
};
|
||||
|
||||
|
||||
void sampleTransfer(boolean load) throws Exception{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called from within the constructor to initialize the form.
|
||||
* WARNING: Do NOT modify this code. The content of this method is always
|
||||
@@ -1060,7 +1092,6 @@ public class MainPanel extends Panel {
|
||||
jLabel23 = new javax.swing.JLabel();
|
||||
panelDetection = new javax.swing.JPanel();
|
||||
buttonSampleLoad = new javax.swing.JButton();
|
||||
buttonSampleUnload = new javax.swing.JButton();
|
||||
panelCover = new javax.swing.JPanel();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
textCoverDet = new javax.swing.JTextField();
|
||||
@@ -1224,32 +1255,21 @@ public class MainPanel extends Panel {
|
||||
}
|
||||
});
|
||||
|
||||
buttonSampleUnload.setText("Unload");
|
||||
buttonSampleUnload.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
buttonSampleUnloadActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout panelDetectionLayout = new javax.swing.GroupLayout(panelDetection);
|
||||
panelDetection.setLayout(panelDetectionLayout);
|
||||
panelDetectionLayout.setHorizontalGroup(
|
||||
panelDetectionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelDetectionLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(panelDetectionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(buttonSampleLoad, javax.swing.GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE)
|
||||
.addComponent(buttonSampleUnload, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addComponent(buttonSampleLoad, javax.swing.GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
);
|
||||
panelDetectionLayout.setVerticalGroup(
|
||||
panelDetectionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(panelDetectionLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonSampleLoad)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(buttonSampleUnload)
|
||||
.addContainerGap())
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
panelCover.setBorder(javax.swing.BorderFactory.createTitledBorder("Cover Detection"));
|
||||
@@ -2005,7 +2025,7 @@ public class MainPanel extends Panel {
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void buttonCameraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonCameraActionPerformed
|
||||
updateViewType();
|
||||
setViewCamera();
|
||||
}//GEN-LAST:event_buttonCameraActionPerformed
|
||||
|
||||
private void buttonExpertCommandsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonExpertCommandsActionPerformed
|
||||
@@ -2052,7 +2072,7 @@ public class MainPanel extends Panel {
|
||||
}//GEN-LAST:event_checkExpertActionPerformed
|
||||
|
||||
private void buttonDrawingActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonDrawingActionPerformed
|
||||
updateViewType();
|
||||
setViewDesign();
|
||||
}//GEN-LAST:event_buttonDrawingActionPerformed
|
||||
|
||||
private void btViewDewarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btViewDewarActionPerformed
|
||||
@@ -2125,17 +2145,9 @@ public class MainPanel extends Panel {
|
||||
}
|
||||
}//GEN-LAST:event_checkServiceActionPerformed
|
||||
|
||||
private void buttonSampleUnloadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSampleUnloadActionPerformed
|
||||
try {
|
||||
sampleTransfer(true);
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
}//GEN-LAST:event_buttonSampleUnloadActionPerformed
|
||||
|
||||
private void buttonSampleLoadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSampleLoadActionPerformed
|
||||
try {
|
||||
sampleTransfer(false);
|
||||
Controller.getInstance().setPuckLoading(true);
|
||||
} catch (Exception ex) {
|
||||
showException(ex);
|
||||
}
|
||||
@@ -2156,7 +2168,6 @@ public class MainPanel extends Panel {
|
||||
private javax.swing.JButton buttonRecovery;
|
||||
private javax.swing.JButton buttonRelease;
|
||||
private javax.swing.JButton buttonSampleLoad;
|
||||
private javax.swing.JButton buttonSampleUnload;
|
||||
private javax.swing.JCheckBox checkExpert;
|
||||
private javax.swing.JCheckBox checkService;
|
||||
private ch.psi.mxsc.DevicesPanel devicesPanel;
|
||||
|
||||
Reference in New Issue
Block a user