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
b09dbc61
Commit
b09dbc61
authored
May 29, 2017
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Установил sm-ready-timeout по умолчанию на 120000 мсек (2 мин),
Заменил raise(SIGTERM) --> std::terminate()
parent
d201c7cf
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
50 additions
and
40 deletions
+50
-40
IOControl.cc
extensions/IOControl/IOControl.cc
+3
-2
LProcessor.cc
extensions/LogicProcessor/LProcessor.cc
+2
-2
LProcessor.h
extensions/LogicProcessor/LProcessor.h
+1
-1
PassiveLProcessor.cc
extensions/LogicProcessor/PassiveLProcessor.cc
+1
-1
MBExchange.cc
extensions/ModbusMaster/MBExchange.cc
+5
-7
MBSlave.cc
extensions/ModbusSlave/MBSlave.cc
+12
-10
SMDBServer.cc
extensions/SMDBServer/SMDBServer.cc
+4
-3
SharedMemory.cc
extensions/SharedMemory/SharedMemory.cc
+4
-2
UNetExchange.cc
extensions/UNetUDP/UNetExchange.cc
+4
-4
UNetSender.cc
extensions/UNetUDP/UNetSender.cc
+7
-4
UniExchange.cc
extensions/UniNetwork/UniExchange.cc
+2
-1
UniExchange.h
extensions/UniNetwork/UniExchange.h
+1
-1
SMonitor.cc
src/Various/SMonitor.cc
+4
-2
No files found.
extensions/IOControl/IOControl.cc
View file @
b09dbc61
...
...
@@ -242,7 +242,7 @@ namespace uniset
int
sm_tout
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-sm-ready-timeout"
,
it
.
getProp
(
"ready_timeout"
));
if
(
sm_tout
==
0
)
smReadyTimeout
=
6
0000
;
smReadyTimeout
=
12
0000
;
else
if
(
sm_tout
<
0
)
smReadyTimeout
=
UniSetTimer
::
WaitUpTime
;
else
...
...
@@ -1561,7 +1561,8 @@ namespace uniset
<<
smReadyTimeout
<<
" msec"
;
iocrit
<<
err
.
str
()
<<
endl
;
throw
SystemError
(
err
.
str
());
//throw SystemError(err.str());
std
::
terminate
();
}
}
// -----------------------------------------------------------------------------
...
...
extensions/LogicProcessor/LProcessor.cc
View file @
b09dbc61
...
...
@@ -30,10 +30,10 @@ LProcessor::LProcessor( const std::string& name ):
{
auto
conf
=
uniset_conf
();
sleepTime
=
conf
->
getArgPInt
(
"--sleepTime"
,
200
);
int
tout
=
conf
->
getArgInt
(
"--sm-ready-timeout"
,
""
);
int
tout
=
conf
->
getArgInt
(
"--sm-ready-timeout"
,
"
120000
"
);
if
(
tout
==
0
)
smReadyTimeout
=
6
0000
;
smReadyTimeout
=
12
0000
;
else
if
(
tout
<
0
)
smReadyTimeout
=
UniSetTimer
::
WaitUpTime
;
else
...
...
extensions/LogicProcessor/LProcessor.h
View file @
b09dbc61
...
...
@@ -180,7 +180,7 @@ namespace uniset
UInterface
ui
;
timeout_t
sleepTime
=
{
200
};
timeout_t
smReadyTimeout
=
{
3
0000
}
;
/*!< время ожидания готовности SM, мсек */
timeout_t
smReadyTimeout
=
{
12
0000
}
;
/*!< время ожидания готовности SM, мсек */
std
::
string
logname
=
{
""
};
std
::
atomic_bool
canceled
=
{
false
};
...
...
extensions/LogicProcessor/PassiveLProcessor.cc
View file @
b09dbc61
...
...
@@ -151,7 +151,7 @@ void PassiveLProcessor::sysCommand( const uniset::SystemMessage* sm )
if
(
!
shm
->
waitSMready
(
smReadyTimeout
)
)
{
dcrit
<<
myname
<<
"(ERR): SM not ready. Terminated... "
<<
endl
;
raise
(
SIGTERM
);
std
::
terminate
(
);
return
;
}
...
...
extensions/ModbusMaster/MBExchange.cc
View file @
b09dbc61
...
...
@@ -302,8 +302,8 @@ namespace uniset
void
MBExchange
::
waitSMReady
()
{
// waiting for SM is ready...
int
tout
=
uniset_conf
()
->
getArgInt
(
"--"
+
prefix
+
"-sm-ready-timeout"
,
"1
5
000"
);
timeout_t
ready_timeout
=
6
0000
;
int
tout
=
uniset_conf
()
->
getArgInt
(
"--"
+
prefix
+
"-sm-ready-timeout"
,
"1
20
000"
);
timeout_t
ready_timeout
=
12
0000
;
if
(
tout
>
0
)
ready_timeout
=
tout
;
...
...
@@ -315,10 +315,7 @@ namespace uniset
ostringstream
err
;
err
<<
myname
<<
"(waitSMReady): failed waiting SharedMemory "
<<
ready_timeout
<<
" msec. ==> TERMINATE!"
;
mbcrit
<<
err
.
str
()
<<
endl
;
raise
(
SIGTERM
);
//if( checkProcActive() )
// throw SystemError(err.str());
std
::
terminate
();
}
}
// -----------------------------------------------------------------------------
...
...
@@ -2817,7 +2814,8 @@ namespace uniset
if
(
devices
.
empty
()
)
{
mbcrit
<<
myname
<<
"(sysCommand): ************* ITEM MAP EMPTY! terminated... *************"
<<
endl
;
raise
(
SIGTERM
);
//raise(SIGTERM);
std
::
terminate
();
return
;
}
...
...
extensions/ModbusSlave/MBSlave.cc
View file @
b09dbc61
...
...
@@ -528,8 +528,8 @@ namespace uniset
void
MBSlave
::
waitSMReady
()
{
// waiting for SM is ready...
int
tout
=
uniset_conf
()
->
getArgInt
(
"--"
+
prefix
+
"-sm-ready-timeout"
,
"1
5
000"
);
timeout_t
ready_timeout
=
6
0000
;
int
tout
=
uniset_conf
()
->
getArgInt
(
"--"
+
prefix
+
"-sm-ready-timeout"
,
"1
20
000"
);
timeout_t
ready_timeout
=
12
0000
;
if
(
tout
>
0
)
ready_timeout
=
tout
;
...
...
@@ -541,10 +541,8 @@ namespace uniset
ostringstream
err
;
err
<<
myname
<<
"(waitSMReady): Не дождались готовности SharedMemory к работе в течение "
<<
ready_timeout
<<
" мсек"
;
mbcrit
<<
err
.
str
()
<<
endl
;
// throw SystemError(err.str());
raise
(
SIGTERM
);
terminate
();
// abort();
//terminate();
std
::
terminate
();
}
}
// -----------------------------------------------------------------------------
...
...
@@ -565,7 +563,8 @@ namespace uniset
if
(
vaddr
.
empty
()
)
{
mbcrit
<<
"(execute_rtu): Unknown my modbus addresses!"
<<
endl
;
raise
(
SIGTERM
);
//raise(SIGTERM);
std
::
terminate
();
return
;
}
...
...
@@ -604,7 +603,8 @@ namespace uniset
if
(
!
tcpserver
)
{
mbcrit
<<
myname
<<
"(execute_tcp): DYNAMIC CAST ERROR (mbslot --> ModbusTCPServerSlot)"
<<
std
::
endl
;
raise
(
SIGTERM
);
//raise(SIGTERM);
std
::
terminate
();
return
;
}
...
...
@@ -626,7 +626,8 @@ namespace uniset
if
(
vaddr
.
empty
()
)
{
mbcrit
<<
"(execute_tcp): Unknown my modbus addresses!"
<<
endl
;
raise
(
SIGTERM
);
//raise(SIGTERM);
std
::
terminate
();
return
;
}
...
...
@@ -892,7 +893,8 @@ namespace uniset
if
(
iomap
.
empty
()
)
{
mbcrit
<<
myname
<<
"(sysCommand): iomap EMPTY! terminated..."
<<
endl
;
raise
(
SIGTERM
);
// raise(SIGTERM);
std
::
terminate
();
return
;
}
...
...
extensions/SMDBServer/SMDBServer.cc
View file @
b09dbc61
...
...
@@ -100,10 +100,10 @@ SMDBServer::~SMDBServer()
void
SMDBServer
::
waitSMReady
()
{
// waiting for SM is ready...
int
ready_timeout
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-sm-ready-timeout"
,
"1
5
000"
);
int
ready_timeout
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-sm-ready-timeout"
,
"1
20
000"
);
if
(
ready_timeout
==
0
)
ready_timeout
=
6
0000
;
ready_timeout
=
12
0000
;
else
if
(
ready_timeout
<
0
)
ready_timeout
=
UniSetTimer
::
WaitUpTime
;
...
...
@@ -112,7 +112,8 @@ void SMDBServer::waitSMReady()
ostringstream
err
;
err
<<
myname
<<
"(waitSMReady): Wait SharedMemory failed. [ "
<<
ready_timeout
<<
" msec ]"
;
dcrit
<<
err
.
str
()
<<
endl
;
throw
SystemError
(
err
.
str
());
//throw SystemError(err.str());
std
::
terminate
();
}
}
// -----------------------------------------------------------------------------
...
...
extensions/SharedMemory/SharedMemory.cc
View file @
b09dbc61
...
...
@@ -894,7 +894,8 @@ namespace uniset
err
<<
myname
<<
"(initFromReserv): Not found ID for '"
<<
smName
<<
"'"
;
smcrit
<<
err
.
str
()
<<
endl
;
// throw SystemError(err.str());
raise
(
SIGTERM
);
//raise(SIGTERM);
std
::
terminate
();
}
std
::
string
smNode
(
it
.
getProp
(
"node"
));
...
...
@@ -910,7 +911,8 @@ namespace uniset
err
<<
myname
<<
"(initFromReserv): Not found NodeID for '"
<<
smNode
<<
"'"
;
smcrit
<<
err
.
str
()
<<
endl
;
// throw SystemError(err.str());
raise
(
SIGTERM
);
//raise(SIGTERM);
std
::
terminate
();
}
...
...
extensions/UNetUDP/UNetExchange.cc
View file @
b09dbc61
...
...
@@ -475,9 +475,9 @@ void UNetExchange::startReceivers()
void
UNetExchange
::
waitSMReady
()
{
// waiting for SM is ready...
int
tout
=
uniset_conf
()
->
getArgInt
(
"--unet-sm-ready-timeout"
,
"1
5
000"
);
int
tout
=
uniset_conf
()
->
getArgInt
(
"--unet-sm-ready-timeout"
,
"1
20
000"
);
timeout_t
ready_timeout
=
6
0000
;
timeout_t
ready_timeout
=
12
0000
;
if
(
tout
>
0
)
ready_timeout
=
tout
;
...
...
@@ -489,7 +489,7 @@ void UNetExchange::waitSMReady()
ostringstream
err
;
err
<<
myname
<<
"(waitSMReady): Не дождались готовности SharedMemory к работе в течение "
<<
ready_timeout
<<
" мсек"
;
unetcrit
<<
err
.
str
()
<<
endl
;
throw
SystemError
(
err
.
str
()
);
std
::
terminate
(
);
}
}
// -----------------------------------------------------------------------------
...
...
@@ -821,7 +821,7 @@ void UNetExchange::help_print( int argc, const char* argv[] ) noexcept
cout
<<
" 'evloop' - используется общий (с приёмом сообщений) event loop"
<<
endl
;
cout
<<
" По умолчанию: evloop"
<<
endl
;
cout
<<
"--prefix-sm-ready-timeout msec - Время ожидание я готовности SM к работе. По умолчанию 1
5
000"
<<
endl
;
cout
<<
"--prefix-sm-ready-timeout msec - Время ожидание я готовности SM к работе. По умолчанию 1
20
000"
<<
endl
;
cout
<<
"--prefix-filter-field name - Название фильтрующего поля при формировании списка датчиков посылаемых данным узлом"
<<
endl
;
cout
<<
"--prefix-filter-value name - Значение фильтрующего поля при формировании списка датчиков посылаемых данным узлом"
<<
endl
;
cout
<<
endl
;
...
...
extensions/UNetUDP/UNetSender.cc
View file @
b09dbc61
...
...
@@ -442,7 +442,8 @@ namespace uniset
<<
"(readItem): OVERFLOW! MAX UDP DIGITAL DATA LIMIT! max="
<<
UniSetUDP
::
MaxDCount
<<
endl
;
raise
(
SIGTERM
);
// raise(SIGTERM);
std
::
terminate
();
return
false
;
}
}
...
...
@@ -480,7 +481,8 @@ namespace uniset
<<
"(readItem): OVERFLOW! MAX UDP ANALOG DATA LIMIT! max="
<<
UniSetUDP
::
MaxACount
<<
endl
;
raise
(
SIGTERM
);
// raise(SIGTERM);
std
::
terminate
();
return
false
;
}
}
...
...
@@ -492,7 +494,8 @@ namespace uniset
{
unetcrit
<<
myname
<<
"(readItem): Sensor ("
<<
p
.
id
<<
")"
<<
sname
<<
" ALREADY ADDED!! ABORT!"
<<
endl
;
raise
(
SIGTERM
);
// raise(SIGTERM);
std
::
terminate
();
return
false
;
}
...
...
@@ -514,7 +517,7 @@ namespace uniset
// -----------------------------------------------------------------------------
void
UNetSender
::
askSensors
(
UniversalIO
::
UIOCommand
cmd
)
{
for
(
auto
&
&
it
:
items
)
for
(
const
auto
&
it
:
items
)
shm
->
askSensor
(
it
.
second
.
id
,
cmd
);
}
// -----------------------------------------------------------------------------
...
...
extensions/UniNetwork/UniExchange.cc
View file @
b09dbc61
...
...
@@ -152,7 +152,8 @@ void UniExchange::execute()
<<
smReadyTimeout
<<
" мсек"
;
ucrit
<<
err
.
str
()
<<
endl
;
throw
SystemError
(
err
.
str
());
//throw SystemError(err.str());
std
::
terminate
();
}
PassiveTimer
pt
(
UniSetTimer
::
WaitUpTime
);
...
...
extensions/UniNetwork/UniExchange.h
View file @
b09dbc61
...
...
@@ -142,7 +142,7 @@ namespace uniset
SList
mymap
;
size_t
maxIndex
=
{
0
};
timeout_t
smReadyTimeout
=
{
15
000
};
// msec
timeout_t
smReadyTimeout
=
{
60
000
};
// msec
private
:
};
...
...
src/Various/SMonitor.cc
View file @
b09dbc61
...
...
@@ -74,12 +74,14 @@ void SMonitor::sysCommand( const SystemMessage* sm )
catch
(
const
uniset
::
Exception
&
ex
)
{
cerr
<<
myname
<<
":(askSensor): "
<<
ex
<<
endl
;
raise
(
SIGTERM
);
// raise(SIGTERM);
std
::
terminate
();
}
catch
(...)
{
cerr
<<
myname
<<
": НЕ СМОГ ЗАКАЗТЬ датчики "
<<
endl
;
raise
(
SIGTERM
);
// raise(SIGTERM);
std
::
terminate
();
}
}
}
...
...
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