MAnaging state of puck load button

This commit is contained in:
gac-S_Changer
2024-12-05 13:11:36 +01:00
parent ac75b13444
commit c7ceebb211
2 changed files with 17 additions and 3 deletions

View File

@@ -460,7 +460,7 @@ public class Controller {
} catch (Exception ex) {
return null;
}
}
}
public void setServiceMode(boolean value){
try{

View File

@@ -594,6 +594,19 @@ public class MainPanel extends Panel {
}
}
public boolean isCoverPosDetected(){
try{
return textCoverDet.getText().contains(", ");
} catch(Exception ex){
return false;
}
}
void updateButtonSampleLoadState(){
boolean doors_open = !Controller.getInstance().isDoorClosed();
boolean cover_pos_detected = isCoverPosDetected();
buttonSampleLoad.setEnabled(doors_open && !cover_pos_detected);
}
void updatePsysSafety(Object value) {
if ((value == null) || !(value instanceof Boolean)) {
ledPsysSafety.setColor(Color.BLACK);
@@ -611,7 +624,7 @@ public class MainPanel extends Panel {
getLogger().log(Level.WARNING, null, ex);
}
}
buttonSampleLoad.setEnabled(!Boolean.TRUE.equals(value));
updateButtonSampleLoadState();
}
void updateMode(Object value) {
@@ -1043,7 +1056,8 @@ public class MainPanel extends Panel {
getLogger().log(Level.WARNING, null, e);
}
}
}
}
updateButtonSampleLoadState();
String text;
try {
List cache = (List)eval("get_cover_location_cache()", true);