Wiki source code of Textual SCCharts Language SCT
Last modified by Richard Kreissig on 2023/09/14 11:05
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | [[~[~[image:attach:SCCharts (pre 1.0)@onlinecompiler.png~]~]>>url:http://www.sccharts.com||shape="rect"]] (% class="confluence-link" %)[[image:attach:KIELER.Command Line Compiler.WebHome@commandlinecompiler2.png]][[doc:KIELER.SCCharts (DeprecatedHistorical Documentation & Features).SCCharts (pre 1\.0).Command Line Compiler.WebHome]](%%) [[image:attach:SCCharts (pre 1.0)@quickstart.png]][[doc:KIELER.SCCharts (DeprecatedHistorical Documentation & Features).SCCharts (pre 1\.0).Quick Start Guide (pre 0\.13).WebHome]] | ||
| 2 | |||
| 3 | |||
| 4 | [[An~[~[image:attach:450px-Xtext_logo.png~]~]>>url:http://www.eclipse.org/Xtext/||shape="rect"]] [[-based Project.>>url:http://www.eclipse.org/Xtext/||shape="rect"]] | ||
| 5 | |||
| 6 | |||
| 7 | == Project Overview == | ||
| 8 | |||
| 9 | Responsible: | ||
| 10 | |||
| 11 | * [[Christian Motika>>url:http://www.informatik.uni-kiel.de/rtsys/kontakt/cmot/||shape="rect"]], [[Steven Smyth>>url:http://www.informatik.uni-kiel.de/rtsys/kontakt/ssm/||shape="rect"]] | ||
| 12 | |||
| 13 | Formerly Responsible / Previous Projects: | ||
| 14 | |||
| 15 | * [[Christian Schneider>>url:http://www.informatik.uni-kiel.de/rtsys/kontakt/christian-schneider/||shape="rect"]] (Textual SyncCharts (KITS)) | ||
| 16 | |||
| 17 | Related Theses: | ||
| 18 | |||
| 19 | * Mirko Wischer, //Textuelle Darstellung und strukturbasiertes Editieren von Statecharts//, February 2006 ([[pdf>>url:http://rtsys.informatik.uni-kiel.de/%7Ebiblio/downloads/theses/miwi-dt.pdf||shape="rect"]]) | ||
| 20 | * Özgün Bayramoglu, //KIELER Infrastructure for Textual Modeling//, December 2009 ([[pdf>>url:http://rtsys.informatik.uni-kiel.de/%7Ebiblio/downloads/theses/oba-dt.pdf||shape="rect"]]) | ||
| 21 | * Christian Schneider, //Integrating Graphical and Textual Modeling//, February 2011 ([[pdf>>url:http://rtsys.informatik.uni-kiel.de/%7Ebiblio/downloads/theses/chsch-dt.pdf||shape="rect"]]) | ||
| 22 | |||
| 23 | SCCharts are typically modeled using the textual SCT language defined as an Xtext grammar in KIELER. Generally, if you do not know which elements can be placed at a certain cursor position you are assisted by a **content-assist that can be called pressing <Ctrl>+<Space>**. It will display all possible valid elements also considering scoping of variables. | ||
| 24 | |||
| 25 | In the following we will demonstrate SCT using the famous ABRO example (the hello world of synchronous programming/modelling). We will then give details for modelling other SCCharts language constructs with SCT. For details on their semantics please be referred to our PLDI paper [1]. | ||
| 26 | |||
| 27 | |||
| 28 | |||
| 29 | {{toc/}} | ||
| 30 | |||
| 31 | [1] R. von Hanxleden, B. Duderstadt, C. Motika, S. Smyth, M. Mendler, J. Aguado, S. Mercer, and O. O’Brien.// SCCharts: Sequentially Constructive Statecharts for Safety-Critical Applications//. In (% class="cmti-10" %)Proc. ACM SIGPLAN Conference on Programming Language Design(%%) (% class="cmti-10" %)and Implementation (PLDI’14)(%%), Edinburgh, UK, June 2014. ([[pdf>>url:http://rtsys.informatik.uni-kiel.de/%7Ebiblio/downloads/papers/pldi14.pdf||shape="rect"]]) | ||
| 32 | |||
| 33 | |||
| 34 | = ABRO Example = | ||
| 35 | |||
| 36 | In the following we will describe some basic elements using the famous ABRO example: | ||
| 37 | |||
| 38 | |||
| 39 | {{code language="sct" linenumbers="true"}} | ||
| 40 | @HVLayout | ||
| 41 | scchart ABRO { | ||
| 42 | input bool A, B, R; | ||
| 43 | output bool O = false; | ||
| 44 | region Main: | ||
| 45 | initial state ABO "ABthenO" { | ||
| 46 | entry / O = false; | ||
| 47 | initial state WaitAandB { | ||
| 48 | region HandleA: | ||
| 49 | initial state wA | ||
| 50 | --> dA with A; | ||
| 51 | final state dA; | ||
| 52 | region HandleB: | ||
| 53 | initial state wB | ||
| 54 | --> dB with B; | ||
| 55 | final state dB; | ||
| 56 | } | ||
| 57 | >-> done with / O = true; | ||
| 58 | final state done; | ||
| 59 | } | ||
| 60 | o-> ABO with R; | ||
| 61 | } | ||
| 62 | {{/code}} | ||
| 63 | |||
| 64 | |||
| 65 | [[image:attach:abro.png]] | ||
| 66 | |||
| 67 | 1. In the first line you see how an SCChart is defined using the //scchart// keyword where the ID of the SCChart will be //ABRO//. An optional label can be inserted after //ABRO// using "<LABEL>". | ||
| 68 | 1. In the next three lines variables are declared, namely,// A//, //B//, //R// and //O//, where //O// is initialized with the value false.// A//, //B//, and //R// are inputs which must not be initialized and get there valued from the environment. | ||
| 69 | 1. An SCChart typically contains concurrent regions which are introduced with the keyword //region// as shown in Line 9. | ||
| 70 | 1. Every region must at least have one state, and every region must exactly have one initial state. An initial state //ABO// is defined for region //Main// in Line 6. | ||
| 71 | 1. Every state is terminated by a //;// as shown in line 11 for state //HandleA//. | ||
| 72 | 1. If you like to specify internal behavior of a state, you can add concurrent regions to a state in //{// <regions>// }// as done for state //ABO// or state //WaitAB//. | ||
| 73 | 1. Transitions outgoing from a state must be declared right before a state is terminated with// ;//. For example a transition from state //wA// to state //dA// is declared in Line 11. | ||
| 74 | 1. Transitions can have triggers and effects which are separated by a dash~:// <trigger>/<effects>//. Multiple sequential effects are separated by a //;//. The transition in Line 11 declares just a trigger //A// (a dash is not necessary in this case), while the transition from line 18 declares only an effect// O = true// (here the dash is mandatory). | ||
| 75 | 1. There are three types of transitions: 1. normal/weak abort transitions //~-~->//, 2. strong abort transitions //o->// and 3. termination/join transitions// >->//. | ||
| 76 | |||
| 77 | = Detailed SCT Syntax of SCCharts Elements = | ||
| 78 | |||
| 79 | [[image:attach:SCCharts (pre 1.0)@sccharts-features.jpg]] | ||
| 80 | |||
| 81 | == SCChart, Initial State, State, Transition and Immediate Transition == | ||
| 82 | |||
| 83 | |||
| 84 | {{code language="sct" linenumbers="true"}} | ||
| 85 | scchart StateTransition { | ||
| 86 | initial state A | ||
| 87 | --> B; | ||
| 88 | state B | ||
| 89 | --> C; | ||
| 90 | state C | ||
| 91 | --> A immediate; | ||
| 92 | } | ||
| 93 | {{/code}} | ||
| 94 | |||
| 95 | |||
| 96 | |||
| 97 | [[image:attach:01statetransition.png]] | ||
| 98 | |||
| 99 | |||
| 100 | == Variable == | ||
| 101 | |||
| 102 | |||
| 103 | {{code language="sct" linenumbers="true"}} | ||
| 104 | scchart Variable { | ||
| 105 | int var1; | ||
| 106 | bool var2; | ||
| 107 | int var3 = 3; | ||
| 108 | bool var4 = false; | ||
| 109 | input int var5; | ||
| 110 | output float var6; | ||
| 111 | input output bool var7; | ||
| 112 | initial state A | ||
| 113 | --> B; | ||
| 114 | state B; | ||
| 115 | } | ||
| 116 | {{/code}} | ||
| 117 | |||
| 118 | |||
| 119 | |||
| 120 | [[image:attach:02variable.png]] | ||
| 121 | |||
| 122 | |||
| 123 | == Transition: Trigger & Effect == | ||
| 124 | |||
| 125 | |||
| 126 | {{code language="sct" linenumbers="true"}} | ||
| 127 | scchart TriggerEffect { | ||
| 128 | input int var1; | ||
| 129 | output bool var2; | ||
| 130 | initial state A | ||
| 131 | --> B with var1 == 3 / var2 = true; | ||
| 132 | state B; | ||
| 133 | } | ||
| 134 | {{/code}} | ||
| 135 | |||
| 136 | |||
| 137 | |||
| 138 | [[image:attach:03triggereffect.png]] | ||
| 139 | |||
| 140 | |||
| 141 | == Super State == | ||
| 142 | |||
| 143 | {{code language="sct" linenumbers="true"}} | ||
| 144 | scchart SuperState { | ||
| 145 | initial state A | ||
| 146 | --> B; | ||
| 147 | state B { | ||
| 148 | initial state B1 | ||
| 149 | --> B2; | ||
| 150 | state B2; | ||
| 151 | }; | ||
| 152 | } | ||
| 153 | {{/code}} | ||
| 154 | |||
| 155 | |||
| 156 | |||
| 157 | [[image:attach:04superstate.png]] | ||
| 158 | |||
| 159 | |||
| 160 | == Super State: Final States & Termination Transition == | ||
| 161 | |||
| 162 | |||
| 163 | {{code language="sct" linenumbers="true"}} | ||
| 164 | scchart FinalStateTermination { | ||
| 165 | initial state A | ||
| 166 | --> B; | ||
| 167 | state B { | ||
| 168 | initial state B1 | ||
| 169 | --> B2; | ||
| 170 | final state B2; | ||
| 171 | } | ||
| 172 | >-> C; | ||
| 173 | state C; | ||
| 174 | } | ||
| 175 | {{/code}} | ||
| 176 | |||
| 177 | |||
| 178 | |||
| 179 | [[image:attach:05finalstatetermination.png]] | ||
| 180 | |||
| 181 | |||
| 182 | == Super State: Weak Abort Transition == | ||
| 183 | |||
| 184 | |||
| 185 | {{code language="sct" linenumbers="true"}} | ||
| 186 | scchart WeakAbort { | ||
| 187 | input bool W; | ||
| 188 | initial state A | ||
| 189 | --> B; | ||
| 190 | state B { | ||
| 191 | initial state B1 | ||
| 192 | --> B2; | ||
| 193 | state B2; | ||
| 194 | } | ||
| 195 | --> C with W; | ||
| 196 | state C; | ||
| 197 | } | ||
| 198 | {{/code}} | ||
| 199 | |||
| 200 | |||
| 201 | |||
| 202 | [[image:attach:06weakabort.png]] | ||
| 203 | |||
| 204 | |||
| 205 | == Super State: Strong Abort Transition == | ||
| 206 | |||
| 207 | |||
| 208 | {{code language="sct" linenumbers="true"}} | ||
| 209 | scchart StrongAbort { | ||
| 210 | input bool S; | ||
| 211 | initial state A | ||
| 212 | --> B; | ||
| 213 | state B { | ||
| 214 | initial state B1 | ||
| 215 | --> B2; | ||
| 216 | state B2; | ||
| 217 | } | ||
| 218 | o-> C with S; | ||
| 219 | |||
| 220 | state C; | ||
| 221 | } | ||
| 222 | {{/code}} | ||
| 223 | |||
| 224 | |||
| 225 | |||
| 226 | [[image:attach:07strongabort.png]] | ||
| 227 | |||
| 228 | |||
| 229 | == Concurrent Regions (inside a Super State) == | ||
| 230 | |||
| 231 | |||
| 232 | {{code language="sct" linenumbers="true"}} | ||
| 233 | scchart Regions { | ||
| 234 | input bool S; | ||
| 235 | initial state A | ||
| 236 | --> B; | ||
| 237 | state B { | ||
| 238 | region Region1 : | ||
| 239 | initial state B1 | ||
| 240 | --> B2; | ||
| 241 | state B2; region Region2 : | ||
| 242 | initial state B3; | ||
| 243 | }; | ||
| 244 | } | ||
| 245 | {{/code}} | ||
| 246 | |||
| 247 | |||
| 248 | |||
| 249 | [[image:attach:08regions.png]] | ||
| 250 | |||
| 251 | |||
| 252 | == Entry Action, During Action, Exit Action == | ||
| 253 | |||
| 254 | |||
| 255 | {{code language="sct" linenumbers="true"}} | ||
| 256 | scchart Actions { | ||
| 257 | input bool var1; | ||
| 258 | output bool var2; | ||
| 259 | initial state A | ||
| 260 | --> B; | ||
| 261 | state B { | ||
| 262 | entry var1 / var2 = true; | ||
| 263 | during var1 / var2 = true; | ||
| 264 | immediate during var1 / var2 = true; | ||
| 265 | exit var1 / var2 = true; | ||
| 266 | initial state B1 | ||
| 267 | --> B2; | ||
| 268 | state B2; | ||
| 269 | }; | ||
| 270 | } | ||
| 271 | {{/code}} | ||
| 272 | |||
| 273 | |||
| 274 | |||
| 275 | [[image:attach:09actions.png]] | ||
| 276 | |||
| 277 | |||
| 278 | == Shallow History Transition == | ||
| 279 | |||
| 280 | |||
| 281 | {{code language="sct" linenumbers="true"}} | ||
| 282 | scchart HistoryShallow { | ||
| 283 | input bool var1; | ||
| 284 | output bool var2; | ||
| 285 | initial state A | ||
| 286 | --> B shallow history with var1; | ||
| 287 | state B { | ||
| 288 | initial state B1 | ||
| 289 | --> B2; | ||
| 290 | state B2; | ||
| 291 | } | ||
| 292 | --> A with var1; | ||
| 293 | } | ||
| 294 | {{/code}} | ||
| 295 | |||
| 296 | |||
| 297 | |||
| 298 | [[image:attach:10historyshallow.png]] | ||
| 299 | |||
| 300 | |||
| 301 | == Deep History Transition == | ||
| 302 | |||
| 303 | |||
| 304 | {{code language="sct" linenumbers="true"}} | ||
| 305 | scchart HistoryDeep { | ||
| 306 | input bool var1; | ||
| 307 | output bool var2; | ||
| 308 | initial state A | ||
| 309 | --> B history with var1; | ||
| 310 | state B { | ||
| 311 | initial state B1 | ||
| 312 | --> B2; | ||
| 313 | state B2; | ||
| 314 | } | ||
| 315 | --> A with var1; | ||
| 316 | } | ||
| 317 | {{/code}} | ||
| 318 | |||
| 319 | |||
| 320 | |||
| 321 | [[image:attach:11historydeep.png]] | ||
| 322 | |||
| 323 | |||
| 324 | == Deferred Transition == | ||
| 325 | |||
| 326 | |||
| 327 | {{code language="sct" linenumbers="true"}} | ||
| 328 | scchart Deferred { | ||
| 329 | input bool var1; | ||
| 330 | output bool var2; | ||
| 331 | initial state A | ||
| 332 | --> B deferred with var1; | ||
| 333 | state B { | ||
| 334 | entry var1 / var2 = true; | ||
| 335 | } | ||
| 336 | --> A with var1; | ||
| 337 | } | ||
| 338 | {{/code}} | ||
| 339 | |||
| 340 | |||
| 341 | |||
| 342 | [[image:attach:12deferred.png]] | ||
| 343 | |||
| 344 | |||
| 345 | == Transition with Count Delay == | ||
| 346 | |||
| 347 | |||
| 348 | {{code language="sct" linenumbers="true"}} | ||
| 349 | scchart CountDelay { | ||
| 350 | input bool var1; | ||
| 351 | output bool var2; | ||
| 352 | initial state A | ||
| 353 | --> B with 4 var1; | ||
| 354 | state B | ||
| 355 | --> A with var1; | ||
| 356 | } | ||
| 357 | {{/code}} | ||
| 358 | |||
| 359 | |||
| 360 | |||
| 361 | [[image:attach:13countdelay.png]] | ||
| 362 | |||
| 363 | |||
| 364 | == Array == | ||
| 365 | |||
| 366 | |||
| 367 | {{code language="sct" linenumbers="true"}} | ||
| 368 | scchart Array { | ||
| 369 | int myArray[10][2]; | ||
| 370 | initial state init | ||
| 371 | --> done with myArray[1][0] == 1 / myArray[2][1] = 2; | ||
| 372 | final state done; | ||
| 373 | } | ||
| 374 | {{/code}} | ||
| 375 | |||
| 376 | |||
| 377 | |||
| 378 | [[image:attach:14array.png]] | ||
| 379 | |||
| 380 | |||
| 381 | == Signal == | ||
| 382 | |||
| 383 | |||
| 384 | {{code language="sct" linenumbers="true"}} | ||
| 385 | scchart Signal { | ||
| 386 | input signal i; | ||
| 387 | output signal o | ||
| 388 | initial state init | ||
| 389 | --> done with i / o; | ||
| 390 | final state done; | ||
| 391 | } | ||
| 392 | {{/code}} | ||
| 393 | |||
| 394 | |||
| 395 | [[image:attach:15signal.png]] | ||
| 396 | |||
| 397 | |||
| 398 | == Reference States == | ||
| 399 | |||
| 400 | **Important: To use the referenced SCCharts feature, activate the Xtext nature for your project!** | ||
| 401 | |||
| 402 | |||
| 403 | {{code language="sct" linenumbers="true"}} | ||
| 404 | scchart MainSCChart { | ||
| 405 | bool A[3]; | ||
| 406 | |||
| 407 | initial state S1 references InnerSCChart; | ||
| 408 | } | ||
| 409 | |||
| 410 | scchart InnerSCChart { | ||
| 411 | input bool A[3]; | ||
| 412 | |||
| 413 | initial state S1 | ||
| 414 | --> S2 with A[0]; | ||
| 415 | |||
| 416 | final state S2; | ||
| 417 | } | ||
| 418 | {{/code}} | ||
| 419 | |||
| 420 | |||
| 421 | |||
| 422 | [[image:attach:MainSCChart.png]][[image:attach:InnerSCChart.png]] | ||
| 423 | |||
| 424 | |||
| 425 | |||
| 426 | = Hostcode = | ||
| 427 | |||
| 428 | You can also use you host language directly. | ||
| 429 | |||
| 430 | == Function Calls == | ||
| 431 | |||
| 432 | Call host code functions with dependency analysis. Use angle brackets to point to an extern function. You can also declare extern variables. | ||
| 433 | |||
| 434 | |||
| 435 | {{code language="sct" linenumbers="true"}} | ||
| 436 | @hostcode "#include <stdio.h>" | ||
| 437 | @hostcode "#include <stdlib.h>" | ||
| 438 | scchart functionCall { | ||
| 439 | output int i; | ||
| 440 | extern int stdout; | ||
| 441 | |||
| 442 | initial state getChar { | ||
| 443 | entry / <printf("Enter an integer: ")>; | ||
| 444 | entry / <fflush( stdout )>; | ||
| 445 | entry / <scanf("%d", &i)>; | ||
| 446 | } | ||
| 447 | --> print with / <printf("The interger you entered: %d\\n", i)>; | ||
| 448 | <fflush( stdout )>; | ||
| 449 | |||
| 450 | state print | ||
| 451 | --> getChar; | ||
| 452 | } | ||
| 453 | {{/code}} | ||
| 454 | |||
| 455 | |||
| 456 | |||
| 457 | [[image:attach:functionCalls.png]] | ||
| 458 | |||
| 459 | |||
| 460 | |||
| 461 | == Hostcode (inline) == | ||
| 462 | |||
| 463 | Inline hostcode just as it is. Use the @hostcode annotation to add hostcode line before the tick function. Also use hostcode in single quotes as hostcode effects. | ||
| 464 | |||
| 465 | **Important: Inline hostcode is not type-safe. Be careful.** | ||
| 466 | |||
| 467 | |||
| 468 | {{code language="sct" linenumbers="true"}} | ||
| 469 | @hostcode "#include <stdio.h>" | ||
| 470 | @hostcode "#include <stdlib.h>" | ||
| 471 | @hostcode "#include <unistd.h>" | ||
| 472 | @hostcode "#include <sys/time.h>" | ||
| 473 | @hostcode "struct timeval val;" | ||
| 474 | scchart hostcode { | ||
| 475 | output int ms; | ||
| 476 | |||
| 477 | initial state getChar { | ||
| 478 | entry / 'gettimeofday(&val, NULL)'; | ||
| 479 | ms = 'val.tv_sec' | ||
| 480 | } | ||
| 481 | --> print with / 'printf("Second: %d\\n", ms); fflush( stdout )'; | ||
| 482 | |||
| 483 | state print | ||
| 484 | --> getChar; | ||
| 485 | } | ||
| 486 | {{/code}} | ||
| 487 | |||
| 488 | |||
| 489 | |||
| 490 | |||
| 491 | [[image:attach:hostcode.png]] | ||
| 492 | |||
| 493 | |||
| 494 | = Annotations = | ||
| 495 | |||
| 496 | The textual SCCharts language supports several annotations to influence the visual representation of the model. | ||
| 497 | |||
| 498 | Annotation are processed in sequential order. | ||
| 499 | |||
| 500 | (% class="wrapped" %) | ||
| 501 | |=((( | ||
| 502 | Pattern | ||
| 503 | )))|=(% colspan="1" %)(% colspan="1" %) | ||
| 504 | ((( | ||
| 505 | Usage | ||
| 506 | )))|=((( | ||
| 507 | Description | ||
| 508 | )))|=((( | ||
| 509 | Example | ||
| 510 | ))) | ||
| 511 | |((( | ||
| 512 | (% class="content-wrapper" %) | ||
| 513 | ((( | ||
| 514 | {{code nopanel="true"}} | ||
| 515 | @diagram[<key>] <value> | ||
| 516 | {{/code}} | ||
| 517 | ))) | ||
| 518 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 519 | ((( | ||
| 520 | (% class="wrapped" %) | ||
| 521 | |=((( | ||
| 522 | Location: | ||
| 523 | )))|((( | ||
| 524 | scchart | ||
| 525 | ))) | ||
| 526 | |=((( | ||
| 527 | <key> | ||
| 528 | )))|((( | ||
| 529 | The name of the synthesis option. The given name is evaluated case-insensitive and whitespace-ignoring. The options are searched for the first matching **prefix**. | ||
| 530 | ))) | ||
| 531 | |=((( | ||
| 532 | <value> | ||
| 533 | )))|((( | ||
| 534 | The value type depends on the option type: | ||
| 535 | |||
| 536 | CheckBox: //true// or //false// | ||
| 537 | |||
| 538 | Choice: Name of choice item | ||
| 539 | |||
| 540 | Slider: Float value | ||
| 541 | ))) | ||
| 542 | )))|((( | ||
| 543 | Sets the synthesis option identified by <key> to the given value. | ||
| 544 | |||
| 545 | The available synthesis options for a diagram are displayed in the sidebar of the diagram view. | ||
| 546 | |||
| 547 | The values from the sidebar will be ignored if a corresponding annotation is present. | ||
| 548 | )))|((( | ||
| 549 | (% class="content-wrapper" %) | ||
| 550 | ((( | ||
| 551 | {{code language="sct"}} | ||
| 552 | @diagram[paper] true | ||
| 553 | scchart Testing { | ||
| 554 | initial state A | ||
| 555 | --> B; | ||
| 556 | final state B; | ||
| 557 | } | ||
| 558 | {{/code}} | ||
| 559 | ))) | ||
| 560 | ))) | ||
| 561 | |((( | ||
| 562 | (% class="content-wrapper" %) | ||
| 563 | ((( | ||
| 564 | {{code nopanel="true"}} | ||
| 565 | @layout[<key>] <value> | ||
| 566 | {{/code}} | ||
| 567 | ))) | ||
| 568 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 569 | ((( | ||
| 570 | (% class="wrapped" %) | ||
| 571 | |=((( | ||
| 572 | Location: | ||
| 573 | )))|((( | ||
| 574 | scchart, state, region, transition | ||
| 575 | ))) | ||
| 576 | |=((( | ||
| 577 | <key> | ||
| 578 | )))|((( | ||
| 579 | The ID of the layout option. The options are searched for the first matching **postfix**. | ||
| 580 | ))) | ||
| 581 | |=((( | ||
| 582 | <value> | ||
| 583 | )))|((( | ||
| 584 | The value type depends on the option type. The value is parsed case-sensitive. | ||
| 585 | ))) | ||
| 586 | )))|((( | ||
| 587 | (% class="content-wrapper" %) | ||
| 588 | ((( | ||
| 589 | Sets the layout property identified by <key> to the given value on the annotated element. | ||
| 590 | |||
| 591 | The available layout options are documented [[here>>doc:KIELER.Discontinued Projects.Infrastructure for Meta Layout (KIML).KIML Layout Options.WebHome]]. | ||
| 592 | |||
| 593 | Layout options will only affect the annotated element and no underlying hierarchy levels. | ||
| 594 | |||
| 595 | 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. | ||
| 596 | |||
| 597 | Special case: If the direction is set on the scchart element (top level) it overrides the default alternating layout. | ||
| 598 | |||
| 599 | {{expand title="Commonly Used"}} | ||
| 600 | (% class="wrapped" %) | ||
| 601 | |((( | ||
| 602 | {{{direction}}} | ||
| 603 | )))|((( | ||
| 604 | Layout direction | ||
| 605 | ))) | ||
| 606 | |((( | ||
| 607 | priority | ||
| 608 | )))|((( | ||
| 609 | Can influence the order of regions | ||
| 610 | ))) | ||
| 611 | {{/expand}} | ||
| 612 | ))) | ||
| 613 | )))|((( | ||
| 614 | (% class="content-wrapper" %) | ||
| 615 | ((( | ||
| 616 | {{code language="sct"}} | ||
| 617 | scchart Testing { | ||
| 618 | @layout[algorithm] de.cau.cs.kieler.graphviz.circo | ||
| 619 | region: | ||
| 620 | initial final state A | ||
| 621 | --> B; | ||
| 622 | state B | ||
| 623 | --> C; | ||
| 624 | state C | ||
| 625 | --> A; | ||
| 626 | } | ||
| 627 | {{/code}} | ||
| 628 | |||
| 629 | |||
| 630 | |||
| 631 | {{code language="sct"}} | ||
| 632 | scchart Testing { | ||
| 633 | @layout[direction] UP | ||
| 634 | region "up": | ||
| 635 | initial state A | ||
| 636 | --> B; | ||
| 637 | final state B; | ||
| 638 | @layout[direction] LEFT | ||
| 639 | region "left": | ||
| 640 | initial state A | ||
| 641 | --> B; | ||
| 642 | final state B; | ||
| 643 | } | ||
| 644 | {{/code}} | ||
| 645 | |||
| 646 | |||
| 647 | |||
| 648 | ))) | ||
| 649 | ))) | ||
| 650 | |((( | ||
| 651 | (% class="content-wrapper" %) | ||
| 652 | ((( | ||
| 653 | {{code nopanel="true"}} | ||
| 654 | @HVLayout | ||
| 655 | @VHLayout | ||
| 656 | {{/code}} | ||
| 657 | ))) | ||
| 658 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 659 | ((( | ||
| 660 | (% class="wrapped" %) | ||
| 661 | |=((( | ||
| 662 | Location: | ||
| 663 | )))|((( | ||
| 664 | scchart, state, region | ||
| 665 | ))) | ||
| 666 | )))|((( | ||
| 667 | Defines the order of the alternating layout directions. | ||
| 668 | |||
| 669 | The annotation can be mixed and nested in the SCChart and will only affect succeeding hierarchy levels. | ||
| 670 | |||
| 671 | The default is an implicit HVLayout starting at the top level state. | ||
| 672 | )))|((( | ||
| 673 | (% class="content-wrapper" %) | ||
| 674 | ((( | ||
| 675 | {{code language="sct"}} | ||
| 676 | @VHLayout | ||
| 677 | scchart Testing { | ||
| 678 | initial state A | ||
| 679 | --> B; | ||
| 680 | final state B; | ||
| 681 | } | ||
| 682 | {{/code}} | ||
| 683 | ))) | ||
| 684 | ))) | ||
| 685 | |(% colspan="1" %)(% colspan="1" %) | ||
| 686 | ((( | ||
| 687 | (% class="content-wrapper" %) | ||
| 688 | ((( | ||
| 689 | {{code nopanel="true"}} | ||
| 690 | @collapse | ||
| 691 | @expand | ||
| 692 | {{/code}} | ||
| 693 | ))) | ||
| 694 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 695 | ((( | ||
| 696 | (% class="wrapped" %) | ||
| 697 | |=((( | ||
| 698 | Location: | ||
| 699 | )))|((( | ||
| 700 | region | ||
| 701 | ))) | ||
| 702 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 703 | ((( | ||
| 704 | The annotated region will be initially collapse or expanded. | ||
| 705 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 706 | ((( | ||
| 707 | (% class="content-wrapper" %) | ||
| 708 | ((( | ||
| 709 | {{code language="sct"}} | ||
| 710 | scchart Testing { | ||
| 711 | @collapse | ||
| 712 | region: | ||
| 713 | initial state A | ||
| 714 | --> B; | ||
| 715 | final state B; | ||
| 716 | } | ||
| 717 | {{/code}} | ||
| 718 | ))) | ||
| 719 | ))) | ||
| 720 | |(% colspan="1" %)(% colspan="1" %) | ||
| 721 | ((( | ||
| 722 | (% class="content-wrapper" %) | ||
| 723 | ((( | ||
| 724 | {{code nopanel="true"}} | ||
| 725 | @hide | ||
| 726 | {{/code}} | ||
| 727 | ))) | ||
| 728 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 729 | ((( | ||
| 730 | (% class="wrapped" %) | ||
| 731 | |=((( | ||
| 732 | Location: | ||
| 733 | )))|((( | ||
| 734 | scchart, state, region, transition | ||
| 735 | ))) | ||
| 736 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 737 | ((( | ||
| 738 | The annotated element will be excluded from the diagram. | ||
| 739 | |||
| 740 | Transitions with a hidden source or target state will be hidden as well. | ||
| 741 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 742 | ((( | ||
| 743 | (% class="content-wrapper" %) | ||
| 744 | ((( | ||
| 745 | {{code language="sct"}} | ||
| 746 | scchart Testing { | ||
| 747 | initial state A | ||
| 748 | --> B; | ||
| 749 | @hide | ||
| 750 | final state B; | ||
| 751 | } | ||
| 752 | {{/code}} | ||
| 753 | ))) | ||
| 754 | ))) | ||
| 755 | |||
| 756 | = Overview of Operators = | ||
| 757 | |||
| 758 | The following briefly describes the operators that can be used in expressions. | ||
| 759 | |||
| 760 | (% class="wrapped" %) | ||
| 761 | |=((( | ||
| 762 | Assignment Operator | ||
| 763 | )))|=((( | ||
| 764 | Description | ||
| 765 | )))|=((( | ||
| 766 | Example | ||
| 767 | ))) | ||
| 768 | |(% colspan="1" %)(% colspan="1" %) | ||
| 769 | ((( | ||
| 770 | ~= | ||
| 771 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 772 | ((( | ||
| 773 | Assignment operator | ||
| 774 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 775 | ((( | ||
| 776 | x = 42 | ||
| 777 | ))) | ||
| 778 | |||
| 779 | (% class="wrapped" %) | ||
| 780 | |=((( | ||
| 781 | Arithmetic Operators | ||
| 782 | )))|=((( | ||
| 783 | Description | ||
| 784 | )))|=(% colspan="1" %)(% colspan="1" %) | ||
| 785 | ((( | ||
| 786 | Example | ||
| 787 | ))) | ||
| 788 | |((( | ||
| 789 | + | ||
| 790 | )))|((( | ||
| 791 | Addition | ||
| 792 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 793 | ((( | ||
| 794 | 2 + 1 | ||
| 795 | ))) | ||
| 796 | |((( | ||
| 797 | - | ||
| 798 | )))|((( | ||
| 799 | Subtraction | ||
| 800 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 801 | ((( | ||
| 802 | 2 - 1 | ||
| 803 | ))) | ||
| 804 | |((( | ||
| 805 | * | ||
| 806 | )))|((( | ||
| 807 | Multiplication | ||
| 808 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 809 | ((( | ||
| 810 | 3 * 2 | ||
| 811 | ))) | ||
| 812 | |((( | ||
| 813 | : | ||
| 814 | )))|((( | ||
| 815 | Division | ||
| 816 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 817 | ((( | ||
| 818 | 6 : 2 | ||
| 819 | ))) | ||
| 820 | |||
| 821 | (% class="wrapped" %) | ||
| 822 | |=((( | ||
| 823 | Unary Operator | ||
| 824 | )))|=((( | ||
| 825 | Description | ||
| 826 | )))|=((( | ||
| 827 | Example | ||
| 828 | ))) | ||
| 829 | |((( | ||
| 830 | + | ||
| 831 | )))|((( | ||
| 832 | Indicate a positive number | ||
| 833 | )))|((( | ||
| 834 | +2 | ||
| 835 | ))) | ||
| 836 | |((( | ||
| 837 | - | ||
| 838 | )))|((( | ||
| 839 | Negate a number | ||
| 840 | )))|((( | ||
| 841 | -2 | ||
| 842 | ))) | ||
| 843 | |((( | ||
| 844 | ++ | ||
| 845 | )))|((( | ||
| 846 | {{{Increment}}} | ||
| 847 | )))|((( | ||
| 848 | x++ | ||
| 849 | ))) | ||
| 850 | |(% colspan="1" %)(% colspan="1" %) | ||
| 851 | ((( | ||
| 852 | ~-~- | ||
| 853 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 854 | ((( | ||
| 855 | Decrement | ||
| 856 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 857 | ((( | ||
| 858 | x~-~- | ||
| 859 | ))) | ||
| 860 | |||
| 861 | (% class="wrapped" %) | ||
| 862 | |=((( | ||
| 863 | Boolean Operator | ||
| 864 | )))|=((( | ||
| 865 | Description | ||
| 866 | )))|=((( | ||
| 867 | Example | ||
| 868 | ))) | ||
| 869 | |(% colspan="1" %)(% colspan="1" %) | ||
| 870 | ((( | ||
| 871 | ~== | ||
| 872 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 873 | ((( | ||
| 874 | Equal to | ||
| 875 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 876 | ((( | ||
| 877 | x == 2 | ||
| 878 | ))) | ||
| 879 | |((( | ||
| 880 | ! | ||
| 881 | )))|((( | ||
| 882 | Negate a boolean value | ||
| 883 | )))|((( | ||
| 884 | ! (x == 2) | ||
| 885 | ))) | ||
| 886 | |((( | ||
| 887 | ~!= | ||
| 888 | )))|((( | ||
| 889 | Not equal to | ||
| 890 | )))|((( | ||
| 891 | x != 2 | ||
| 892 | ))) | ||
| 893 | |((( | ||
| 894 | ~> | ||
| 895 | )))|((( | ||
| 896 | Greater than | ||
| 897 | )))|((( | ||
| 898 | x > 2 | ||
| 899 | ))) | ||
| 900 | |((( | ||
| 901 | ~>= | ||
| 902 | )))|((( | ||
| 903 | Greather than or equal to | ||
| 904 | )))|((( | ||
| 905 | x >= 2 | ||
| 906 | ))) | ||
| 907 | |((( | ||
| 908 | < | ||
| 909 | )))|((( | ||
| 910 | Less than | ||
| 911 | )))|((( | ||
| 912 | x < 2 | ||
| 913 | ))) | ||
| 914 | |((( | ||
| 915 | <= | ||
| 916 | )))|((( | ||
| 917 | Less than or equal to | ||
| 918 | )))|((( | ||
| 919 | x <= 2 | ||
| 920 | ))) | ||
| 921 | |(% colspan="1" %)(% colspan="1" %) | ||
| 922 | ((( | ||
| 923 | && | ||
| 924 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 925 | ((( | ||
| 926 | Conditional-AND | ||
| 927 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 928 | ((( | ||
| 929 | x > 0 && x < 9 | ||
| 930 | ))) | ||
| 931 | |(% colspan="1" %)(% colspan="1" %) | ||
| 932 | ((( | ||
| 933 | ~|| | ||
| 934 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 935 | ((( | ||
| 936 | Conditional-OR | ||
| 937 | )))|(% colspan="1" %)(% colspan="1" %) | ||
| 938 | ((( | ||
| 939 | x < 0 || x > 9 | ||
| 940 | )))~{~{/column}} |