Commit 70d2a89b authored by Pavel Vaynerman's avatar Pavel Vaynerman

add global HeartBeatTime to Configuration

parent f30f6903
......@@ -412,6 +412,7 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::waitSM( int wait_msec, ObjectId tes
// ----------------------------------------------------------------------------
</xsl:template>
<xsl:template name="COMMON-CC-HEAD">
// --------------------------------------------------------------------------
/*
......@@ -519,7 +520,7 @@ activated(false)
throw SystemError(err.str());
}
int heartbeatTime = conf->getArgPInt("--heartbeat-time",it.getProp("heartbeatTime"), 5000);
int heartbeatTime = conf->getArgPInt("--heartbeat-time",it.getProp("heartbeatTime"),conf-&gt;getHeartBeatTime());
if( heartbeatTime>0 )
ptHeartBeat.setTiming(heartbeatTime);
else
......@@ -752,7 +753,7 @@ activated(false)
throw SystemError(err.str());
}
int heartbeatTime = conf->getArgPInt("--heartbeat-time",it.getProp("heartbeatTime"), 5000);
int heartbeatTime = conf->getArgPInt("--heartbeat-time",it.getProp("heartbeatTime"),conf-&gt;getHeartBeatTime());
if( heartbeatTime>0 )
ptHeartBeat.setTiming(heartbeatTime);
......
......@@ -3,7 +3,7 @@
Name: libuniset
Version: 0.97
Release: eter13
Release: eter15
Summary: UniSet - library for building distributed industrial control systems
License: GPL
Group: Development/C++
......@@ -178,6 +178,12 @@ rm -f %buildroot%_libdir/*.la
%exclude %_pkgconfigdir/libUniSet.pc
%changelog
* Sat Sep 26 2009 Pavel Vainerman <pv@etersoft.ru> 0.97-eter14
- add default heartbeat time to Configuration
* Sat Sep 26 2009 Pavel Vainerman <pv@etersoft.ru> 0.97-eter13
- add heartbeat logic to uniset-codegen
* Sat Sep 26 2009 Pavel Vainerman <pv@etersoft.ru> 0.97-eter12
- minor fixes in IONotifyController
......
......@@ -122,6 +122,8 @@ namespace UniSetTypes
inline const std::string getConfFileName() const { return fileConfName; }
inline std::string getImagesDir() const { return imagesDir; } //
inline int getHeartBeatTime(){ return heartbeat_msec; }
// dirs
inline const std::string getConfDir() const { return confDir; }
inline const std::string getDataDir() const { return dataDir; }
......@@ -233,6 +235,8 @@ namespace UniSetTypes
std::string lockDir;
bool localIOR;
bool transientIOR;
int heartbeat_msec;
};
/*! */
......
......@@ -92,7 +92,8 @@ Configuration::Configuration():
localDBServer(UniSetTypes::DefaultObjectId),
localInfoServer(UniSetTypes::DefaultObjectId),
localNode(UniSetTypes::DefaultObjectId),
fileConfName("")
fileConfName(""),
heartbeat_msec(10000)
{
// unideb[Debug::CRIT] << " configuration FAILED!!!!!!!!!!!!!!!!!" << endl;
// throw Exception();
......@@ -215,6 +216,10 @@ void Configuration::initConfiguration( int argc, const char* const* argv )
throw;
}
// default value
heartbeat_msec = 5000;
// cerr << "*************** initConfiguration: xmlOpen: " << pt.getCurrent() << " msec " << endl;
// pt.reset();
......@@ -561,6 +566,10 @@ void Configuration::initParameters()
if( confDir.empty() )
confDir = getRootDir();
}
else if( name == "HeartBeatTime" )
{
heartbeat_msec = it.getIntProp("name");
}
}
}
// -------------------------------------------------------------------------
......
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