Back: Parameters | Home: Table of Contents | Next: Edit configuration |
Configuration project attributes
Main window attributes
Location of source Procedure files
Dialogs and Procedure files
Directories
Configuration Editor
Reading Configuration information from a text file
Configuration files are the key to Spire. They describe a common project template that multiple users utilize in reconstruction projects.
Like HTML, XML uses tags (items enclosed in angle brackets) to describe content. There must always be a closing tag. In XML, upper case vs lower case matters. Configuration files must begin and end with Configuration tags. The main sections of a configuration file are enclosed in Main, Locations, Dialogs, and Directories tags, described in more detail below. The basic organization of a configuration file is:
The <Configuration> tag has two attributes, params and database.
params specifies whether or not the project uses a parameter doc file. Specifically, when a new project is started, a parameter form is automatically presented to the user. Setting params="no" turns off this behaviour.
database specifies whether or not the project uses an external database. Setting database="no" prevents database entry fields from appearing in the GUI.
NB: the default is for Spire to use both parameters and a database. Therefore
<Configuration params="yes" database="yes" > has the same effect as
<Configuration> with no attributes set.
The main window image and title
Each configuration file should have a single <Main> tag, which
configures the Spire main window.
The <title> tag specifies the large title that describes the type
of project/configuration.
The <image> tag specifies the gif image in the upper left corner of
Spire's main window. The image should be about 100 x 100 pixels. The full path to the image may be specified.
Some default images are provided in the $PYTHONPATH/site-packages/Spire/pics
directory.
The <helpurl> tag specifies a URL to display when the user selects
Project Help in Spire's Help menu.
Example:
|
|
The Dialogs section tells Spire how to organize and present the project to the user. Procedure files and other programs are linked to buttons, with short descriptive labels.
Section tag: <Dialogs> Element tags: <dialog>: begin a new dialog <name>: short name for the dialog <title>: dialog title <directory>: directory containing these Procedure files <help>: help URL (optional) <button>: button tags contain the following elements: <label>: descriptive label <buttontext>: text on the button itself <proc>: SPIDER procedure to run <prog>: a non-SPIDER program to run <group>: for grouping together several buttons
For example, the following fragment of XML markup creates the dialog in accompanying figure. After
the dialog heading, five buttons are specified. Each button has a brief description, a button label,
and an associated Procedure file (denoted by the <proc> tag). A Procedure file such
as refproj.spi is actually executed as spider bat/ext @refproj
.
The second button is tied to a program (web) that is not a Spider Procedure file, denoted by the <prog> tag. Such programs are executed just as they appear within the <prog> tag, along with any arguments. Since this occurs within a Unix subshell, sometimes the program is not recognized unless the full path to the executable is given.
The third and fourth buttons are grouped together, using the <group> tag. This may be used to allow the user to choose between alternative or optional Procedure files.
The last button has 2 Procedure files within the <proc> tag. More than one Procedure file can be included this way; they are executed one after another unless an error is encountered.
<dialog> <name>Alignment</name> <title>Particle Alignment</title> <dir>Alignment</dir> <button> <label>Create references</label> <buttontext>refproj.spi</buttontext> <proc>refproj.spi</proc> </button> <button> <label>open web</label> <buttontext>web</buttontext> <prog>web</prog> </button> <group name="Get alignment parameters - choose one:"> <button> <label>Align particles to references</label> <buttontext>apmq.spi</buttontext> <proc>apmq.spi</proc> </button> <button> <label>Align particles using PubSub</label> <buttontext>pub_apmq.spi</buttontext> <proc>pub_apmq.spi</proc> </button> </group> <button> <label>Create the aligned images</label> <buttontext>align.spi</buttontext> <proc>combine.spi, align.spi</proc> </button> </dialog> |
Project subdirectories are specified by the <dir> tag; the directory name is the tag attribute "name". Directories may contain filenames and other directories. If a directory has no contents, the empty tag must still be closed with a slash mark, as in <dir name="prj" />. The top-level project directory must be specified by ".". The example below shows the top-level directory has a single Procedure file, resizevol.spi. The subdirectory Alignment has two empty subdirectories (ali and prj) plus five Procedure files. Spire creates subdirectories for the project, then fetches Procedure files from the source specified by the <Locations> tags, and copies them into the project directories.
<Directories> <dir name=".">resizevol.spi</dir> <dir name="Alignment"> <dir name="ali"/> <dir name="prj"/> refproj.spi, refprojctf.spi, sel_by_group.spi, apsh.spi, apshctf.spi </dir> </Directories> |