Skip to content
Snippets Groups Projects
Commit 6e01279e authored by Martin Killenberg's avatar Martin Killenberg
Browse files

IFFF: added processIfff and IfffDescription. Still not working becasue it's not in the factory yet

parent 5b54aa11
No related branches found
No related tags found
No related merge requests found
......@@ -107,19 +107,6 @@ namespace ChimeraTK {
}
};
// struct SpectrumDescription:
// public PropertyDescription, public PropertyAttributes{
// float xStart;
// float xIncrement;
// ChimeraTK::RegisterPath mainSource;
// ChimeraTK::RegisterPath xStartSource;
// ChimeraTK::RegisterPath xIncrementSource;
// SpectrumDescription(float start_=0.0, float increment_=1.0)
// : start(start_), increment(increment_){}
// bool operator==(SpectrumDescription const & other) const{
// return start==other.start && increment==other.increment;
// }
// };
/********************************************************************************************************************/
struct XyDescription : public PropertyDescription, public PropertyAttributes {
......@@ -149,6 +136,26 @@ namespace ChimeraTK {
/********************************************************************************************************************/
struct IfffDescription : public PropertyDescription, public PropertyAttributes {
ChimeraTK::RegisterPath i1Source;
ChimeraTK::RegisterPath f1Source, f2Source, f3Source;
IfffDescription(ChimeraTK::RegisterPath const& i1Source_ = "", ChimeraTK::RegisterPath const& f1Source_ = "",
ChimeraTK::RegisterPath const& f2Source_ = "", ChimeraTK::RegisterPath const& f3Source_ = "",
std::string const& location_ = "", std::string const& name_ = "")
: PropertyDescription(location_, name_), i1Source(i1Source_), f1Source(f1Source_), f2Source(f2Source_),
f3Source(f3Source_) {}
const std::type_info& type() const override { return typeid(IfffDescription); }
void print(std::ostream& os = std::cout) const override {
os << "i1: " << i1Source << ", f1: " << f1Source << ", f2: " << f2Source << ", f3: " << f3Source << " -> "
<< location << " / " << name << std::endl;
}
};
/********************************************************************************************************************/
// This is the per location information which are used as default for the
// properties in this location
struct LocationInfo : public PropertyAttributes {
......
......@@ -67,6 +67,7 @@ namespace ChimeraTK {
void processNode(xmlpp::Node const* propertyNode, std::string locationName);
void processSpectrumNode(xmlpp::Node const* node, std::string locationName);
void processXyNode(xmlpp::Node const* node, std::string& locationName);
void processIfffNode(xmlpp::Node const* node, std::string& locationName);
void processImportNode(xmlpp::Node const* importNode, std::string importLocationName = std::string());
void processCode(xmlpp::Element const* location, std::string locationName);
......
......@@ -77,6 +77,9 @@ namespace ChimeraTK {
else if(node->get_name() == "D_xy") {
processXyNode(node, locationName);
}
else if(node->get_name() == "D_ifff") {
processIfffNode(node, locationName);
}
else {
throw std::invalid_argument(std::string("Error parsing xml file in location ") + locationName +
": Unknown node '" + node->get_name() + "'");
......@@ -315,6 +318,28 @@ namespace ChimeraTK {
addDescription(xyDescription, {xAbsoluteSource, yAbsoluteSource});
}
/********************************************************************************************************************/
void VariableMapper::processIfffNode(xmlpp::Node const* node, std::string& locationName) {
auto ifffXml = asXmlElement(node);
auto i1Source = getAttributeValue(ifffXml, "i1_source");
auto f1Source = getAttributeValue(ifffXml, "f1_source");
auto f2Source = getAttributeValue(ifffXml, "f2_source");
auto f3Source = getAttributeValue(ifffXml, "f3_source");
auto name = getAttributeValue(ifffXml, "name");
std::list<std::string> absoluteSources;
absoluteSources.push_back(getAbsoluteSource(i1Source, locationName));
absoluteSources.push_back(getAbsoluteSource(f1Source, locationName));
absoluteSources.push_back(getAbsoluteSource(f2Source, locationName));
absoluteSources.push_back(getAbsoluteSource(f3Source, locationName));
auto ifffDescription =
std::make_shared<IfffDescription>(i1Source, f1Source, f2Source, f3Source, locationName, name);
processHistoryAndWritableAttributes(ifffDescription, ifffXml, locationName);
addDescription(ifffDescription, absoluteSources);
}
/********************************************************************************************************************/
......@@ -394,8 +419,7 @@ namespace ChimeraTK {
autoPropertyDescription->hasHistory = getHasHistoryDefault(locationName);
autoPropertyDescription->isWriteable = getIsWriteableDefault(locationName);
autoPropertyDescription->macroPulseNumberSource = getMacroPusleNumberSourceDefault(locationName);
autoPropertyDescription->dataMatching =
getDataMatchingDefault(locationName);
autoPropertyDescription->dataMatching = getDataMatchingDefault(locationName);
addDescription(autoPropertyDescription, {processVariable});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment