This commit is contained in:
gac-S_Changer
2019-01-24 14:40:48 +01:00
parent 1fd5b666e6
commit 872eb21eb4
2 changed files with 14 additions and 3 deletions

View File

@@ -465,6 +465,14 @@ public class Controller {
}
}
public Boolean isImagingEnabled() {
try {
return getMainFrame().eval("is_imaging_enabled()", true).equals(true);
} catch (Exception ex) {
return null;
}
}
public void imageDetectPucks() throws Context.ContextStateException {
imageDetectPucks(null, null, null);

View File

@@ -25,7 +25,9 @@ public class DevicesPanel extends javax.swing.JPanel {
GenericDevice puck_detection;
GenericDevice sm;
GenericDevice img;
GenericDevice gripper_cam;
GenericDevice gripper_cam;
boolean imagingEnabled;
/**
* Creates new form DevicesPanel
@@ -56,7 +58,8 @@ public class DevicesPanel extends javax.swing.JPanel {
public void onDeviceRemoved(GenericDevice dev) {
}
});
updateDevices();
imagingEnabled = Controller.getInstance().isImagingEnabled();
updateDevices();
}
void updateDevices(){
@@ -72,7 +75,7 @@ public class DevicesPanel extends javax.swing.JPanel {
wago = Controller.getInstance().getDevice("wago");
laser = Controller.getInstance().getDevice("ue");
puck_detection = Controller.getInstance().getDevice("puck_detection");
img = Controller.getInstance().getDevice("img");
img = imagingEnabled ? Controller.getInstance().getDevice("img") : null;
gripper_cam = Controller.getInstance().getDevice("gripper_cam");
sm = Controller.getInstance().getDevice("smart_magnet");
update();