Quick Start Guide to GDA 8.6

Expanding the zip files ready for compilation

GDA as downloaded from our ftp site consists of 3 zip files, one containing the GDA plugin projects, one the required third party plugins such as eclipse and other essential items, and the third contains documentation.

  1. Put the 3 zip files into a folder.

  2. cd into that folder

  3. >unzip -q GDA_release_8.6_rxxxxx.zip

    >ls GDA_release_8.6

    builder COPYING documentation example-config features plugin

  4. >unzip -q GDA_release_8.6_docs_rxxxxx.zip

    >ls GDA_release_8.6_docs

    GdaAnalysisGuide.pdf GdaDeveloperGuide.pdf GdaInstallationGuide.pdf GdaQuickStartGuide.pdf GdaUserGuide.pdf html

  5. >unzip -q GDA_release_8.6_thirdparty_rxxxxx.zip -d GDA_release_8.6

    >ls GDA_release_8.6/thirdparty

    bundles ch.qos.logback.eclipse_1.1.1 CSS-SDS-1.2.0 eclipse edna pydev

Content of GDA_release_8.6/plugins

  • uk.ac.diamond.scisoft.analysis
  • uk.ac.diamond.scisoft.analysis.rcp
  • uk.ac.gda.client
  • uk.ac.gda.client.extensions
  • uk.ac.gda.common
  • uk.ac.gda.common.rcp
  • uk.ac.gda.core
  • uk.ac.gda.dal
  • uk.ac.gda.epics
  • uk.ac.gda.example
  • uk.ac.gda.libs
  • uk.ac.gda.nexus
  • uk.ac.gda.pydev.extension

Content of GDA_release_8.6/features

  • uk.ac.gda.client-feature
  • uk.ac.gda.dal-feature
  • uk.ac.gda.example-feature
  • uk.ac.gda.xmleditor-feature

Setting up the Eclipse workspace

  1. GDA 8.6 depends on JDK 1.6 update 16. Ensure JAVA_HOME is set appropriately so that $JAVA_HOME/bin/java exists.

  2. Switch to a new workspace

  3. Turn Automatic Build off

  4. Use “Import Existing Projects into Workspace” to import all projects in GDA_release_8.6/plugins, GDA_release_8.6/features and the single projects in the folders GDA_release_8.6/thirdparty and GDA_release_8.6/example-config.

  5. Use Window | Preferences option to set the Plugin Development | Target Platform - select the GDA Build Target defined in the file uk.ac.gda.core/build.target.

  6. Setup PyDev Interpreter

    If you have PyDev installed then due to the PyDev natures of certain projects in GDA then when you turn Automatic Build on in the next step you may see error messages of the form:

    Invalid interpreter: Jython2.5.1 configured for project: uk.ac.gda.core.

    To remove these select Windows | Preferences | PyDev | Interpreter - Jython and create a new interpreter:

    Interpreter Name = Jython2.5.1
    Interpreter Executable = <InstallationFolder>/GDA_release_8.6/plugins/uk.ac.gda.libs/jython2.5.1/jython.jar
  7. Turn Automatic Build on

This will allow you to build the various plugins, features and products for the different GUIs as well as the different java projects used by the server. Note that the example product is defined in uk.ac.gda.example-feature/uk.ac.gda.example.product. The actual devices and scripts for a particular installation are stored in the configuration project GDA_release_8.6/example-config.

Starting the server processes

  1. cd GDA_release_8.6/example-config
  2. ./bin/GDA_StartServers

This will produce a lot of logging output on the console ending with the line:

2010-02-24 13:41:42,190 INFO  gda.util.ObjectServer - Server initialisation complete. xmlFile = server.xml

To stop the servers use the command

  1. ./bin/GDA_StartServers –stop

Starting the client process

There is a product launch file in plugin uk.ac.gda.example-feature called uk.ac.gda.example.product.launch. This was created using the run configurations dialog with settings:

Run a product : uk.ac.gda.example.product

Arguments:
-vmargs
-Dgda.root=${project_loc:uk.ac.gda.core}/../
-Dgda.config=${project_loc:example-config}
-Dgda.users=${project_loc:example-config}/users
-Dgda.propertiesFile=${project_loc:example-config}/properties/java.properties
-Djacorb.config.dir=${project_loc:example-config}/properties
-Dgov.aps.jca.JCALibrary.properties=${project_loc:example-config}/properties/JCALibrary.properties
-Xms128m -Xmx1024m -XX:MaxPermSize=128m

Plugins:
    (Use Add Required Plugins)
    Add uk.ac.gda.dal manually

Open the launch file using the context menu command ‘Run As | uk.ac.gda.example.product’. This will display a simply login dialog. Press the OK button to display the default perspective.

Quick tour of perspectives and views

Scripts Perspective

_images/scripting_perspective1.png

The view on the left of the Scripts Perspective shows the various collections of pre-existing scripts. If you do not see the ‘Scripts - GDA’ and ‘Scripts - Config’ projects go to the preferences on the ‘Project Explorer’ and show those two projects.

The editor shows the simple script hello_world.py. To run the script simply press the Run Script toolbar icon . Similarly type jython directly into the input pane of the Console view ( marked with >>>).

Open the XYScanPlot view from the collection named ‘Data Acquisition - General’. Then enter the command in the Console view:

scan scannableGaussian0 -2.0 2.0 0.1
_images/simplescan_xyscanplot1.png

Autocompletion in the Jython Editor View

When GDA Client is deployed (i.e. not a debug/run session in eclipse as above but built into the deployed product), the Jython Editor is configured to see the compiled GDA classes for auto-completion. It uses a jar file called ‘gda-script-interface.jar’ in the ‘client’ folder.

So then when entering the text:

from gda.

and pressing CTRL-SPACE, the editor shows the auto-completions (see ‘Autocompletion in the Console View’ below).

In a run/debug session this jar file does not exist. You may set the property ‘gda.debgug.client.interface’ to specify the location of this file or edit the Jython Interpreter directly when using the client. (Note that if you set ‘gda.debgug.client.interface’ it is only used when the client is first started on a new workspace.)

The jar file ‘gda-script-interface.jar’ can be generated using the build-main.xml the task ‘make_script_interface_jar’ does this.

Autocompletion in the Console View

In the input Console view type (with the final dot):

from gda.

and press CTRL-SPACE. This will bring up a list of possible completions. Select configuration and press enter. Type a further . and press CTRL-SPACE again to reveal further completions; select properties and press enter. Complete the command so that it becomes:

from gda.configuration.properties import LocalProperties

Now simply type LocalPr and press CTRL_SPACE for autocompletion of LocalProperties to be performed.

Simple Scan, viewing the results and manipulating them in script

Now create a simple 1d scan using the commands:

from scannableClasses import *
ss = ScannableSine("ss",0.0, period=0.5)
scan ss -4. 4. .05

The contents of a data file can be read into an object called a ScanFileHolder. To get the name of the name of the last file created programmatically and use that to load the data in a ScanFileHolder enter the commands:

    from gda.data import NumTracker
    from gda.data import PathConstructor
    numTracker = NumTracker("tmp")
    file = PathConstructor.createFromDefaultProperty()
file = file + "/" + `int(numTracker.getCurrentFileNumber())`+".dat"
    data = ScanFileHolder()
    data.loadSRS(file)
data.getHeadings()

Now open the view called “Plot 1” from the group named ‘Data Analysis - General’. To display the data just loaded in this view enter the commands:

RCPPlotter.plot("Plot 1",data[0], data[1])

You can plot the effects of various mathematical operators on the data such as:

RCPPlotter.plot("Plot 1",data[0], data[1]*2.0)
_images/RCPPlotter1.png

Nested Scans and XY Plotting

First we want to change the data format to from the ASCII format used above to Nexus. The format is controlled by a property called gda.data.scan.datawriter.dataForma that can be read and set using the static methods LocalProperties.get and LocalProperties.set.

To get the current value type:

LocalProperties.get("gda.data.scan.datawriter.dataFormat")

This should return SrsDataFile which indicates that currently data files are written in an ASCII format originating from SRS. Now type:

LocalProperties.set("gda.data.scan.datawriter.dataFormat","NexusDataWriter")

to change the file format to Nexus.

Now to create an interesting multidimensional Nexus file enter the commands:

import scannableClasses
from scannableClasses import *
sgw = ScannableGaussianWidth('sgw', scannableGaussian0)
scan sgw 0.2 2.0 0.2 scannableGaussian0 -1.0 1.0 0.02

This nested scan has an outer scan which sets the width of the contained scannable Gaussian to different values from 0.2 to 2.0 in steps of 0.2. The inner scannable is then plotted for each width from -1.0 to 1.0 in steps of 0.02

_images/nestedscan_xyscanplot1.png

Data Perspective

Open the Data Perspective and select the latest created Nexus file ( ends in extension nxs). The structure of the Nexus file can be viewed in the NexusTree view. The selected data , normally within entry1 | default | name, can then be viewed in various ways from 1d to 2d surfaces.

_images/nestedscan_nexusplot1.png _images/nexus_2dplot.png

Object Viewer Perspective

The Object Viewer Perspective displays a tree view of the objects on the server grouped by interface, if you select an item its property is shown in the Properties view. The context menus on the tree are item type dependent and can be extended via extension points.

_images/objectviewer_perspective1.png

Synoptic Displays

For information on CSS see http://css.desy.de/content/index_eng.html

GDA contains a plugin called uk.ac.gda.dal that contains a DAL to allow GDA scannables to be displayed in a CSS SDS window.

Open the Display Development perspective. Refresh the Navigator view. You should see a project called screens containing a file called frontJackScannable.css-sds which allows monitoring and control of a scannable named FrontJackScannable.(Note that this scannable has a range of 0 to 20). Select this file and open it using the command “Run as View”. With the view displayed scan the FrontJackScannable using a command of the form:

scan FrontJackScannable 0. 20. 2.
_images/sds1.png

The view was created using the following instructions:

  1. Select the project called screens and add a new Synoptic Display.

  2. Add a Linking Container to the view large enough to hold a number of widgets.

  3. Add an alias to the linking container:

    name = channel
    value = FrontJackScannable
    
  4. Set the Primary PV of the linking container to $channel$

  5. Add various widgets to within the linking container and use the Configure Dynamic Aspects to link the value of FrontJackScannable to the

    widget properties. For example add a ThumbWheel and configure the dynamic aspect of the value property so that the Value input channel is associated with $channel$.