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
c1c70ecd
Commit
c1c70ecd
authored
Feb 11, 2019
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(codegen): added support init from global settings section
parent
07d1c5cd
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
11 deletions
+29
-11
ctl-cpp-common.xsl
Utilities/codegen/ctl-cpp-common.xsl
+0
-0
ctl-cpp-h-alone.xsl
Utilities/codegen/ctl-cpp-h-alone.xsl
+2
-2
ctl-cpp-h.xsl
Utilities/codegen/ctl-cpp-h.xsl
+2
-2
UObject_SK.h
extensions/include/UObject_SK.h
+2
-2
UObject_SK.cc
extensions/lib/UObject_SK.cc
+19
-4
LogReader.cc
src/Log/LogReader.cc
+1
-1
UniXML.cc
src/Various/UniXML.cc
+3
-0
No files found.
Utilities/codegen/ctl-cpp-common.xsl
View file @
c1c70ecd
This diff is collapsed.
Click to expand it.
Utilities/codegen/ctl-cpp-h-alone.xsl
View file @
c1c70ecd
...
...
@@ -61,10 +61,10 @@ class <xsl:value-of select="$CLASSNAME"/>_SK:
{
public:
<xsl:if
test=
"not(normalize-space($OID))=''"
>
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK( uniset::ObjectId id = uniset::uniset_conf()->getObjectID("
<xsl:value-of
select=
"$OID"
/>
"), xmlNode* node=uniset::uniset_conf()->getNode("
<xsl:value-of
select=
"normalize-space($OID)"
/>
"), const std::string
&
argprefix="" );
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK( uniset::ObjectId id = uniset::uniset_conf()->getObjectID("
<xsl:value-of
select=
"$OID"
/>
"), xmlNode* node=uniset::uniset_conf()->getNode("
<xsl:value-of
select=
"normalize-space($OID)"
/>
"), const std::string
&
argprefix=""
, xmlNode* globalConfNode=nullptr
);
</xsl:if>
<xsl:if
test=
"normalize-space($OID)=''"
>
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK( uniset::ObjectId id, xmlNode* node=uniset::uniset_conf()->getNode("
<xsl:value-of
select=
"normalize-space($OID)"
/>
") );
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK( uniset::ObjectId id, xmlNode* node=uniset::uniset_conf()->getNode("
<xsl:value-of
select=
"normalize-space($OID)"
/>
")
, xmlNode* globalConfNode=nullptr
);
</xsl:if>
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK();
...
...
Utilities/codegen/ctl-cpp-h.xsl
View file @
c1c70ecd
...
...
@@ -60,10 +60,10 @@ class <xsl:value-of select="$CLASSNAME"/>_SK:
{
public:
<xsl:if
test=
"not(normalize-space($OID))=''"
>
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK( uniset::ObjectId id = uniset::uniset_conf()->getObjectID("
<xsl:value-of
select=
"$OID"
/>
"), xmlNode* node=uniset::uniset_conf()->getNode("
<xsl:value-of
select=
"normalize-space($CNAME)"
/>
"), const std::string
&
argprefix="
<xsl:value-of
select=
"normalize-space($ARGPREFIX)"
/>
" );
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK( uniset::ObjectId id = uniset::uniset_conf()->getObjectID("
<xsl:value-of
select=
"$OID"
/>
"), xmlNode* node=uniset::uniset_conf()->getNode("
<xsl:value-of
select=
"normalize-space($CNAME)"
/>
"), const std::string
&
argprefix="
<xsl:value-of
select=
"normalize-space($ARGPREFIX)"
/>
"
, xmlNode* globalConfNode=nullptr
);
</xsl:if>
<xsl:if
test=
"normalize-space($OID)=''"
>
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK( uniset::ObjectId id, xmlNode* node=uniset::uniset_conf()->getNode("
<xsl:value-of
select=
"normalize-space($CNAME)"
/>
"), const std::string
&
argprefix="
<xsl:value-of
select=
"normalize-space($ARGPREFIX)"
/>
" );
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK( uniset::ObjectId id, xmlNode* node=uniset::uniset_conf()->getNode("
<xsl:value-of
select=
"normalize-space($CNAME)"
/>
"), const std::string
&
argprefix="
<xsl:value-of
select=
"normalize-space($ARGPREFIX)"
/>
"
, xmlNode* globalConfNode=nullptr
);
</xsl:if>
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK();
virtual ~
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK();
...
...
extensions/include/UObject_SK.h
View file @
c1c70ecd
...
...
@@ -8,7 +8,7 @@
ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ.
*/
// --------------------------------------------------------------------------
// generate timestamp: 2019-02-
09
+03:00
// generate timestamp: 2019-02-
11
+03:00
// -----------------------------------------------------------------------------
#ifndef UObject_SK_H_
#define UObject_SK_H_
...
...
@@ -29,7 +29,7 @@ class UObject_SK:
public
uniset
::
UniSetObject
{
public
:
UObject_SK
(
uniset
::
ObjectId
id
,
xmlNode
*
node
=
uniset
::
uniset_conf
()
->
getNode
(
"UObject"
),
const
std
::
string
&
argprefix
=
""
);
UObject_SK
(
uniset
::
ObjectId
id
,
xmlNode
*
node
=
uniset
::
uniset_conf
()
->
getNode
(
"UObject"
),
const
std
::
string
&
argprefix
=
""
,
xmlNode
*
globalConfNode
=
nullptr
);
UObject_SK
();
virtual
~
UObject_SK
();
...
...
extensions/lib/UObject_SK.cc
View file @
c1c70ecd
...
...
@@ -11,7 +11,7 @@
ВСЕ ВАШИ ИЗМЕНЕНИЯ БУДУТ ПОТЕРЯНЫ.
*/
// --------------------------------------------------------------------------
// generate timestamp: 2019-02-
09
+03:00
// generate timestamp: 2019-02-
11
+03:00
// -----------------------------------------------------------------------------
#include <memory>
#include <iomanip>
...
...
@@ -56,6 +56,21 @@ end_private(false)
throw
uniset
::
Exception
(
std
::
string
(
myname
+
": init failed!!!"
)
);
}
// -----------------------------------------------------------------------------
// ( val, confval, globalval, default val )
static
const
std
::
string
init4_str
(
const
std
::
string
&
s1
,
const
std
::
string
&
s2
,
const
std
::
string
&
s3
,
const
std
::
string
&
s4
)
{
if
(
!
s1
.
empty
()
)
return
s1
;
if
(
!
s2
.
empty
()
)
return
s2
;
if
(
!
s3
.
empty
()
)
return
s3
;
return
s4
;
}
// -----------------------------------------------------------------------------
// ( val, confval, default val )
static
const
std
::
string
init3_str
(
const
std
::
string
&
s1
,
const
std
::
string
&
s2
,
const
std
::
string
&
s3
)
{
...
...
@@ -80,7 +95,7 @@ static uniset::ObjectId init_node( xmlNode* cnode, const std::string& prop )
return
conf
->
getNodeID
(
conf
->
getProp
(
cnode
,
prop
));
}
// -----------------------------------------------------------------------------
UObject_SK
::
UObject_SK
(
ObjectId
id
,
xmlNode
*
cnode
,
const
std
::
string
&
_argprefix
)
:
UObject_SK
::
UObject_SK
(
ObjectId
id
,
xmlNode
*
cnode
,
const
std
::
string
&
_argprefix
,
xmlNode
*
globalnode
)
:
UniSetObject
(
id
),
// Инициализация идентификаторов (имена берутся из конф. файла)
...
...
@@ -179,7 +194,7 @@ end_private(false)
if
(
s_resetTime
.
empty
()
)
// -V547
s_resetTime
=
"500"
;
resetMsgTime
=
uni_atoi
(
init
3_str
(
conf
->
getArgParam
(
"--"
+
argprefix
+
"resetMsgTime"
),
conf
->
getProp
(
cnode
,
"resetMsgTime"
),
s_resetTime
));
resetMsgTime
=
uni_atoi
(
init
4_str
(
conf
->
getArgParam
(
"--"
+
argprefix
+
"resetMsgTime"
),
conf
->
getProp
(
cnode
,
"resetMsgTime"
),
conf
->
getProp
(
globalnode
,
"resetMsgTime"
),
s_resetTime
));
ptResetMsg
.
setTiming
(
resetMsgTime
);
int
sm_tout
=
conf
->
getArgInt
(
"--"
+
argprefix
+
"sm-ready-timeout"
,
""
);
...
...
@@ -190,7 +205,7 @@ end_private(false)
else
smReadyTimeout
=
sm_tout
;
smTestID
=
conf
->
getSensorID
(
init
3_str
(
conf
->
getArgParam
(
"--"
+
argprefix
+
"sm-test-id"
),
conf
->
getProp
(
c
node
,
"smTestID"
),
""
));
smTestID
=
conf
->
getSensorID
(
init
4_str
(
conf
->
getArgParam
(
"--"
+
argprefix
+
"sm-test-id"
),
conf
->
getProp
(
cnode
,
"smTestID"
),
conf
->
getProp
(
global
node
,
"smTestID"
),
""
));
if
(
smTestID
==
DefaultObjectId
)
// -V547
...
...
src/Log/LogReader.cc
View file @
c1c70ecd
...
...
@@ -430,7 +430,7 @@ void LogReader::readlogs( const std::string& _addr, int _port, LogServerTypes::C
{
cerr
<<
"(LogReader): "
<<
e
.
displayText
()
<<
" ("
<<
_addr
<<
")"
<<
endl
;
}
catch
(
Poco
::
IOException
&
e
x
)
catch
(
Poco
::
IOException
&
e
)
{
cerr
<<
"(LogReader): "
<<
e
.
displayText
()
<<
" ("
<<
_addr
<<
")"
<<
endl
;
disconnect
();
...
...
src/Various/UniXML.cc
View file @
c1c70ecd
...
...
@@ -156,6 +156,9 @@ string UniXML::getProp2(const xmlNode* node, const string& name, const string& d
// -----------------------------------------------------------------------------
string
UniXML
::
getProp
(
const
xmlNode
*
node
,
const
string
&
name
)
noexcept
{
if
(
!
node
)
return
""
;
xmlChar
*
text
=
::
xmlGetProp
((
xmlNode
*
)
node
,
(
const
xmlChar
*
)
name
.
c_str
());
if
(
text
==
NULL
)
...
...
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