4 #include <boost/lambda/lambda.hpp>
6 #include <rdet/RAntennaTypeXMLManager.h>
7 #include <utl/ErrorLogger.h>
8 #include <utl/TabulatedFunction.h>
9 #include <utl/TabulatedFunctionComplexLgAmpPhase.h>
10 #include <rdet/RDetector.h>
11 #include <rdet/RManagerRegister.h>
17 using namespace xercesc;
18 using namespace boost::lambda;
32 const string& antennaType,
33 const string& antennaProp,
37 Branch antennaPropB = FindAntennaTypeProperty(antennaType, antennaProp);
38 for ( ; antennaPropB; antennaPropB = antennaPropB.
GetNextSibling())
39 if (antennaPropB.
GetAttributes().find(propIndex.begin()->first)->
second == propIndex.begin()->second)
43 err <<
"Cannot find antennaProp '" << antennaProp
44 <<
"' with index '" << propIndex.begin()->second
45 <<
"' while parsing for antennaType '" << antennaType <<
"' in XML.";
53 const string& antennaType,
54 const string& antennaProp)
57 Branch antennaB = FindAntennaType(antennaType);
61 for ( ; antennaPropB; antennaPropB = antennaPropB.
GetNextSibling())
62 if (antennaPropB.
GetName() == antennaProp)
65 err <<
"Cannot find " + antennaProp +
" while parsing for antennaType "+ antennaType +
" in XML." ;
72 Branch RAntennaTypeXMLManager::FindAntennaType(
73 const string& antennaType)
78 if (antennaB.
GetName() ==
"Antenna" &&
83 err <<
"Cannot find specifications for '" + antennaType +
"' while XML parsing.\n"
84 <<
"You may want to use the RAntennaTypeListAll.xml config to include additional antenna models.";
93 RAntennaTypeXMLManager::InternalGetData(T& returnData,
94 const string& antennaProp,
95 const string& antennaType,
96 const IndexMap& propIndex)
104 if (antennaProp !=
"frequency" &&
105 antennaProp !=
"theta" &&
106 antennaProp !=
"phi" &&
107 antennaProp !=
"MeanTransfer" &&
108 antennaProp !=
"EAHTheta_amp" &&
109 antennaProp !=
"EAHTheta_phase" &&
110 antennaProp !=
"EAHPhi_amp" &&
111 antennaProp !=
"EAHPhi_phase" ) {
115 switch(propIndex.size()) {
117 dataBranch = FindAntennaTypeProperty(antennaType, antennaProp);
120 dataBranch = FindAntennaTypePropertyIndex(antennaType, antennaProp, propIndex);
123 if (IsReportingErrors()) {
124 INFO(
string(
"Searching for more than 1 property index not supported; ") +
125 QueryInfoMessage(antennaProp, antennaType, propIndex));
130 dataBranch.
GetData(returnData);
#define INFO(message)
Macro for logging informational messages.
void Init()
Initialise the registry.
AttributeMap GetAttributes() const
Get a map<string, string> containing all the attributes of this Branch.
Branch GetNextSibling() const
Get next sibling of this branch.
#define REGISTER_R_MANAGER(_name_, _Type_)
Class representing a document branch.
utl::Branch FindAntennaTypeProperty(const std::string &antennaType, const std::string &antennaProp) const
void GetData(bool &b) const
Overloads of the GetData member template function.
std::string GetName() const
function to get the Branch name
utl::Branch FindAntennaTypePropertyIndex(const std::string &antennaType, const std::string &antennaProp, const IndexMap &propIndex) const
Manager for RD description in XML "AntennaType" files.
std::map< std::string, std::string > IndexMap
Branch GetFirstChild() const
Get first child of this Branch.
#define ERROR(message)
Macro for logging error messages.
Status
Specifies success or (eventually) various possible failure modes.