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
6ded0d3f
Commit
6ded0d3f
authored
Jun 10, 2018
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Plain Diff
backported to p8 as 2.7-alt10.M80P.11 (with rpmbph script)
parents
ab8f5513
2d719114
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
41 additions
and
18 deletions
+41
-18
libuniset2.spec
conf/libuniset2.spec
+11
-3
BackendOpenTSDB.cc
extensions/Backend-OpenTSDB/BackendOpenTSDB.cc
+1
-2
DBServer_PostgreSQL.cc
extensions/DBServer-PostgreSQL/DBServer_PostgreSQL.cc
+8
-1
DBServer_PostgreSQL.h
extensions/DBServer-PostgreSQL/DBServer_PostgreSQL.h
+4
-0
SharedMemory.cc
extensions/SharedMemory/SharedMemory.cc
+1
-3
IOConfig_XML.h
include/IOConfig_XML.h
+1
-1
UHelpers.h
include/UHelpers.h
+1
-0
IOConfig_XML.cc
src/Processes/IOConfig_XML.cc
+7
-8
UniXML.cc
src/Various/UniXML.cc
+3
-0
test_unixml.cc
tests/test_unixml.cc
+4
-0
No files found.
conf/libuniset2.spec
View file @
6ded0d3f
...
...
@@ -14,14 +14,19 @@
%def_disable netdata
%def_enable api
%def_enable logdb
%def_enable com485f
%def_enable opentsdb
%ifarch %ix86
%def_enable com485f
%else
%def_disable com485f
%endif
%define oname uniset2
Name: libuniset2
Version: 2.7
Release: alt
9.M80P.10
Release: alt
10.M80P.11
Summary: UniSet - library for building distributed industrial control systems
License: LGPL
...
...
@@ -542,9 +547,12 @@ rm -f %buildroot%_libdir/*.la
# history of current unpublished changes
%changelog
*
Thu May 24 2018 Pavel Vainerman <pv@altlinux.ru> 2.7-alt9.M80P.10
*
Sun Jun 10 2018 Pavel Vainerman <pv@altlinux.ru> 2.7-alt10.M80P.11
- backport to ALTLinux p8 (by rpmbph script)
* Sat Jun 09 2018 Pavel Vainerman <pv@altlinux.ru> 2.7-alt11
- PostgreSQL: extended the interface
* Thu May 24 2018 Pavel Vainerman <pv@altlinux.ru> 2.7-alt10
- fix pack opentsdb backend
...
...
extensions/Backend-OpenTSDB/BackendOpenTSDB.cc
View file @
6ded0d3f
...
...
@@ -162,8 +162,7 @@ void BackendOpenTSDB::help_print( int argc, const char* const* argv )
cout
<<
" set-levels ... "
<<
endl
;
cout
<<
" logfile filanme "
<<
endl
;
cout
<<
" no-debug "
<<
endl
;
cout
<<
" Base oprtions: "
<<
endl
;
// cout << UObject_SK::help() << endl;
cout
<<
endl
;
cout
<<
" LogServer: "
<<
endl
;
cout
<<
"--prefix-run-logserver - run logserver. Default: localhost:id"
<<
endl
;
cout
<<
"--prefix-logserver-host ip - listen ip. Default: localhost"
<<
endl
;
...
...
extensions/DBServer-PostgreSQL/DBServer_PostgreSQL.cc
View file @
6ded0d3f
...
...
@@ -222,7 +222,7 @@ void DBServer_PostgreSQL::flushInsertBuffer()
dbinfo
<<
myname
<<
"(flushInsertBuffer): write insert buffer["
<<
ibufSize
<<
"] to DB.."
<<
endl
;
if
(
!
db
->
copy
(
"main_history"
,
tblcols
,
ibuf
)
)
if
(
!
writeBufferToDB
(
"main_history"
,
tblcols
,
ibuf
)
)
{
dbcrit
<<
myname
<<
"(flushInsertBuffer): error: "
<<
db
->
error
()
<<
endl
;
}
...
...
@@ -233,6 +233,13 @@ void DBServer_PostgreSQL::flushInsertBuffer()
}
}
//--------------------------------------------------------------------------------------------
bool
DBServer_PostgreSQL
::
writeBufferToDB
(
const
std
::
string
&
tableName
,
const
std
::
vector
<
std
::
string
>&
colNames
,
DBServer_PostgreSQL
::
InsertBuffer
&
wbuf
)
{
return
db
->
copy
(
tableName
,
colNames
,
wbuf
);
}
//--------------------------------------------------------------------------------------------
void
DBServer_PostgreSQL
::
sensorInfo
(
const
uniset
::
SensorMessage
*
si
)
{
try
...
...
extensions/DBServer-PostgreSQL/DBServer_PostgreSQL.h
View file @
6ded0d3f
...
...
@@ -129,6 +129,10 @@ namespace uniset
size_t
ibufMaxSize
=
{
2000
};
timeout_t
ibufSyncTimeout
=
{
15000
};
void
flushInsertBuffer
();
virtual
bool
writeBufferToDB
(
const
std
::
string
&
table
,
const
std
::
vector
<
std
::
string
>&
colname
,
InsertBuffer
&
ibuf
);
float
ibufOverflowCleanFactor
=
{
0
.
5
};
// коэфициент {0...1} чистки буфера при переполнении
private
:
...
...
extensions/SharedMemory/SharedMemory.cc
View file @
6ded0d3f
...
...
@@ -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"
));
...
...
include/IOConfig_XML.h
View file @
6ded0d3f
...
...
@@ -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
);
...
...
include/UHelpers.h
View file @
6ded0d3f
...
...
@@ -18,6 +18,7 @@
#define UHelpers_H_
// --------------------------------------------------------------------------
#include "UniSetTypes.h"
#include "Exceptions.h"
#include "Configuration.h"
// --------------------------------------------------------------------------
namespace
uniset
...
...
src/Processes/IOConfig_XML.cc
View file @
6ded0d3f
...
...
@@ -55,17 +55,17 @@ namespace uniset
IOController
::
IOStateList
lst
;
if
(
!
root
)
{
root
=
uxml
->
findNode
(
uxml
->
getFirstNode
(),
"sensors"
);
if
(
!
root
)
return
lst
;
UniXML
::
iterator
it
(
root
);
it
.
goChildren
();
root
=
it
.
getCurrent
();
}
if
(
root
)
{
lst
=
read_list
(
root
);
if
(
!
it
.
goChildren
()
)
return
lst
;
lst
=
read_list
(
it
);
// только после чтения всех датчиков и формирования списка IOList
// можно инициализировать списки зависимостей
init_depends_signals
(
lst
);
...
...
@@ -74,7 +74,6 @@ namespace uniset
if
(
tnode
)
init_thresholds
(
tnode
,
lst
);
}
return
lst
;
}
...
...
src/Various/UniXML.cc
View file @
6ded0d3f
...
...
@@ -598,6 +598,9 @@ bool UniXML_iterator::findName( const std::string& nodename, const std::string&
{
fnode
=
this
->
findX
(
fnode
,
nodename
,
deepfind
);
if
(
!
fnode
)
return
false
;
if
(
searchname
==
UniXML
::
getProp
(
fnode
,
"name"
)
)
{
curNode
=
fnode
;
...
...
tests/test_unixml.cc
View file @
6ded0d3f
...
...
@@ -97,6 +97,10 @@ TEST_CASE("UniXML::iterator", "[unixml][iterator][basic]" )
--
it
;
CHECK
(
it
.
getName
()
==
"UserData"
);
UniXML
::
iterator
it_bad
=
uxml
.
begin
();
REQUIRE_FALSE
(
it_bad
.
findName
(
"UnknownNode"
,
"NOTFOUND"
)
);
REQUIRE_FALSE
(
!
it_bad
);
it
=
uxml
.
begin
();
CHECK
(
it
.
findName
(
"TestNode"
,
"TestNode1"
)
!=
0
);
it
=
uxml
.
begin
();
...
...
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