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
b9172d42
Commit
b9172d42
authored
Aug 06, 2009
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
overall: use getArgInt instead atoi(getArgParam)
parent
aabafa19
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
95 additions
and
97 deletions
+95
-97
main.cc
Utilities/NullController/main.cc
+1
-1
main.cc
Utilities/SViewer-text/main.cc
+2
-2
ctl-cpp-common.xsl
Utilities/codegen/ctl-cpp-common.xsl
+10
-10
IOControl.cc
extensions/IOControl/IOControl.cc
+14
-14
LProcessor.cc
extensions/LogicProcessor/LProcessor.cc
+1
-1
MBMaster.cc
extensions/MBTCPMaster/MBMaster.cc
+14
-14
MBSlave.cc
extensions/ModbusSlave/MBSlave.cc
+8
-8
RTUExchange.cc
extensions/RTUExchange/RTUExchange.cc
+15
-15
SharedMemory.cc
extensions/SharedMemory/SharedMemory.cc
+7
-7
UDPExchange.cc
extensions/UDPExchange/UDPExchange.cc
+15
-17
UObject_SK.cc
extensions/lib/UObject_SK.cc
+8
-8
No files found.
Utilities/NullController/main.cc
View file @
b9172d42
...
...
@@ -73,7 +73,7 @@ int main(int argc, char** argv)
string
d_fvalue
=
conf
->
getArgParam
(
"--d-filter-value"
);
//
bool
dbDumping
=
atoi
(
conf
->
getArgParam
(
"--dbDumping"
).
c_str
()
);
bool
dbDumping
=
conf
->
getArgInt
(
"--dbDumping"
);
NullController
nc
(
ID
,
askfile
,
s_field
,
s_fvalue
,
c_field
,
c_fvalue
,
d_field
,
d_fvalue
,
dbDumping
);
ObjectsActivator
act
;
...
...
Utilities/SViewer-text/main.cc
View file @
b9172d42
...
...
@@ -36,10 +36,10 @@ int main(int argc, const char **argv)
for(int i=0; i<size; i++)
cout << "id=" << seq[i].si.id << " val=" << seq[i].value << endl;
*/
bool
fullname
=
atoi
(
conf
->
getArgParam
(
"--fullname"
).
c_str
()
);
bool
fullname
=
conf
->
getArgInt
(
"--fullname"
);
SViewer
sv
(
conf
->
getControllersSection
(),
!
fullname
);
int
timeMS
=
atoi
(
conf
->
getArgParam
(
"--polltime"
).
c_str
()
);
timeout_t
timeMS
=
conf
->
getArgInt
(
"--polltime"
);
if
(
timeMS
)
{
cout
<<
"(main): "
<<
timeMS
<<
"[]"
<<
endl
;
...
...
Utilities/codegen/ctl-cpp-common.xsl
View file @
b9172d42
...
...
@@ -512,26 +512,26 @@ activated(false)
</xsl:if>
</xsl:for-each>
sleep_msec =
atoi(conf->getArgParam("--sleep-msec","
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'sleep-msec'"
/></xsl:call-template>
").c_str()
);
sleep_msec =
conf->getArgInt("--sleep-msec","
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'sleep-msec'"
/></xsl:call-template>
"
);
if( sleep_msec
<
=0 )
sleep_msec =
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'sleep-msec'"
/></xsl:call-template>
;
resetMsgTime =
atoi(conf->getProp(cnode,"resetMsgTime").c_str(
));
resetMsgTime =
uni_atoi(conf->getProp(cnode,"resetMsgTime"
));
if( resetMsgTime
<
= 0 )
resetMsgTime = 200;
ptResetMsg.setTiming(resetMsgTime);
smReadyTimeout =
atoi(conf->getArgParam("--sm-ready-timeout","
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'smReadyTimeout'"
/></xsl:call-template>
").c_str()
);
smReadyTimeout =
conf->getArgInt("--sm-ready-timeout","
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'smReadyTimeout'"
/></xsl:call-template>
"
);
if( smReadyTimeout == 0 )
smReadyTimeout = 60000;
else if( smReadyTimeout
<
0 )
smReadyTimeout = UniSetTimer::WaitUpTime;
activateTimeout =
atoi(conf->getArgParam("--activate-timeout").c_str()
);
activateTimeout =
conf->getArgInt("--activate-timeout"
);
if( activateTimeout
<
=0 )
activateTimeout = 20000;
int msec =
atoi(conf->getArgParam("--startup-timeout").c_str()
);
int msec =
conf->getArgInt("--startup-timeout"
);
if( msec
<
=0 )
msec = 10000;
ptStartUpTimeout.setTiming(msec);
...
...
@@ -709,26 +709,26 @@ activated(false)
</xsl:call-template>
</xsl:for-each>
sleep_msec =
atoi(conf->getArgParam("--sleep-msec","
<xsl:call-template
name=
"settings-alone"
><xsl:with-param
name=
"varname"
select=
"'sleep-msec'"
/></xsl:call-template>
").c_str()
);
sleep_msec =
conf->getArgInt("--sleep-msec","
<xsl:call-template
name=
"settings-alone"
><xsl:with-param
name=
"varname"
select=
"'sleep-msec'"
/></xsl:call-template>
"
);
if( sleep_msec
<
=0 )
sleep_msec =
<xsl:call-template
name=
"settings-alone"
><xsl:with-param
name=
"varname"
select=
"'sleep-msec'"
/></xsl:call-template>
;
resetMsgTime =
atoi(conf->getProp(cnode,"resetMsgTime").c_str(
));
resetMsgTime =
uni_atoi(conf->getProp(cnode,"resetMsgTime"
));
if( resetMsgTime
<
= 0 )
resetMsgTime = 0;
ptResetMsg.setTiming(resetMsgTime);
smReadyTimeout =
atoi(conf->getArgParam("--sm-ready-timeout","
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'smReadyTimeout'"
/></xsl:call-template>
").c_str());
smReadyTimeout =
conf->getArgInt("--sm-ready-timeout","
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'smReadyTimeout'"
/></xsl:call-template>
");
if( smReadyTimeout == 0 )
smReadyTimeout = 60000;
else if( smReadyTimeout
<
0 )
smReadyTimeout = UniSetTimer::WaitUpTime;
activateTimeout =
atoi(conf->getArgParam("--activate-timeout").c_str()
);
activateTimeout =
conf->getArgInt("--activate-timeout"
);
if( activateTimeout
<
=0 )
activateTimeout = 20000;
int msec =
atoi(conf->getArgParam("--startup-timeout").c_str()
);
int msec =
conf->getArgInt("--startup-timeout"
);
if( msec
<
=0 )
msec = 10000;
ptStartUpTimeout.setTiming(msec);
...
...
extensions/IOControl/IOControl.cc
View file @
b9172d42
...
...
@@ -109,15 +109,15 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
}
}
polltime
=
atoi
(
conf
->
getArgParam
(
"--io-polltime"
,
it
.
getProp
(
"polltime"
)).
c_str
(
));
polltime
=
conf
->
getArgInt
(
"--io-polltime"
,
it
.
getProp
(
"polltime"
));
if
(
!
polltime
)
polltime
=
150
;
force
=
atoi
(
conf
->
getArgParam
(
"--io-force"
,
it
.
getProp
(
"force"
)).
c_str
(
));
force_out
=
atoi
(
conf
->
getArgParam
(
"--io-force-out"
,
it
.
getProp
(
"force_out"
)).
c_str
(
));
force
=
conf
->
getArgInt
(
"--io-force"
,
it
.
getProp
(
"force"
));
force_out
=
conf
->
getArgInt
(
"--io-force-out"
,
it
.
getProp
(
"force_out"
));
filtersize
=
atoi
(
conf
->
getArgParam
(
"--io-filtersize"
,
it
.
getProp
(
"filtersize"
)).
c_str
(
));
if
(
filtersize
<=
0
)
filtersize
=
conf
->
getArgInt
(
"--io-filtersize"
,
it
.
getProp
(
"filtersize"
));
if
(
filtersize
<=
0
)
filtersize
=
1
;
filterT
=
atof
(
conf
->
getArgParam
(
"--io-filterT"
,
it
.
getProp
(
"filterT"
)).
c_str
());
...
...
@@ -146,13 +146,13 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
unideb
[
Debug
::
INFO
]
<<
myname
<<
"(init): read s_field='"
<<
s_field
<<
"' s_fvalue='"
<<
s_fvalue
<<
"'"
<<
endl
;
int
blink_msec
=
atoi
(
conf
->
getArgParam
(
"--io-blink-time"
,
it
.
getProp
(
"blink-time"
)).
c_str
(
));
int
blink_msec
=
conf
->
getArgInt
(
"--io-blink-time"
,
it
.
getProp
(
"blink-time"
));
if
(
blink_msec
<=
0
)
blink_msec
=
300
;
ptBlink
.
setTiming
(
blink_msec
);
smReadyTimeout
=
atoi
(
conf
->
getArgParam
(
"--io-sm-ready-timeout"
,
it
.
getProp
(
"ready_timeout"
)).
c_str
(
));
smReadyTimeout
=
conf
->
getArgInt
(
"--io-sm-ready-timeout"
,
it
.
getProp
(
"ready_timeout"
));
if
(
smReadyTimeout
==
0
)
smReadyTimeout
=
15000
;
else
if
(
smReadyTimeout
<
0
)
...
...
@@ -160,7 +160,7 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
string
sm_ready_sid
=
conf
->
getArgParam
(
"--io-sm-ready-test-sid"
,
it
.
getProp
(
"sm_ready_test_sid"
));
sidTestSMReady
=
conf
->
getSensorID
(
sm_ready_sid
.
c_str
()
);
sidTestSMReady
=
conf
->
getSensorID
(
sm_ready_sid
);
if
(
sidTestSMReady
==
DefaultObjectId
)
{
sidTestSMReady
=
4100
;
/* TestMode_S */
...
...
@@ -185,19 +185,19 @@ IOControl::IOControl( UniSetTypes::ObjectId id, UniSetTypes::ObjectId icID,
throw
SystemError
(
err
.
str
());
}
int
heartbeatTime
=
atoi
(
conf
->
getArgParam
(
"--heartbeat-check-time"
,
"1000"
).
c_str
()
);
int
heartbeatTime
=
conf
->
getArgInt
(
"--heartbeat-check-time"
,
"1000"
);
if
(
heartbeatTime
)
ptHeartBeat
.
setTiming
(
heartbeatTime
);
else
ptHeartBeat
.
setTiming
(
UniSetTimer
::
WaitUpTime
);
maxHeartBeat
=
atoi
(
conf
->
getArgParam
(
"--io-heartbeat-max"
,
it
.
getProp
(
"heartbeat_max"
)).
c_str
(
));
if
(
maxHeartBeat
<=
0
)
maxHeartBeat
=
conf
->
getArgInt
(
"--io-heartbeat-max"
,
it
.
getProp
(
"heartbeat_max"
));
if
(
maxHeartBeat
<=
0
)
maxHeartBeat
=
10
;
}
activateTimeout
=
atoi
(
conf
->
getArgParam
(
"--activate-timeout"
).
c_str
()
);
if
(
activateTimeout
<=
0
)
activateTimeout
=
conf
->
getArgInt
(
"--activate-timeout"
);
if
(
activateTimeout
<=
0
)
activateTimeout
=
25000
;
if
(
!
shm
->
isLocalwork
()
)
// ic
...
...
@@ -249,7 +249,7 @@ void IOControl::execute()
// -
initIOCard
();
bool
skip_iout
=
atoi
(
conf
->
getArgParam
(
"--io-skip-init-output"
).
c_str
()
);
bool
skip_iout
=
conf
->
getArgInt
(
"--io-skip-init-output"
);
if
(
!
skip_iout
)
initOutputs
();
...
...
extensions/LogicProcessor/LProcessor.cc
View file @
b9172d42
...
...
@@ -7,7 +7,7 @@ using namespace UniSetTypes;
// -------------------------------------------------------------------------
LProcessor
::
LProcessor
()
{
sleepTime
=
atoi
(
conf
->
getArgParam
(
"--sleepTime"
).
c_str
()
);
sleepTime
=
conf
->
getArgInt
(
"--sleepTime"
);
sleepTime
=
(
sleepTime
<=
0
)
?
200
:
sleepTime
;
}
...
...
extensions/MBTCPMaster/MBMaster.cc
View file @
b9172d42
...
...
@@ -51,11 +51,11 @@ prefix(prefix)
throw
UniSetTypes
::
SystemError
(
myname
+
"(MBMaster): Unknown inet addr...(Use: "
+
pname
+
")"
);
string
tmp
(
"--"
+
prefix
+
"-port"
);
port
=
atoi
(
conf
->
getArgParam
(
tmp
,
it
.
getProp
(
"port"
)).
c_str
(
));
if
(
port
<=
0
)
port
=
conf
->
getArgInt
(
tmp
,
it
.
getProp
(
"port"
));
if
(
port
<=
0
)
throw
UniSetTypes
::
SystemError
(
myname
+
"(MBMaster): Unknown inet port...(Use: "
+
tmp
+
")"
);
recv_timeout
=
atoi
(
conf
->
getArgParam
(
"--"
+
prefix
+
"-recv-timeout"
,
it
.
getProp
(
"recv_timeout"
)).
c_str
(
));
recv_timeout
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-recv-timeout"
,
it
.
getProp
(
"recv_timeout"
));
if
(
recv_timeout
<=
0
)
recv_timeout
=
2000
;
...
...
@@ -64,18 +64,18 @@ prefix(prefix)
if
(
saddr
.
empty
()
)
myaddr
=
0x00
;
mbregFromID
=
atoi
(
conf
->
getArgParam
(
"--"
+
prefix
+
"-reg-from-id"
,
it
.
getProp
(
"reg_from_id"
)).
c_str
(
));
mbregFromID
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-reg-from-id"
,
it
.
getProp
(
"reg_from_id"
));
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(init): mbregFromID="
<<
mbregFromID
<<
endl
;
polltime
=
atoi
(
conf
->
getArgParam
(
"--"
+
prefix
+
"-polltime"
,
it
.
getProp
(
"polltime"
)).
c_str
(
));
polltime
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-polltime"
,
it
.
getProp
(
"polltime"
));
if
(
!
polltime
)
polltime
=
100
;
initPause
=
atoi
(
conf
->
getArgParam
(
"--"
+
prefix
+
"-initPause"
,
it
.
getProp
(
"initPause"
)).
c_str
(
));
initPause
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-initPause"
,
it
.
getProp
(
"initPause"
));
if
(
!
initPause
)
initPause
=
3000
;
force
=
atoi
(
conf
->
getArgParam
(
"--"
+
prefix
+
"-force"
,
it
.
getProp
(
"force"
)).
c_str
(
));
force
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-force"
,
it
.
getProp
(
"force"
));
if
(
shm
->
isLocalwork
()
)
{
...
...
@@ -105,8 +105,8 @@ prefix(prefix)
else
ptHeartBeat
.
setTiming
(
UniSetTimer
::
WaitUpTime
);
maxHeartBeat
=
atoi
(
conf
->
getArgParam
(
"--"
+
prefix
+
"-heartbeat-max"
,
it
.
getProp
(
"heartbeat_max"
)).
c_str
(
));
if
(
maxHeartBeat
<=
0
)
maxHeartBeat
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-heartbeat-max"
,
it
.
getProp
(
"heartbeat_max"
));
if
(
maxHeartBeat
<=
0
)
maxHeartBeat
=
10
;
test_id
=
sidHeartBeat
;
...
...
@@ -123,12 +123,12 @@ prefix(prefix)
}
}
activateTimeout
=
atoi
(
conf
->
getArgParam
(
"--"
+
prefix
+
"-activate-timeout"
).
c_str
()
);
if
(
activateTimeout
<=
0
)
activateTimeout
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-activate-timeout"
);
if
(
activateTimeout
<=
0
)
activateTimeout
=
20000
;
int
msec
=
atoi
(
conf
->
getArgParam
(
"--"
+
prefix
+
"-timeout"
,
it
.
getProp
(
"timeout"
)).
c_str
(
));
if
(
msec
<=
0
)
int
msec
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-timeout"
,
it
.
getProp
(
"timeout"
));
if
(
msec
<=
0
)
msec
=
3000
;
ptTimeout
.
setTiming
(
msec
);
...
...
@@ -146,7 +146,7 @@ MBMaster::~MBMaster()
void
MBMaster
::
waitSMReady
()
{
// waiting for SM is ready...
int
ready_timeout
=
atoi
(
conf
->
getArgParam
(
"--"
+
prefix
+
"-sm-ready-timeout"
,
"15000"
).
c_str
()
);
int
ready_timeout
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-sm-ready-timeout"
,
"15000"
);
if
(
ready_timeout
==
0
)
ready_timeout
=
15000
;
else
if
(
ready_timeout
<
0
)
...
...
extensions/ModbusSlave/MBSlave.cc
View file @
b9172d42
...
...
@@ -49,7 +49,7 @@ prefix(prefix)
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(init): read s_field='"
<<
s_field
<<
"' s_fvalue='"
<<
s_fvalue
<<
"'"
<<
endl
;
force
=
uni_atoi
(
conf
->
getArgParam
(
"--"
+
prefix
+
"-force"
,
it
.
getProp
(
"force"
)
));
force
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-force"
,
it
.
getProp
(
"force"
));
// int recv_timeout = atoi(conf->getArgParam("--" + prefix + "-recv-timeout",it.getProp("recv_timeout")).c_str());
...
...
@@ -60,7 +60,7 @@ prefix(prefix)
else
addr
=
ModbusRTU
::
str2mbAddr
(
saddr
);
mbregFromID
=
uni_atoi
(
conf
->
getArgParam
(
"--"
+
prefix
+
"-reg-from-id"
,
it
.
getProp
(
"reg_from_id"
)
));
mbregFromID
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-reg-from-id"
,
it
.
getProp
(
"reg_from_id"
));
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(init): mbregFromID="
<<
mbregFromID
<<
endl
;
string
stype
=
conf
->
getArgParam
(
"--"
+
prefix
+
"-type"
,
it
.
getProp
(
"type"
));
...
...
@@ -157,8 +157,8 @@ prefix(prefix)
else
ptHeartBeat
.
setTiming
(
UniSetTimer
::
WaitUpTime
);
maxHeartBeat
=
atoi
(
conf
->
getArgParam
(
"--"
+
prefix
+
"-heartbeat-max"
,
it
.
getProp
(
"heartbeat_max"
)).
c_str
(
));
if
(
maxHeartBeat
<=
0
)
maxHeartBeat
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-heartbeat-max"
,
it
.
getProp
(
"heartbeat_max"
));
if
(
maxHeartBeat
<=
0
)
maxHeartBeat
=
10
;
test_id
=
sidHeartBeat
;
...
...
@@ -184,11 +184,11 @@ prefix(prefix)
if
(
wait_msec
<
500
)
wait_msec
=
500
;
activateTimeout
=
atoi
(
conf
->
getArgParam
(
"--"
+
prefix
+
"-activate-timeout"
).
c_str
()
);
if
(
activateTimeout
<=
0
)
activateTimeout
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-activate-timeout"
);
if
(
activateTimeout
<=
0
)
activateTimeout
=
20000
;
int
msec
=
atoi
(
conf
->
getArgParam
(
"--"
+
prefix
+
"-timeout"
,
it
.
getProp
(
"timeout"
)).
c_str
(
));
int
msec
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-timeout"
,
it
.
getProp
(
"timeout"
));
if
(
msec
<=
0
)
msec
=
3000
;
...
...
@@ -256,7 +256,7 @@ MBSlave::~MBSlave()
void
MBSlave
::
waitSMReady
()
{
// waiting for SM is ready...
int
ready_timeout
=
atoi
(
conf
->
getArgParam
(
"--"
+
prefix
+
"-sm-ready-timeout"
,
"15000"
).
c_str
()
);
int
ready_timeout
=
conf
->
getArgInt
(
"--"
+
prefix
+
"-sm-ready-timeout"
,
"15000"
);
if
(
ready_timeout
==
0
)
ready_timeout
=
15000
;
else
if
(
ready_timeout
<
0
)
...
...
extensions/RTUExchange/RTUExchange.cc
View file @
b9172d42
...
...
@@ -55,32 +55,32 @@ allNotRespond(false)
defSpeed
=
ComPort
::
getSpeed
(
speed
);
recv_timeout
=
atoi
(
conf
->
getArgParam
(
"--rs-recv-timeout"
,
it
.
getProp
(
"recv_timeout"
)).
c_str
(
));
recv_timeout
=
conf
->
getArgInt
(
"--rs-recv-timeout"
,
it
.
getProp
(
"recv_timeout"
));
if
(
recv_timeout
<=
0
)
recv_timeout
=
50
;
int
alltout
=
atoi
(
conf
->
getArgParam
(
"--rs-all-timeout"
,
it
.
getProp
(
"all_timeout"
)).
c_str
(
));
if
(
alltout
<=
0
)
int
alltout
=
conf
->
getArgInt
(
"--rs-all-timeout"
,
it
.
getProp
(
"all_timeout"
));
if
(
alltout
<=
0
)
alltout
=
2000
;
ptAllNotRespond
.
setTiming
(
alltout
);
rs_pre_clean
=
atoi
(
conf
->
getArgParam
(
"--rs-pre-clean"
,
it
.
getProp
(
"pre_clean"
)).
c_str
(
));
noQueryOptimization
=
atoi
(
conf
->
getArgParam
(
"--rs-no-query-optimization"
,
it
.
getProp
(
"no_query_optimization"
)).
c_str
(
));
rs_pre_clean
=
conf
->
getArgInt
(
"--rs-pre-clean"
,
it
.
getProp
(
"pre_clean"
));
noQueryOptimization
=
conf
->
getArgInt
(
"--rs-no-query-optimization"
,
it
.
getProp
(
"no_query_optimization"
));
mbregFromID
=
atoi
(
conf
->
getArgParam
(
"--mbs-reg-from-id"
,
it
.
getProp
(
"reg_from_id"
)).
c_str
(
));
mbregFromID
=
conf
->
getArgInt
(
"--mbs-reg-from-id"
,
it
.
getProp
(
"reg_from_id"
));
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(init): mbregFromID="
<<
mbregFromID
<<
endl
;
polltime
=
atoi
(
conf
->
getArgParam
(
"--rs-polltime"
,
it
.
getProp
(
"polltime"
)).
c_str
(
));
polltime
=
conf
->
getArgInt
(
"--rs-polltime"
,
it
.
getProp
(
"polltime"
));
if
(
!
polltime
)
polltime
=
100
;
initPause
=
atoi
(
conf
->
getArgParam
(
"--rs-initPause"
,
it
.
getProp
(
"initPause"
)).
c_str
(
));
initPause
=
conf
->
getArgInt
(
"--rs-initPause"
,
it
.
getProp
(
"initPause"
));
if
(
!
initPause
)
initPause
=
3000
;
force
=
atoi
(
conf
->
getArgParam
(
"--rs-force"
,
it
.
getProp
(
"force"
)).
c_str
(
));
force_out
=
atoi
(
conf
->
getArgParam
(
"--rs-force-out"
,
it
.
getProp
(
"force_out"
)).
c_str
(
));
force
=
conf
->
getArgInt
(
"--rs-force"
,
it
.
getProp
(
"force"
));
force_out
=
conf
->
getArgInt
(
"--rs-force-out"
,
it
.
getProp
(
"force_out"
));
if
(
shm
->
isLocalwork
()
)
{
...
...
@@ -110,8 +110,8 @@ allNotRespond(false)
else
ptHeartBeat
.
setTiming
(
UniSetTimer
::
WaitUpTime
);
maxHeartBeat
=
atoi
(
conf
->
getArgParam
(
"--rs-heartbeat-max"
,
it
.
getProp
(
"heartbeat_max"
)).
c_str
(
));
if
(
maxHeartBeat
<=
0
)
maxHeartBeat
=
conf
->
getArgInt
(
"--rs-heartbeat-max"
,
it
.
getProp
(
"heartbeat_max"
));
if
(
maxHeartBeat
<=
0
)
maxHeartBeat
=
10
;
test_id
=
sidHeartBeat
;
}
...
...
@@ -129,8 +129,8 @@ allNotRespond(false)
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(init): test_id="
<<
test_id
<<
endl
;
activateTimeout
=
atoi
(
conf
->
getArgParam
(
"--activate-timeout"
).
c_str
()
);
if
(
activateTimeout
<=
0
)
activateTimeout
=
conf
->
getArgInt
(
"--activate-timeout"
);
if
(
activateTimeout
<=
0
)
activateTimeout
=
20000
;
initMB
(
false
);
...
...
@@ -206,7 +206,7 @@ void RTUExchange::initMB( bool reopen )
void
RTUExchange
::
waitSMReady
()
{
// waiting for SM is ready...
int
ready_timeout
=
atoi
(
conf
->
getArgParam
(
"--rs-sm-ready-timeout"
,
"15000"
).
c_str
()
);
int
ready_timeout
=
conf
->
getArgInt
(
"--rs-sm-ready-timeout"
,
"15000"
);
if
(
ready_timeout
==
0
)
ready_timeout
=
15000
;
else
if
(
ready_timeout
<
0
)
...
...
extensions/SharedMemory/SharedMemory.cc
View file @
b9172d42
...
...
@@ -40,7 +40,7 @@ SharedMemory::SharedMemory( ObjectId id, string datafile ):
string
d_field
=
conf
->
getArgParam
(
"--d-filter-field"
);
string
d_fvalue
=
conf
->
getArgParam
(
"--d-filter-value"
);
int
lock_msec
=
atoi
(
conf
->
getArgParam
(
"--lock-value-pause"
).
c_str
()
);
int
lock_msec
=
conf
->
getArgInt
(
"--lock-value-pause"
);
if
(
lock_msec
<
0
)
lock_msec
=
0
;
setCheckLockValuePause
(
lock_msec
);
...
...
@@ -51,7 +51,7 @@ SharedMemory::SharedMemory( ObjectId id, string datafile ):
else
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(init): heartbeat-node: "
<<
heartbeat_node
<<
endl
;
heartbeatCheckTime
=
atoi
(
conf
->
getArgParam
(
"--heartbeat-check-time"
,
"1000"
).
c_str
()
);
heartbeatCheckTime
=
conf
->
getArgInt
(
"--heartbeat-check-time"
,
"1000"
);
// rxml->setSensorFilter(s_filterField, s_filterValue);
...
...
@@ -74,17 +74,17 @@ SharedMemory::SharedMemory( ObjectId id, string datafile ):
dlog
[
Debug
::
WARN
]
<<
myname
<<
"(init): watchdog timer NOT USED (--wdt-device NULL)"
<<
endl
;
dblogging
=
atoi
(
conf
->
getArgParam
(
"--db-logging"
).
c_str
()
);
dblogging
=
conf
->
getArgInt
(
"--db-logging"
);
e_filter
=
conf
->
getArgParam
(
"--e-filter"
);
buildEventList
(
cnode
);
evntPause
=
atoi
(
conf
->
getArgParam
(
"--e-startup-pause"
).
c_str
()
);
if
(
evntPause
<=
0
)
evntPause
=
conf
->
getArgInt
(
"--e-startup-pause"
);
if
(
evntPause
<=
0
)
evntPause
=
5000
;
activateTimeout
=
atoi
(
conf
->
getArgParam
(
"--activate-timeout"
).
c_str
()
);
if
(
activateTimeout
<=
0
)
activateTimeout
=
conf
->
getArgInt
(
"--activate-timeout"
);
if
(
activateTimeout
<=
0
)
activateTimeout
=
10000
;
}
...
...
extensions/UDPExchange/UDPExchange.cc
View file @
b9172d42
...
...
@@ -44,12 +44,10 @@ maxItem(0)
if
(
s_host
.
empty
()
)
throw
UniSetTypes
::
SystemError
(
myname
+
"(UDPExchange): Unknown host. Use --udp-host"
);
string
s_port
=
conf
->
getArgParam
(
"--udp-port"
,
it
.
getProp
(
"port"
));
if
(
s_port
.
empty
()
)
port
=
conf
->
getArgInt
(
"--udp-port"
,
it
.
getProp
(
"port"
));
if
(
port
<=
0
)
throw
UniSetTypes
::
SystemError
(
myname
+
"(UDPExchange): Unknown port address. Use --udp-port"
);
port
=
atoi
(
s_port
.
c_str
());
if
(
dlog
.
debugging
(
Debug
::
INFO
)
)
dlog
[
Debug
::
INFO
]
<<
"(UDPExchange): UDP set to "
<<
s_host
<<
":"
<<
port
<<
endl
;
...
...
@@ -69,16 +67,16 @@ maxItem(0)
thr
=
new
ThreadCreator
<
UDPExchange
>
(
this
,
&
UDPExchange
::
poll
);
recvTimeout
=
atoi
(
conf
->
getArgParam
(
"--udp-recv-timeout"
,
it
.
getProp
(
"recvTimeout"
)).
c_str
(
));
if
(
recvTimeout
<=
0
)
recvTimeout
=
conf
->
getArgInt
(
"--udp-recv-timeout"
,
it
.
getProp
(
"recvTimeout"
));
if
(
recvTimeout
<=
0
)
recvTimeout
=
5000
;
sendTimeout
=
atoi
(
conf
->
getArgParam
(
"--udp-send-timeout"
,
it
.
getProp
(
"sendTimeout"
)).
c_str
(
));
if
(
sendTimeout
<=
0
)
sendTimeout
=
conf
->
getArgInt
(
"--udp-send-timeout"
,
it
.
getProp
(
"sendTimeout"
));
if
(
sendTimeout
<=
0
)
sendTimeout
=
5000
;
polltime
=
atoi
(
conf
->
getArgParam
(
"--udp-polltime"
,
it
.
getProp
(
"polltime"
)).
c_str
(
));
if
(
!
polltime
)
polltime
=
conf
->
getArgInt
(
"--udp-polltime"
,
it
.
getProp
(
"polltime"
));
if
(
polltime
<=
0
)
polltime
=
100
;
...
...
@@ -111,8 +109,8 @@ maxItem(0)
else
ptHeartBeat
.
setTiming
(
UniSetTimer
::
WaitUpTime
);
maxHeartBeat
=
atoi
(
conf
->
getArgParam
(
"--udp-heartbeat-max"
,
it
.
getProp
(
"heartbeat_max"
)).
c_str
(
));
if
(
maxHeartBeat
<=
0
)
maxHeartBeat
=
conf
->
getArgInt
(
"--udp-heartbeat-max"
,
it
.
getProp
(
"heartbeat_max"
));
if
(
maxHeartBeat
<=
0
)
maxHeartBeat
=
10
;
test_id
=
sidHeartBeat
;
}
...
...
@@ -130,12 +128,12 @@ maxItem(0)
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(init): test_id="
<<
test_id
<<
endl
;
activateTimeout
=
atoi
(
conf
->
getArgParam
(
"--activate-timeout"
).
c_str
(
));
if
(
activateTimeout
<=
0
)
activateTimeout
=
conf
->
getArgInt
(
"--activate-timeout"
));
if
(
activateTimeout
<=
0
)
activateTimeout
=
20000
;
int
msec
=
atoi
(
conf
->
getArgParam
(
"--udp-timeout"
,
it
.
getProp
(
"timeout"
)).
c_str
(
));
if
(
msec
<=
0
)
int
msec
=
conf
->
getArgInt
(
"--udp-timeout"
,
it
.
getProp
(
"timeout"
));
if
(
msec
<=
0
)
msec
=
3000
;
dlog
[
Debug
::
INFO
]
<<
myname
<<
"(init): udp-timeout="
<<
msec
<<
" msec"
<<
endl
;
...
...
@@ -151,7 +149,7 @@ UDPExchange::~UDPExchange()
void
UDPExchange
::
waitSMReady
()
{
// waiting for SM is ready...
int
ready_timeout
=
atoi
(
conf
->
getArgParam
(
"--udp-sm-ready-timeout"
,
"15000"
).
c_str
()
);
int
ready_timeout
=
conf
->
getArgInt
(
"--udp-sm-ready-timeout"
,
"15000"
);
if
(
ready_timeout
==
0
)
ready_timeout
=
15000
;
else
if
(
ready_timeout
<
0
)
...
...
extensions/lib/UObject_SK.cc
View file @
b9172d42
...
...
@@ -38,27 +38,27 @@ activated(false)
{
si
.
node
=
conf
->
getLocalNode
();
sleep_msec
=
atoi
(
conf
->
getArgParam
(
"--sleep-msec"
,
"200"
).
c_str
()
);
if
(
sleep_msec
<=
0
)
sleep_msec
=
conf
->
getArgInt
(
"--sleep-msec"
,
"200"
);
if
(
sleep_msec
<=
0
)
sleep_msec
=
200
;
resetMsgTime
=
atoi
(
conf
->
getProp
(
cnode
,
"resetMsgTime"
).
c_str
()
);
resetMsgTime
=
conf
->
getIntProp
(
cnode
,
"resetMsgTime"
);
if
(
resetMsgTime
<=
0
)
resetMsgTime
=
200
;
ptResetMsg
.
setTiming
(
resetMsgTime
);
smReadyTimeout
=
atoi
(
conf
->
getArgParam
(
"--sm-ready-timeout"
,
""
).
c_str
()
);
smReadyTimeout
=
conf
->
getArgInt
(
"--sm-ready-timeout"
,
""
);
if
(
smReadyTimeout
==
0
)
smReadyTimeout
=
60000
;
else
if
(
smReadyTimeout
<
0
)
smReadyTimeout
=
UniSetTimer
::
WaitUpTime
;
activateTimeout
=
atoi
(
conf
->
getArgParam
(
"--activate-timeout"
).
c_str
(
));
if
(
activateTimeout
<=
0
)
activateTimeout
=
conf
->
getArgInt
(
"--activate-timeout"
));
if
(
activateTimeout
<=
0
)
activateTimeout
=
20000
;
int
msec
=
atoi
(
conf
->
getArgParam
(
"--startup-timeout"
).
c_str
()
);
if
(
msec
<=
0
)
int
msec
=
conf
->
getArgInt
(
"--startup-timeout"
);
if
(
msec
<=
0
)
msec
=
10000
;
ptStartUpTimeout
.
setTiming
(
msec
);
}
...
...
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