<
From version < 30.1 >
edited by aas2
on 2015/08/24 10:20
To version < 33.1 >
edited by aas2
on 2015/10/28 15:02
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -12,7 +12,7 @@
12 12  
13 13  The KIELER Compiler (KiCo) can generate different code targets from models. For example it is possible to generate C and Java code from an SCT file. As a result KIELER has to integrate with existing development tools and practices for the C and Java world. In the context of embedded systems, the target device also varies heavily.
14 14  
15 -Therefore the KIELER Project Management (Prom) has been developed. It eases the creation, compilation and deployment of projects, when using models that can be compiled via KiCo (e.g. SCCharts, Esterel). Furthermore it eases the creation of wrapper code, which is used to initialize and run the model. To do so, there are mainly three components: An Eclipse //Launch Configuration//, so called //Environments//, and //Project Wizards,// which will be introduces in the following.
15 +Therefore the KIELER Project Management (Prom) has been developed. It eases the creation, compilation and deployment of projects, when using models that can be compiled via KiCo (e.g. SCCharts, Esterel). Furthermore it eases the creation of wrapper code, which is used to initialize and run the model. To do so, there are mainly three components: An Eclipse //Launch Configuration//, so called //Environments//, and //Project Wizards,// which will be introduced in the following.
16 16  
17 17  ----
18 18  
... ... @@ -22,11 +22,11 @@
22 22  
23 23  1. compile code from models via KiCo
24 24  1. at the same time, generate wrapper code for these model files
25 -1. afterwards, execute arbitrary shell commands sequentially, if the KiCo compilation and wrapper code generation finished successfully
25 +1. afterwards, execute arbitrary shell commands sequentially if the KiCo compilation and wrapper code generation finished successfully
26 26  
27 -KiCo launch configurations work per project basis, thus every project has to create its own launch config. This is done automatically when performing //Right Click > Run As > KiCo Compilation //(% style="color: rgb(0,51,102);" %)on a model file.
27 +KiCo launch configurations work per project basis so that every project has to create its own launch config. This is done automatically when performing //Right Click > Run As > KiCo Compilation //(% style="color: rgb(0,51,102);" %)on a model file.
28 28  
29 -The **Run As** command will search for a KiCo launch config for the project. If there is such a config, the selected file is only added to the list of model files which should be compiled. If there is none, a launch config is created by using the main file and environment the project has been created with. If the main file and environment information could not be found, dialogs will query it from the user.
29 +The **Run As** command will search for a KiCo launch config for the project. If there is such a config, the selected file is only added to the list of model files that should be compiled. If there is none, a launch config is created by using the main file and environment the project has been created with. If the main file and environment information could not be found, dialogs will query it from the user.
30 30  
31 31  The **main file** of the launch config is used to set several file path variables, which can be used in several fields of the configuration, notably the shell commands to be executed, and wrapper code input. To use a variablethe syntax is **${**//variable_name//**}**. The variables that are set are
32 32  
... ... @@ -121,6 +121,10 @@
121 121  
122 122  Therefore one can write **wrapper code snippets** for a target device. These can then be injected to a **template file** as part of a KiCo launch. What snippets are injected is defined using **annotations on inputs and outputs** directly in the model file.
123 123  
124 +In SCT files, annotations are added as in java, with an at-sign e.g. //@LightSensor S3//. You can write implicit and explicit wrapper code annotations.
125 +
126 +Explicit annotations have the form **{{code language="none"}}@Wrapper SnippetName arg1 arg2 ... argN{{/code}}**. An explicit wrapper annotation raises an error if the snippet does not exist, thus it is **recommened** to use the explicit **@Wrapper** annotation. Every other annotation is tried as wrapper code annotation as well, but will be ignored, if no such snippet could be found. Thus you can write the above explicit annotation as **@SnippetName arg1 arg2 ... argN**{{code language="none"}}{{/code}}, but there will be no error if the snippet with this name does not exist or could not be found e.g. because of a typo.
127 +
124 124  [[image:attach:wrapper_code_generation_scheme.png]]
125 125  
126 126  In the **template file** one can use special **placeholders**.
... ... @@ -135,12 +135,12 @@
135 135  
136 136  [[image:attach:template_file_structure.png]]
137 137  
142 +To ease the modification of the template file, one can open it with the text editor the final code will be for. This will enable syntax highlighting and code completion for the langauge, but it will not show any errors. You can open the file for example with the Java Editor of Eclipse using //Right Click > Open With > Other > Java Editor//
143 +
138 138  === FreeMarker ===
139 139  
140 140  The wrapper code injection is done using the open source **template engine [[FreeMarker>>url:http://freemarker.org/||shape="rect"]]**. A wrapper code snippet is basically a [[Macro>>url:http://freemarker.org/docs/ref_directive_macro.html||shape="rect"]] definition of FreeMarker. The Macro is called when the corresponding annotation is found in the model file. The file extension of FreeMarker templates is **.ftl**.
141 141  
142 -(Image showing snippet definition, template file, annotated model file, template file with macro calls, output file)
143 -
144 144  There is an [[Eclipse plugin>>url:http://freemarker.org/editors.html||shape="rect"]] for FreeMarker as part of the JBoss Tools Project. It can be installed using the Eclipse Marketplace.
145 145  
146 146  [[image:attach:wrapper_code_generation_example.png]]
Confluence.Code.ConfluencePageClass[0]
Id
... ... @@ -1,1 +1,1 @@
1 -13762745
1 +13763280
URL
... ... @@ -1,1 +1,1 @@
1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/13762745/Project Creation, Initialization and Launch (Prom)
1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/13763280/Project Creation, Initialization and Launch (Prom)