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

add global HeartBeatTime to Configuration

parent f30f6903
...@@ -283,9 +283,9 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::sysCommand( SystemMessage* sm ) ...@@ -283,9 +283,9 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::sysCommand( SystemMessage* sm )
askSensors(UniversalIO::UIONotify); askSensors(UniversalIO::UIONotify);
active = true; active = true;
break; break;
} }
case SystemMessage::FoldUp: case SystemMessage::FoldUp:
case SystemMessage::Finish: case SystemMessage::Finish:
askSensors(UniversalIO::UIODontNotify); askSensors(UniversalIO::UIODontNotify);
break; break;
...@@ -412,6 +412,7 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::waitSM( int wait_msec, ObjectId tes ...@@ -412,6 +412,7 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::waitSM( int wait_msec, ObjectId tes
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
</xsl:template> </xsl:template>
<xsl:template name="COMMON-CC-HEAD"> <xsl:template name="COMMON-CC-HEAD">
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
/* /*
...@@ -519,7 +520,7 @@ activated(false) ...@@ -519,7 +520,7 @@ activated(false)
throw SystemError(err.str()); 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 ) if( heartbeatTime>0 )
ptHeartBeat.setTiming(heartbeatTime); ptHeartBeat.setTiming(heartbeatTime);
else else
...@@ -752,7 +753,7 @@ activated(false) ...@@ -752,7 +753,7 @@ activated(false)
throw SystemError(err.str()); 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 ) if( heartbeatTime>0 )
ptHeartBeat.setTiming(heartbeatTime); ptHeartBeat.setTiming(heartbeatTime);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
Name: libuniset Name: libuniset
Version: 0.97 Version: 0.97
Release: eter13 Release: eter15
Summary: UniSet - library for building distributed industrial control systems Summary: UniSet - library for building distributed industrial control systems
License: GPL License: GPL
Group: Development/C++ Group: Development/C++
...@@ -178,6 +178,12 @@ rm -f %buildroot%_libdir/*.la ...@@ -178,6 +178,12 @@ rm -f %buildroot%_libdir/*.la
%exclude %_pkgconfigdir/libUniSet.pc %exclude %_pkgconfigdir/libUniSet.pc
%changelog %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 * Sat Sep 26 2009 Pavel Vainerman <pv@etersoft.ru> 0.97-eter12
- minor fixes in IONotifyController - minor fixes in IONotifyController
......
...@@ -122,10 +122,12 @@ namespace UniSetTypes ...@@ -122,10 +122,12 @@ namespace UniSetTypes
inline const std::string getConfFileName() const { return fileConfName; } inline const std::string getConfFileName() const { return fileConfName; }
inline std::string getImagesDir() const { return imagesDir; } // inline std::string getImagesDir() const { return imagesDir; } //
inline int getHeartBeatTime(){ return heartbeat_msec; }
// dirs // dirs
inline const std::string getConfDir() const { return confDir; } inline const std::string getConfDir() const { return confDir; }
inline const std::string getDataDir() const { return dataDir; } inline const std::string getDataDir() const { return dataDir; }
inline const std::string getBinDir() const { return binDir; } inline const std::string getBinDir() const { return binDir; }
inline const std::string getLogDir() const { return logDir; } inline const std::string getLogDir() const { return logDir; }
inline const std::string getLockDir() const { return lockDir; } inline const std::string getLockDir() const { return lockDir; }
inline const std::string getDocDir() const { return docDir; } inline const std::string getDocDir() const { return docDir; }
...@@ -233,6 +235,8 @@ namespace UniSetTypes ...@@ -233,6 +235,8 @@ namespace UniSetTypes
std::string lockDir; std::string lockDir;
bool localIOR; bool localIOR;
bool transientIOR; bool transientIOR;
int heartbeat_msec;
}; };
/*! */ /*! */
......
...@@ -92,7 +92,8 @@ Configuration::Configuration(): ...@@ -92,7 +92,8 @@ Configuration::Configuration():
localDBServer(UniSetTypes::DefaultObjectId), localDBServer(UniSetTypes::DefaultObjectId),
localInfoServer(UniSetTypes::DefaultObjectId), localInfoServer(UniSetTypes::DefaultObjectId),
localNode(UniSetTypes::DefaultObjectId), localNode(UniSetTypes::DefaultObjectId),
fileConfName("") fileConfName(""),
heartbeat_msec(10000)
{ {
// unideb[Debug::CRIT] << " configuration FAILED!!!!!!!!!!!!!!!!!" << endl; // unideb[Debug::CRIT] << " configuration FAILED!!!!!!!!!!!!!!!!!" << endl;
// throw Exception(); // throw Exception();
...@@ -215,6 +216,10 @@ void Configuration::initConfiguration( int argc, const char* const* argv ) ...@@ -215,6 +216,10 @@ 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();
...@@ -561,6 +566,10 @@ void Configuration::initParameters() ...@@ -561,6 +566,10 @@ void Configuration::initParameters()
if( confDir.empty() ) if( confDir.empty() )
confDir = getRootDir(); 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