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
3f7e7fad
Commit
3f7e7fad
authored
Jun 28, 2017
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(step 2): fixes after converity scan (
https://scan9.coverity.com
)
parent
5c020591
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
114 additions
and
53 deletions
+114
-53
IOControl.cc
extensions/IOControl/IOControl.cc
+4
-4
MBTCPMaster.cc
extensions/ModbusMaster/MBTCPMaster.cc
+10
-3
MBTCPMultiMaster.cc
extensions/ModbusMaster/MBTCPMultiMaster.cc
+6
-0
MBTCPMultiMaster.h
extensions/ModbusMaster/MBTCPMultiMaster.h
+1
-0
mq-test.cc
extensions/tests/MQPerfTest/mq-test.cc
+1
-1
UInterface.h
include/UInterface.h
+2
-2
ModbusTypes.cc
src/Communications/Modbus/ModbusTypes.cc
+4
-2
UInterface.cc
src/Interfaces/UInterface.cc
+41
-24
DebugStream.cc
src/Log/DebugStream.cc
+4
-0
UniSetActivator.cc
src/ObjectRepository/UniSetActivator.cc
+8
-1
IOController.cc
src/Processes/IOController.cc
+2
-2
IONotifyController.cc
src/Processes/IONotifyController.cc
+4
-0
Configuration.cc
src/Various/Configuration.cc
+7
-12
Mutex.cc
src/Various/Mutex.cc
+17
-2
SViewer.cc
src/Various/SViewer.cc
+2
-0
develop.cc
tests/develop.cc
+1
-0
No files found.
extensions/IOControl/IOControl.cc
View file @
3f7e7fad
...
@@ -466,7 +466,7 @@ namespace uniset
...
@@ -466,7 +466,7 @@ namespace uniset
return
;
return
;
// Опрос приоритетной очереди
// Опрос приоритетной очереди
for
(
auto
it
:
pmap
)
for
(
auto
&&
it
:
pmap
)
{
{
if
(
it
.
priority
>
0
)
if
(
it
.
priority
>
0
)
{
{
...
@@ -491,7 +491,7 @@ namespace uniset
...
@@ -491,7 +491,7 @@ namespace uniset
// опять опросим приоритетные
// опять опросим приоритетные
if
(
!
prior
&&
i
>
maxHalf
)
if
(
!
prior
&&
i
>
maxHalf
)
{
{
for
(
auto
&
p
:
pmap
)
for
(
auto
&
&
p
:
pmap
)
{
{
if
(
p
.
priority
>
1
)
if
(
p
.
priority
>
1
)
{
{
...
@@ -505,7 +505,7 @@ namespace uniset
...
@@ -505,7 +505,7 @@ namespace uniset
}
}
// Опрос приоритетной очереди
// Опрос приоритетной очереди
for
(
auto
&
it
:
pmap
)
for
(
auto
&
&
it
:
pmap
)
{
{
if
(
it
.
priority
>
2
)
if
(
it
.
priority
>
2
)
{
{
...
@@ -1304,8 +1304,8 @@ namespace uniset
...
@@ -1304,8 +1304,8 @@ namespace uniset
{
{
if
(
!
force
)
if
(
!
force
)
{
{
force
=
true
;
std
::
lock_guard
<
std
::
mutex
>
l
(
iopollMutex
);
std
::
lock_guard
<
std
::
mutex
>
l
(
iopollMutex
);
force
=
true
;
iopoll
();
iopoll
();
force
=
false
;
force
=
false
;
}
}
...
...
extensions/ModbusMaster/MBTCPMaster.cc
View file @
3f7e7fad
...
@@ -80,10 +80,17 @@ MBTCPMaster::~MBTCPMaster()
...
@@ -80,10 +80,17 @@ MBTCPMaster::~MBTCPMaster()
{
{
if
(
pollThread
)
if
(
pollThread
)
{
{
pollThread
->
stop
();
try
{
pollThread
->
stop
();
if
(
pollThread
->
isRunning
()
)
if
(
pollThread
->
isRunning
()
)
pollThread
->
join
();
pollThread
->
join
();
}
catch
(
Poco
::
NullPointerException
&
ex
)
{
}
}
}
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
...
...
extensions/ModbusMaster/MBTCPMultiMaster.cc
View file @
3f7e7fad
...
@@ -422,6 +422,12 @@ void MBTCPMultiMaster::MBSlaveInfo::setUse( bool st )
...
@@ -422,6 +422,12 @@ void MBTCPMultiMaster::MBSlaveInfo::setUse( bool st )
use
=
st
;
use
=
st
;
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
bool
MBTCPMultiMaster
::
MBSlaveInfo
::
isUse
()
{
std
::
lock_guard
<
std
::
mutex
>
l
(
mutInit
);
return
use
;
}
// -----------------------------------------------------------------------------
bool
MBTCPMultiMaster
::
MBSlaveInfo
::
init
(
std
::
shared_ptr
<
DebugStream
>&
mblog
)
bool
MBTCPMultiMaster
::
MBSlaveInfo
::
init
(
std
::
shared_ptr
<
DebugStream
>&
mblog
)
{
{
std
::
lock_guard
<
std
::
mutex
>
l
(
mutInit
);
std
::
lock_guard
<
std
::
mutex
>
l
(
mutInit
);
...
...
extensions/ModbusMaster/MBTCPMultiMaster.h
View file @
3f7e7fad
...
@@ -354,6 +354,7 @@ namespace uniset
...
@@ -354,6 +354,7 @@ namespace uniset
bool
init
(
std
::
shared_ptr
<
DebugStream
>&
mblog
);
bool
init
(
std
::
shared_ptr
<
DebugStream
>&
mblog
);
bool
check
();
bool
check
();
void
setUse
(
bool
st
);
void
setUse
(
bool
st
);
bool
isUse
();
timeout_t
recv_timeout
;
timeout_t
recv_timeout
;
timeout_t
aftersend_pause
;
timeout_t
aftersend_pause
;
...
...
extensions/tests/MQPerfTest/mq-test.cc
View file @
3f7e7fad
...
@@ -45,7 +45,7 @@ int main(int argc, const char** argv)
...
@@ -45,7 +45,7 @@ int main(int argc, const char** argv)
end
=
std
::
chrono
::
system_clock
::
now
();
end
=
std
::
chrono
::
system_clock
::
now
();
int
elapsed_seconds
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
end
-
start
).
count
();
int
elapsed_seconds
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
end
-
start
).
count
();
std
::
cerr
<<
"elapsed time: "
<<
elapsed_seconds
<<
" ms num="
<<
num
<<
endl
;
std
::
cerr
<<
"elapsed time: "
<<
elapsed_seconds
<<
" ms num="
<<
num
<<
endl
;
std
::
cerr
<<
"speed: "
<<
(
(
float
)
elapsed_seconds
/
num
)
<<
" msg per sec"
<<
endl
;
std
::
cerr
<<
"speed: "
<<
(
num
>
0
?
((
float
)
elapsed_seconds
/
num
)
:
0
)
<<
" msg per sec"
<<
endl
;
return
0
;
return
0
;
}
}
...
...
include/UInterface.h
View file @
3f7e7fad
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
#include "Configuration.h"
#include "Configuration.h"
// -----------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------
#define UI_THROW_EXCEPTIONS uniset::TimeOut,uniset::IOBadParam,uniset::ORepFailed
#define UI_THROW_EXCEPTIONS uniset::TimeOut,uniset::IOBadParam,uniset::ORepFailed
,uniset::SystemError
// -----------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------
namespace
uniset
namespace
uniset
{
{
...
@@ -248,7 +248,7 @@ namespace uniset
...
@@ -248,7 +248,7 @@ namespace uniset
MaxSize
(
maxsize
),
minCallCount
(
cleancount
)
{};
MaxSize
(
maxsize
),
minCallCount
(
cleancount
)
{};
~
CacheOfResolve
()
{};
~
CacheOfResolve
()
{};
uniset
::
ObjectPtr
resolve
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
node
)
const
throw
(
uniset
::
NameNotFound
);
uniset
::
ObjectPtr
resolve
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
node
)
const
throw
(
uniset
::
NameNotFound
,
uniset
::
SystemError
);
void
cache
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
node
,
uniset
::
ObjectVar
&
ptr
)
const
;
void
cache
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
node
,
uniset
::
ObjectVar
&
ptr
)
const
;
void
erase
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
node
)
const
noexcept
;
void
erase
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
node
)
const
noexcept
;
...
...
src/Communications/Modbus/ModbusTypes.cc
View file @
3f7e7fad
...
@@ -757,7 +757,7 @@ namespace uniset
...
@@ -757,7 +757,7 @@ namespace uniset
void
ReadInputStatusMessage
::
init
(
const
ModbusMessage
&
m
)
void
ReadInputStatusMessage
::
init
(
const
ModbusMessage
&
m
)
{
{
assert
(
m
.
pduhead
.
func
==
fnReadInputStatus
);
assert
(
m
.
pduhead
.
func
==
fnReadInputStatus
);
memcpy
(
this
,
&
m
.
pduhead
,
sizeof
(
m
.
pduhead
)
+
szData
());
memcpy
(
this
,
&
(
m
.
pduhead
)
,
sizeof
(
m
.
pduhead
)
+
szData
());
// переворачиваем слова
// переворачиваем слова
start
=
SWAPSHORT
(
start
);
start
=
SWAPSHORT
(
start
);
...
@@ -961,8 +961,10 @@ namespace uniset
...
@@ -961,8 +961,10 @@ namespace uniset
void
ReadOutputMessage
::
init
(
const
ModbusMessage
&
m
)
void
ReadOutputMessage
::
init
(
const
ModbusMessage
&
m
)
{
{
assert
(
m
.
pduhead
.
func
==
fnReadOutputRegisters
);
assert
(
m
.
pduhead
.
func
==
fnReadOutputRegisters
);
func
=
m
.
pduhead
.
func
;
addr
=
m
.
pduhead
.
addr
;
//memset(this, 0, sizeof(*this));
//memset(this, 0, sizeof(*this));
memcpy
(
this
,
&
m
.
pduhead
,
sizeof
(
m
.
pduhead
)
+
szData
());
memcpy
(
&
start
,
&
m
.
data
,
szData
());
// переворачиваем слова
// переворачиваем слова
start
=
SWAPSHORT
(
start
);
start
=
SWAPSHORT
(
start
);
...
...
src/Interfaces/UInterface.cc
View file @
3f7e7fad
...
@@ -1265,23 +1265,30 @@ namespace uniset
...
@@ -1265,23 +1265,30 @@ namespace uniset
}
}
// ------------------------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------------------------
uniset
::
ObjectPtr
UInterface
::
CacheOfResolve
::
resolve
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
node
)
const
uniset
::
ObjectPtr
UInterface
::
CacheOfResolve
::
resolve
(
const
uniset
::
ObjectId
id
,
const
uniset
::
ObjectId
node
)
const
throw
(
uniset
::
NameNotFound
)
throw
(
uniset
::
NameNotFound
,
uniset
::
SystemError
)
{
{
uniset
::
uniset_rwmutex_rlock
l
(
cmutex
);
try
{
auto
it
=
mcache
.
find
(
uniset
::
key
(
id
,
node
)
);
uniset
::
uniset_rwmutex_rlock
l
(
cmutex
);
if
(
it
==
mcache
.
end
()
)
throw
uniset
::
NameNotFound
();
it
->
second
.
ncall
++
;
auto
it
=
mcache
.
find
(
uniset
::
key
(
id
,
node
)
)
;
// т.к. функция возвращает указатель
if
(
it
!=
mcache
.
end
()
)
// и тот кто вызывает отвечает за освобождение памяти
{
// то мы делаем _duplicate....
it
->
second
.
ncall
++
;
if
(
!
CORBA
::
is_nil
(
it
->
second
.
ptr
)
)
// т.к. функция возвращает указатель
return
CORBA
::
Object
::
_duplicate
(
it
->
second
.
ptr
);
// и тот кто вызывает отвечает за освобождение памяти
// то мы делаем _duplicate....
if
(
!
CORBA
::
is_nil
(
it
->
second
.
ptr
)
)
return
CORBA
::
Object
::
_duplicate
(
it
->
second
.
ptr
);
}
}
catch
(
std
::
exception
&
ex
)
{
uwarn
<<
"UI(CacheOfResolve::resolve): exception: "
<<
ex
.
what
()
<<
endl
;
throw
uniset
::
SystemError
(
ex
.
what
());
}
throw
uniset
::
NameNotFound
();
throw
uniset
::
NameNotFound
();
}
}
...
@@ -1305,22 +1312,29 @@ namespace uniset
...
@@ -1305,22 +1312,29 @@ namespace uniset
// ------------------------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------------------------
bool
UInterface
::
CacheOfResolve
::
clean
()
noexcept
bool
UInterface
::
CacheOfResolve
::
clean
()
noexcept
{
{
uniset
::
uniset_rwmutex_wrlock
l
(
cmutex
);
try
{
uniset
::
uniset_rwmutex_wrlock
l
(
cmutex
);
uinfo
<<
"UI: clean cache...."
<<
endl
;
uinfo
<<
"UI: clean cache...."
<<
endl
;
for
(
auto
it
=
mcache
.
begin
();
it
!=
mcache
.
end
();)
for
(
auto
it
=
mcache
.
begin
();
it
!=
mcache
.
end
();)
{
if
(
it
->
second
.
ncall
<=
minCallCount
)
{
{
try
if
(
it
->
second
.
ncall
<=
minCallCount
)
{
{
mcache
.
erase
(
it
++
);
try
{
mcache
.
erase
(
it
++
);
}
catch
(...)
{}
}
}
catch
(...)
{}
else
++
it
;
}
}
else
}
++
it
;
catch
(
std
::
exception
&
ex
)
{
uwarn
<<
"UI::Chache::clean: exception: "
<<
ex
.
what
()
<<
endl
;
}
}
if
(
mcache
.
size
()
<
MaxSize
)
if
(
mcache
.
size
()
<
MaxSize
)
...
@@ -1341,7 +1355,10 @@ namespace uniset
...
@@ -1341,7 +1355,10 @@ namespace uniset
if
(
it
!=
mcache
.
end
()
)
if
(
it
!=
mcache
.
end
()
)
mcache
.
erase
(
it
);
mcache
.
erase
(
it
);
}
}
catch
(...)
{}
catch
(
std
::
exception
&
ex
)
{
uwarn
<<
"UI::Chache::erase: exception: "
<<
ex
.
what
()
<<
endl
;
}
}
}
// ------------------------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------------------------
...
...
src/Log/DebugStream.cc
View file @
3f7e7fad
...
@@ -238,11 +238,15 @@ std::ostream& DebugStream::printDateTime(Debug::type t) noexcept
...
@@ -238,11 +238,15 @@ std::ostream& DebugStream::printDateTime(Debug::type t) noexcept
<<
std
::
setw
(
2
)
<<
std
::
setfill
(
'0'
)
<<
tms
.
tm_sec
;
<<
std
::
setw
(
2
)
<<
std
::
setfill
(
'0'
)
<<
tms
.
tm_sec
;
#endif
#endif
std
::
ios_base
::
fmtflags
old_flags
=
this
->
flags
();
if
(
show_usec
)
if
(
show_usec
)
(
*
this
)
<<
"."
<<
std
::
setw
(
6
)
<<
std
::
setfill
(
'0'
)
<<
(
tv
.
tv_nsec
/
1000
);
(
*
this
)
<<
"."
<<
std
::
setw
(
6
)
<<
std
::
setfill
(
'0'
)
<<
(
tv
.
tv_nsec
/
1000
);
else
if
(
show_msec
)
else
if
(
show_msec
)
(
*
this
)
<<
"."
<<
std
::
setw
(
3
)
<<
std
::
setfill
(
'0'
)
<<
(
tv
.
tv_nsec
/
1000000
);
(
*
this
)
<<
"."
<<
std
::
setw
(
3
)
<<
std
::
setfill
(
'0'
)
<<
(
tv
.
tv_nsec
/
1000000
);
this
->
setf
(
old_flags
);
return
*
this
;
return
*
this
;
}
}
...
...
src/ObjectRepository/UniSetActivator.cc
View file @
3f7e7fad
...
@@ -215,7 +215,14 @@ bool gdb_print_trace()
...
@@ -215,7 +215,14 @@ bool gdb_print_trace()
char
pid_buf
[
30
];
char
pid_buf
[
30
];
sprintf
(
pid_buf
,
"%d"
,
getpid
());
sprintf
(
pid_buf
,
"%d"
,
getpid
());
char
name_buf
[
512
];
char
name_buf
[
512
];
name_buf
[
readlink
(
"/proc/self/exe"
,
name_buf
,
511
)]
=
0
;
ssize_t
ind
=
readlink
(
"/proc/self/exe"
,
name_buf
,
511
);
if
(
ind
<
0
)
{
perror
(
"Can't readlink..."
);
return
false
;
}
name_buf
[
ind
]
=
0
;
TRACELOG
<<
"stack trace: for "
<<
name_buf
<<
" pid="
<<
pid_buf
<<
endl
;
TRACELOG
<<
"stack trace: for "
<<
name_buf
<<
" pid="
<<
pid_buf
<<
endl
;
...
...
src/Processes/IOController.cc
View file @
3f7e7fad
...
@@ -624,7 +624,7 @@ IOController::USensorInfo::operator=(IOController_i::SensorIOInfo* r)
...
@@ -624,7 +624,7 @@ IOController::USensorInfo::operator=(IOController_i::SensorIOInfo* r)
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
void
*
IOController
::
USensorInfo
::
getUserData
(
size_t
index
)
void
*
IOController
::
USensorInfo
::
getUserData
(
size_t
index
)
{
{
if
(
index
>
MaxUserData
)
if
(
index
>
=
MaxUserData
)
return
nullptr
;
return
nullptr
;
uniset
::
uniset_rwmutex_rlock
ulock
(
userdata_lock
);
uniset
::
uniset_rwmutex_rlock
ulock
(
userdata_lock
);
...
@@ -633,7 +633,7 @@ void* IOController::USensorInfo::getUserData( size_t index )
...
@@ -633,7 +633,7 @@ void* IOController::USensorInfo::getUserData( size_t index )
void
IOController
::
USensorInfo
::
setUserData
(
size_t
index
,
void
*
data
)
void
IOController
::
USensorInfo
::
setUserData
(
size_t
index
,
void
*
data
)
{
{
if
(
index
>
MaxUserData
)
if
(
index
>
=
MaxUserData
)
return
;
return
;
uniset
::
uniset_rwmutex_wrlock
ulock
(
userdata_lock
);
uniset
::
uniset_rwmutex_wrlock
ulock
(
userdata_lock
);
...
...
src/Processes/IONotifyController.cc
View file @
3f7e7fad
...
@@ -175,6 +175,8 @@ void IONotifyController::showStatisticsForConsumer( ostringstream& inf, const st
...
@@ -175,6 +175,8 @@ void IONotifyController::showStatisticsForConsumer( ostringstream& inf, const st
}
}
else
else
{
{
std
::
ios_base
::
fmtflags
old_flags
=
inf
.
flags
();
inf
<<
std
::
right
;
inf
<<
std
::
right
;
auto
oind
=
uniset_conf
()
->
oind
;
auto
oind
=
uniset_conf
()
->
oind
;
...
@@ -190,6 +192,8 @@ void IONotifyController::showStatisticsForConsumer( ostringstream& inf, const st
...
@@ -190,6 +192,8 @@ void IONotifyController::showStatisticsForConsumer( ostringstream& inf, const st
<<
" ]"
<<
" ]"
<<
endl
;
<<
endl
;
}
}
inf
.
setf
(
old_flags
);
}
}
inf
<<
"--------------------------------------------"
<<
endl
;
inf
<<
"--------------------------------------------"
<<
endl
;
...
...
src/Various/Configuration.cc
View file @
3f7e7fad
...
@@ -139,9 +139,6 @@ namespace uniset
...
@@ -139,9 +139,6 @@ namespace uniset
localNodeName
(
""
),
localNodeName
(
""
),
fileConfName
(
xmlfile
)
fileConfName
(
xmlfile
)
{
{
if
(
xmlfile
.
empty
()
)
setConfFileName
();
initConfiguration
(
argc
,
argv
);
initConfiguration
(
argc
,
argv
);
}
}
// ---------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------
...
@@ -158,9 +155,6 @@ namespace uniset
...
@@ -158,9 +155,6 @@ namespace uniset
localNodeName
(
""
),
localNodeName
(
""
),
fileConfName
(
fileConf
)
fileConfName
(
fileConf
)
{
{
if
(
fileConf
.
empty
()
)
setConfFileName
();
oind
=
_oind
;
oind
=
_oind
;
initConfiguration
(
argc
,
argv
);
initConfiguration
(
argc
,
argv
);
}
}
...
@@ -177,9 +171,6 @@ namespace uniset
...
@@ -177,9 +171,6 @@ namespace uniset
localNodeName
(
""
),
localNodeName
(
""
),
fileConfName
(
fileConf
)
fileConfName
(
fileConf
)
{
{
if
(
fileConf
.
empty
()
)
setConfFileName
();
shared_ptr
<
ObjectIndex_Array
>
_oi
=
make_shared
<
ObjectIndex_Array
>
(
omap
);
shared_ptr
<
ObjectIndex_Array
>
_oi
=
make_shared
<
ObjectIndex_Array
>
(
omap
);
oind
=
static_pointer_cast
<
ObjectIndex
>
(
_oi
);
oind
=
static_pointer_cast
<
ObjectIndex
>
(
_oi
);
...
@@ -188,9 +179,6 @@ namespace uniset
...
@@ -188,9 +179,6 @@ namespace uniset
// ---------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------
void
Configuration
::
initConfiguration
(
int
argc
,
const
char
*
const
*
argv
)
void
Configuration
::
initConfiguration
(
int
argc
,
const
char
*
const
*
argv
)
{
{
// PassiveTimer pt(UniSetTimer::WaitUpTime);
ulogsys
<<
"*** configure from file: "
<<
fileConfName
<<
endl
;
// т.к. мы не знаем откуда эти argc и argv и может они будут удалены сразу после завершения функции
// т.к. мы не знаем откуда эти argc и argv и может они будут удалены сразу после завершения функции
// то надёжнее скопировать себе всё..
// то надёжнее скопировать себе всё..
_argc
=
argc
;
_argc
=
argc
;
...
@@ -201,6 +189,13 @@ namespace uniset
...
@@ -201,6 +189,13 @@ namespace uniset
iorfile
=
make_shared
<
IORFile
>
();
iorfile
=
make_shared
<
IORFile
>
();
// инициализировать надо после argc,argv
if
(
fileConfName
.
empty
()
)
setConfFileName
();
// PassiveTimer pt(UniSetTimer::WaitUpTime);
ulogsys
<<
"*** configure from file: "
<<
fileConfName
<<
endl
;
// -------------------------------------------------------------------------
// -------------------------------------------------------------------------
xmlSensorsSec
=
0
;
xmlSensorsSec
=
0
;
xmlObjectsSec
=
0
;
xmlObjectsSec
=
0
;
...
...
src/Various/Mutex.cc
View file @
3f7e7fad
...
@@ -102,7 +102,15 @@ uniset_rwmutex_wrlock::uniset_rwmutex_wrlock( uniset_rwmutex& _m ):
...
@@ -102,7 +102,15 @@ uniset_rwmutex_wrlock::uniset_rwmutex_wrlock( uniset_rwmutex& _m ):
uniset_rwmutex_wrlock
::~
uniset_rwmutex_wrlock
()
uniset_rwmutex_wrlock
::~
uniset_rwmutex_wrlock
()
{
{
m
.
unlock
();
try
{
m
.
unlock
();
}
//catch( Poco::SystemException& ex )
catch
(
std
::
exception
&
ex
)
{
std
::
terminate
();
}
}
}
// -------------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------------
uniset_rwmutex_rlock
::
uniset_rwmutex_rlock
(
uniset_rwmutex
&
_m
)
:
uniset_rwmutex_rlock
::
uniset_rwmutex_rlock
(
uniset_rwmutex
&
_m
)
:
...
@@ -113,6 +121,13 @@ uniset_rwmutex_rlock::uniset_rwmutex_rlock( uniset_rwmutex& _m ):
...
@@ -113,6 +121,13 @@ uniset_rwmutex_rlock::uniset_rwmutex_rlock( uniset_rwmutex& _m ):
uniset_rwmutex_rlock
::~
uniset_rwmutex_rlock
()
uniset_rwmutex_rlock
::~
uniset_rwmutex_rlock
()
{
{
m
.
unlock
();
try
{
m
.
unlock
();
}
catch
(
std
::
exception
&
ex
)
{
std
::
terminate
();
}
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
src/Various/SViewer.cc
View file @
3f7e7fad
...
@@ -306,8 +306,10 @@ void SViewer::updateThresholds( IONotifyController_i::ThresholdsListSeq_var& tls
...
@@ -306,8 +306,10 @@ void SViewer::updateThresholds( IONotifyController_i::ThresholdsListSeq_var& tls
void
SViewer
::
printInfo
(
uniset
::
ObjectId
id
,
const
string
&
sname
,
long
value
,
const
string
&
supplier
,
void
SViewer
::
printInfo
(
uniset
::
ObjectId
id
,
const
string
&
sname
,
long
value
,
const
string
&
supplier
,
const
string
&
txtname
,
const
string
&
iotype
)
const
string
&
txtname
,
const
string
&
iotype
)
{
{
std
::
ios_base
::
fmtflags
old_flags
=
cout
.
flags
();
cout
<<
"("
<<
setw
(
5
)
<<
id
<<
")"
<<
" | "
<<
setw
(
2
)
<<
iotype
<<
" | "
<<
setw
(
60
)
<<
sname
cout
<<
"("
<<
setw
(
5
)
<<
id
<<
")"
<<
" | "
<<
setw
(
2
)
<<
iotype
<<
" | "
<<
setw
(
60
)
<<
sname
<<
" | "
<<
setw
(
5
)
<<
value
<<
"
\t
| "
<<
" | "
<<
setw
(
5
)
<<
value
<<
"
\t
| "
<<
setw
(
40
)
<<
left
<<
supplier
<<
endl
;
// "\t | " << txtname << endl;
<<
setw
(
40
)
<<
left
<<
supplier
<<
endl
;
// "\t | " << txtname << endl;
cout
.
setf
(
old_flags
);
}
}
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
tests/develop.cc
View file @
3f7e7fad
...
@@ -22,6 +22,7 @@ struct TestClass
...
@@ -22,6 +22,7 @@ struct TestClass
{
{
TestClass
()
TestClass
()
{
{
memset
(
&
data
,
0
,
sizeof
(
data
));
cerr
<<
"TEST CLASS CREATE.."
<<
endl
;
cerr
<<
"TEST CLASS CREATE.."
<<
endl
;
}
}
...
...
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