Migrate to Pshell 2.0
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import ch.psi.pshell.core.Context;
|
||||
import ch.psi.pshell.framework.Context;
|
||||
import ch.psi.pshell.device.Device;
|
||||
import ch.psi.pshell.swing.DevicePanel;
|
||||
import ch.psi.utils.swing.SwingUtils;
|
||||
import ch.psi.pshell.swing.SwingUtils;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
/**
|
||||
@@ -32,7 +32,7 @@ public class BarcodeReaderPanel extends DevicePanel {
|
||||
public void onTimer(){
|
||||
if ((getDevice()!=null) && enabled){
|
||||
if ((future==null) || (future.isDone())){
|
||||
future = Context.getInstance().evalLineBackgroundAsync(getDevice().getName() + ".get()");
|
||||
future = Context.getInterpreter().evalLineBackgroundAsync(getDevice().getName() + ".get()");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public class BarcodeReaderPanel extends DevicePanel {
|
||||
|
||||
void execute(String statement, boolean showReturn){
|
||||
try {
|
||||
Context.getInstance().evalLineBackgroundAsync(statement).handle((ret, ex) -> {
|
||||
Context.getInterpreter().evalLineBackgroundAsync(statement).handle((ret, ex) -> {
|
||||
if (BarcodeReaderPanel.this.isShowing()){
|
||||
if (ex != null){
|
||||
showException((Exception)ex);
|
||||
|
||||
Reference in New Issue
Block a user