mrparameterset__define.pro


Name:
mrparameterset
Methods:
Constructor
mrparameterset::init         : constructor, 2nd part

Public variables (get)
mrparameterset::name         : returns the name of this parameter set

Public methods
mrparameterset::getByName    : get a parameter element by its name
mrparameterset::check        : calls the check method of all members
mrparameterset::load         : load a parameter set from disk
mrparameterset::save         : save a parameter set to disk
mrparameterset::dump         : dump contents to screen - meant for debugging

Inherited methods from IDL_Container
mrparameterset::count        : returns number of elements
mrparameterset::get          : /all, position=index, count=var
mrparameterset::move         : source_index, destination_index
mrparameterset::remove       : obj, /all, position=index

Overloaded methods
mrparameterset::add          : overloaded to check for class
mrparameterset::isContained  : name, position=var

XML Parser
mrparxml__define             : constructor, part I
mrparxml::init               : constructor, part II
mrparxml::startElement       : only start element,
mrparxml::endElement         : end element,
mrparxml::characters         : and data values are parsed

Private
mrparameterset__define       : constructor, 1st part
mrparameterset::cleanup      : the destructor
Description:
File format:
The file format is XML, described by a DTD directly in the file and
should be pretty self explaining. A parameter entry has the form
0
100
10
Destroying a parameterset will automatically destroy all contained
parameter objects.

Name:
mrparameterset::init
Syntax:
obj = obj_new('mrparameterset', name, filename=file )
Arguments:
name
String, which defines a name for the parameter set
filename
If given, a parameterset is loaded from the given filename.
Should that fail, '0' is returned, i.e. the object is not created.
Description:
Instanciates a new object of class mrparameterset and calls the
constructor of the superclass IDL_Container

Name:
mrparameterset::cleanup
Syntax:
obj_destroy, obj
Description:
The destructor - destroying a container will automatically destroy
all contained objects.

Name:
mrparameterset::add
Syntax:
obj->add, objects [, position=index]
Arguments:
objects
An object instance or an array of objects of class mrparameter to
be added to the parameter set.
index
Scalar or array of zero based index values. The number of elements
must equal the number of object references specified by the objects
argument, or the method will return immediately.
Each index specifies the position at which the corresponding object
is to be placed. Defauls is to add new objects at the end of the list.
Description:
Add an object to the parameter set.
Objects which are not of class mrparameter are silently ignored.
Objects of identical names in the set will be replaced (and destroyed!)
This might possibly screw up position settings.
If no position is given, the object is added to the end of the list.

Name:
mrparameterset::name
Syntax:
result = obj->name
Description:
Returns the name of this parameter set.

Name:
mrparameterset::getByName
Syntax:
result = obj->getByName, name
Arguments:
name
A string naming the mrparameter object to return
Description:
The method returns the mrparameter object of that name or obj_new(),
if an object of the specified name is not contained in the set.

Name:
mrparameterset::check
Syntax:
result = obj->check()
Description:
Calls mrparameter::check for all contained objects and returns true (1),
if check was successful for all objects or false (0), if it failed for
at least one.

Name:
mrparameterset::dump
Syntax:
obj->dump
Description:
Dump content of the parameterset to screen by calling the dump
function of each of the included parameters.
Mainly meant for debugging

Name:
mrparameterset::isContained
Syntax:
result = obj->isContained, name, position=var
Arguments:
name
A string denoting the name of the parameter to check
position
If set, the variable upon return holds the position at which the
parameter is located or -1.
Description:
The method returns true (1), if a mrparameter of the specified
name exists in the set, or false (0) otherwise.

Name:
mrparameterset::load
Syntax:
result = obj->load( filename, doubles=var )
Return value:
Returns 1 if successful and an error code <= 0 otherwise
0: unspecified error
-1: error opening file
Arguments:
filename
The filename (complete path) from which to load the parameter set
doubles
A string ('error', 'replace'(D) or 'ignore') which denotes the behaviour
in case a mrparamter object of the same name already exists in the list.
By default, the object will be destroyed and replaced by the new one.
The 'error' option has not been tested yet. There's anyway some work to
be done on catching errors from the XML parser.
When set to 'ignore', the object in the file is ignored.
Description:
The load method loads a parameter set from the specified file and adds
the contained data as mrparameters to the existing parameterset.

Name:
mrparameterset::save
Syntax:
obj->save, filename, /valuesonly, error=err
Arguments:
filename
A string specifying the filename to write to.
valuesonly
If set, only the parameter's values, but no limits or valid value
lists are saved. Default is to save all.
error
The corresponding variable is set to '1' if anything goes wrong
while saving.
Description:
Saves a parameterset to disk. If the parameterset was originally
loaded from file, filename may be omitted and the original file
will be overwritten.

Name:
mrparxml::init
Description:
Initialized the parser - need the parameter set and the 'doubles'
keyword as arguments.

Name:
mrparxml::startElement
Description:
Handles element start: parses attributes and creates a new mrparameter
object.

Name:
mrparxml::endElement
Description:
If : add the mrparameter object to the set, respecting
settings of 'doubles' keyword

Name:
mrparxml::characters
Description:
Set limits, step size, value or valid value

Name:
mrparxml__define
Description:
create separate object - dunno if multiple inheritance works under
IDL, but that's cleaner anyway

Name:
mrparameterset__define
Description:
Private Procedure (constructor)

Last modified: Mon Nov 29 13:30:07 2004