Service mode and no cover detection

This commit is contained in:
gac-S_Changer
2024-11-05 14:52:40 +01:00
parent 611f89bc27
commit 91871fe741
7 changed files with 251 additions and 155 deletions
+18 -1
View File
@@ -13,7 +13,6 @@ import ch.psi.pshell.device.Device;
import ch.psi.pshell.device.DeviceAdapter;
import ch.psi.pshell.device.DeviceListener;
import ch.psi.pshell.device.GenericDevice;
import ch.psi.pshell.device.ReadbackDevice;
import ch.psi.pshell.ui.App;
import ch.psi.pshell.ui.Panel;
import ch.psi.utils.Arr;
@@ -436,6 +435,24 @@ public class Controller {
}
}
public Boolean isServiceMode() {
try {
return getMainFrame().eval("is_service_mode()", true).equals(true);
} catch (Exception ex) {
return null;
}
}
public void setServiceMode(boolean value){
try{
String state = value ? "True" : "False";
getMainFrame().evalAsync("set_service_mode(" + state + ")");
} catch (Exception ex) {
Logger.getLogger(Controller.class.getName()).log(Level.SEVERE, null, ex);
}
}
public Boolean isBarcodeReaderScanPucks() {
try {
return getMainFrame().eval("is_barcode_reader_scan_pucks()", true).equals(true);