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
84763442
Commit
84763442
authored
May 08, 2013
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(uniset-codegen): Исправил ошибку в генерируемой функции getValue().
-она была объявлена как bool getValue -не генерировалась реализациия
parent
4938dfc7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
11 deletions
+37
-11
ctl-cpp-cc-alone-ask.xsl
Utilities/codegen/ctl-cpp-cc-alone-ask.xsl
+7
-1
ctl-cpp-cc-alone.xsl
Utilities/codegen/ctl-cpp-cc-alone.xsl
+7
-1
ctl-cpp-cc-ask.xsl
Utilities/codegen/ctl-cpp-cc-ask.xsl
+6
-1
ctl-cpp-cc.xsl
Utilities/codegen/ctl-cpp-cc.xsl
+9
-4
ctl-cpp-common.xsl
Utilities/codegen/ctl-cpp-common.xsl
+1
-1
libuniset.spec
conf/libuniset.spec
+4
-1
test.xml
conf/test.xml
+3
-2
No files found.
Utilities/codegen/ctl-cpp-cc-alone-ask.xsl
View file @
84763442
...
...
@@ -193,9 +193,15 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::askValue( UniSetTypes::ObjectId _si
{
ui.askRemoteSensor(_sid,_cmd,_node,getId());
}
// -----------------------------------------------------------------------------
bool
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::getState( UniSetTypes::ObjectId _sid )
{
return (bool)getValue(_sid);
}
// -----------------------------------------------------------------------------
long
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::getValue( UniSetTypes::ObjectId _sid )
{
try
{
<xsl:for-each
select=
"//sensors/item/consumers/consumer"
>
...
...
@@ -228,7 +234,7 @@ bool <xsl:value-of select="$CLASSNAME"/>_SK::getState( UniSetTypes::ObjectId _si
unideb[Debug::CRIT]
<<
myname
<<
"(getState): Обращение к неизвестному ДИСКРЕТНОМУ датчику sid="
<<
_sid
<<
endl;
return
false
;
return
0
;
}
catch(Exception
&
ex)
{
...
...
Utilities/codegen/ctl-cpp-cc-alone.xsl
View file @
84763442
...
...
@@ -171,9 +171,15 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::setValue( UniSetTypes::ObjectId _si
</xsl:if>
</xsl:for-each>
}
// -----------------------------------------------------------------------------
bool
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::getState( UniSetTypes::ObjectId _sid )
{
return (bool)getValue(_sid);
}
// -----------------------------------------------------------------------------
long
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::getValue( UniSetTypes::ObjectId _sid )
{
<xsl:for-each
select=
"//sensors/item/consumers/consumer"
>
<xsl:if
test=
"normalize-space(../../@msg)!='1'"
>
<xsl:if
test=
"normalize-space(@name)=$OID"
>
...
...
@@ -186,7 +192,7 @@ bool <xsl:value-of select="$CLASSNAME"/>_SK::getState( UniSetTypes::ObjectId _si
unideb[Debug::CRIT]
<<
myname
<<
"(getState): Обращение к неизвестному ДИСКРЕТНОМУ датчику sid="
<<
_sid
<<
endl;
return
false
;
return
0
;
}
// -----------------------------------------------------------------------------
void
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::updateOutputs( bool _force )
...
...
Utilities/codegen/ctl-cpp-cc-ask.xsl
View file @
84763442
...
...
@@ -168,6 +168,11 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::askValue( UniSetTypes::ObjectId _si
// -----------------------------------------------------------------------------
bool
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::getState( UniSetTypes::ObjectId _sid )
{
return (bool)getValue(_sid);
}
// -----------------------------------------------------------------------------
long
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::getValue( UniSetTypes::ObjectId _sid )
{
try
{
<xsl:for-each
select=
"//smap/item"
>
...
...
@@ -202,7 +207,7 @@ bool <xsl:value-of select="$CLASSNAME"/>_SK::getState( UniSetTypes::ObjectId _si
throw ex;
}
return
false
;
return
0
;
}
// -----------------------------------------------------------------------------
...
...
Utilities/codegen/ctl-cpp-cc.xsl
View file @
84763442
...
...
@@ -175,16 +175,21 @@ void <xsl:value-of select="$CLASSNAME"/>_SK::askValue( UniSetTypes::ObjectId sid
}
}
// -----------------------------------------------------------------------------
bool
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::getState( UniSetTypes::ObjectId sid )
bool
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::getState( UniSetTypes::ObjectId _sid )
{
return (bool)getValue(_sid);
}
// -----------------------------------------------------------------------------
long
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::getValue( UniSetTypes::ObjectId _sid )
{
<xsl:for-each
select=
"//smap/item"
>
if( sid ==
<xsl:value-of
select=
"@name"
/>
)
if(
_
sid ==
<xsl:value-of
select=
"@name"
/>
)
return
<xsl:call-template
name=
"setprefix"
/><xsl:value-of
select=
"@name"
/>
;
</xsl:for-each>
unideb[Debug::CRIT]
<<
myname
<<
"(getState): Обращение к неизвестному ДИСКРЕТНОМУ датчику sid="
<<
sid
<<
endl;
return
false
;
<<
_
sid
<<
endl;
return
0
;
}
// -----------------------------------------------------------------------------
void
<xsl:value-of
select=
"$CLASSNAME"
/>
_SK::preSensorInfo( UniSetTypes::SensorMessage* sm )
...
...
Utilities/codegen/ctl-cpp-common.xsl
View file @
84763442
...
...
@@ -178,7 +178,7 @@
bool alarm( UniSetTypes::ObjectId sid, bool state );
bool getState( UniSetTypes::ObjectId sid );
bool
getValue( UniSetTypes::ObjectId sid );
long
getValue( UniSetTypes::ObjectId sid );
void setValue( UniSetTypes::ObjectId sid, long value );
void setState( UniSetTypes::ObjectId sid, bool state );
void askState( UniSetTypes::ObjectId sid, UniversalIO::UIOCommand, UniSetTypes::ObjectId node = UniSetTypes::conf->getLocalNode() );
...
...
conf/libuniset.spec
View file @
84763442
...
...
@@ -7,7 +7,7 @@
Name: libuniset
Version: 1.6
Release: alt
7
Release: alt
8
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
* Wed May 08 2013 Pavel Vainerman <pv@altlinux.ru> 1.6-alt8
- fixed minor bug in uniset-codegen (getValue)
* Wed Mar 20 2013 Pavel Vainerman <pv@altlinux.ru> 1.6-alt7
- modbus: add new function 0x2B/0x0E(43/14)"Read device identification"
...
...
conf/test.xml
View file @
84763442
...
...
@@ -101,9 +101,9 @@
</device>
</MEI>
</MBSlave1>
<RTUExchange
name=
"RTUExchange"
speed=
"38400"
>
<RTUExchange
name=
"RTUExchange"
>
<DeviceList>
<item
addr=
"0x01"
invert=
"0"
respondSensor=
"RespondRTU_S"
speed=
"9600"
timeout=
"5000"
/>
<item
addr=
"0x01"
invert=
"0"
respondSensor=
"RespondRTU_S"
timeout=
"5000"
/>
</DeviceList>
</RTUExchange>
<UDPExchange
name=
"UDPExchange"
/>
...
...
@@ -190,6 +190,7 @@
</thresholds>
<controllers
name=
"Controllers"
>
<item
id=
"5000"
name=
"SharedMemory1"
/>
<item
id=
"5003"
name=
"SharedMemory"
/>
<item
id=
"5001"
name=
"UniExchange"
/>
<item
id=
"5002"
name=
"UniExchange2"
/>
</controllers>
...
...
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