Commit 88641fd0 authored by Pavel Vainerman's avatar Pavel Vainerman

Удалил старую функцию Extensions::getHeartBeatTime(). Перевёл всех

на использование conf->getHeartBeatTime(). В секции <HeartBeatTime> параметр задающий переименовал в "time_msec" --> "msec" Conflicts: conf/libuniset2.spec extensions/LogicProcessor/PassiveLProcessor.cc extensions/ModbusMaster/MBExchange.cc extensions/ModbusSlave/MBSlave.cc extensions/SMDBServer/SMDBServer.cc extensions/UNetUDP/UNetExchange.cc extensions/include/Extensions.h extensions/lib/Extensions.cc src/Various/Configuration.cc
parent c23a39f0
...@@ -28,7 +28,7 @@ PassiveLProcessor::PassiveLProcessor( std::string lfile, UniSetTypes::ObjectId o ...@@ -28,7 +28,7 @@ PassiveLProcessor::PassiveLProcessor( std::string lfile, UniSetTypes::ObjectId o
throw SystemError(err.str()); throw SystemError(err.str());
} }
int heartbeatTime = getHeartBeatTime(); int heartbeatTime = conf->getArgPInt("--" + prefix + "-heartbeat-time",conf->getHeartBeatTime());
if( heartbeatTime ) if( heartbeatTime )
ptHeartBeat.setTiming(heartbeatTime); ptHeartBeat.setTiming(heartbeatTime);
else else
......
...@@ -96,7 +96,7 @@ pollActivated(false) ...@@ -96,7 +96,7 @@ pollActivated(false)
throw SystemError(err.str()); throw SystemError(err.str());
} }
int heartbeatTime = getHeartBeatTime(); int heartbeatTime = conf->getArgPInt("--" + prefix + "-heartbeat-time",it.getProp("heartbeatTime"),conf->getHeartBeatTime());
if( heartbeatTime ) if( heartbeatTime )
ptHeartBeat.setTiming(heartbeatTime); ptHeartBeat.setTiming(heartbeatTime);
else else
......
...@@ -175,7 +175,7 @@ prefix(prefix) ...@@ -175,7 +175,7 @@ prefix(prefix)
throw SystemError(err.str()); throw SystemError(err.str());
} }
int heartbeatTime = getHeartBeatTime(); int heartbeatTime = conf->getArgPInt("--" + prefix + "-heartbeat-time",it.getProp("heartbeatTime"),conf->getHeartBeatTime());
if( heartbeatTime ) if( heartbeatTime )
ptHeartBeat.setTiming(heartbeatTime); ptHeartBeat.setTiming(heartbeatTime);
else else
...@@ -200,7 +200,7 @@ prefix(prefix) ...@@ -200,7 +200,7 @@ prefix(prefix)
dinfo << myname << ": init askcount_id=" << askcount_id << endl; dinfo << myname << ": init askcount_id=" << askcount_id << endl;
dinfo << myname << ": init test_id=" << test_id << endl; dinfo << myname << ": init test_id=" << test_id << endl;
wait_msec = getHeartBeatTime() - 100; wait_msec = conf->getHeartBeatTime() - 100;
if( wait_msec < 500 ) if( wait_msec < 500 )
wait_msec = 500; wait_msec = 500;
......
...@@ -309,7 +309,7 @@ sender2(0) ...@@ -309,7 +309,7 @@ sender2(0)
throw SystemError(err.str()); throw SystemError(err.str());
} }
int heartbeatTime = getHeartBeatTime(); int heartbeatTime = conf->getArgPInt("--" + prefix + "-heartbeat-time",it.getProp("heartbeatTime"),conf->getHeartBeatTime());
if( heartbeatTime ) if( heartbeatTime )
ptHeartBeat.setTiming(heartbeatTime); ptHeartBeat.setTiming(heartbeatTime);
else else
......
...@@ -200,8 +200,6 @@ void Configuration::initConfiguration( int argc, const char* const* argv ) ...@@ -200,8 +200,6 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
throw; throw;
} }
// default value
heartbeat_msec = 5000;
// cerr << "*************** initConfiguration: xmlOpen: " << pt.getCurrent() << " msec " << endl; // cerr << "*************** initConfiguration: xmlOpen: " << pt.getCurrent() << " msec " << endl;
// pt.reset(); // pt.reset();
...@@ -245,20 +243,15 @@ void Configuration::initConfiguration( int argc, const char* const* argv ) ...@@ -245,20 +243,15 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
initParameters(); initParameters();
// help
// if( !getArgParam("--help").empty() )
// help(cout);
initRepSections(); initRepSections();
// localIOR // localIOR
// localIOR = false; // ??. initParameters()
int lior = getArgInt("--localIOR"); int lior = getArgInt("--localIOR");
if( lior ) if( lior )
localIOR = lior; localIOR = lior;
// transientIOR // transientIOR
// transientIOR = false; // ??. initParameters()
int tior = getArgInt("--transientIOR"); int tior = getArgInt("--transientIOR");
if( tior ) if( tior )
transientIOR = tior; transientIOR = tior;
...@@ -511,10 +504,16 @@ void Configuration::initParameters() ...@@ -511,10 +504,16 @@ void Configuration::initParameters()
if( confDir.empty() ) if( confDir.empty() )
confDir = getRootDir(); confDir = getRootDir();
} }
else if( name == "HeartBeatTime" ) }
// Heartbeat init...
xmlNode* cnode = getNode("HeartBeatTime");
if( cnode )
{ {
heartbeat_msec = it.getIntProp("name"); UniXML_iterator hit(cnode);
} heartbeat_msec = hit.getIntProp("msec");
if( heartbeat_msec <= 0 )
heartbeat_msec = 5000;
} }
} }
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
......
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