Edl::Doc


NAME

Edl::Doc


DESCRIPTION

EdlBuild is a collection of Perl modules, which provide a Perl programming interface for generating input files (.edl files) for the EPICS display manager/editor edm.

EdlBuild allows full configuration of every name/value pair of widget properties for all edm widgets. (It actually allows configuration of stuff, which had better not be changed. Suit yourself!).

EdlBuild is extensible and can easily accommodate new widgets as they are developed.

See also:

https://isacwserv.triumf.ca/epics/edlbuild/TRIUMFedlbuild.htm

Package Content

The Edl package consists of:

- a main module Edl::Edl.pm which includes all other modules.
- one widget module for each edm widget. Links to widget modules are placed with documentation of the widget generator functions in the Edl::Edl.pm module.
- a colour module Edl::Colors.pm wich parses the edm colors.list file and provides color indices by functional name.
In addition there are TRIUMF-specific modules which support the building of device-control panels:
- a module Edl::Cp.pm which contains higher level function with pre-packeged widgets.
- modules for building device control panels by device type
Edl::Panels.pm, Edl::Panels2.pm, Edl::Panels3.pm.


Introduction

A Perl script for creating an .edl file issues a series of calls to "widget generator" functions (see module Edl::Edl.pm).

Each widget generator function is provided with a set of widget configuration parameters. The widget generator function uses these configuration parameters when it calls the widget's constructor.

Each widget generator function returns a reference to the widget object.

Widget Modules

There exists one Perl module per edm widget. Each widget module provides a configure() function which may be called to incrementally configure a widget. The configure function is called using the widget reference returnred by the widget generator function (see the configuration of the edl object near the end of the programming example)..

The configurable parameters of a widget are documented with the individual widget modules.

Configuration Parameter Format

Widget configuration parameters are passed to the widget generator functions and widget configuration functions as name/value pairs in hash notation.

The value of a "list" parameter, such as the point coordinates of a line widget or the display names of a related display widget, is passed as a string of list items separated by | (vertical bar). Each list item consists of an integer list index separated by one space character from the item value.

See the programming example below.

Colour Specification

Any time a widget colour is specified there are two options:

The colour can be specified as it is stored in the .edl file, e.g.

 fgColor => 'index 7'

Alternatively (and preferred) the Edl::Colors module provides the convenience function getColor(<name>) where <name> is any valid functional colour name defined in Edm's colors.list file, e.g.

 fgColor => getColor('screen_foreground')


PROGRAMMING EXAMPLE

The following examplePerl script shows how to use EdlBuild. It should be self-explanatory to anyone with some knowledge of the Perl language:

 #!/usr/bin/perl -w
 #
 # EdlBuild.pl
 #
 #
 #======================================================================
 #
 use strict;
 
 use Edl::Edl;
 
 # get file name from command line
 my $file = shift;                         
 if (!defined $file) {
     $file = 'test';
 }
 # set up new edl file and return reference
 my $edl = new Edl::Edl($file.'.edl');
 
 # add some widgets
 $edl->text_update(x => 300, y => 350, h => 50, w => 200, controlPv => '"$(D):VOL"');
 
 $edl->reg_text_update(x => 300, y => 400, h => 50, w => 200, controlPv => '"$(D):VOL"');
     
 $edl->text_entry(x => 600, y => 900, w => 200, controlPv => '"$(D):VOL"',
     font => '"helvetica-bold-r-12.0"');
        
 $edl->choice_button(x => 600, y => 400, w => 200, controlPv => '"$(D):VOL"');
 
 my $handle = $edl->lines(x => 10, y => 500, h =>150, w => 200,
     xPoints => '0 10|1 120|2 10|3 120', yPoints => '0 500|1 520|2 530|3 540', numPoints => 4,
     lineWidth => 3);
 
 # get a color index  (screen-foreground must be defined in colors.list)
 my $lc = getColor('screen-foreground');
 
 # configure the line color (could have been done in the constructor) 
 $handle->configure(fgColor => $lc);
          
 # configure the final screen size      
 $edl->configure(w => 900, h=> 1100);
 
 # finish up and write output file
 $edl->finish();


DEPENDENCIES

none


AUTHOR

Rolf Keitel <rolf@triumf.ca>

Copyright (C) TRIUMF 2005, ..

 Edl::Doc