Download presentation
Presentation is loading. Please wait.
Published byJane Beasley Modified over 9 years ago
1
XMLconfig XML scheme for configuration data V.Černý Technical improvements thanks to suggestions by Aleksey Khudyakov No changes concerning configuration data structs All work possibly done by users on data structures can be used by the upgraded scheme without any change The xml-file structure unchanged Just one line of code needed to read or write the xml file Changes mainly internal, hidden from the user
2
Status of the project fully functional software new installation/demo tarball available https://twiki.cern.ch/twiki/bin/view/NA62/ConfigurationDataScheme https://twiki.cern.ch/twiki/bin/view/NA62/ConfigurationDataScheme preprocessor is provided to generate everything needed except of the struct containing the configuration data, which, of course, is to be provided by the user Comments, suggestions for changes, requests for additional features Mail to: Vladimir.Cerny@cern.ch
3
XML format: tagged text file Essential: human readable, human editable Example of a simple xml configuration file: LTUconfig.xml
4
More structured xml file: 100 Demodetector 5 3.1347002794315403e-317 6 1 5001.1999999999998 2 5001.1999999999998 3 5001.1999999999998 4 5001.1999999999998 5 5001.1999999999998 -6 -1e+100
5
Operation scheme 1: C calling C++ API Operation scheme 2: C++ Operation scheme 3: Java
6
C++ xml-supporting library: boost
7
What the user should do Define your configuration data structure in a c include file Run xmlconfig preprocessor to create the API c-include file and other files needed for internal working insert one line of c-code into your c-program to read the xml configuration file data into your data structure if you need output the data contained in your data structure it is again just one line of c-code
8
#ifndef __Node_h__ #define __Node_h__ #include "xmlstring.h" #define Node_VERSION 100 #define NCHANNELMAX 6 //maximal number of channels typedef struct __Channel { int channel_no; double hvoltage; } Channel ; typedef struct __Node { int version; xmlchar idstring[XMLSTRING]; int channelcount; double pressure; Channel channel[NCHANNELMAX]; }Node; #endif /* __Node_h__ */ Data-structure-defining include file Node.h 100 Demodetector 5 3.1347002794315403e-317 6 1 5001.1999999999998 2 5001.1999999999998 3 5001.1999999999998 4 5001.1999999999998 5 5001.1999999999998 -6 -1e+100 Corresponding xml file node.xml
9
#include "Node.h" #include "xmlconfig_Node.h"/* include file prepared by the xmlpp preprocessor */ int main(){ Node node; /* in realistic example you make the variable node global to be seen by any part of your code */ INXML_Node(node); /*serialization by macro defined in xmlconfig_Node.h*/ /* now the struct node contains all the data from the xml file and you can do anything needed */ return 0; } #ifndef __Node_h__ #define __Node_h__ #include "xmlstring.h" #define Node_VERSION 100 #define NCHANNELMAX 10 //maximal number of channels typedef struct __Channel { int channel_no; double hvoltage; } Channel ; typedef struct __Node { int version; xmlchar idstring[XMLSTRING]; int channelcount; double pressure; Channel channel[NCHANNELMAX]; }Node; #endif /* __Node_h__ */ User’s tasks 1.Write data-defining include file 2.Write one line of input code wherever needed
10
XMLconfig to be merged with Run Control? What has been presented up to now is a standalone XMLconfig project. The xml files were expected to be designed and stored by particular subdetector groups. This would be ok if the configuration data were fixed for a long time. It may happen, however, that the experimental node has to run in different configurations for, say, different triggers. So there would be more than one configuration xml file for the same node and a proper one should be loaded as needed. Then the appropriate capabilities should be included in the run-control system. New node states should be designed controlling which xml configuration is/should be loaded. Possibly a central database of xml configuration files should be maintained so that the run-control log-book would contain just links to the xml files.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.