Commit 32b858cc authored by Vitaly Lipatov's avatar Vitaly Lipatov

use getPIntProp instead getIntProp and cases

parent 9c096894
...@@ -67,18 +67,11 @@ maxItem(0) ...@@ -67,18 +67,11 @@ maxItem(0)
thr = new ThreadCreator<UDPExchange>(this, &UDPExchange::poll); thr = new ThreadCreator<UDPExchange>(this, &UDPExchange::poll);
recvTimeout = conf->getArgInt("--udp-recv-timeout",it.getProp("recvTimeout")); recvTimeout = conf->getArgPInt("--udp-recv-timeout",it.getProp("recvTimeout"), 5000);
if( recvTimeout <= 0 )
recvTimeout = 5000;
sendTimeout = conf->getArgInt("--udp-send-timeout",it.getProp("sendTimeout"));
if( sendTimeout <= 0 )
sendTimeout = 5000;
polltime = conf->getArgInt("--udp-polltime",it.getProp("polltime")); sendTimeout = conf->getArgPInt("--udp-send-timeout",it.getProp("sendTimeout"), 5000);
if( polltime <= 0 )
polltime = 100;
polltime = conf->getArgPInt("--udp-polltime",it.getProp("polltime"), 100);
// ------------------------------- // -------------------------------
if( shm->isLocalwork() ) if( shm->isLocalwork() )
...@@ -109,9 +102,7 @@ maxItem(0) ...@@ -109,9 +102,7 @@ maxItem(0)
else else
ptHeartBeat.setTiming(UniSetTimer::WaitUpTime); ptHeartBeat.setTiming(UniSetTimer::WaitUpTime);
maxHeartBeat = conf->getArgInt("--udp-heartbeat-max",it.getProp("heartbeat_max")); maxHeartBeat = conf->getArgPInt("--udp-heartbeat-max", it.getProp("heartbeat_max"), 10);
if( maxHeartBeat <= 0 )
maxHeartBeat = 10;
test_id = sidHeartBeat; test_id = sidHeartBeat;
} }
else else
...@@ -128,13 +119,9 @@ maxItem(0) ...@@ -128,13 +119,9 @@ maxItem(0)
dlog[Debug::INFO] << myname << "(init): test_id=" << test_id << endl; dlog[Debug::INFO] << myname << "(init): test_id=" << test_id << endl;
activateTimeout = conf->getArgInt("--activate-timeout")); activateTimeout = conf->getArgPInt("--activate-timeout"), 20000);
if( activateTimeout <= 0 )
activateTimeout = 20000;
timeout_t msec = conf->getArgInt("--udp-timeout",it.getProp("timeout")); timeout_t msec = conf->getArgPInt("--udp-timeout",it.getProp("timeout"), 3000);
if( msec == 0 )
msec = 3000;
dlog[Debug::INFO] << myname << "(init): udp-timeout=" << msec << " msec" << endl; dlog[Debug::INFO] << myname << "(init): udp-timeout=" << msec << " msec" << endl;
} }
......
...@@ -398,9 +398,7 @@ bool IOBase::initItem( IOBase* b, UniXML_iterator& it, SMInterface* shm, ...@@ -398,9 +398,7 @@ bool IOBase::initItem( IOBase* b, UniXML_iterator& it, SMInterface* shm,
sid = conf->getSensorID(sname); sid = conf->getSensorID(sname);
else else
{ {
sid = it.getIntProp("id"); sid = it.getPIntProp("id", DefaultObjectId);
if( sid <=0 )
sid = DefaultObjectId;
} }
if( sid == DefaultObjectId ) if( sid == DefaultObjectId )
......
...@@ -507,16 +507,11 @@ void Configuration::initParameters() ...@@ -507,16 +507,11 @@ void Configuration::initParameters()
} }
else if( name == "RepeatTimeoutMS" ) else if( name == "RepeatTimeoutMS" )
{ {
repeatTimeout = it.getIntProp("name"); repeatTimeout = it.getPIntProp("name", 50);
if(!repeatTimeout)
repeatTimeout=50; //[????]
} }
else if( name == "RepeatCount" ) else if( name == "RepeatCount" )
{ {
repeatCount = it.getIntProp("name"); repeatCount = it.getPIntProp("name", 1);
if(!repeatCount)
repeatCount = 1;
} }
else if( name == "ImagesPath" ) else if( name == "ImagesPath" )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment