musrWiz 0.1.0
Loading...
Searching...
No Matches
PInstrumentDefXMLParser Class Reference

The PInstrumentDefXMLParser class parses instrument definition XML files. More...

#include <PAdmin.h>

Public Member Functions

 PInstrumentDefXMLParser (const QString &fln, PAdmin *)
 Constructor. Parses the given instrument definition XML file.
 
virtual ~PInstrumentDefXMLParser ()
 Destructor.
 
virtual bool isValid ()
 Checks if the XML parsing was successful.
 

Private Types

enum  EKeyWords {
  eEmpty , eInstitute , eInstrument , eRunNameTemplate ,
  eBeamline , eDataFileFormat , eTf , eZf ,
  eLf , eNoOfDetectors , eFgbOffset , eLgb ,
  eBkgRange , eLogicDetector
}
 Enumeration of XML tag keywords for parsing state machine. More...
 

Private Member Functions

bool parse (QIODevice *device)
 
bool startDocument ()
 
bool startElement ()
 
bool endElement ()
 
bool characters ()
 
bool endDocument ()
 

Private Attributes

QXmlStreamReader fXml
 xml stream reader object
 
bool fValid
 flag showing if XML read has been successful
 
EKeyWords fKeyWord
 key word tag to know how to handle the content
 
PAdminfAdmin
 a pointer to the main administration class object
 
QString fInstituteName
 current institute name being parsed
 
PInstrumentfInstrument
 current instrument object being built
 
PSetupfSetup
 current setup object being built
 

Detailed Description

The PInstrumentDefXMLParser class parses instrument definition XML files.

This class reads and parses XML files containing instrument definitions for various muon facilities (PSI, TRIUMF, ISIS, J-PARC). Each instrument includes setup configurations for different measurement types (ZF, TF, LF).

Member Enumeration Documentation

◆ EKeyWords

Enumeration of XML tag keywords for parsing state machine.

Enumerator
eEmpty 
eInstitute 
eInstrument 
eRunNameTemplate 
eBeamline 
eDataFileFormat 
eTf 
eZf 
eLf 
eNoOfDetectors 
eFgbOffset 
eLgb 
eBkgRange 
eLogicDetector 

Constructor & Destructor Documentation

◆ PInstrumentDefXMLParser()

PInstrumentDefXMLParser::PInstrumentDefXMLParser ( const QString & fln,
PAdmin * admin )

Constructor. Parses the given instrument definition XML file.

Parameters
flnPath to the instrument definition XML file.
adminPointer to the PAdmin object where parsed data will be stored.

XML Parser class for the instrument definition file(s).

Parameters
filename of the instrument definition file(s).
adminpointer to an admin class instance.

◆ ~PInstrumentDefXMLParser()

virtual PInstrumentDefXMLParser::~PInstrumentDefXMLParser ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ characters()

bool PInstrumentDefXMLParser::characters ( )
private

This routine delivers the content of an XML tag. It fills the content into the load data structure.

◆ endDocument()

bool PInstrumentDefXMLParser::endDocument ( )
private

Called at the end of the XML parse process. It checks if default paths contain system variables, and if so expand them for the further use.

◆ endElement()

bool PInstrumentDefXMLParser::endElement ( )
private

Routine called when the end XML tag is found. It is used to put the filtering tag to 'empty'. It also resets the fFunc flag in case the entry was a theory function.

◆ isValid()

virtual bool PInstrumentDefXMLParser::isValid ( )
inlinevirtual

Checks if the XML parsing was successful.

Returns
true if parsing succeeded, false otherwise.

◆ parse()

bool PInstrumentDefXMLParser::parse ( QIODevice * device)
private

parse the instrument definition xml-file(s).

Parameters
deviceQFile object of the instrument definition xml-file(s).
Returns
true on success, false otherwise

◆ startDocument()

bool PInstrumentDefXMLParser::startDocument ( )
private

Routine called at the beginning of the XML parsing process.

◆ startElement()

bool PInstrumentDefXMLParser::startElement ( )
private

Routine called when a new XML tag is found. Here it is used to set a tag for filtering afterwards the content.

Member Data Documentation

◆ fAdmin

PAdmin* PInstrumentDefXMLParser::fAdmin
private

a pointer to the main administration class object

◆ fInstituteName

QString PInstrumentDefXMLParser::fInstituteName
private

current institute name being parsed

◆ fInstrument

PInstrument* PInstrumentDefXMLParser::fInstrument
private

current instrument object being built

◆ fKeyWord

EKeyWords PInstrumentDefXMLParser::fKeyWord
private

key word tag to know how to handle the content

◆ fSetup

PSetup* PInstrumentDefXMLParser::fSetup
private

current setup object being built

◆ fValid

bool PInstrumentDefXMLParser::fValid
private

flag showing if XML read has been successful

◆ fXml

QXmlStreamReader PInstrumentDefXMLParser::fXml
private

xml stream reader object


The documentation for this class was generated from the following files: