Commit 4f04ed1b authored by Pavel Vainerman's avatar Pavel Vainerman

(uniset-codegen): Добавил возможность указать в src.xml параметр loglevel="1",…

(uniset-codegen): Добавил возможность указать в src.xml параметр loglevel="1", для указания датчика задающего уровень выводимых логов. (для управления логами "на ходу").
parent 9c4be0fb
......@@ -148,9 +148,18 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::preSensorInfo( UniSetTypes::SensorM
{
<xsl:for-each select="//smap/item">
<xsl:if test="normalize-space(@vartype)='in'">
<xsl:if test="normalize-space(@loglevel)=''">
if( _sm->id == <xsl:value-of select="@name"/> )
<xsl:call-template name="setprefix"/><xsl:value-of select="@name"/> = _sm->value;
</xsl:if>
<xsl:if test="normalize-space(@loglevel)!=''">
if( _sm->id == <xsl:value-of select="@name"/> )
{
<xsl:call-template name="setprefix"/><xsl:value-of select="@name"/> = _sm->value;
dlog.level( Debug::type(_sm->value) );
}
</xsl:if>
</xsl:if>
</xsl:for-each>
sensorInfo(_sm);
......
......@@ -185,6 +185,10 @@
void askValue( UniSetTypes::ObjectId sid, UniversalIO::UIOCommand, UniSetTypes::ObjectId node = UniSetTypes::conf->getLocalNode() );
void updateValues();
void setMsg( UniSetTypes::ObjectId code, bool state );
static DebugStream dlog;
static void init_dlog(DebugStream&amp; dlog);
</xsl:template>
<xsl:template name="COMMON-HEAD-PROTECTED">
......@@ -253,6 +257,18 @@
</xsl:template>
<xsl:template name="COMMON-CC-FILE">
// ------------------------------------------------------------------------------------------
DebugStream <xsl:value-of select="$CLASSNAME"/>_SK::dlog;
static bool init_dlog_ok = false;
void <xsl:value-of select="$CLASSNAME"/>_SK::init_dlog( DebugStream&amp; d )
{
if( !init_dlog_ok )
{
<xsl:value-of select="$CLASSNAME"/>_SK::dlog = d;
init_dlog_ok = true;
}
}
// ------------------------------------------------------------------------------------------
void <xsl:value-of select="$CLASSNAME"/>_SK::processingMessage( UniSetTypes::VoidMessage* _msg )
{
try
......
......@@ -41,6 +41,7 @@
<item name="input1_s" vartype="in" iotype="DI" comment="comment for input1" smTestID="1"/>
<item name="input2_s" vartype="in" iotype="DI" comment="comment for input2" />
<item name="output1_c" vartype="out" iotype="DO" omment="comment for output1" no_check_id="1"/>
<item name="loglevel_s" vartype="in" iotype="AI" omment="log level control" loglevel="1"/>
</smap>
<msgmap>
......
......@@ -7,7 +7,7 @@
Name: libuniset
Version: 1.6
Release: alt15
Release: alt16
Summary: UniSet - library for building distributed industrial control systems
......@@ -319,6 +319,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
%exclude %_pkgconfigdir/libUniSet.pc
%changelog
* Tue Nov 05 2013 Pavel Vainerman <pv@altlinux.ru> 1.6-alt16
- (uniset-codegen): add 'loglevel' parameters for src.xml
* Mon Oct 28 2013 Pavel Vainerman <pv@altlinux.ru> 1.6-alt15
- (python): fixed bug in UInterface
......
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