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
fd257874
Commit
fd257874
authored
Apr 24, 2014
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Удалил старую функцию Extensions::getHeartBeatTime(). Перевёл всех
на использование conf->getHeartBeatTime(). В секции <HeartBeatTime> параметр задающий переименовал в "time_msec" --> "msec"
parent
3e5a3923
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
23 additions
and
63 deletions
+23
-63
libuniset.spec
conf/libuniset.spec
+5
-1
PassiveLProcessor.cc
extensions/LogicProcessor/PassiveLProcessor.cc
+1
-1
MBExchange.cc
extensions/ModbusMaster/MBExchange.cc
+1
-1
MBSlave.cc
extensions/ModbusSlave/MBSlave.cc
+2
-3
SMDBServer.cc
extensions/SMDBServer/SMDBServer.cc
+1
-1
UNetExchange.cc
extensions/UNetUDP/UNetExchange.cc
+1
-1
Extensions.h
extensions/include/Extensions.h
+0
-3
Extensions.cc
extensions/lib/Extensions.cc
+0
-30
Configuration.cc
src/Various/Configuration.cc
+12
-22
No files found.
conf/libuniset.spec
View file @
fd257874
...
...
@@ -8,7 +8,7 @@
Name: libuniset
Version: 1.7
Release: alt1
0
Release: alt1
1
Summary: UniSet - library for building distributed industrial control systems
...
...
@@ -335,6 +335,10 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
%exclude %_pkgconfigdir/libUniSet.pc
%changelog
* Thu Apr 24 2014 Pavel Vainerman <pv@altlinux.ru> 1.7-alt11
- remove deprecated Extensions:getHeartBeatTime(). Use conf->getHeartBeatTime()
- rename parameter: "time_msec" --> "msec" for <HeartBeatTime msec=""/>
* Tue Apr 01 2014 Pavel Vainerman <pv@altlinux.ru> 1.7-alt10
- add new vtype: F2r, I2r, U2r (reverse data order)
...
...
extensions/LogicProcessor/PassiveLProcessor.cc
View file @
fd257874
...
...
@@ -28,7 +28,7 @@ PassiveLProcessor::PassiveLProcessor( std::string lfile, UniSetTypes::ObjectId o
throw
SystemError
(
err
.
str
());
}
int
heartbeatTime
=
getHeartBeatTime
(
);
int
heartbeatTime
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-heartbeat-time"
,
conf
->
getHeartBeatTime
()
);
if
(
heartbeatTime
)
ptHeartBeat
.
setTiming
(
heartbeatTime
);
else
...
...
extensions/ModbusMaster/MBExchange.cc
View file @
fd257874
...
...
@@ -99,7 +99,7 @@ pollActivated(false)
throw
SystemError
(
err
.
str
());
}
int
heartbeatTime
=
getHeartBeatTime
(
);
int
heartbeatTime
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-heartbeat-time"
,
it
.
getProp
(
"heartbeatTime"
),
conf
->
getHeartBeatTime
()
);
if
(
heartbeatTime
)
ptHeartBeat
.
setTiming
(
heartbeatTime
);
else
...
...
extensions/ModbusSlave/MBSlave.cc
View file @
fd257874
...
...
@@ -160,7 +160,7 @@ prefix(prefix)
throw
SystemError
(
err
.
str
());
}
int
heartbeatTime
=
getHeartBeatTime
(
);
int
heartbeatTime
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-heartbeat-time"
,
it
.
getProp
(
"heartbeatTime"
),
conf
->
getHeartBeatTime
()
);
if
(
heartbeatTime
)
ptHeartBeat
.
setTiming
(
heartbeatTime
);
else
...
...
@@ -186,7 +186,7 @@ prefix(prefix)
dlog
[
Debug
::
INFO
]
<<
myname
<<
": init test_id="
<<
test_id
<<
endl
;
wait_msec
=
getHeartBeatTime
()
-
100
;
wait_msec
=
conf
->
getHeartBeatTime
()
-
100
;
if
(
wait_msec
<
500
)
wait_msec
=
500
;
...
...
@@ -197,7 +197,6 @@ prefix(prefix)
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(init): rs-timeout="
<<
msec
<<
" msec"
<<
endl
;
// build file list...
xmlNode
*
fnode
=
0
;
UniXML
*
xml
=
conf
->
getConfXML
();
...
...
extensions/SMDBServer/SMDBServer.cc
View file @
fd257874
...
...
@@ -46,7 +46,7 @@ prefix(prefix)
throw
SystemError
(
err
.
str
());
}
int
heartbeatTime
=
getHeartBeatTime
(
);
int
heartbeatTime
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-heartbeat-time"
,
it
.
getProp
(
"heartbeatTime"
),
conf
->
getHeartBeatTime
()
);
if
(
heartbeatTime
)
ptHeartBeat
.
setTiming
(
heartbeatTime
);
else
...
...
extensions/UNetUDP/UNetExchange.cc
View file @
fd257874
...
...
@@ -310,7 +310,7 @@ sender2(0)
throw
SystemError
(
err
.
str
());
}
int
heartbeatTime
=
getHeartBeatTime
(
);
int
heartbeatTime
=
conf
->
getArgPInt
(
"--"
+
prefix
+
"-heartbeat-time"
,
it
.
getProp
(
"heartbeatTime"
),
conf
->
getHeartBeatTime
()
);
if
(
heartbeatTime
)
ptHeartBeat
.
setTiming
(
heartbeatTime
);
else
...
...
extensions/include/Extensions.h
View file @
fd257874
...
...
@@ -13,9 +13,6 @@ namespace UniSetExtensions
/*! Получение идентификатора объекта(процесса) разделяемой памяти */
UniSetTypes
::
ObjectId
getSharedMemoryID
();
/*! Получение времени для подтверждения "живости" */
int
getHeartBeatTime
();
xmlNode
*
findNode
(
xmlNode
*
node
,
const
std
::
string
&
snode
,
const
std
::
string
&
field
);
xmlNode
*
getCalibrationsSection
();
...
...
extensions/lib/Extensions.cc
View file @
fd257874
...
...
@@ -32,36 +32,6 @@ namespace UniSetExtensions
return
shmID
;
}
// -------------------------------------------------------------------------
static
int
heartBeatTime
=
-
1
;
// начальная инициализация
int
getHeartBeatTime
()
{
if
(
heartBeatTime
!=
-
1
)
return
heartBeatTime
;
xmlNode
*
cnode
=
conf
->
getNode
(
"HeartBeatTime"
);
if
(
cnode
==
NULL
)
{
ostringstream
err
;
err
<<
"Not found conf-node for HeartBeatTime"
;
cerr
<<
err
.
str
()
<<
endl
;
throw
SystemError
(
err
.
str
());
}
UniXML_iterator
it
(
cnode
);
heartBeatTime
=
it
.
getIntProp
(
"time_msec"
);
if
(
heartBeatTime
<=
0
)
{
heartBeatTime
=
0
;
dlog
[
Debug
::
WARN
]
<<
"(getHeartBeatTime): механизм 'HEARTBEAT' ОТКЛЮЧЁН!"
<<
endl
;
}
if
(
dlog
.
debugging
(
Debug
::
INFO
)
)
dlog
[
Debug
::
INFO
]
<<
"(getHeartBeatTime): heartbeat time = "
<<
heartBeatTime
<<
endl
;
return
heartBeatTime
;
}
// -------------------------------------------------------------------------
void
escape_string
(
string
&
s
)
{
if
(
s
.
empty
()
)
...
...
src/Various/Configuration.cc
View file @
fd257874
...
...
@@ -86,14 +86,14 @@ Configuration::Configuration():
mi
(
NULL
),
oind
(
NULL
),
NSName
(
"NameService"
),
repeatCount
(
2
),
repeatTimeout
(
100
),
repeatCount
(
2
),
repeatTimeout
(
100
),
localTimerService
(
UniSetTypes
::
DefaultObjectId
),
localDBServer
(
UniSetTypes
::
DefaultObjectId
),
localInfoServer
(
UniSetTypes
::
DefaultObjectId
),
localNode
(
UniSetTypes
::
DefaultObjectId
),
localNodeName
(
""
),
fileConfName
(
""
),
heartbeat_msec
(
10
000
)
heartbeat_msec
(
5
000
)
{
// unideb[Debug::CRIT] << " configuration FAILED!!!!!!!!!!!!!!!!!" << endl;
// throw Exception();
...
...
@@ -228,10 +228,6 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
throw
;
}
// default value
heartbeat_msec
=
5000
;
// cerr << "*************** initConfiguration: xmlOpen: " << pt.getCurrent() << " msec " << endl;
// pt.reset();
...
...
@@ -278,9 +274,6 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
// Настраиваем отладочные логи
initDebug
(
unideb
,
"UniSetDebug"
);
// cerr << "*************** initConfiguration: oind: " << pt.getCurrent() << " msec " << endl;
// pt.reset();
// default init...
transientIOR
=
false
;
localIOR
=
false
;
...
...
@@ -291,20 +284,14 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
initParameters
();
// help
// if( !getArgParam("--help").empty() )
// help(cout);
initRepSections
();
// localIOR
// localIOR = false; // ??. initParameters()
int
lior
=
getArgInt
(
"--localIOR"
);
if
(
lior
)
localIOR
=
lior
;
// transientIOR
// transientIOR = false; // ??. initParameters()
int
tior
=
getArgInt
(
"--transientIOR"
);
if
(
tior
)
transientIOR
=
tior
;
...
...
@@ -312,9 +299,6 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
if
(
imagesDir
[
0
]
!=
'/'
&&
imagesDir
[
0
]
!=
'.'
)
imagesDir
=
dataDir
+
imagesDir
+
"/"
;
// cerr << "*************** initConfiguration: parameters...: " << pt.getCurrent() << " msec " << endl;
// pt.reset();
// считываем список узлов
createNodesList
();
...
...
@@ -596,10 +580,16 @@ void Configuration::initParameters()
if
(
confDir
.
empty
()
)
confDir
=
getRootDir
();
}
else
if
(
name
==
"HeartBeatTime"
)
{
heartbeat_msec
=
it
.
getIntProp
(
"name"
);
}
}
// Heartbeat init...
xmlNode
*
cnode
=
conf
->
getNode
(
"HeartBeatTime"
);
if
(
cnode
)
{
UniXML_iterator
hit
(
cnode
);
heartbeat_msec
=
hit
.
getIntProp
(
"msec"
);
if
(
heartbeat_msec
<=
0
)
heartbeat_msec
=
5000
;
}
}
// -------------------------------------------------------------------------
...
...
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