From: <cs-...@li...> - 2012-03-02 13:34:46
|
details: http://cs-studio.hg.sourceforge.net/hgweb/cs-studio/cs-studio//hgroot/cs-studio/cs-studio/rev/791849086843 changeset: 14213:791849086843 user: kasemir date: Thu Mar 01 17:12:14 2012 -0500 description: SNS scan system: Jython script tests for server on remote host details: http://cs-studio.hg.sourceforge.net/hgweb/cs-studio/cs-studio//hgroot/cs-studio/cs-studio/rev/7568a2c50c56 changeset: 14214:7568a2c50c56 user: kasemir date: Thu Mar 01 17:14:51 2012 -0500 description: SNS scan system: Jython script tests for server on remote host details: http://cs-studio.hg.sourceforge.net/hgweb/cs-studio/cs-studio//hgroot/cs-studio/cs-studio/rev/e32029fb22ab changeset: 14215:e32029fb22ab user: kasemir date: Fri Mar 02 08:33:38 2012 -0500 description: o.c.alarm.beast.configtool: XML Schema update from Denis @ ITER diffstat: applications/plugins/org.csstudio.alarm.beast.configtool/AlarmConfigurationSchema.xsd | 32 ++++++++- products/SNS/plugins/org.csstudio.scan/examples/jython.sh | 2 +- products/SNS/plugins/org.csstudio.scan/examples/scan_client.py | 13 ++++ products/SNS/plugins/org.csstudio.scan/src/org/csstudio/scan/data/ScanSample.java | 8 +- products/SNS/plugins/org.csstudio.scan/src/org/csstudio/scan/server/ScanServer.java | 4 +- 5 files changed, 46 insertions(+), 13 deletions(-) diffs (171 lines): diff -r 4b82cef935e3 -r e32029fb22ab applications/plugins/org.csstudio.alarm.beast.configtool/AlarmConfigurationSchema.xsd --- a/applications/plugins/org.csstudio.alarm.beast.configtool/AlarmConfigurationSchema.xsd Thu Mar 01 16:03:08 2012 -0500 +++ b/applications/plugins/org.csstudio.alarm.beast.configtool/AlarmConfigurationSchema.xsd Fri Mar 02 08:33:38 2012 -0500 @@ -1,6 +1,8 @@ <?xml version="1.0" encoding="utf-8" ?> <!-- Contributed by Laurier Baribeau, <Lau...@li...> + Updated by Denis Stepanov, + <Den...@it...> --> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> @@ -12,18 +14,38 @@ </xs:sequence> </xs:complexType> </xs:element> + + <xs:element name="display"> + <xs:complexType> + <xs:sequence> + <xs:element name="title" type="xs:string"/> + <xs:element name="details" type="xs:string"/> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:element name="command"> + <xs:complexType> + <xs:sequence> + <xs:element name="title" type="xs:string"/> + <xs:element name="details" type="xs:string"/> + </xs:sequence> + </xs:complexType> + </xs:element> <xs:element name="pv"> <xs:complexType> <xs:sequence> - <xs:element name="description" type="xs:string"/> + <xs:element name="description" type="xs:string" minOccurs="0"/> <xs:element name="enabled" type="xs:boolean" minOccurs="0"/> <xs:element name="latching" type="xs:boolean" minOccurs="0"/> <xs:element name="annunciating" type="xs:boolean" minOccurs="0"/> <xs:element name="delay" type="xs:decimal" minOccurs="0"/> - <xs:element name="count" type="xs:positiveInteger" minOccurs="0"/> + <xs:element name="count" type="xs:unsignedInt" minOccurs="0"/> <xs:element name="filter" type="xs:string" minOccurs="0"/> <xs:element ref="guidance" minOccurs="0" maxOccurs="unbounded"/> + <xs:element ref="display" minOccurs="0" maxOccurs="unbounded"/> + <xs:element ref="command" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="name" use="required"/> </xs:complexType> @@ -32,8 +54,8 @@ <xs:element name="component"> <xs:complexType> <xs:sequence> + <xs:element ref="pv" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="component" minOccurs="0" maxOccurs="unbounded"/> - <xs:element ref="pv" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="name" use="required"/> </xs:complexType> @@ -42,8 +64,8 @@ <xs:element name="config"> <xs:complexType> <xs:sequence> + <xs:element ref="pv" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="component" minOccurs="0" maxOccurs="unbounded"/> - <xs:element ref="pv" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="name" use="required"/> </xs:complexType> @@ -51,7 +73,7 @@ </xs:schema> -<!-- My notepad: +<!-- My notepad (Laurier Baribeau): - Add definitions for 'command' element and 'display' element. - 'latching' tag is to be investigated... I think its optional but don't know the default. diff -r 4b82cef935e3 -r e32029fb22ab products/SNS/plugins/org.csstudio.scan/examples/jython.sh --- a/products/SNS/plugins/org.csstudio.scan/examples/jython.sh Thu Mar 01 16:03:08 2012 -0500 +++ b/products/SNS/plugins/org.csstudio.scan/examples/jython.sh Fri Mar 02 08:33:38 2012 -0500 @@ -9,7 +9,7 @@ # When listing jython.jar on the classpath, # need to specify the main class to run PLUGINS=../.. -JYTHON=$PLUGINS/org.csstudio.scan.client_*/lib/jython.jar +JYTHON=$PLUGINS/org.csstudio.scan.client*/lib/jython.jar # java -cp $JYTHON:$CLIENT:$COMMON org.python.util.jython "$@" java -cp $JYTHON org.python.util.jython "$@" diff -r 4b82cef935e3 -r e32029fb22ab products/SNS/plugins/org.csstudio.scan/examples/scan_client.py --- a/products/SNS/plugins/org.csstudio.scan/examples/scan_client.py Thu Mar 01 16:03:08 2012 -0500 +++ b/products/SNS/plugins/org.csstudio.scan/examples/scan_client.py Fri Mar 02 08:33:38 2012 -0500 @@ -33,8 +33,21 @@ sys.path.append(install + "/org.csstudio.scan_1.0.0") sys.path.append(install + "/org.csstudio.scan.client_1.0.0") + # ------------------------------------------------------- +# Scan Server connection setup +import org.csstudio.scan.server.ScanServer as ScanServer +import java.lang.System as System +# Set scan server host and port if they're not the default. +# Can also pass this as command-line arg to jython: +# jython -DScanServerHost=ky9linux.ornl.gov .... +#System.setProperty(ScanServer.HOST_PROPERTY, "ky9linux.ornl.gov") +#System.setProperty(ScanServer.PORT_PROPERTY, str(4810)) + + +# ------------------------------------------------------- +# Leave rest as is import org.csstudio.scan.client.ScanServerConnector as ScanServerConnector from org.csstudio.scan.command import * import time diff -r 4b82cef935e3 -r e32029fb22ab products/SNS/plugins/org.csstudio.scan/src/org/csstudio/scan/data/ScanSample.java --- a/products/SNS/plugins/org.csstudio.scan/src/org/csstudio/scan/data/ScanSample.java Thu Mar 01 16:03:08 2012 -0500 +++ b/products/SNS/plugins/org.csstudio.scan/src/org/csstudio/scan/data/ScanSample.java Fri Mar 02 08:33:38 2012 -0500 @@ -4,12 +4,12 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * The scan engine idea is based on the "ScanEngine" developed * by the Software Services Group (SSG), Advanced Photon Source, * Argonne National Laboratory, * Copyright (c) 2011 , UChicago Argonne, LLC. - * + * * This implementation, however, contains no SSG "ScanEngine" source code * and is not endorsed by the SSG authors. ******************************************************************************/ @@ -47,8 +47,6 @@ final private Date timestamp; final private long serial; - // TODO Does each Scan Sample need the device name? - // Should the device name only be kept in the logger? /** Initialize * @param device_name Name of device that provided the sample * @param timestamp Time stamp @@ -85,7 +83,7 @@ * @return Value of the sample */ abstract public Object getValue(); - + @Override public String toString() { diff -r 4b82cef935e3 -r e32029fb22ab products/SNS/plugins/org.csstudio.scan/src/org/csstudio/scan/server/ScanServer.java --- a/products/SNS/plugins/org.csstudio.scan/src/org/csstudio/scan/server/ScanServer.java Thu Mar 01 16:03:08 2012 -0500 +++ b/products/SNS/plugins/org.csstudio.scan/src/org/csstudio/scan/server/ScanServer.java Fri Mar 02 08:33:38 2012 -0500 @@ -31,10 +31,10 @@ * They can be overriddden via Java system preferences * to allow doing this from any Java tool (jython, Matlab, ...). * - * TODO Eclipse-based tools set the system properties from Eclipse preferences, + * Eclipse-based tools set the system properties from Eclipse preferences, * so what's used in the end are the system preference values, * but they can be configured from Eclipse preferences - * TODO and the GUI tools include preference pages. + * and the GUI tools include preference pages. * * @author Kay Kasemir */ |