Commit 61828f30 authored by Pavel Vainerman's avatar Pavel Vainerman

Исправил ошибку в предыдущем коммите и в функции getIOType(string)

parent e2cbe9cd
......@@ -3,7 +3,7 @@
Name: libuniset
Version: 1.0
Release: alt1
Release: alt2
Summary: UniSet - library for building distributed industrial control systems
License: GPL
Group: Development/C++
......@@ -187,6 +187,10 @@ rm -f %buildroot%_libdir/*.la
%exclude %_pkgconfigdir/libUniSet.pc
%changelog
* Mon Feb 14 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt2
- minor fixes
- new version ModbusTCPMaster
* Wed Feb 09 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt1
- fixed bug in VERSION (bad pc-files)
......
......@@ -1049,6 +1049,15 @@ UniversalIO::IOTypes Configuration::getIOType( UniSetTypes::ObjectId id )
// -------------------------------------------------------------------------
UniversalIO::IOTypes Configuration::getIOType( const std::string name )
{
// Если указано "короткое" имя
// то просто сперва ищём ID, а потом по нему
// iotype
ObjectId id = getSensorID(name);
if( id != DefaultObjectId )
return getIOType(id);
// Пробуем искать, считая, что задано mapname
// ("RootSection/Sensors/name")
const ObjectInfo* i = oind->getObjectInfo(name);
if( i && (xmlNode*)(i->data) )
{
......
......@@ -456,12 +456,12 @@ bool NCRestorer_XML::getThresholdInfo( UniXML& xml,xmlNode* node,
}
else
{
UniversalIO::IOTypes iotype = conf->getIOType(sid_name);
UniversalIO::IOTypes iotype = conf->getIOType(ti.sid);
// Пока что IONotifyController поддерживает работу только с 'DI'.
if( iotype != UniversalIO::DigitalInput )
{
unideb[Debug::CRIT] << "(NCRestorer_XML:getThresholdInfo): "
<< " Bad iotype for " << sid_name << ". iotype must be 'DI'!" << endl;
<< " Bad iotype(" << iotype << ") for " << sid_name << ". iotype must be 'DI'!" << endl;
return false;
}
......
......@@ -31,9 +31,12 @@ int main(int argc, const char **argv)
cout << "**** check getMapName: " << ( mn.empty() ? "FAILED" : "OK" ) << endl;
UniversalIO::IOTypes t1=conf->getIOType(1);
cout << "**** getIOType for " << mn << endl;
cout << "**** check getIOType(id): (" << t1 << ") " << ( t1 == UniversalIO::UnknownIOType ? "FAILED" : "OK" ) << endl;
UniversalIO::IOTypes t2=conf->getIOType(mn);
cout << "**** check getIOType(name): (" << t2 << ") " << ( t2 == UniversalIO::UnknownIOType ? "FAILED" : "OK" ) << endl;
UniversalIO::IOTypes t3=conf->getIOType("Input1_S");
cout << "**** check getIOType(name): for short name 'Input1_S': (" << t3 << ") " << ( t3 == UniversalIO::UnknownIOType ? "FAILED" : "OK" ) << endl;
return 0;
}
......
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