Simple Table Specification
back to Table Specification
Create a Simple Table Specification
Consider the following basic component:
To add a simple table to it just drag and drop the corresponding item from the Model Elements view:
When adding a simplified table specification to a component, a State Transition Table is created:
This table contains has two sorts of columns: the ``input'' columns and the ``output'' columns.
As shows the above figure, there is one input column per input port and one output column per output port.
We can add rows to the table by clicking the left "+" next to "Click to add a new rule...":
The default row contains NoVal everywhere, but we can modify this value by clicking on the corresponding cells:
The cell value must have the same type as the corresponding port.
If the port has an enumerated type, the cell allows to select a value among the values of the list.
For instance in the following figure, we assume that Input1 has the type int and Output has the type boolean:
This row means that if Input1 receives the value 0 and Input2 receives no value, then Output is set to true.
A table row can be removed by clicking the "-" left to it.
In addition to the usual values, we can also use a star "*" in a condition column, to denote "any value":
The second row specifies that the result should be false if Input1 does not receive any message,
whatever is the value of Input2.
As many rows as required can be added, for instance:
As this figure shows, the output column can contain complex expressions instead of constants:
here the fifth row sets the output to Input1-Input2.
If many rows can apply, only the first one will be executed, and if some situation corresponds to no row then nothing happens.
Checking whether a table is deterministic or complete can be achieved automatically using the dedicated analysis tools, see TODO.
More complex Input Columns
The structure of a table is flexible: one can delete a column by clicking on the "-" to the right of its header.
This simply means that the corresponding column has no impact on the result.
One can also modify a column header simply by clicking on it, and add a column by clicking on the rightmost "+" in the inputs column.
In both cases, if some input ports do not have a column yet (either because it was deleted or because ports were added after
the creation of the table), a dialog pops up proposing to select one among them:
Clicking "Yes" displays a list allowing to select the port to add:
Clicking "No" yields the following dialog:
Which shows that one can actually use more complex input columns than just ports:
indeed one can create a condition checking the value of a boolean, of an integer or of a double.
To do this, simply check the corresponding type and define the condition in the text field, for instance:
Which then yields the following column (after setting the cells):
One can also check complex expressions:
Yielding the following column: