From c3d57c6e006fbfbd3b128dd37736399397b464bd Mon Sep 17 00:00:00 2001 From: boccioli_m Date: Tue, 16 Jun 2015 11:43:36 +0200 Subject: [PATCH] Closedown --- config/devices.properties | 2 +- plugins/TestingList.java | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/config/devices.properties b/config/devices.properties index 91fc8b6..2572e92 100644 --- a/config/devices.properties +++ b/config/devices.properties @@ -20,4 +20,4 @@ tab=ch.psi.pshell.dev.MotorGroupDiscretePositioner table #det=ch.psi.pshell.epics.AreaDetector 13SIM1:cam1 13SIM1:image1 #$scienta=ch.psi.pshell.epics.Scienta 13SIM1:cam1 13SIM1:image1 $slit=ch.psi.pshell.epics.Slit MOT1 MOT2 -vhq1=ch.psi.pshell.epics.Vhq4 PO2DV-NCS-VHQ1 +#vhq1=ch.psi.pshell.epics.Vhq4 PO2DV-NCS-VHQ1 diff --git a/plugins/TestingList.java b/plugins/TestingList.java index 3910164..f02e860 100644 --- a/plugins/TestingList.java +++ b/plugins/TestingList.java @@ -2,10 +2,13 @@ * Copyright (c) 2014 Paul Scherrer Institute. All rights reserved. */ +import ch.psi.pshell.core.Controller; import ch.psi.utils.swing.MonitoredPanel; import ch.psi.pshell.ui.Panel; import ch.psi.utils.swing.SwingUtils; +import ch.psi.wsaf.ApplicationStateException; import ch.psi.wsaf.Task; +import ch.psi.wsaf.TaskRunningException; import java.awt.Desktop; import java.io.File; import java.text.DateFormat; @@ -25,6 +28,7 @@ import java.util.Properties; import java.util.logging.FileHandler; import java.util.logging.SimpleFormatter; import javafx.scene.control.SelectionMode; +import javax.script.ScriptException; import javax.swing.JFileChooser; import javax.swing.SwingUtilities; import org.apache.commons.io.FilenameUtils; @@ -357,10 +361,28 @@ public class TestingList extends Panel { } private void setButtonToStart(){ + Object state = null; + try { + state = eval("state"); + } catch (ApplicationStateException ex) { + Logger.getLogger(TestingList.class.getName()).log(Level.SEVERE, null, ex); + } catch (ScriptException ex) { + Logger.getLogger(TestingList.class.getName()).log(Level.SEVERE, null, ex); + } catch (IOException ex) { + Logger.getLogger(TestingList.class.getName()).log(Level.SEVERE, null, ex); + } catch (Controller.ControllerStateException ex) { + Logger.getLogger(TestingList.class.getName()).log(Level.SEVERE, null, ex); + } catch (InterruptedException ex) { + Logger.getLogger(TestingList.class.getName()).log(Level.SEVERE, null, ex); + } catch (TaskRunningException ex) { + Logger.getLogger(TestingList.class.getName()).log(Level.SEVERE, null, ex); + } + if(state.toString().equals("Ready")){ this.jButtonRun.setToolTipText("Stop tests"); jButtonRun.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/button_stop-64px.png"))); this.jTable1.clearSelection(); this.jTable1.setEnabled(false); + } }