Commit 21468239 authored by Pavel Vainerman's avatar Pavel Vainerman

Вернул по ошибке удалённые изменения..

parent 89f4a590
......@@ -3,7 +3,7 @@
Name: libuniset
Version: 1.0
Release: alt43
Release: alt44
Summary: UniSet - library for building distributed industrial control systems
License: GPL
Group: Development/C++
......@@ -207,6 +207,10 @@ rm -f %buildroot%_libdir/*.la
%changelog
* Mon Oct 03 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt44
- add nodes filter for UNet2
- minor optimization
* Thu Jul 14 2011 Pavel Vainerman <pv@altlinux.ru> 1.0-alt42
- fixed bug in uniset-codegen
......
......@@ -687,7 +687,7 @@ void IOControl::readConfiguration()
for( ;it.getCurrent(); it.goNext() )
{
if( check_item(it) )
if( UniSetTypes::check_filter(it,s_field,s_fvalue) )
initIOItem(it);
}
......@@ -696,29 +696,12 @@ void IOControl::readConfiguration()
// ------------------------------------------------------------------------------------------
bool IOControl::readItem( UniXML& xml, UniXML_iterator& it, xmlNode* sec )
{
if( check_item(it) )
if( UniSetTypes::check_filter(it,s_field,s_fvalue) )
initIOItem(it);
return true;
}
// ------------------------------------------------------------------------------------------
bool IOControl::check_item( UniXML_iterator& it )
{
if( s_field.empty() )
return true;
// просто проверка на не пустой field
if( s_fvalue.empty() && it.getProp(s_field).empty() )
return false;
// просто проверка что field = value
if( !s_fvalue.empty() && it.getProp(s_field) != s_fvalue )
return false;
return true;
}
// ------------------------------------------------------------------------------------------
bool IOControl::initIOItem( UniXML_iterator& it )
{
IOInfo inf;
......
......@@ -293,7 +293,6 @@ class IOControl:
// чтение файла конфигурации
void readConfiguration();
bool initIOItem( UniXML_iterator& it );
bool check_item( UniXML_iterator& it );
bool readItem( UniXML& xml, UniXML_iterator& it, xmlNode* sec );
void buildCardsList();
......
......@@ -1284,33 +1284,16 @@ void MBTCPMaster::readConfiguration()
for( ;it.getCurrent(); it.goNext() )
{
if( check_item(it) )
if( UniSetTypes::check_filter(it,s_field,s_fvalue) )
initItem(it);
}
// readconf_ok = true;
}
// ------------------------------------------------------------------------------------------
bool MBTCPMaster::check_item( UniXML_iterator& it )
{
if( s_field.empty() )
return true;
// просто проверка на не пустой field
if( s_fvalue.empty() && it.getProp(s_field).empty() )
return false;
// просто проверка что field = value
if( !s_fvalue.empty() && it.getProp(s_field)!=s_fvalue )
return false;
return true;
}
// ------------------------------------------------------------------------------------------
bool MBTCPMaster::readItem( UniXML& xml, UniXML_iterator& it, xmlNode* sec )
{
if( check_item(it) )
if( UniSetTypes::check_filter(it,s_field,s_fvalue) )
initItem(it);
return true;
}
......
......@@ -407,7 +407,6 @@ class MBTCPMaster:
void rtuQueryOptimization( RTUDeviceMap& m );
void readConfiguration();
bool check_item( UniXML_iterator& it );
bool checkProcActive();
void setProcActive( bool st );
......
......@@ -687,33 +687,16 @@ void MBSlave::readConfiguration()
for( ;it.getCurrent(); it.goNext() )
{
if( check_item(it) )
if( UniSetTypes::check_filter(it,s_field,s_fvalue) )
initItem(it);
}
// readconf_ok = true;
}
// ------------------------------------------------------------------------------------------
bool MBSlave::check_item( UniXML_iterator& it )
{
if( s_field.empty() )
return true;
// просто проверка на не пустой field
if( s_fvalue.empty() && it.getProp(s_field).empty() )
return false;
// просто проверка что field = value
if( !s_fvalue.empty() && it.getProp(s_field)!=s_fvalue )
return false;
return true;
}
// ------------------------------------------------------------------------------------------
bool MBSlave::readItem( UniXML& xml, UniXML_iterator& it, xmlNode* sec )
{
if( check_item(it) )
if( UniSetTypes::check_filter(it,s_field,s_fvalue) )
initItem(it);
return true;
}
......
......@@ -963,33 +963,16 @@ void RTUExchange::readConfiguration()
for( ;it.getCurrent(); it.goNext() )
{
if( check_item(it) )
if( UniSetTypes::check_filter(it,s_field,s_fvalue) )
initItem(it);
}
// readconf_ok = true;
}
// ------------------------------------------------------------------------------------------
bool RTUExchange::check_item( UniXML_iterator& it )
{
if( s_field.empty() )
return true;
// просто проверка на не пустой field
if( s_fvalue.empty() && it.getProp(s_field).empty() )
return false;
// просто проверка что field = value
if( !s_fvalue.empty() && it.getProp(s_field)!=s_fvalue )
return false;
return true;
}
// ------------------------------------------------------------------------------------------
bool RTUExchange::readItem( UniXML& xml, UniXML_iterator& it, xmlNode* sec )
{
if( check_item(it) )
if( UniSetTypes::check_filter(it,s_field,s_fvalue) )
initItem(it);
return true;
}
......
......@@ -233,7 +233,6 @@ class RTUExchange:
void rtuQueryOptimization( RTUDeviceMap& m );
void readConfiguration();
bool check_item( UniXML_iterator& it );
private:
RTUExchange();
......
......@@ -67,8 +67,8 @@ sender(0)
continue;
}
// проверяем заданы ли фильтры для подсетей
if( !n_field.empty() && !check_filter(n_it,n_field,n_fvalue) )
// проверяем фильтры для подсетей
if( !UniSetTypes::check_filter(n_it,n_field,n_fvalue) )
continue;
// Если указано поле unet_broadcast_ip непосредственно у узла - берём его
......
......@@ -236,30 +236,14 @@ void UNetSender::readConfiguration()
for( ;it.getCurrent(); it.goNext() )
{
if( check_item(it) )
if( check_filter(it,s_field,s_fvalue) )
initItem(it);
}
}
// ------------------------------------------------------------------------------------------
bool UNetSender::check_item( UniXML_iterator& it )
{
if( s_field.empty() )
return true;
// просто проверка на не пустой field
if( s_fvalue.empty() && it.getProp(s_field).empty() )
return false;
// просто проверка что field = value
if( !s_fvalue.empty() && it.getProp(s_field)!=s_fvalue )
return false;
return true;
}
// ------------------------------------------------------------------------------------------
bool UNetSender::readItem( UniXML& xml, UniXML_iterator& it, xmlNode* sec )
{
if( check_item(it) )
if( UniSetTypes::check_filter(it,s_field,s_fvalue) )
initItem(it);
return true;
}
......
......@@ -76,7 +76,6 @@ class UNetSender
bool readItem( UniXML& xml, UniXML_iterator& it, xmlNode* sec );
void readConfiguration();
bool check_item( UniXML_iterator& it );
private:
UNetSender();
......
......@@ -425,33 +425,16 @@ void UniExchange::readConfiguration()
for( ;it.getCurrent(); it.goNext() )
{
if( check_item(it) )
if( UniSetTypes::check_filter(it,s_field,s_fvalue) )
initItem(it);
}
// readconf_ok = true;
}
// ------------------------------------------------------------------------------------------
bool UniExchange::check_item( UniXML_iterator& it )
{
if( s_field.empty() )
return true;
// просто проверка на не пустой field
if( s_fvalue.empty() && it.getProp(s_field).empty() )
return false;
// просто проверка что field = value
if( !s_fvalue.empty() && it.getProp(s_field)!=s_fvalue )
return false;
return true;
}
// ------------------------------------------------------------------------------------------
bool UniExchange::readItem( UniXML& xml, UniXML_iterator& it, xmlNode* sec )
{
if( check_item(it) )
if( UniSetTypes::check_filter(it,s_field,s_fvalue) )
initItem(it);
return true;
}
......
......@@ -102,7 +102,6 @@ class UniExchange:
NetNodeList nlst;
void readConfiguration();
bool check_item( UniXML_iterator& it );
bool readItem( UniXML& xml, UniXML_iterator& it, xmlNode* sec );
bool initItem( UniXML_iterator& it );
void updateLocalData();
......
......@@ -479,18 +479,7 @@ bool NCRestorer_XML::getThresholdInfo( UniXML& xml,xmlNode* node,
// ------------------------------------------------------------------------------------------
bool NCRestorer_XML::check_thresholds_item( UniXML_iterator& it )
{
if( t_filterField.empty() )
return true;
// просто проверка на не пустой field
if( t_filterValue.empty() && it.getProp(t_filterField).empty() )
return false;
// просто проверка что field = value
if( !t_filterValue.empty() && it.getProp(t_filterField)!=t_filterValue )
return false;
return true;
return UniSetTypes::check_filter(it,t_filterField,t_filterValue);
}
// ------------------------------------------------------------------------------------------
void NCRestorer_XML::setReadThresholdItem( ReaderSlot sl )
......@@ -696,18 +685,7 @@ void NCRestorer_XML::build_depends( UniXML& xml, xmlNode* node, IONotifyControll
bool NCRestorer_XML::check_depend_item( UniXML_iterator& it )
{
if( d_filterField.empty() )
return true;
// просто проверка на не пустой field
if( d_filterValue.empty() && it.getProp(d_filterField).empty() )
return false;
// просто проверка что field = value
if( !d_filterValue.empty() && it.getProp(d_filterField)!=d_filterValue )
return false;
return true;
return UniSetTypes::check_filter(it,d_filterField,d_filterValue);
}
// ------------------------------------------------------------------------------------------
bool NCRestorer_XML::getDependsInfo( UniXML& xml, xmlNode* it, IOController::DependsInfo& di )
......
......@@ -171,34 +171,12 @@ bool Restorer_XML::old_getConsumerInfo( UniXML_iterator& it,
// -----------------------------------------------------------------------------
bool Restorer_XML::check_list_item( UniXML_iterator& it )
{
if( i_filterField.empty() )
return true;
// просто проверка на не пустой field
if( i_filterValue.empty() && it.getProp(i_filterField).empty() )
return false;
// просто проверка что field = value
if( !i_filterValue.empty() && it.getProp(i_filterField)!=i_filterValue )
return false;
return true;
return UniSetTypes::check_filter(it,i_filterField,i_filterValue);
}
// -----------------------------------------------------------------------------
bool Restorer_XML::check_consumer_item( UniXML_iterator& it )
{
if( c_filterField.empty() )
return true;
// просто проверка на не пустой field
if( c_filterValue.empty() && it.getProp(c_filterField).empty() )
return false;
// просто проверка что field = value
if( !c_filterValue.empty() && it.getProp(c_filterField)!=c_filterValue )
return false;
return true;
return UniSetTypes::check_filter(it,c_filterField,c_filterValue);
}
// -----------------------------------------------------------------------------
xmlNode* Restorer_XML::find_node( UniXML& xml, xmlNode* root,
......
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