genui: Engineering Data Interface Generator

Contents

Introduction

genui is a code generator for processing engineering data within the Anderson Group Data Acquisition System architecture. Based on a simple configuration file, genui generates source code for data extraction and a series of Matlab .m files for viewing the resulting data. Multiple data channels can be displayed on each graph, and multiple graphs can be stacked together in groups, making it easy to correlate events across a group of related channels.

Invocation

genui [-d matdir] [-c] inputfile
-d matdir
Specify directory where .m files will be written
-c
Generate .cdf file (for .csv output) instead of .edf (for .sps)
inputfile
The name of the configuration file.

When you run genui, it will generate a .cdf or .edf file from which an extraction program can be compiled. The name of the output file is the concatenation of the MNEMONIC (specified in the configuration file), 'eng' and the file type (.cdf or .edf).

In order to build the extraction program, you will need to add a definition to the .spec file something like this:

ccengext : cceng.cdf

You may need to modify this rule to add additional files, and you will also have to add an explicit rule for generating cceng.cdf.

Configuration File

The configuration file, frequently called genui.txt, has a very simple format, consisting of only two line types:

Keyword definition lines consist of a keyword followed by a space and the keyword value. The keywords are:

HEADER
Value: Text to be displayed at the top of the Matlab GUI
MNEMONIC
Value: A short string uniquely associated with this instrument, used to create unique function and file names.
HOMEDIR
Value: The name of a function that will be used to locate where the data files are stored. The function itself will be generated the first time the generated GUI is run, but the name must be chosen to be unique to this experiment.
ROWS
Value: An integer specifying how many buttons should be listed in each column of the GUI.

Data definition lines consist of the following elements separated by whitespace:

<Rate> <Mnc>[:<Var>:<bit>] <Group> <Graph> [<format>] [:<function>] [<legend_pos>] [<legend>]
Data Rate
The possibly fractional rate of the datum in Hz. Must be specified as an integer or a fraction.
Data Mnemonic
The TM variable name. Bit-mapped digital status values can use the format mnemonic:datum:bit_number, where datum is the aggregate TM variable and bit_number is an integer, with zero representing the least significant bit. Digital status values cannot be combined on the same graph with analog channels, although they can be combined effectively within a group.
Group
The name of the group of related graphs. This usually will refer to a subsystem.
Graph
The name of the graph. Multiple data definition lines can refer to the same group and graph. Graphs in different groups can have the same name.
Format
Optional: a printf-style format for converting the value from a double type to text. The default is the same as the screen display format, but that needs to be overridden if the screen display is non-numeric. A format of '%-' disables extraction of the specified variable. This is to support backwards compatibility when TM variables are eliminated.
Function Name
Optional: If you want to add a fully custom graph to the GUI, you can provide a string beginning with a colon (e.g. ':foo'). This is combined with the customization prefix ('cust_' followed by the MNEMONIC string) to create the name of the custom function.
Legend Position
An optional four-element Matlab vector [x y h v] specifying the relative position and alignment of the graph's legend as specified by the nlegend() function. x and y specify the reference position, where [0 0] is the lower left corner and [1 1] is the upper right. h and v specify the horizontal and vertical alignment, respectively, with -1 specifying left or bottom alignment, 1 specifying top or right alignment and 0 representing center alignment. Non-integer values are also supported.
Legend
Optional string to be used instead of the mnemonic in the graph's legend. Useful for eliminating a common prefix from a group of channels.

Matlab Setup

There are three Matlab libraries you will need to install to run the engineering plot gui:

Installation involves checking out the libraries from the appropriate source code repository and adding them to your Matlab path. The first thing you probably want to do is figure out where you want to locate these libraries. You probably want to create a common base directory for Matlab libraries. This could be a Matlab directory in "My Documents" or C:\Matlab. All three of these libraries could then be subdirectories of this root directory. On the other hand, you might have all of the experiment's source code checked out somewhere, so it might make sense to leave the experiment-specific engineering plot library where it is.

To check out Nort's matlab libraries, bring up a shell, cd into your common base directory and:

cvs -d :ext:forge.abcd.harvard.edu:/cvsroot/arp-das co -d nort Matlab/nort

or

cvs -d :pserver:anonymous@forge.abcd.harvard.edu:/cvsroot/arp-das login
cvs -d :pserver:anonymous@forge.abcd.harvard.edu:/cvsroot/arp-das co -d nort Matlab/nort

There are several directories included in this download, but only two that should be added to your Matlab path: nort and nort/ne. The others contain examples of installation-specific configuration hooks to make other parts of the libraries work.

To download the experiment-specific engineering plots, you will need to refer to the source code repository for your instrument. Look for a README file in a directory named 'eng'.

Add the libraries nort, nort/ne and the experiment-specific directory to your Matlab path.

Data Setup

Now you need to decide on a root directory for flight/run data. This directory will contain a subdirectory for each run using the same run numbering as under QNX. Each run directory will contain .mat files with all the engineering data. If you append an 'F' to the name of flight runs, then the plots will note that this is flight data.

The first time your run the instrument's engineering GUI, you will be prompted to specify your data root directory. The directory name will be stored using the file name specified with the HOMEDIR keyword in the genui configuration file.

Data Download

Each time you make a data run, you will need to perform the following steps in order to view the engineering plots:

The exact order of these operations and the specific procedures you need to follow are probably experiment-specific.

Running the GUI

The name of the GUI routine is 'ui_', where is the value specified in the configuration file, e.g. 'ui_cc'. Running 'ui_cc' in Matlab will bring up a GUI interface listing all the graphs and groups and all of the data runs found in the data directory. Select the run from the list on the right. The most recent run is the default. Each button in the main area generates a graph. The larger buttons represent groups that put multiple graphs on one figure.

I have added some menu items to the graph displays:

Zoom:
Added before Matlab added their zoom buttons, but still sometimes a little easier to use. Allows you to select horizontal or vertical zoom in one step.
MatchX:
After zooming in on an X-axis region in one graph, MatchX will zoom all the other graphs in the figure to the same X range.
Edit:
Allows you to further customize the graphs.
Expand:
Allows you to open any of the graphs in a group in it's own figure.

Customizations

You will often want to further customize individual graphs. The use of lines may be inappropriate on particularly noisy data, for example, or the default limits may reflect a transient startup condition, not the region of interest. You can create a customization function for any graph by selecting the graph in the 'Edit' menu. The customization function will contain a summary of the graph's definition and examples of how you might want to modify it. The argument to this function is a vector of graphic object handles.

Such modifications can be checked back in to the instrument's source code repository to make them available to other team members. Subsequent changes to genui.txt should not overwrite these, although it is possible that major modifications to the group and plot structure might result in name changes that would defeat your modifications.


Return to Manuals Guide


last updated: Wed Apr 17 13:00 2013 EDT webmaster@huarp.harvard.edu
Copyright 2013 by the President and Fellows of Harvard College