Commit ff8c1b49 authored by Pavel Vainerman's avatar Pavel Vainerman

(uniset-codegen): Набросал документацию по генератору кода

parent 5c19921d
......@@ -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 --ask --alone -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)
......
<?xml version="1.0" encoding="koi8-r"?>
<?xml version="1.0" encoding="utf-8"?>
<!--
name - название класса
msgcount - сколько сообщений обрабатывается за один раз
......
......@@ -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" default1="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>
......
......@@ -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
......
......@@ -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">
......
......@@ -8,4 +8,5 @@
- \ref page_Concept
- \ref page_Uniset
- \ref UniSetLibStylePage
- \ref pages
*/
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