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
55d31016
Commit
55d31016
authored
Jul 11, 2018
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Plain Diff
backported to p8 as 2.7-alt12.M80P.13 (with rpmbph script)
parents
fa141b99
b657f2fb
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
123 additions
and
67 deletions
+123
-67
README.md
README.md
+4
-2
libuniset2.spec
conf/libuniset2.spec
+8
-3
test.xml
conf/test.xml
+1
-1
PassiveLProcessor.cc
extensions/LogicProcessor/PassiveLProcessor.cc
+1
-1
MBExchange.cc
extensions/ModbusMaster/MBExchange.cc
+3
-3
MBSlave.cc
extensions/ModbusSlave/MBSlave.cc
+8
-7
mbslave.cc
extensions/ModbusSlave/mbslave.cc
+0
-2
SharedMemory.cc
extensions/SharedMemory/SharedMemory.cc
+13
-13
start_fg.sh
extensions/SharedMemory/start_fg.sh
+1
-1
UNetExchange.cc
extensions/UNetUDP/UNetExchange.cc
+2
-2
unetexchange.cc
extensions/UNetUDP/unetexchange.cc
+0
-2
UniExchange.cc
extensions/UniNetwork/UniExchange.cc
+4
-1
start_fg.sh
extensions/UniNetwork/start_fg.sh
+1
-3
stop.sh
extensions/UniNetwork/stop.sh
+2
-0
test.xml
extensions/UniNetwork/test.xml
+2
-0
uninet.cc
extensions/UniNetwork/uninet.cc
+1
-2
uniset2-functions.sh
extensions/UniNetwork/uniset2-functions.sh
+2
-0
uniset2-start.sh
extensions/UniNetwork/uniset2-start.sh
+2
-0
OmniThreadCreator.h
include/OmniThreadCreator.h
+1
-1
UniSetActivator.h
include/UniSetActivator.h
+7
-2
UniXML.h
include/UniXML.h
+6
-3
UniSetActivator.cc
src/Core/UniSetActivator.cc
+32
-9
UniSetObject.cc
src/Core/UniSetObject.cc
+5
-0
DebugStream.cc
src/Log/DebugStream.cc
+2
-0
IOController.cc
src/Processes/IOController.cc
+1
-1
IONotifyController.cc
src/Processes/IONotifyController.cc
+1
-1
ProxyManager.cc
src/Processes/ProxyManager.cc
+1
-1
UniXML.cc
src/Various/UniXML.cc
+12
-6
No files found.
README.md
View file @
55d31016
...
...
@@ -18,5 +18,7 @@ with open source third-party libraries. UniSet provide the consistent interface
add-on components and third-party libraries. Python wrapper helps in using the library
in python scripts.
More information in Russian:
http://wiki.etersoft.ru/UniSet
More information:
*
[
RU
]
https://habr.com/post/278535/
*
[
RU
]
https://habr.com/post/171711/
*
[
RU
]
https://wiki.etersoft.ru/UniSet2/docs/
conf/libuniset2.spec
View file @
55d31016
...
...
@@ -26,7 +26,7 @@
Name: libuniset2
Version: 2.7
Release: alt1
1.M80P.12
Release: alt1
2.M80P.13
Summary: UniSet - library for building distributed industrial control systems
License: LGPL
...
...
@@ -54,7 +54,8 @@ BuildRequires: libcomedi-devel
%endif
%if_enabled mysql
BuildRequires: libmysqlclient-devel
# build with mariadb
BuildRequires: libmariadb-devel
%endif
%if_enabled sqlite
...
...
@@ -545,9 +546,13 @@ rm -f %buildroot%_docdir/%oname/html/*.md5
# history of current unpublished changes
%changelog
*
Sun Jun 10 2018 Pavel Vainerman <pv@altlinux.ru> 2.7-alt11.M80P.12
*
Wed Jul 11 2018 Pavel Vainerman <pv@altlinux.ru> 2.7-alt12.M80P.13
- backport to ALTLinux p8 (by rpmbph script)
* Wed Jul 11 2018 Pavel Vainerman <pv@altlinux.ru> 2.7-alt13
- (UActivator): refactoring the program termination process
- minor fixes
* Sun Jun 10 2018 Pavel Vainerman <pv@altlinux.ru> 2.7-alt12
- spec cleanup
...
...
conf/test.xml
View file @
55d31016
...
...
@@ -180,7 +180,7 @@
<UDPExchange2
name=
"UDPExchange2"
/>
<UNetExchange
name=
"UNetExchange"
/>
<HeartBeatTime
msec=
"5000"
/>
<NCReadyTimeout
msec=
"1
2
0000"
/>
<NCReadyTimeout
msec=
"10000"
/>
<TestGen
input1_s=
"Input1_S"
input2_s=
"DumpSensor1_S"
name=
"TestGen"
output1_c=
"DO_C"
output2_c=
"DO1_C"
/>
<RRDServer1
name=
"RRDServer1"
>
<rrd
filename=
"rrdtest.rrd"
filter_field=
"rrd"
filter_value=
"1"
step=
"5"
ds_field=
"rrd1_ds"
overwrite=
"0"
>
...
...
extensions/LogicProcessor/PassiveLProcessor.cc
View file @
55d31016
...
...
@@ -150,7 +150,7 @@ void PassiveLProcessor::sysCommand( const uniset::SystemMessage* sm )
{
if
(
!
shm
->
waitSMreadyWithCancellation
(
smReadyTimeout
,
cannceled
)
)
{
dcrit
<<
myname
<<
"(ERR): SM not ready. Terminated... "
<<
endl
;
dcrit
<<
myname
<<
"(ERR): SM not ready. Terminated... "
<<
endl
<<
flush
;
// std::terminate();
uterminate
();
return
;
...
...
extensions/ModbusMaster/MBExchange.cc
View file @
55d31016
...
...
@@ -3021,7 +3021,7 @@ namespace uniset
if
(
devices
.
empty
()
)
{
mbcrit
<<
myname
<<
"(sysCommand): ************* ITEM MAP EMPTY! terminated... *************"
<<
endl
;
mbcrit
<<
myname
<<
"(sysCommand): ************* ITEM MAP EMPTY! terminated... *************"
<<
endl
<<
flush
;
// std::terminate();
uterminate
();
return
;
...
...
@@ -3056,7 +3056,7 @@ namespace uniset
if
(
!
isProcActive
()
)
{
mbcrit
<<
myname
<<
"(sysCommand): ************* don`t activate?! ************"
<<
endl
;
mbcrit
<<
myname
<<
"(sysCommand): ************* don`t activate?! ************"
<<
endl
<<
flush
;
uterminate
();
return
;
}
...
...
@@ -3132,7 +3132,7 @@ namespace uniset
<<
"(askSensors): Не дождались готовности(work) SharedMemory к работе в течение "
<<
activateTimeout
<<
" мсек"
;
mbcrit
<<
err
.
str
()
<<
endl
;
mbcrit
<<
err
.
str
()
<<
endl
<<
flush
;
// std::terminate(); // прерываем (перезапускаем) процесс...
uterminate
();
return
;
...
...
extensions/ModbusSlave/MBSlave.cc
View file @
55d31016
...
...
@@ -582,7 +582,7 @@ namespace uniset
if
(
vaddr
.
empty
()
)
{
mbcrit
<<
"(execute_rtu): Unknown my modbus addresses!"
<<
endl
;
mbcrit
<<
"(execute_rtu): Unknown my modbus addresses!"
<<
endl
<<
flush
;
//std::terminate();
uterminate
();
return
;
...
...
@@ -622,7 +622,7 @@ namespace uniset
{
if
(
!
tcpserver
)
{
mbcrit
<<
myname
<<
"(execute_tcp): DYNAMIC CAST ERROR (mbslot --> ModbusTCPServerSlot)"
<<
std
::
endl
;
mbcrit
<<
myname
<<
"(execute_tcp): DYNAMIC CAST ERROR (mbslot --> ModbusTCPServerSlot)"
<<
std
::
endl
<<
flush
;
// std::terminate();
uterminate
();
return
;
...
...
@@ -645,7 +645,7 @@ namespace uniset
if
(
vaddr
.
empty
()
)
{
mbcrit
<<
"(execute_tcp): Unknown my modbus addresses!"
<<
endl
;
mbcrit
<<
"(execute_tcp): Unknown my modbus addresses!"
<<
endl
<<
flush
;
// std::terminate();
uterminate
();
return
;
...
...
@@ -686,7 +686,8 @@ namespace uniset
{
mbcrit
<<
myname
<<
"(execute_tcp): error run tcpserver: "
<<
tcpserver
->
getInetAddress
()
<<
":"
<<
tcpserver
->
getInetPort
()
<<
" err: not active.."
<<
endl
;
<<
":"
<<
tcpserver
->
getInetPort
()
<<
" err: not active.."
<<
endl
<<
flush
;
// std::terminate();
uterminate
();
return
;
...
...
@@ -947,7 +948,7 @@ namespace uniset
{
if
(
iomap
.
empty
()
)
{
mbcrit
<<
myname
<<
"(sysCommand): iomap EMPTY! terminated..."
<<
endl
;
mbcrit
<<
myname
<<
"(sysCommand): iomap EMPTY! terminated..."
<<
endl
<<
flush
;
// std::terminate();
uterminate
();
return
;
...
...
@@ -1049,8 +1050,8 @@ namespace uniset
<<
"(askSensors): Не дождались готовности(work) SharedMemory к работе в течение "
<<
activateTimeout
<<
" мсек"
;
mbcrit
<<
err
.
str
()
<<
endl
;
kill
(
SIGTERM
,
getpid
());
// прерываем (перезапускаем) процесс...
mbcrit
<<
err
.
str
()
<<
endl
<<
flush
;
uterminate
();
throw
SystemError
(
err
.
str
());
}
...
...
extensions/ModbusSlave/mbslave.cc
View file @
55d31016
...
...
@@ -77,7 +77,6 @@ int main(int argc, const char** argv)
dlogany
<<
"(main): -------------- MBSlave START -------------------------
\n\n
"
;
act
->
run
(
false
);
// on_sigchild(SIGTERM);
return
0
;
}
catch
(
const
std
::
exception
&
e
)
...
...
@@ -91,7 +90,6 @@ int main(int argc, const char** argv)
cerr
<<
(
p
?
p
.
__cxa_exception_type
()
->
name
()
:
"null"
)
<<
std
::
endl
;
}
// on_sigchild(SIGTERM);
return
1
;
}
// --------------------------------------------------------------------------
extensions/SharedMemory/SharedMemory.cc
View file @
55d31016
...
...
@@ -270,7 +270,7 @@ namespace uniset
if
(
!
activated
)
{
smcrit
<<
myname
<<
"(sysCommand): Don`t activate [timeout="
<<
activateTimeout
<<
" msec]! TERMINATE.."
<<
endl
;
smcrit
<<
myname
<<
"(sysCommand): Don`t activate [timeout="
<<
activateTimeout
<<
" msec]! TERMINATE.."
<<
endl
<<
flush
;
// std::terminate();
uterminate
();
return
;
...
...
@@ -463,9 +463,9 @@ namespace uniset
<<
") указан неверно ("
<<
it
.
getProp
(
"iotype"
)
<<
") должен быть 'AI'"
;
smcrit
<<
msg
.
str
()
<<
endl
;
kill
(
getpid
(),
SIGTERM
);
// throw NameNotFound
(msg.str());
smcrit
<<
msg
.
str
()
<<
endl
<<
flush
;
uterminate
(
);
throw
SystemError
(
msg
.
str
());
};
HeartBeatInfo
hi
;
...
...
@@ -478,7 +478,7 @@ namespace uniset
{
ostringstream
msg
;
msg
<<
"(SharedMemory::readItem): дискретный датчик (heartbeat_ds_name) связанный с "
<<
it
.
getProp
(
"name"
);
smwarn
<<
msg
.
str
()
<<
endl
;
smwarn
<<
msg
.
str
()
<<
endl
<<
flush
;
}
}
else
...
...
@@ -492,9 +492,9 @@ namespace uniset
// Если уж задали имя для датчика, то он должен существовать..
// поэтому завершаем процесс, если не нашли..
smcrit
<<
msg
.
str
()
<<
endl
;
kill
(
getpid
(),
SIGTERM
);
// throw NameNotFound
(msg.str());
smcrit
<<
msg
.
str
()
<<
endl
<<
flush
;
uterminate
(
);
throw
SystemError
(
msg
.
str
());
}
}
...
...
@@ -507,9 +507,9 @@ namespace uniset
msg
<<
"(SharedMemory::readItem): НЕ УКАЗАН id для "
<<
it
.
getProp
(
"name"
)
<<
" секция "
<<
sec
;
smcrit
<<
msg
.
str
()
<<
endl
;
kill
(
getpid
(),
SIGTERM
);
// throw NameNotFound
(msg.str());
smcrit
<<
msg
.
str
()
<<
endl
<<
flush
;
uterminate
(
);
throw
SystemError
(
msg
.
str
());
};
// без проверки на дублирование т.к.
...
...
@@ -912,7 +912,7 @@ namespace uniset
{
ostringstream
err
;
err
<<
myname
<<
"(initFromReserv): Not found ID for '"
<<
smName
<<
"'"
;
smcrit
<<
err
.
str
()
<<
endl
;
smcrit
<<
err
.
str
()
<<
endl
<<
flush
;
// std::terminate();
uterminate
();
return
;
...
...
@@ -929,7 +929,7 @@ namespace uniset
{
ostringstream
err
;
err
<<
myname
<<
"(initFromReserv): Not found NodeID for '"
<<
smNode
<<
"'"
;
smcrit
<<
err
.
str
()
<<
endl
;
smcrit
<<
err
.
str
()
<<
endl
<<
flush
;
//std::terminate();
uterminate
();
return
;
...
...
extensions/SharedMemory/start_fg.sh
View file @
55d31016
...
...
@@ -6,7 +6,7 @@ ulimit -Sc 10000000000
./uniset2-start.sh
-f
./uniset2-smemory
--smemory-id
SharedMemory
\
--confile
test.xml
--datfile
test.xml
--db-logging
1
--ulog-add-levels
system,level1,level9
\
--sm-log-add-levels
any
$*
--sm-run-logserver
--activator-run-httpserver
\
--
heartbeat-node
ses
--
sm-log-add-levels
any
$*
--sm-run-logserver
--activator-run-httpserver
\
#--pulsar-id DO_C --pulsar-iotype DO --pulsar-msec 100
...
...
extensions/UNetUDP/UNetExchange.cc
View file @
55d31016
...
...
@@ -712,8 +712,8 @@ void UNetExchange::askSensors( UniversalIO::UIOCommand cmd )
<<
"(askSensors): Не дождались готовности(work) SharedMemory к работе в течение "
<<
activateTimeout
<<
" мсек"
;
unetcrit
<<
err
.
str
()
<<
endl
;
kill
(
SIGTERM
,
getpid
());
// прерываем (перезапускаем) процесс...
unetcrit
<<
err
.
str
()
<<
endl
<<
flush
;
uterminate
();
throw
SystemError
(
err
.
str
());
}
...
...
extensions/UNetUDP/unetexchange.cc
View file @
55d31016
...
...
@@ -58,7 +58,6 @@ int main( int argc, const char** argv )
dlogany
<<
"(main): -------------- UDPReceiver START -------------------------
\n\n
"
;
act
->
run
(
false
);
on_sigchild
(
SIGTERM
);
}
catch
(
const
uniset
::
Exception
&
ex
)
{
...
...
@@ -69,6 +68,5 @@ int main( int argc, const char** argv )
dcrit
<<
"(unetexchange): catch ..."
<<
std
::
endl
;
}
on_sigchild
(
SIGTERM
);
return
0
;
}
extensions/UniNetwork/UniExchange.cc
View file @
55d31016
...
...
@@ -151,7 +151,7 @@ void UniExchange::execute()
err
<<
myname
<<
"(execute): Не дождались готовности SharedMemory к работе в течение "
<<
smReadyTimeout
<<
" мсек"
;
ucrit
<<
err
.
str
()
<<
endl
;
ucrit
<<
err
.
str
()
<<
endl
<<
flush
;
//throw SystemError(err.str());
//std::terminate();
uterminate
();
...
...
@@ -223,6 +223,9 @@ void UniExchange::execute()
ptUpdate
.
reset
();
}
if
(
cancelled
)
break
;
msleep
(
polltime
);
}
}
...
...
extensions/UniNetwork/start_fg.sh
View file @
55d31016
#!/bin/sh
export
LD_LIBRARY_PATH
=
"../../lib/.libs;../lib/.libs"
ulimit
-Sc
10000000000
./uniset2-start.sh
-f
./uniset2-network
--confile
test.xml
\
--smemory-id
SharedMemory
\
--unet-id
UniExchange
--unet-id
UniExchange
$*
extensions/UniNetwork/stop.sh
0 → 120000
View file @
55d31016
../../Utilities/scripts/uniset2-stop.sh
\ No newline at end of file
extensions/UniNetwork/test.xml
0 → 120000
View file @
55d31016
../../conf/test.xml
\ No newline at end of file
extensions/UniNetwork/uninet.cc
View file @
55d31016
...
...
@@ -68,7 +68,7 @@ int main(int argc, const char** argv)
act
->
broadcast
(
sm
.
transport_msg
()
);
act
->
run
(
true
);
uex
->
execute
();
on_sigchild
(
SIGTERM
);
act
->
join
(
);
return
0
;
}
catch
(
const
std
::
exception
&
ex
)
...
...
@@ -80,6 +80,5 @@ int main(int argc, const char** argv)
dcrit
<<
"(uninetwork): catch(...)"
<<
endl
;
}
on_sigchild
(
SIGTERM
);
return
1
;
}
extensions/UniNetwork/uniset2-functions.sh
0 → 120000
View file @
55d31016
../../Utilities/scripts/uniset2-functions.sh
\ No newline at end of file
extensions/UniNetwork/uniset2-start.sh
0 → 120000
View file @
55d31016
../../Utilities/scripts/uniset2-start.sh
\ No newline at end of file
include/OmniThreadCreator.h
View file @
55d31016
...
...
@@ -97,7 +97,7 @@ namespace uniset
typedef
void
(
ThreadMaster
::*
Action
)();
OmniThreadCreator
(
const
std
::
shared_ptr
<
ThreadMaster
>&
m
,
Action
a
,
bool
undetached
=
false
);
~
OmniThreadCreator
()
{}
virtual
~
OmniThreadCreator
()
{}
inline
bool
isRunning
()
{
...
...
include/UniSetActivator.h
View file @
55d31016
...
...
@@ -72,11 +72,15 @@ namespace uniset
// запуск системы
// async = true - асинхронный запуск (создаётся отдельный поток).
void
run
(
bool
async
);
// terminate_control = true - управление процессом завершения (обработка сигналов завершения)
void
run
(
bool
async
,
bool
terminate_control
=
true
);
// штатное завершение работы
void
shutdown
();
// ожидание завершения (если был запуск run(true))
void
join
();
// прерывание работы
void
terminate
();
...
...
@@ -96,7 +100,7 @@ namespace uniset
protected
:
void
w
ork
();
void
mainW
ork
();
// уносим в protected, т.к. Activator должен быть только один..
UniSetActivator
();
...
...
@@ -111,6 +115,7 @@ namespace uniset
std
::
shared_ptr
<
OmniThreadCreator
<
UniSetActivator
>
>
orbthr
;
CORBA
::
ORB_var
orb
;
bool
termControl
=
{
true
};
#ifndef DISABLE_REST_API
std
::
shared_ptr
<
uniset
::
UHttp
::
UHttpServer
>
httpserv
;
...
...
include/UniXML.h
View file @
55d31016
...
...
@@ -58,7 +58,7 @@ namespace uniset
bool
findName
(
const
std
::
string
&
node
,
const
std
::
string
&
searchname
,
bool
deepfind
=
true
)
noexcept
;
bool
find
(
const
std
::
string
&
searchnode
,
bool
deepfind
=
true
)
noexcept
;
xmlNode
*
findX
(
xmlNode
*
root
,
const
std
::
string
&
searchnode
,
bool
deepfind
=
true
)
noexcept
;
xmlNode
*
findX
(
xmlNode
*
root
,
const
std
::
string
&
searchnode
,
bool
deepfind
=
true
)
const
noexcept
;
/*! Перейти к следующему узлу. Возвращает false, если некуда перейти */
bool
goNext
()
noexcept
;
...
...
@@ -159,9 +159,12 @@ namespace uniset
// Добавить новый дочерний узел
static
xmlNode
*
createChild
(
xmlNode
*
node
,
const
std
::
string
&
title
,
const
std
::
string
&
text
);
// Добавить следующий узел
// Добавить следующий узел
(добавление в конец списка узлов на уровне node)
static
xmlNode
*
createNext
(
xmlNode
*
node
,
const
std
::
string
&
title
,
const
std
::
string
&
text
);
// Создать новый узел следующим за node
static
xmlNode
*
insertNext
(
xmlNode
*
node
,
const
std
::
string
&
title
,
const
std
::
string
&
text
);
// Удалить указанный узел и все вложенные узлы
static
void
removeNode
(
xmlNode
*
node
);
...
...
@@ -187,7 +190,7 @@ namespace uniset
// Функция поиска по текущему уровню (без рекурсии для дочерних узлов)
// root указывается исходный, внутри функции осуществляется переход к списку дочерних узлов
// (другими словами делать goChildren() не надо)
xmlNode
*
findNodeLevel1
(
xmlNode
*
root
,
const
std
::
string
&
nodename
,
const
std
::
string
&
nm
=
""
);
xmlNode
*
findNodeLevel1
(
xmlNode
*
root
,
const
std
::
string
&
nodename
,
const
std
::
string
&
nm
=
""
)
const
;
protected
:
...
...
src/Core/UniSetActivator.cc
View file @
55d31016
...
...
@@ -54,6 +54,14 @@ static std::atomic_bool g_done = ATOMIC_VAR_INIT(0);
static
const
int
TERMINATE_TIMEOUT_SEC
=
15
;
// время отведенное на завершение процесса [сек]
// ------------------------------------------------------------------------------------------
struct
ORBThreadDeleter
{
void
operator
()(
OmniThreadCreator
<
UniSetActivator
>*
p
)
const
{
// не удаляем..
}
};
// ---------------------------------------------------------------------------
namespace
uniset
{
UniSetActivatorPtr
UniSetActivator
::
inst
;
...
...
@@ -126,10 +134,11 @@ namespace uniset
}
// ------------------------------------------------------------------------------------------
void
UniSetActivator
::
run
(
bool
thread
)
void
UniSetActivator
::
run
(
bool
thread
,
bool
terminate_control
)
{
ulogsys
<<
myname
<<
"(run): создаю менеджер "
<<
endl
;
termControl
=
terminate_control
;
auto
aptr
=
std
::
static_pointer_cast
<
UniSetActivator
>
(
get_ptr
());
UniSetManager
::
initPOA
(
aptr
);
...
...
@@ -144,6 +153,7 @@ namespace uniset
pman
->
activate
();
msleep
(
50
);
if
(
termControl
)
set_signals
(
true
);
#ifndef DISABLE_REST_API
...
...
@@ -168,13 +178,13 @@ namespace uniset
if
(
thread
)
{
uinfo
<<
myname
<<
"(run): запускаемся с созданием отдельного потока... "
<<
endl
;
orbthr
=
make_shared
<
OmniThreadCreator
<
UniSetActivator
>
>
(
aptr
,
&
UniSetActivator
::
work
);
orbthr
=
std
::
shared_ptr
<
OmniThreadCreator
<
UniSetActivator
>>
(
new
OmniThreadCreator
<
UniSetActivator
>
(
aptr
,
&
UniSetActivator
::
mainWork
),
ORBThreadDeleter
()
);
orbthr
->
start
();
}
else
{
uinfo
<<
myname
<<
"(run): запускаемся без создания отдельного потока... "
<<
endl
;
w
ork
();
mainW
ork
();
shutdown
();
}
}
...
...
@@ -189,14 +199,15 @@ namespace uniset
return
;
active
=
false
;
if
(
termControl
)
{
set_signals
(
false
);
{
std
::
unique_lock
<
std
::
mutex
>
lk
(
g_donemutex
);
g_done
=
false
;
g_finish_guard_thread
=
make_shared
<
std
::
thread
>
(
on_finish_timeout
);
}
}
ulogsys
<<
myname
<<
"(shutdown): deactivate... "
<<
endl
;
deactivate
();
...
...
@@ -238,9 +249,6 @@ namespace uniset
ucrit
<<
myname
<<
"(shutdown): "
<<
ex
.
what
()
<<
endl
;
}
if
(
orbthr
)
orbthr
->
join
();
{
std
::
unique_lock
<
std
::
mutex
>
lk
(
g_donemutex
);
g_done
=
true
;
...
...
@@ -252,6 +260,20 @@ namespace uniset
g_finish_guard_thread
->
join
();
}
// ------------------------------------------------------------------------------------------
void
UniSetActivator
::
join
()
{
if
(
g_done
)
return
;
ulogsys
<<
myname
<<
"(join): ..."
<<
endl
;
std
::
unique_lock
<
std
::
mutex
>
lk
(
g_donemutex
);
g_doneevent
.
wait
(
lk
,
[]()
{
return
(
g_done
==
true
);
}
);
}
// ------------------------------------------------------------------------------------------
void
UniSetActivator
::
terminate
()
{
ulogsys
<<
myname
<<
"(terminate): ..."
<<
endl
;
...
...
@@ -262,6 +284,7 @@ namespace uniset
{
auto
act
=
UniSetActivator
::
Instance
();
act
->
shutdown
();
ulogsys
<<
"******** activator_terminate finished **** "
<<
endl
;
}
// ------------------------------------------------------------------------------------------
void
UniSetActivator
::
on_finish_timeout
()
...
...
@@ -340,7 +363,7 @@ namespace uniset
// sigaction(SIGSEGV, &act, &oact);
}
// ------------------------------------------------------------------------------------------
void
UniSetActivator
::
w
ork
()
void
UniSetActivator
::
mainW
ork
()
{
ulogsys
<<
myname
<<
"(work): запускаем orb на обработку запросов..."
<<
endl
;
...
...
src/Core/UniSetObject.cc
View file @
55d31016
...
...
@@ -760,9 +760,14 @@ namespace uniset
}
else
{
// выдаём предупреждение только если поток не отключён, но при этом не задан ID
if
(
threadcreate
)
{
uinfo
<<
myname
<<
": ?? не задан ObjectId...("
<<
"myid="
<<
myid
<<
" threadcreate="
<<
threadcreate
<<
")"
<<
endl
;
}
thread
(
false
);
}
...
...
src/Log/DebugStream.cc
View file @
55d31016
...
...
@@ -171,6 +171,8 @@ std::ostream& DebugStream::printDate(Debug::type t, char brk) noexcept
{
if
(
dt
&&
t
)
{
uniset
::
ios_fmt_restorer
ifs
(
*
this
);
std
::
time_t
tv
=
std
::
chrono
::
system_clock
::
to_time_t
(
std
::
chrono
::
system_clock
::
now
());
std
::
tm
tms
=
*
std
::
localtime
(
&
tv
);
...
...
src/Processes/IOController.cc
View file @
55d31016
...
...
@@ -123,7 +123,7 @@ void IOController::activateInit()
}
catch
(
const
uniset
::
Exception
&
ex
)
{
ucrit
<<
myname
<<
"(activateInit): "
<<
ex
<<
endl
;
ucrit
<<
myname
<<
"(activateInit): "
<<
ex
<<
endl
<<
flush
;
//std::terminate();
uterminate
();
}
...
...
src/Processes/IONotifyController.cc
View file @
55d31016
...
...
@@ -772,7 +772,7 @@ void IONotifyController::readConf()
// Если дамп не удалось считать, значит что-то не то в configure.xml
// и безопаснее "вылететь", чем запустится, т.к. часть датчиков не будет работать
// как ожидается.
ucrit
<<
myname
<<
"(IONotifyController::readConf): "
<<
ex
.
what
()
<<
endl
;
ucrit
<<
myname
<<
"(IONotifyController::readConf): "
<<
ex
.
what
()
<<
endl
<<
flush
;
//std::terminate(); // std::abort();
uterminate
();
}
...
...
src/Processes/ProxyManager.cc
View file @
55d31016
...
...
@@ -106,7 +106,7 @@ bool ProxyManager::activateObject()
}
catch
(
const
uniset
::
Exception
&
ex
)
{
ucrit
<<
myname
<<
"(activate): "
<<
ex
<<
endl
;
ucrit
<<
myname
<<
"(activate): "
<<
ex
<<
endl
<<
flush
;
//std::terminate();
uterminate
();
}
...
...
src/Various/UniXML.cc
View file @
55d31016
...
...
@@ -159,10 +159,7 @@ string UniXML::getProp(const xmlNode* node, const string& name) noexcept
xmlChar
*
text
=
::
xmlGetProp
((
xmlNode
*
)
node
,
(
const
xmlChar
*
)
name
.
c_str
());
if
(
text
==
NULL
)
{
xmlFree
(
text
);
return
""
;
}
try
{
...
...
@@ -224,7 +221,7 @@ xmlNode* UniXML::createChild(xmlNode* node, const string& title, const string& t
return
::
xmlNewChild
(
node
,
NULL
,
(
const
xmlChar
*
)
title
.
c_str
(),
(
const
xmlChar
*
)
text
.
c_str
());
}
// -----------------------------------------------------------------------------
xmlNode
*
UniXML
::
createNext
(
xmlNode
*
node
,
const
string
&
title
,
const
string
&
text
)
xmlNode
*
UniXML
::
createNext
(
xmlNode
*
node
,
const
string
&
title
,
const
string
&
text
)
{
if
(
node
->
parent
)
return
createChild
(
node
->
parent
,
title
,
text
);
...
...
@@ -232,6 +229,15 @@ xmlNode* UniXML::createNext(xmlNode* node, const string& title, const string& te
return
0
;
}
// -----------------------------------------------------------------------------
xmlNode
*
UniXML
::
insertNext
(
xmlNode
*
node
,
const
string
&
title
,
const
string
&
text
)
{
xmlNode
*
newNode
=
createNext
(
node
,
title
,
text
);
if
(
newNode
)
return
::
xmlAddNextSibling
(
node
,
newNode
);
return
0
;
}
// -----------------------------------------------------------------------------
/// Удаление указанного узла со всеми вложенными
void
UniXML
::
removeNode
(
xmlNode
*
node
)
{
...
...
@@ -379,7 +385,7 @@ xmlNode* UniXML::extFindNode( xmlNode* node, int depth, int width, const string&
return
NULL
;
}
// -----------------------------------------------------------------------------
xmlNode
*
UniXML
::
findNodeLevel1
(
xmlNode
*
root
,
const
string
&
nodename
,
const
string
&
nm
)
xmlNode
*
UniXML
::
findNodeLevel1
(
xmlNode
*
root
,
const
string
&
nodename
,
const
string
&
nm
)
const
{
UniXML
::
iterator
it
(
root
);
...
...
@@ -628,7 +634,7 @@ bool UniXML_iterator::find( const std::string& searchnode, bool deepfind ) noexc
return
false
;
}
// -------------------------------------------------------------------------
xmlNode
*
UniXML_iterator
::
findX
(
xmlNode
*
root
,
const
std
::
string
&
searchnode
,
bool
deepfind
)
noexcept
xmlNode
*
UniXML_iterator
::
findX
(
xmlNode
*
root
,
const
std
::
string
&
searchnode
,
bool
deepfind
)
const
noexcept
{
if
(
root
==
NULL
)
return
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