Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
d7ea1f54
Commit
d7ea1f54
authored
Nov 29, 2013
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(uniset-codegen): Добавил возможность задавать argprefix для переменных,
через конструктор. Заодно перенёс параметр arg_prefix из <variables> в <settings>.
parent
1753d25a
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
41 additions
and
18 deletions
+41
-18
ctl-cpp-cc-alone-ask.xsl
Utilities/codegen/ctl-cpp-cc-alone-ask.xsl
+3
-0
ctl-cpp-cc-alone.xsl
Utilities/codegen/ctl-cpp-cc-alone.xsl
+3
-0
ctl-cpp-cc-ask.xsl
Utilities/codegen/ctl-cpp-cc-ask.xsl
+3
-0
ctl-cpp-cc.xsl
Utilities/codegen/ctl-cpp-cc.xsl
+3
-0
ctl-cpp-common.xsl
Utilities/codegen/ctl-cpp-common.xsl
+12
-12
ctl-cpp-h-alone.xsl
Utilities/codegen/ctl-cpp-h-alone.xsl
+4
-1
ctl-cpp-h.xsl
Utilities/codegen/ctl-cpp-h.xsl
+6
-2
testgen.src.xml
Utilities/codegen/tests/testgen.src.xml
+3
-2
libuniset.spec
conf/libuniset.spec
+4
-1
No files found.
Utilities/codegen/ctl-cpp-cc-alone-ask.xsl
View file @
d7ea1f54
...
@@ -18,6 +18,9 @@
...
@@ -18,6 +18,9 @@
<xsl:variable
name=
"TESTMODE"
>
<xsl:variable
name=
"TESTMODE"
>
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'testmode'"
/></xsl:call-template>
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'testmode'"
/></xsl:call-template>
</xsl:variable>
</xsl:variable>
<xsl:variable
name=
"ARGPREFIX"
>
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'arg-prefix'"
/></xsl:call-template>
</xsl:variable>
<xsl:template
match=
"/"
>
<xsl:template
match=
"/"
>
<!-- BEGIN CC-FILE -->
<!-- BEGIN CC-FILE -->
...
...
Utilities/codegen/ctl-cpp-cc-alone.xsl
View file @
d7ea1f54
...
@@ -18,6 +18,9 @@
...
@@ -18,6 +18,9 @@
<xsl:variable
name=
"TESTMODE"
>
<xsl:variable
name=
"TESTMODE"
>
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'testmode'"
/></xsl:call-template>
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'testmode'"
/></xsl:call-template>
</xsl:variable>
</xsl:variable>
<xsl:variable
name=
"ARGPREFIX"
>
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'arg-prefix'"
/></xsl:call-template>
</xsl:variable>
<xsl:template
match=
"/"
>
<xsl:template
match=
"/"
>
<!-- BEGIN CC-FILE -->
<!-- BEGIN CC-FILE -->
...
...
Utilities/codegen/ctl-cpp-cc-ask.xsl
View file @
d7ea1f54
...
@@ -17,6 +17,9 @@
...
@@ -17,6 +17,9 @@
<xsl:variable
name=
"TESTMODE"
>
<xsl:variable
name=
"TESTMODE"
>
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'testmode'"
/></xsl:call-template>
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'testmode'"
/></xsl:call-template>
</xsl:variable>
</xsl:variable>
<xsl:variable
name=
"ARGPREFIX"
>
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'arg-prefix'"
/></xsl:call-template>
</xsl:variable>
<!-- Генерирование cc-файла -->
<!-- Генерирование cc-файла -->
<xsl:template
match=
"/"
>
<xsl:template
match=
"/"
>
...
...
Utilities/codegen/ctl-cpp-cc.xsl
View file @
d7ea1f54
...
@@ -17,6 +17,9 @@
...
@@ -17,6 +17,9 @@
<xsl:variable
name=
"TESTMODE"
>
<xsl:variable
name=
"TESTMODE"
>
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'testmode'"
/></xsl:call-template>
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'testmode'"
/></xsl:call-template>
</xsl:variable>
</xsl:variable>
<xsl:variable
name=
"ARGPREFIX"
>
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'arg-prefix'"
/></xsl:call-template>
</xsl:variable>
<!-- Генерирование cc-файла -->
<!-- Генерирование cc-файла -->
<xsl:template
match=
"/"
>
<xsl:template
match=
"/"
>
...
...
Utilities/codegen/ctl-cpp-common.xsl
View file @
d7ea1f54
...
@@ -471,22 +471,22 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::waitSM( int wait_msec, ObjectId _te
...
@@ -471,22 +471,22 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::waitSM( int wait_msec, ObjectId _te
</xsl:template>
</xsl:template>
<xsl:template
name=
"init-variables"
>
<xsl:template
name=
"init-variables"
>
<xsl:if
test=
"normalize-space(@type)='int'"
>
<xsl:if
test=
"normalize-space(@type)='int'"
>
<xsl:value-of
select=
"normalize-space(@name)"
/>
(uni_atoi( init3_str(conf->getArgParam("--
<xsl:value-of
select=
"../@arg_prefix"
/>
<xsl:value-of
select=
"@name"
/>
"),conf->getProp(cnode,"
<xsl:value-of
select=
"@name"
/>
"),"
<xsl:value-of
select=
"normalize-space(@default)"
/>
"))),
<xsl:value-of
select=
"normalize-space(@name)"
/>
(uni_atoi( init3_str(conf->getArgParam("--
" + argprefix + "
<xsl:value-of
select=
"@name"
/>
"),conf->getProp(cnode,"
<xsl:value-of
select=
"@name"
/>
"),"
<xsl:value-of
select=
"normalize-space(@default)"
/>
"))),
</xsl:if>
</xsl:if>
<xsl:if
test=
"normalize-space(@type)='long'"
>
<xsl:if
test=
"normalize-space(@type)='long'"
>
<xsl:value-of
select=
"normalize-space(@name)"
/>
(uni_atoi( init3_str(conf->getArgParam("--
<xsl:value-of
select=
"../@arg_prefix"
/>
<xsl:value-of
select=
"@name"
/>
"),conf->getProp(cnode,"
<xsl:value-of
select=
"@name"
/>
"),"
<xsl:value-of
select=
"normalize-space(@default)"
/>
"))),
<xsl:value-of
select=
"normalize-space(@name)"
/>
(uni_atoi( init3_str(conf->getArgParam("--
" + argprefix + "
<xsl:value-of
select=
"@name"
/>
"),conf->getProp(cnode,"
<xsl:value-of
select=
"@name"
/>
"),"
<xsl:value-of
select=
"normalize-space(@default)"
/>
"))),
</xsl:if>
</xsl:if>
<xsl:if
test=
"normalize-space(@type)='float'"
>
<xsl:if
test=
"normalize-space(@type)='float'"
>
<xsl:value-of
select=
"normalize-space(@name)"
/>
(atof( init3_str(conf->getArgParam("--
<xsl:value-of
select=
"../@arg_prefix"
/>
<xsl:value-of
select=
"@name"
/>
"),conf->getProp(cnode,"
<xsl:value-of
select=
"@name"
/>
"),"
<xsl:value-of
select=
"normalize-space(@default)"
/>
").c_str())),
<xsl:value-of
select=
"normalize-space(@name)"
/>
(atof( init3_str(conf->getArgParam("--
" + argprefix + "
<xsl:value-of
select=
"@name"
/>
"),conf->getProp(cnode,"
<xsl:value-of
select=
"@name"
/>
"),"
<xsl:value-of
select=
"normalize-space(@default)"
/>
").c_str())),
</xsl:if>
</xsl:if>
<xsl:if
test=
"normalize-space(@type)='double'"
>
<xsl:if
test=
"normalize-space(@type)='double'"
>
<xsl:value-of
select=
"normalize-space(@name)"
/>
(atof( init3_str(conf->getArgParam("--
<xsl:value-of
select=
"../@arg_prefix"
/>
<xsl:value-of
select=
"@name"
/>
"),conf->getProp(cnode,"
<xsl:value-of
select=
"@name"
/>
"),"
<xsl:value-of
select=
"normalize-space(@default)"
/>
").c_str())),
<xsl:value-of
select=
"normalize-space(@name)"
/>
(atof( init3_str(conf->getArgParam("--
" + argprefix + "
<xsl:value-of
select=
"@name"
/>
"),conf->getProp(cnode,"
<xsl:value-of
select=
"@name"
/>
"),"
<xsl:value-of
select=
"normalize-space(@default)"
/>
").c_str())),
</xsl:if>
</xsl:if>
<xsl:if
test=
"normalize-space(@type)='bool'"
>
<xsl:if
test=
"normalize-space(@type)='bool'"
>
<xsl:value-of
select=
"normalize-space(@name)"
/>
(uni_atoi( init3_str(conf->getArgParam("--
<xsl:value-of
select=
"../@arg_prefix"
/>
<xsl:value-of
select=
"@name"
/>
"),conf->getProp(cnode,"
<xsl:value-of
select=
"@name"
/>
"),"
<xsl:value-of
select=
"normalize-space(@default)"
/>
"))),
<xsl:value-of
select=
"normalize-space(@name)"
/>
(uni_atoi( init3_str(conf->getArgParam("--
" + argprefix + "
<xsl:value-of
select=
"@name"
/>
"),conf->getProp(cnode,"
<xsl:value-of
select=
"@name"
/>
"),"
<xsl:value-of
select=
"normalize-space(@default)"
/>
"))),
</xsl:if>
</xsl:if>
<xsl:if
test=
"normalize-space(@type)='str'"
>
<xsl:if
test=
"normalize-space(@type)='str'"
>
<xsl:value-of
select=
"normalize-space(@name)"
/>
(init3_str(conf->getArgParam("--
<xsl:value-of
select=
"../@arg_prefix"
/>
<xsl:value-of
select=
"@name"
/>
"),conf->getProp(cnode,"
<xsl:value-of
select=
"@name"
/>
"),"
<xsl:value-of
select=
"normalize-space(@default)"
/>
")),
<xsl:value-of
select=
"normalize-space(@name)"
/>
(init3_str(conf->getArgParam("--
" + argprefix + "
<xsl:value-of
select=
"@name"
/>
"),conf->getProp(cnode,"
<xsl:value-of
select=
"@name"
/>
"),"
<xsl:value-of
select=
"normalize-space(@default)"
/>
")),
</xsl:if>
</xsl:if>
</xsl:template>
</xsl:template>
...
@@ -573,7 +573,7 @@ static const std::string init3_str( const std::string& s1, const std::string
...
@@ -573,7 +573,7 @@ static const std::string init3_str( const std::string& s1, const std::string
return s3;
return s3;
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK( ObjectId id, xmlNode* cnode ):
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK( ObjectId id, xmlNode* cnode
, const std::string
&
argprefix
):
<xsl:if
test=
"normalize-space($BASECLASS)!=''"
><xsl:value-of
select=
"normalize-space($BASECLASS)"
/>
(id),
</xsl:if>
<xsl:if
test=
"normalize-space($BASECLASS)!=''"
><xsl:value-of
select=
"normalize-space($BASECLASS)"
/>
(id),
</xsl:if>
<xsl:if
test=
"normalize-space($BASECLASS)=''"
>
UniSetObject(id),
</xsl:if>
<xsl:if
test=
"normalize-space($BASECLASS)=''"
>
UniSetObject(id),
</xsl:if>
// Инициализация идентификаторов (имена берутся из конф. файла)
// Инициализация идентификаторов (имена берутся из конф. файла)
...
@@ -698,10 +698,10 @@ end_private(false)
...
@@ -698,10 +698,10 @@ end_private(false)
// Инициализация значений
// Инициализация значений
<xsl:for-each
select=
"//smap/item"
>
<xsl:for-each
select=
"//smap/item"
>
<xsl:if
test=
"normalize-space(@default)=''"
>
<xsl:if
test=
"normalize-space(@default)=''"
>
<xsl:call-template
name=
"setprefix"
/><xsl:value-of
select=
"@name"
/>
= conf->getArgPInt("--
<xsl:value-of
select=
"../@arg_prefix"
/>
<xsl:value-of
select=
"@name"
/>
-default",it.getProp("
<xsl:value-of
select=
"@name"
/>
_default"),0);
<xsl:call-template
name=
"setprefix"
/><xsl:value-of
select=
"@name"
/>
= conf->getArgPInt("--
" + argprefix + "
<xsl:value-of
select=
"@name"
/>
-default",it.getProp("
<xsl:value-of
select=
"@name"
/>
_default"),0);
</xsl:if>
</xsl:if>
<xsl:if
test=
"not(normalize-space(@default)='')"
>
<xsl:if
test=
"not(normalize-space(@default)='')"
>
<xsl:call-template
name=
"setprefix"
/><xsl:value-of
select=
"@name"
/>
= conf->getArgPInt("--
<xsl:value-of
select=
"../@arg_prefix"
/>
<xsl:value-of
select=
"@name"
/>
-default",it.getProp("
<xsl:value-of
select=
"@name"
/>
_default"),
<xsl:value-of
select=
"@default"
/>
);
<xsl:call-template
name=
"setprefix"
/><xsl:value-of
select=
"@name"
/>
= conf->getArgPInt("--
" + argprefix + "
<xsl:value-of
select=
"@name"
/>
-default",it.getProp("
<xsl:value-of
select=
"@name"
/>
_default"),
<xsl:value-of
select=
"@default"
/>
);
</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
...
@@ -729,7 +729,7 @@ end_private(false)
...
@@ -729,7 +729,7 @@ end_private(false)
<xsl:for-each
select=
"//smap/item"
>
<xsl:for-each
select=
"//smap/item"
>
<xsl:if
test=
"normalize-space(@smTestID)!=''"
>
tmp_smtestID = "
<xsl:value-of
select=
"@name"
/>
";
</xsl:if>
<xsl:if
test=
"normalize-space(@smTestID)!=''"
>
tmp_smtestID = "
<xsl:value-of
select=
"@name"
/>
";
</xsl:if>
</xsl:for-each>
</xsl:for-each>
smTestID = conf->getSensorID(init3_str(conf->getArgParam("--
<xsl:value-of
select=
"../@arg_prefix"
/>
sm-test-id"),conf->getProp(cnode,"smTestID"),tmp_smtestID));
smTestID = conf->getSensorID(init3_str(conf->getArgParam("--
" + argprefix + "
sm-test-id"),conf->getProp(cnode,"smTestID"),tmp_smtestID));
activateTimeout = conf->getArgPInt("--activate-timeout", 20000);
activateTimeout = conf->getArgPInt("--activate-timeout", 20000);
...
@@ -919,7 +919,7 @@ askPause(2000)
...
@@ -919,7 +919,7 @@ askPause(2000)
throw Exception( string(myname+": init failed!!!") );
throw Exception( string(myname+": init failed!!!") );
}
}
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK( ObjectId id, xmlNode* cnode ):
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK( ObjectId id, xmlNode* cnode
, const string
&
argprefix
):
<xsl:if
test=
"normalize-space($BASECLASS)!=''"
><xsl:value-of
select=
"normalize-space($BASECLASS)"
/>
(id),
</xsl:if>
<xsl:if
test=
"normalize-space($BASECLASS)!=''"
><xsl:value-of
select=
"normalize-space($BASECLASS)"
/>
(id),
</xsl:if>
<xsl:if
test=
"normalize-space($BASECLASS)=''"
>
UniSetObject(id),
</xsl:if>
<xsl:if
test=
"normalize-space($BASECLASS)=''"
>
UniSetObject(id),
</xsl:if>
// Инициализация идентификаторов (имена берутся из конф. файла)
// Инициализация идентификаторов (имена берутся из конф. файла)
...
@@ -998,7 +998,7 @@ askPause(conf->getPIntProp(cnode,"askPause",2000))
...
@@ -998,7 +998,7 @@ askPause(conf->getPIntProp(cnode,"askPause",2000))
else if( smReadyTimeout
<
0 )
else if( smReadyTimeout
<
0 )
smReadyTimeout = UniSetTimer::WaitUpTime;
smReadyTimeout = UniSetTimer::WaitUpTime;
smTestID = conf->getSensorID(init3_str(conf->getArgParam("--
<xsl:value-of
select=
"../@arg_prefix"
/>
sm-test-id"),conf->getProp(cnode,"smTestID"),""));
smTestID = conf->getSensorID(init3_str(conf->getArgParam("--
" + argprefix + "
sm-test-id"),conf->getProp(cnode,"smTestID"),""));
activateTimeout = conf->getArgPInt("--activate-timeout", 20000);
activateTimeout = conf->getArgPInt("--activate-timeout", 20000);
int msec = conf->getArgPInt("--startup-timeout", 10000);
int msec = conf->getArgPInt("--startup-timeout", 10000);
...
...
Utilities/codegen/ctl-cpp-h-alone.xsl
View file @
d7ea1f54
...
@@ -17,6 +17,9 @@
...
@@ -17,6 +17,9 @@
<xsl:variable
name=
"TESTMODE"
>
<xsl:variable
name=
"TESTMODE"
>
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'testmode'"
/></xsl:call-template>
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'testmode'"
/></xsl:call-template>
</xsl:variable>
</xsl:variable>
<xsl:variable
name=
"ARGPREFIX"
>
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'arg-prefix'"
/></xsl:call-template>
</xsl:variable>
<!-- Генерирование заголовочного файла -->
<!-- Генерирование заголовочного файла -->
<xsl:template
match=
"/"
>
<xsl:template
match=
"/"
>
...
@@ -48,7 +51,7 @@ class <xsl:value-of select="$CLASSNAME"/>_SK:
...
@@ -48,7 +51,7 @@ class <xsl:value-of select="$CLASSNAME"/>_SK:
{
{
public:
public:
<xsl:if
test=
"not(normalize-space($OID))=''"
>
<xsl:if
test=
"not(normalize-space($OID))=''"
>
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK( UniSetTypes::ObjectId id = UniSetTypes::conf->getObjectID("
<xsl:value-of
select=
"$OID"
/>
"), xmlNode* node=UniSetTypes::conf->getNode("
<xsl:value-of
select=
"normalize-space($OID)"
/>
") );
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK( UniSetTypes::ObjectId id = UniSetTypes::conf->getObjectID("
<xsl:value-of
select=
"$OID"
/>
"), xmlNode* node=UniSetTypes::conf->getNode("
<xsl:value-of
select=
"normalize-space($OID)"
/>
")
, const string
&
argprefix=""
);
</xsl:if>
</xsl:if>
<xsl:if
test=
"normalize-space($OID)=''"
>
<xsl:if
test=
"normalize-space($OID)=''"
>
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK( UniSetTypes::ObjectId id, xmlNode* node=UniSetTypes::conf->getNode("
<xsl:value-of
select=
"normalize-space($OID)"
/>
") );
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK( UniSetTypes::ObjectId id, xmlNode* node=UniSetTypes::conf->getNode("
<xsl:value-of
select=
"normalize-space($OID)"
/>
") );
...
...
Utilities/codegen/ctl-cpp-h.xsl
View file @
d7ea1f54
...
@@ -17,6 +17,9 @@
...
@@ -17,6 +17,9 @@
<xsl:variable
name=
"TESTMODE"
>
<xsl:variable
name=
"TESTMODE"
>
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'testmode'"
/></xsl:call-template>
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'testmode'"
/></xsl:call-template>
</xsl:variable>
</xsl:variable>
<xsl:variable
name=
"ARGPREFIX"
>
<xsl:call-template
name=
"settings"
><xsl:with-param
name=
"varname"
select=
"'arg-prefix'"
/></xsl:call-template>
</xsl:variable>
<!-- Генерирование заголовочного файла -->
<!-- Генерирование заголовочного файла -->
<xsl:template
match=
"/"
>
<xsl:template
match=
"/"
>
...
@@ -34,6 +37,7 @@
...
@@ -34,6 +37,7 @@
#ifndef
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK_H_
#ifndef
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK_H_
#define
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK_H_
#define
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK_H_
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
#include
<
string
>
<xsl:if
test=
"normalize-space($BASECLASS)!=''"
>
#include
<xsl:call-template
name=
"preinclude"
/><xsl:value-of
select=
"normalize-space($BASECLASS)"
/>
.h
<xsl:call-template
name=
"postinclude"
/></xsl:if>
<xsl:if
test=
"normalize-space($BASECLASS)!=''"
>
#include
<xsl:call-template
name=
"preinclude"
/><xsl:value-of
select=
"normalize-space($BASECLASS)"
/>
.h
<xsl:call-template
name=
"postinclude"
/></xsl:if>
<xsl:if
test=
"normalize-space($BASECLASS)=''"
>
#include
<xsl:call-template
name=
"preinclude"
/>
UniSetObject.h
<xsl:call-template
name=
"postinclude"
/></xsl:if>
<xsl:if
test=
"normalize-space($BASECLASS)=''"
>
#include
<xsl:call-template
name=
"preinclude"
/>
UniSetObject.h
<xsl:call-template
name=
"postinclude"
/></xsl:if>
#include
<xsl:call-template
name=
"preinclude"
/>
LT_Object.h
<xsl:call-template
name=
"postinclude"
/>
#include
<xsl:call-template
name=
"preinclude"
/>
LT_Object.h
<xsl:call-template
name=
"postinclude"
/>
...
@@ -48,10 +52,10 @@ class <xsl:value-of select="$CLASSNAME"/>_SK:
...
@@ -48,10 +52,10 @@ class <xsl:value-of select="$CLASSNAME"/>_SK:
{
{
public:
public:
<xsl:if
test=
"not(normalize-space($OID))=''"
>
<xsl:if
test=
"not(normalize-space($OID))=''"
>
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK( UniSetTypes::ObjectId id = conf->getObjectID("
<xsl:value-of
select=
"$OID"
/>
"), xmlNode* node=UniSetTypes::conf->getNode("
<xsl:value-of
select=
"normalize-space($CNAME)"
/>
") );
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK( UniSetTypes::ObjectId id = conf->getObjectID("
<xsl:value-of
select=
"$OID"
/>
"), xmlNode* node=UniSetTypes::conf->getNode("
<xsl:value-of
select=
"normalize-space($CNAME)"
/>
")
, const std::string
&
argprefix="
<xsl:value-of
select=
"normalize-space($ARGPREFIX)"
/>
"
);
</xsl:if>
</xsl:if>
<xsl:if
test=
"normalize-space($OID)=''"
>
<xsl:if
test=
"normalize-space($OID)=''"
>
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK( UniSetTypes::ObjectId id, xmlNode* node=UniSetTypes::conf->getNode("
<xsl:value-of
select=
"normalize-space($CNAME)"
/>
") );
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK( UniSetTypes::ObjectId id, xmlNode* node=UniSetTypes::conf->getNode("
<xsl:value-of
select=
"normalize-space($CNAME)"
/>
")
, const std::string
&
argprefix="
<xsl:value-of
select=
"normalize-space($ARGPREFIX)"
/>
"
);
</xsl:if>
</xsl:if>
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK();
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK();
virtual ~
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK();
virtual ~
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK();
...
...
Utilities/codegen/tests/testgen.src.xml
View file @
d7ea1f54
...
@@ -15,8 +15,9 @@
...
@@ -15,8 +15,9 @@
<set
name=
"class-name"
val=
"TestGen"
/>
<set
name=
"class-name"
val=
"TestGen"
/>
<set
name=
"msg-count"
val=
"20"
/>
<set
name=
"msg-count"
val=
"20"
/>
<set
name=
"sleep-msec"
val=
"150"
/>
<set
name=
"sleep-msec"
val=
"150"
/>
<set
name=
"arg-prefix"
val=
"test-"
/>
</settings>
</settings>
<variables
arg_prefix=
"test-"
>
<variables>
<!-- type = [int,str,bool,float]
<!-- type = [int,str,bool,float]
int: max,min,no_range_exception=[0,1]
int: max,min,no_range_exception=[0,1]
str:
str:
...
@@ -36,7 +37,7 @@
...
@@ -36,7 +37,7 @@
<item
name=
"test_bool"
type=
"bool"
private=
"1"
/>
<item
name=
"test_bool"
type=
"bool"
private=
"1"
/>
<item
name=
"test_str"
type=
"str"
default=
"ddd"
/>
<item
name=
"test_str"
type=
"str"
default=
"ddd"
/>
</variables>
</variables>
<smap
arg_prefix=
"test-"
>
<smap>
<!-- name - название переменной в конф. файле -->
<!-- name - название переменной в конф. файле -->
<item
name=
"input1_s"
vartype=
"in"
iotype=
"DI"
comment=
"comment for input1"
smTestID=
"1"
/>
<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=
"input2_s"
vartype=
"in"
iotype=
"DI"
comment=
"comment for input2"
/>
...
...
conf/libuniset.spec
View file @
d7ea1f54
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
Name: libuniset
Name: libuniset
Version: 1.6
Version: 1.6
Release: alt1
6
Release: alt1
7
Summary: UniSet - library for building distributed industrial control systems
Summary: UniSet - library for building distributed industrial control systems
...
@@ -319,6 +319,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
...
@@ -319,6 +319,9 @@ mv -f %buildroot%python_sitelibdir_noarch/* %buildroot%python_sitelibdir/%oname
%exclude %_pkgconfigdir/libUniSet.pc
%exclude %_pkgconfigdir/libUniSet.pc
%changelog
%changelog
* Fri Nov 29 2013 Pavel Vainerman <pv@altlinux.ru> 1.6-alt17
- (uniset-codegen): move 'arg-prefix' from <variables> to <settings>
* Tue Nov 05 2013 Pavel Vainerman <pv@altlinux.ru> 1.6-alt16
* Tue Nov 05 2013 Pavel Vainerman <pv@altlinux.ru> 1.6-alt16
- (uniset-codegen): add 'loglevel' parameters for src.xml
- (uniset-codegen): add 'loglevel' parameters for src.xml
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment