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
ff8c1b49
Commit
ff8c1b49
authored
Oct 23, 2011
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(uniset-codegen): Набросал документацию по генератору кода
parent
5c19921d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
20 additions
and
14 deletions
+20
-14
Makefile.am
Utilities/codegen/tests/Makefile.am
+2
-2
testgen-alone.src.xml
Utilities/codegen/tests/testgen-alone.src.xml
+1
-1
testgen.src.xml
Utilities/codegen/tests/testgen.src.xml
+2
-2
uniset-codegen.in
Utilities/codegen/uniset-codegen.in
+13
-9
test.xml
conf/test.xml
+1
-0
mainpage.dox
docs/DocPages/mainpage.dox
+1
-0
uniset-codegen.dox
docs/DocPages/uniset-codegen.dox
+0
-0
No files found.
Utilities/codegen/tests/Makefile.am
View file @
ff8c1b49
...
...
@@ -13,10 +13,10 @@ GENERATED=TestGen_SK.h TestGen_SK.cc TestGen-main.cc
GENERATED2
=
TestGenAlone_SK.h TestGenAlone_SK.cc TestGenAlone-main.cc
$(GENERATED)
:
../@PACKAGE@-codegen testgen.src.xml ../*.xsl
../@PACKAGE@-codegen
-l
$(top_builddir)
/Utilities/codegen
--local-include
-
-ask
-
n
TestGen testgen.src.xml
../@PACKAGE@-codegen
-l
$(top_builddir)
/Utilities/codegen
--local-include
-n
TestGen testgen.src.xml
$(GENERATED2)
:
../@PACKAGE@-codegen testgen-alone.src.xml ../*.xsl
../@PACKAGE@-codegen
-l
$(top_builddir)
/Utilities/codegen
--local-include
--a
sk
--a
lone
-n
TestGenAlone testgen-alone.src.xml
../@PACKAGE@-codegen
-l
$(top_builddir)
/Utilities/codegen
--local-include
--alone
-n
TestGenAlone testgen-alone.src.xml
clean-local
:
rm
-rf
$(GENERATED)
$(GENERATED2)
...
...
Utilities/codegen/tests/testgen-alone.src.xml
View file @
ff8c1b49
<?xml version="1.0" encoding="
koi8-r
"?>
<?xml version="1.0" encoding="
utf-8
"?>
<!--
name - название класса
msgcount - сколько сообщений обрабатывается за один раз
...
...
Utilities/codegen/tests/testgen.src.xml
View file @
ff8c1b49
...
...
@@ -32,11 +32,11 @@
<item
name=
"test_int2"
type=
"int"
max=
"100"
default=
"110"
no_range_exception=
"1"
/>
<item
name=
"test_float"
type=
"float"
max=
"100.0"
default=
"50.0"
/>
<item
name=
"test_bool"
type=
"bool"
/>
<item
name=
"test_str"
type=
"str"
default
1
=
"ddd"
/>
<item
name=
"test_str"
type=
"str"
default=
"ddd"
/>
</variables>
<smap>
<!-- name - название переменной в конф. файле -->
<item
name=
"input1_s"
vartype=
"in"
iotype=
"DI"
comment=
"comment for input1"
node=
"K1Node"
/>
<item
name=
"input1_s"
vartype=
"in"
iotype=
"DI"
comment=
"comment for input1"
/>
<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"
/>
</smap>
...
...
Utilities/codegen/uniset-codegen.in
View file @
ff8c1b49
...
...
@@ -23,15 +23,19 @@ $PROG - generate source code for control process
xmlfile - source xml-file
Valid options are:
-m, --main filename for main.cc. Default: main.cc
-n, --name filename for *_SK files (base class implementation). Default: xmlfilename_SK
-h, --help display help screen
-h, --help - display help
-m, --main - filename for main.cc. Default: main.cc
-n, --name - filename for *_SK files (base class implementation). Default: xmlfilename_SK
--ask - Use 'ask' templates. See the documentation.
--alone - Use 'alone' templates. See the documentation.
EOF
[
-n
"
$1
"
]
&&
exit
"
$1
"
||
exit
}
#parse command line options
TEMP
=
`
getopt
-n
$PROG
-o
h,n:,m:,a,l:
-l
help
,name:,main:,no-main,topdir:,path:,alone,
ask,local:,local-include,add-cc-include,add-hh-include
--
"
$@
"
`
||
exit
1
TEMP
=
`
getopt
-n
$PROG
-o
h,n:,m:,a,l:
,z
-l
help
,name:,main:,no-main,topdir:,path:,alone,ask,no-
ask,local:,local-include,add-cc-include,add-hh-include
--
"
$@
"
`
||
exit
1
eval set
--
"
$TEMP
"
name
=
...
...
@@ -41,7 +45,7 @@ uni_main=
no_main
=
xmlfile
=
alone
=
ask
=
ask
=
1
localinc
=
0
add_cc_inc
=
add_hh_inc
=
...
...
@@ -76,10 +80,6 @@ while :; do
xls_m
=
"ctl-cpp-main-alone.xsl"
;;
--with-prev-values
)
prev_val
=
1
;;
--local-include
)
localinc
=
1
;;
...
...
@@ -96,6 +96,10 @@ while :; do
ask
=
1
;;
--no-ask
|
-z
)
ask
=
;;
-l
|
--local
)
shift
xsltdir
=
$1
...
...
conf/test.xml
View file @
ff8c1b49
...
...
@@ -143,6 +143,7 @@
<item
name=
"imitator_performance1"
precision=
"6"
textname=
"Производительность танка 1"
iotype=
"AI"
rs=
"mbslave"
mbreg=
"43"
mb_vtype=
"I2"
/>
<item
name=
"performance1"
precision=
"6"
noprecision=
"1"
textname=
"Производительность танка 1"
iotype=
"AI"
rs=
"mbmaster"
tcp_vtype=
"I2"
tcp_mbtype=
"rtu"
tcp_mbaddr=
"1"
tcp_mbreg=
"43"
tcp_mbfunc=
"0x04"
/>
<item
iotype=
"DI"
name=
"Message1"
priority=
"Medium"
textname=
"Текст сообщения 1"
/>
</sensors>
<thresholds
name=
"thresholds"
>
<sensor
iotype=
"AI"
name=
"AI_AS"
>
...
...
docs/DocPages/mainpage.dox
View file @
ff8c1b49
...
...
@@ -8,4 +8,5 @@
- \ref page_Concept
- \ref page_Uniset
- \ref UniSetLibStylePage
- \ref pages
*/
docs/DocPages/uniset-codegen.dox
0 → 100644
View file @
ff8c1b49
This diff is collapsed.
Click to expand it.
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