MAnaging state of puck load button
This commit is contained in:
@@ -460,7 +460,7 @@ public class Controller {
|
||||
} catch (Exception ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setServiceMode(boolean value){
|
||||
try{
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user