Changes for page Project Creation, Initialization and Launch (Prom)
Last modified by Richard Kreissig on 2023/09/14 10:56
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -121,10 +121,6 @@ 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 - 128 128 [[image:attach:wrapper_code_generation_scheme.png]] 129 129 130 130 In the **template file** one can use special **placeholders**. ... ... @@ -139,8 +139,6 @@ 139 139 140 140 [[image:attach:template_file_structure.png]] 141 141 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 - 144 144 === FreeMarker === 145 145 146 146 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**.
- Confluence.Code.ConfluencePageClass[0]
-
- Id
-
... ... @@ -1,1 +1,1 @@ 1 -13762 8321 +13762745 - URL
-
... ... @@ -1,1 +1,1 @@ 1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/13762 832/Project Creation, Initialization and Launch (Prom)1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/13762745/Project Creation, Initialization and Launch (Prom)