Display user name

This commit is contained in:
gac-S_Changer
2025-01-09 14:24:37 +01:00
parent 31d3ceee2b
commit 41936ef6f7
7 changed files with 64 additions and 27 deletions

View File

@@ -407,13 +407,15 @@ public class MainPanel extends Panel {
});
updateDryer(((Device) getDevice("gripper_dryer")).take());
((Device) getDevice("feedback_psys_safety")).addListener(new DeviceAdapter() {
Device feedback_psys_safety = ((Device) getDevice("feedback_psys_safety"));
feedback_psys_safety.addListener(new DeviceAdapter() {
@Override
public void onValueChanged(Device device, Object value, Object former) {
doorsHaveOpened = Boolean.FALSE.equals(value);
updatePsysSafety(value);
}
});
feedback_psys_safety.request();
updatePsysSafety(((Device) getDevice("feedback_psys_safety")).take());
((Device) getDevice("robot")).addListener(new DeviceAdapter() {
@Override
@@ -604,7 +606,7 @@ public class MainPanel extends Panel {
}
void updateButtonState(){
boolean doors_open = !Controller.getInstance().isDoorClosed();
boolean doors_open = !Boolean.TRUE.equals(Controller.getInstance().isDoorClosed());
boolean cover_pos_detected = isCoverPosDetected();
buttonSampleLoad.setEnabled(doors_open && !cover_pos_detected && getState().isInitialized());
buttonCamera.setEnabled(getState().isInitialized());
@@ -850,7 +852,7 @@ public class MainPanel extends Panel {
sampleData,
new String[]{
//"User Name", "Dewar Name",
"Puck Name", "Puck Type", "Puck Id", "Puck Address",
"Puck Name", "User Name", "Puck Id", "Puck Address",
"Sample Name", "Sample Position", "Sample Id", "Sample Status", "Mount Count"
}
) {
@@ -1061,20 +1063,30 @@ public class MainPanel extends Panel {
}
}
updateButtonState();
String text;
try {
List cache = (List)eval("get_cover_location_cache()", true);
text = cache.get(0) + ", " +cache.get(1);
text= "Robot";
String text = "";
try{
/*
Number clearStatus = (Number)eval("get_cover_location_mm(raise_ex=False, print_log=False)[3]", true);
switch (clearStatus.intValue()){
case 1: text = "Dewar"; break;
case 2: text = "Doors"; break;
case 3: text = "Manual"; break;
case 4: text = "Task"; break;
default: text = "";
}
*/
} catch (Exception ex) {
text = "";
/*
try{
Object use_target_cache = eval("use_target_cache", true);
if (Boolean.TRUE.equals(use_target_cache)){
text= "Target";
}
} catch (Exception e) {
}
}
*/
}
textCoverCache.setText(text);
@@ -1307,7 +1319,7 @@ public class MainPanel extends Panel {
});
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel2.setText("Cache");
jLabel2.setText("Cleared:");
textCoverCache.setEditable(false);
textCoverCache.setHorizontalAlignment(javax.swing.JTextField.CENTER);
@@ -1345,6 +1357,7 @@ public class MainPanel extends Panel {
buttonGroup1.add(buttonCamera);
buttonCamera.setText("Image");
buttonCamera.setEnabled(false);
buttonCamera.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonCameraActionPerformed(evt);
@@ -1353,6 +1366,7 @@ public class MainPanel extends Panel {
buttonGroup1.add(buttonDrawing);
buttonDrawing.setText("Design");
buttonDrawing.setEnabled(false);
buttonDrawing.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonDrawingActionPerformed(evt);