This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user