diff --git a/include/PropertyDescription.h b/include/PropertyDescription.h index 10af552d89bab805568342da78139c4c6a31f277..0524e1ef88013b3ed610341ea595cd5abaec182e 100644 --- a/include/PropertyDescription.h +++ b/include/PropertyDescription.h @@ -38,6 +38,10 @@ namespace ChimeraTK{ virtual const std::type_info& type() const{ return typeid(PropertyDescription); } + virtual void print(std::ostream & os = std::cout) const{ + os << location << " / " << name + << std::endl; + } }; // Combines property attributes and the base description @@ -58,6 +62,10 @@ namespace ChimeraTK{ virtual const std::type_info& type() const override{ return typeid(AutoPropertyDescription); } + virtual void print(std::ostream & os = std::cout) const{ + os << source << " -> " << location << " / " << name + << std::endl; + } }; struct ArrayDescription: public AutoPropertyDescription{ @@ -106,6 +114,12 @@ namespace ChimeraTK{ virtual const std::type_info& type() const{ return typeid(SpectrumDescription); } + virtual void print(std::ostream & os = std::cout) const{ + os << source << " -> " << location << " / " << name + << " (startSource = " << startSource + << ", incrementSource = " << incrementSource <<")" + << std::endl; + } }; // struct SpectrumDescription: diff --git a/src/VariableMapper.cc b/src/VariableMapper.cc index 73323025a70b5322821537eee75ea687eaa667da..1dd91f080e776028d196f0d43c350170e35612fd 100644 --- a/src/VariableMapper.cc +++ b/src/VariableMapper.cc @@ -342,14 +342,11 @@ namespace ChimeraTK{ /// printing the map is useful for debugging void VariableMapper::print(std::ostream & os) const { + os << "====== VariableMapper =====" << std::endl; for (auto & description : _descriptions ){ - // FIXME: commenting out the history already shows that there is something wrong - // each description needs << overloaded. - os << description->location << " / " << description->name - // << " hasHistory:" << propertyDescription.hasHistory - // << " isWriteable:" << propertyDescription.isWriteable - << std::endl; + description->print(os); } + os << "======= Mapping End =======" << std::endl; } bool VariableMapper::evaluateBool(std::string txt){ diff --git a/src/eq_create.cc b/src/eq_create.cc index fd623e6eeeb4e50d7a1038c5e72ab4f03848a345..50ec87565aae70cf63a2fe332903947433610cc1 100644 --- a/src/eq_create.cc +++ b/src/eq_create.cc @@ -32,7 +32,7 @@ void eq_init_prolog() { std::cerr << "WARNIUNG: No XML file for the Doocs variable config found. Trying direct import." << std::endl; ChimeraTK::VariableMapper::getInstance().directImport(pvNames); } - std::cout << "here is the mapping:" << std::endl; + // print the mapping for debug purposes ChimeraTK::VariableMapper::getInstance().print(); // activate the advanced archiver to have histories