MCA Logo
MCA Online Reference Documentation
Main Index

Chapter 4. Configuration files

Table of Contents
4.1. Creating configuration files
4.2. Reading values from an AttributeTree

The more complex a control program becomes, the more parameter it needs. It's of course possible to define them as command line parameters, but starting the program will then be well complicated.

Configureation files are another possibility to define program parameters. Just start with parameter --configfile=filename (See also part parameters ). All defined attributes in this file are then automatically read and stored in an internal structure by your part.

4.1. Creating configuration files

Configuration files are read and stored by tAttributeTree . An attribute tree is organized like the directory structure of a file system: Every entry has an attribute name and an attribute content. The content may be empty. Moreover every entry may have subentries. When saved to file, subentries are encluded into { } brackets, or their names include the parent entry name separated by a point:

Example 4-1. Attribute Tree

{
  example_entry_1{
    value:0.9
    name:example entry
 }example_entry_1
 example_entry_2.name: example entry 2
 example_entry_2.value:0.7
 example_entry_3{
    my_string:this is a string which could be very long ...
    subentry_a{
      my_one_integer:100
      # vectors of values can be stored like this
      my_doubles_ly_here.0:1.23
      my_doubles_ly_here.1:0.45
      my_doubles_ly_here.2:-3.7e60
      # vectors of values can also be stored like that
      my_string_vector{
	0: test string 1
	1: test string 2
	2: test string 3
	3: test string 4
	4: test string 5
      }my_string_vector
    }subentry_a
    subentry_b{
      # bool entries must get the integer value of the bool
      my_one_bool:1
      my_integer_vector{
        0:0
	1:-100
	2:4000
	3:888
	4:44
	5:55
	6:88
      }my_integer_vector
    }subentry_b
 }example_entry_3
}

Of course you are able to create such configuration files manually with every editor you like. But there is a special editor as part of the MCA project: EditAT enables creating and manipulating AttributeTree files in an easy and comfortable way.