Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
f47ea61b
Commit
f47ea61b
authored
Feb 11, 2011
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(SM): сделал отдельный фильтр на пороги секции <thresholds>
parent
d42fb708
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
6 deletions
+53
-6
SharedMemory.cc
extensions/SharedMemory/SharedMemory.cc
+3
-0
SharedMemory.h
extensions/SharedMemory/SharedMemory.h
+8
-1
NCRestorer.h
include/NCRestorer.h
+8
-3
NCRestorer_XML.cc
src/Various/NCRestorer_XML.cc
+34
-2
No files found.
extensions/SharedMemory/SharedMemory.cc
View file @
f47ea61b
...
...
@@ -39,6 +39,8 @@ SharedMemory::SharedMemory( ObjectId id, string datafile ):
string
c_fvalue
=
conf
->
getArgParam
(
"--c-filter-value"
);
string
d_field
=
conf
->
getArgParam
(
"--d-filter-field"
);
string
d_fvalue
=
conf
->
getArgParam
(
"--d-filter-value"
);
string
t_field
=
conf
->
getArgParam
(
"--t-filter-field"
);
string
t_fvalue
=
conf
->
getArgParam
(
"--t-filter-value"
);
int
lock_msec
=
conf
->
getArgPInt
(
"--lock-value-pause"
,
0
);
if
(
lock_msec
<
0
)
...
...
@@ -56,6 +58,7 @@ SharedMemory::SharedMemory( ObjectId id, string datafile ):
rxml
->
setItemFilter
(
s_field
,
s_fvalue
);
rxml
->
setConsumerFilter
(
c_field
,
c_fvalue
);
rxml
->
setDependsFilter
(
d_field
,
d_fvalue
);
rxml
->
setThresholdsFilter
(
t_field
,
t_fvalue
);
restorer
=
rxml
;
...
...
extensions/SharedMemory/SharedMemory.h
View file @
f47ea61b
...
...
@@ -76,7 +76,14 @@
--d-filter-field - задаёт фильтрующее поле для "зависимостей" (depends)
--d-filter-value - задаёт значение фильтрующего поля. Необязательный параметр.
\endcode
\par Фильтрование порогов (<thresholds>)
\code
--t-filter-field - задаёт фильтрующее поле для "порогов" (thresholds)
--t-filter-value - задаёт значение фильтрующего поля. Необязательный параметр.
\endcode
\note Если поле \b --X-filter-value не указано будут загружены все датчики(заказчики,зависимости)
у которых поле \b --X-filter-field не пустое.
\note Если не указывать параметры \b --X-filter-field - то в SM будут загружен ВЕСЬ список
...
...
include/NCRestorer.h
View file @
f47ea61b
...
...
@@ -20,9 +20,7 @@
/*! \file
* \brief Интерфейс к объекту сохраняющему список заказчиков для NotifyController-ов
* \author Pavel Vainerman
* \version $Id: NCRestorer.h,v 1.17 2008/12/14 21:57:51 vpashka Exp $
* \date $Date: 2008/12/14 21:57:51 $
*/
*/
// --------------------------------------------------------------------------
#ifndef NCRestorer_H_
#define NCRestorer_H_
...
...
@@ -153,6 +151,11 @@ class NCRestorer_XML:
*/
void
setDependsFilter
(
const
std
::
string
filterField
,
const
std
::
string
filterValue
=
""
);
/*! Установить фильтр на чтение списка 'порогов')
\note Функцию необходимо вызывать до вызова buildDependsList(...)
*/
void
setThresholdsFilter
(
const
std
::
string
filterField
,
const
std
::
string
filterValue
=
""
);
bool
setFileName
(
const
std
::
string
&
file
,
bool
create
);
inline
std
::
string
getFileName
(){
return
fname
;
}
...
...
@@ -218,6 +221,8 @@ class NCRestorer_XML:
std
::
string
c_filterValue
;
std
::
string
d_filterField
;
std
::
string
d_filterValue
;
std
::
string
t_filterField
;
std
::
string
t_filterValue
;
std
::
string
fname
;
UniXML
uxml
;
...
...
src/Various/NCRestorer_XML.cc
View file @
f47ea61b
...
...
@@ -34,6 +34,14 @@ using namespace UniversalIO;
using
namespace
UniSetTypes
;
// ------------------------------------------------------------------------------------------
NCRestorer_XML
::
NCRestorer_XML
(
const
string
fname
)
:
s_filterField
(
""
),
s_filterValue
(
""
),
c_filterField
(
""
),
c_filterValue
(
""
),
d_filterField
(
""
),
d_filterValue
(
""
),
t_filterField
(
""
),
t_filterValue
(
""
),
fname
(
fname
)
{
init
(
fname
);
...
...
@@ -42,6 +50,14 @@ fname(fname)
NCRestorer_XML
::
NCRestorer_XML
(
const
string
fname
,
const
std
::
string
f_field
,
const
std
::
string
f_value
)
:
s_filterField
(
f_field
),
s_filterValue
(
f_value
),
c_filterField
(
""
),
c_filterValue
(
""
),
d_filterField
(
""
),
d_filterValue
(
""
),
t_filterField
(
""
),
t_filterValue
(
""
),
fname
(
fname
)
{
init
(
fname
);
...
...
@@ -468,8 +484,18 @@ bool NCRestorer_XML::getThresholdInfo( UniXML& xml,xmlNode* node,
// ------------------------------------------------------------------------------------------
bool
NCRestorer_XML
::
check_thresholds_item
(
UniXML_iterator
&
it
)
{
// формат тот же как и <sensors>
return
check_consumer_item
(
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
;
}
// ------------------------------------------------------------------------------------------
void
NCRestorer_XML
::
setReadThresholdItem
(
ReaderSlot
sl
)
...
...
@@ -488,6 +514,12 @@ void NCRestorer_XML::setDependsFilter( const std::string field, const std::strin
d_filterValue
=
val
;
}
// -----------------------------------------------------------------------------
void
NCRestorer_XML
::
setThresholdsFilter
(
const
std
::
string
field
,
const
std
::
string
val
)
{
t_filterField
=
field
;
t_filterValue
=
val
;
}
// -----------------------------------------------------------------------------
void
NCRestorer_XML
::
setNCReadItem
(
NCReaderSlot
sl
)
{
ncrslot
=
sl
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment