Commit 79fd3464 authored by Pavel Vainerman's avatar Pavel Vainerman

(Config): minor fixes in IOConfig reader

parent f5c264be
......@@ -537,9 +537,7 @@ namespace uniset
else
{
dinfo << "(smemory): init from configure: " << conf->getConfFileName() << endl;
UniXML::iterator it(conf->getXMLSensorsSection());
it.goChildren();
ioconf = make_shared<IOConfig_XML>(conf->getConfXML(), conf, it);
ioconf = make_shared<IOConfig_XML>(conf->getConfXML(), conf, conf->getXMLSensorsSection());
}
uniset::ObjectId ID = conf->getControllerID(conf->getArgParam("--smemory-id", "SharedMemory"));
......
......@@ -51,7 +51,7 @@ namespace uniset
/*!
* \param xml - xml формата uniset-project
* \param conf - конфигурация
* \param root - узел с датчиками (если не задан, ищется "sensors")
* \param root - узел со списком датчиков (если не задан, ищется "sensors")
*/
IOConfig_XML( const std::shared_ptr<UniXML>& _xml, const std::shared_ptr<Configuration>& conf, xmlNode* root = nullptr );
......
......@@ -55,26 +55,25 @@ namespace uniset
IOController::IOStateList lst;
if( !root )
{
root = uxml->findNode( uxml->getFirstNode(), "sensors");
UniXML::iterator it(root);
it.goChildren();
root = it.getCurrent();
}
if( !root )
return lst;
if( root )
{
lst = read_list(root);
// только после чтения всех датчиков и формирования списка IOList
// можно инициализировать списки зависимостей
init_depends_signals(lst);
UniXML::iterator it(root);
xmlNode* tnode = uxml->findNode(uxml->getFirstNode(), "thresholds");
if( !it.goChildren() )
return lst;
if( tnode )
init_thresholds(tnode, lst);
}
lst = read_list(it);
// только после чтения всех датчиков и формирования списка IOList
// можно инициализировать списки зависимостей
init_depends_signals(lst);
xmlNode* tnode = uxml->findNode(uxml->getFirstNode(), "thresholds");
if( tnode )
init_thresholds(tnode, lst);
return lst;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment