From 6ec574af9d9f2754748109e0e6d18a8dd68e304e Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 26 Aug 2024 11:31:04 +0000 Subject: [PATCH] Fix TableRange parsing --- src/Info/ParamTable.cc | 2 +- src/Info/ParamTableNode.cc | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/Info/ParamTable.cc b/src/Info/ParamTable.cc index c765bc9..b11d600 100644 --- a/src/Info/ParamTable.cc +++ b/src/Info/ParamTable.cc @@ -25,7 +25,7 @@ namespace AMDA { LoggerPtr ParamTable::_logger(Logger::getLogger("AMDA-Kernel.ParamTable")); ParamTable::ParamTable(const char *paramId, int dim) : _paramId(paramId), _dim(dim), - _tableName(""), _tableUnits(""), _variable("false") { + _tableName(""), _tableUnits(""), _variable(false) { } ParamTable::~ParamTable() { diff --git a/src/Info/ParamTableNode.cc b/src/Info/ParamTableNode.cc index f771cd8..5a64b96 100644 --- a/src/Info/ParamTableNode.cc +++ b/src/Info/ParamTableNode.cc @@ -544,8 +544,39 @@ namespace AMDA { std::string paramId = pParamInfo->getId(); + //Get name + xmlChar* value = xmlGetProp(pNode, (const xmlChar *) "name"); + std::string name; + if (value != NULL) { + name = (char *) value; + xmlFree(value); + } + + //Get units + value = xmlGetProp(pNode, (const xmlChar *) "units"); + std::string units; + if (value != NULL) { + units = (char *) value; + xmlFree(value); + } + + //Get variable + value = xmlGetProp(pNode, (const xmlChar *) "variable"); + bool variable = false; + if (value != NULL) { + variable = (strcmp((char*) value, "true") == 0); + xmlFree(value); + } + //Get fullVariable + value = xmlGetProp(pNode, (const xmlChar *) "fullVariable"); + bool fullVariable = false; + if (value != NULL) { + fullVariable = (strcmp((char*) value, "true") == 0); + xmlFree(value); + } + //Get min - xmlChar* value = xmlGetProp(pNode, (const xmlChar *) "min"); + value = xmlGetProp(pNode, (const xmlChar *) "min"); double min = 0.; if (value != NULL) { min = atof((char *) value); @@ -589,6 +620,10 @@ namespace AMDA { } boost::shared_ptr table(new RangeTable(paramId.c_str(), dim, min, max, step)); + table->setName(name); + table->setUnits(units); + table->setIsVariable(variable); + table->setIsFullVariable(fullVariable); pParamInfo->addTable(dim, table); } -- libgit2 0.21.2