Annotations
The textual SCCharts language supports several annotations to influence the visual representation of the model.
Annotation are processed in sequential order.
Pattern | Usage | Description | Example | ||||||
---|---|---|---|---|---|---|---|---|---|
@diagram[<key>] <value> |
| Sets the synthesis option identified by <key> to the given value. The available synthesis options for a diagram are displayed in the sidebar of the diagram view. The values from the sidebar will be ignored if a corresponding annotation is present. | @diagram[paper] true scchart Testing { initial state A --> B; final state B; } | ||||||
@layout[<key>] <value> |
| Sets the layout property identified by <key> to the given value on the annotated element. The available layout options are documented here. Layout options will only affect the annotated element and no underlying hierarchy levels. If a layout direction is specified with this annotation it overrides the layout direction set by HV-/VH-Layout in any parent element for this element. Special case: If the direction is set on the scchart element (top level) it overrides the default alternating layout. The layout option is identified by matching a postfix. Hence the key | scchart Testing { @layout[algorithm] org.eclipse.elk.graphviz.circo region: initial final state A --> B; state B --> C; state C --> A; } scchart Testing { @layout[elk.direction] UP region "up": initial state A --> B; final state B; @layout[elk.direction] LEFT region "left": initial state A --> B; final state B; } | ||||||
@HVLayout @VHLayout |
| Defines the order of the alternating layout directions. The annotation can be mixed and nested in the SCChart and will only affect succeeding hierarchy levels. The default is an implicit HVLayout starting at the top level state. | @VHLayout scchart Testing { initial state A go to B; final state B; } | ||||||
@collapse @expand |
| The annotated region will be initially collapse or expanded. | scchart Testing { @collapse region { initial state A go to B; final state B; } } | ||||||
@hide |
| The annotated element will be excluded from the diagram. Transitions with a hidden source or target state will be hidden as well. | scchart Testing { initial state A go to B; @hide final state B; } |
Pragmas
Pragmas are annotations that are valid for the whole file in contrast to annotations that are valid for semantic model elements. They are placed in front of an .sctx.
Pragma | Effect |
---|---|
#KiCoEnv {<json>} | Configures the compiler environment. |
#hostcode <code> #hostcode-[c | c-header | java] <code> | Allows hostcode additions that are placed at the beginning of the generated code file. The exact handling may depend on the used code generator. NEW IN 1.1 |
#code.naming | NEW IN 1.1 Configures the code generation to use different names for generated functions. #code.naming <TICK_FUNCTION_NAME>, <RESET_FUNCTION_NAME>, <LOGIC_FUNCTION_NAME>, <TICKDATA_STRUCT_NAME> #code.naming suffix |
#resource <file | directory> | NEW IN 1.1 The given resources (single files or directories) will be copied to the generated code folder (usually kieler-gen). Since this is the working directory for the compilation KIELER these files can be included via hostcode integration. All non-absolute paths will be resolved relative to the model file. Example #resource "myheader.h" #resource "mycode.c" #hostcode "#include \"myheader.h\"" scchart Testing { ... } |
#HideImportedSCCharts | NEW IN 1.1 This will hide all SCCharts that are imported from other files in the diagram, if the 'All SCCharts' synthesis option is activated. |