diff --git a/plugins/TestingPanel.java b/plugins/TestingPanel.java index 0a93b75..a950a12 100644 --- a/plugins/TestingPanel.java +++ b/plugins/TestingPanel.java @@ -11,6 +11,7 @@ import ch.psi.pshell.swing.MotorPanel; import ch.psi.pshell.ui.App; import ch.psi.utils.swing.MonitoredPanel; import ch.psi.pshell.ui.Panel; +import ch.psi.utils.State; import ch.psi.utils.swing.SwingUtils; import ch.psi.wsaf.ApplicationStateException; import ch.psi.wsaf.Task; @@ -57,6 +58,22 @@ public class TestingPanel extends Panel { motor = (Motor) TestingPanel.this.getDevice("motor"); motorPanel.setDevice(motor); } + + protected void onStateChange(State state, State former) { + if ((state == State.Ready) && (former == State.Busy)) { + if ("test".equals(getController().getRunningScriptName())) { + try{ + Object ret = eval("ret"); + if (ret != null) { + SwingUtils.showMessage(getComponent(), "", ret.toString() + " - " + ret.getClass().getName()); + } + } catch (Exception ex) { + SwingUtils.showException(getComponent(), ex); + } + } + } +} + public class NetbeansPluginPanel extends MonitoredPanel { diff --git a/script/power-supply.py b/script/power-supply.py index bc6ea11..ac3880e 100644 --- a/script/power-supply.py +++ b/script/power-supply.py @@ -61,4 +61,4 @@ ActualIA.close() scan.end() -ret = 0 \ No newline at end of file +ret = 'pippo' \ No newline at end of file