Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In the following we will describe some basic elements using the famous ABRO example:

Column
width50%
Code Block
languagesct
linenumberstrue
@HVLayout
scchart ABRO {
  input bool A, B, R;
  output bool O = false; 
  region Main:
  initial state ABO "ABthenO" {
    entry / O = false;
    initial state WaitAandB {
      region HandleA: 
      initial state wA 
      --> dA with A;
      final state dA;
      region HandleB:
      initial state wB
      --> dB with B;
      final state dB;
    }
    >-> done with / O = true;
    final state done;
  }
  o-> ABO with R;
}           

...

Annotation are processed in sequential order.

PatternUsageDescriptionExample
No Format
nopaneltrue
@synthesis[<key>] <value>
Location:scchart
<key>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.
<value>

The value type depends on the option type:

CheckBox: true or false

Choice: Name of choice item

Slider: Float 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.

Code Block
languagesct
@diagram[paper] true
scchart Testing {
  initial state A
  --> B;
  final state B;
}
No Format
nopaneltrue
@layout[<key>] <value>
Location:scchart, state, region, transition
<key>The ID of the layout option. The options are searched for the first matching postfix.
<value>

The value type depends on the option type. The value is parsed case-sensitive.

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.

Expand
titleCommonly Used
direction
Layout direction
priorityCan influence the order of regions
Code Block
languagesct
scchart Testing {
    @layout[algorithm] de.cau.cs.kieler.graphviz.circo
    region:
    initial final state A
    --> B;
    state B
    --> C;
    state C
    --> A;
}

 

 

Code Block
languagesct
scchart Testing {
    @layout[direction] UP
    region "up":
    initial state A
    --> B;
    final state B;
    @layout[direction] LEFT
    region "left":
    initial state A
    --> B;
    final state B;
}

 

 

No Format
nopaneltrue
@HVLayout
@VHLayout
Location:scchart, state, region

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.

Code Block
languagesct
@VHLayout
scchart Testing {
  initial state A
  --> B;
  final state B;
}
No Format
nopaneltrue
@collapse
@expand
Location:region
The annotated region will be initially collapse or expanded.
Code Block
languagesct
scchart Testing {
  @collapsed  
  region:
  initial state A
  --> B;
  final state B;
}
No Format
nopaneltrue
@hide
Location:scchart, state, region, transition

The annotated element will be excluded from the diagram.

Transitions with a hidden source or target state will be hidden as well.

Code Block
languagesct
scchart Testing {
  initial state A
  --> B;
  @hide
  final state B;
}

 

Overview of Operators

The following briefly describes the operators that can be used in expressions.

Assignment OperatorDescriptionExample
=Assignment operatorx = 42
Arithmetic OperatorsDescriptionExample
+Addition2 + 1
-Subtraction2 - 1
*Multiplication3 * 2
:

Division

6 : 2
Unary OperatorDescriptionExample
+Indicate a positive number+2
-Negate a number-2
++
Increment
x++
--Decrementx--
Boolean OperatorDescriptionExample
==Equal tox == 2
!Negate a boolean value! (x == 2)
!=Not equal tox != 2
>Greater thanx > 2
>=Greather than or equal tox >= 2
<Less thanx < 2
<=Less than or equal tox <= 2
&&Conditional-ANDx > 0 && x < 9
||Conditional-ORx < 0 || x > 9