<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://sinelabore.com/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>SinelaboreRT - wiki:getting_started</title>
        <description>Productivity for embedded software development</description>
        <link>https://sinelabore.com/</link>
        <lastBuildDate>Wed, 08 Apr 2026 05:36:15 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://sinelabore.com/lib/exe/fetch.php/favicon.ico</url>
            <title>SinelaboreRT</title>
            <link>https://sinelabore.com/</link>
        </image>
        <item>
            <title>Getting started on macOS with Astah and Clang</title>
            <link>https://sinelabore.com/doku.php/wiki/getting_started/astah_mac_clang</link>
            <description>


&lt;h1 class=&quot;sectionedit1&quot; id=&quot;getting_started_on_macos_with_astah_and_clang&quot;&gt;Getting started on macOS with Astah and Clang&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
This section guides you through the whole development process from designing a state machine to integrating it into an application. This will help you to get familiar with the code generator and its features.
&lt;/p&gt;

&lt;p&gt;
All files for this tutorial are available in this folder: &lt;code&gt;examples/microwave_handbook_astah_win32&lt;/code&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Getting started on macOS with Astah and Clang&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;getting_started_on_macos_with_astah_and_clang&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;14-388&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;a_microwave_oven&quot;&gt;A Microwave Oven&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
In this section we create the model of a simple microwave oven using a state machine diagram. A microwave oven was chosen because it is self-explanatory and not too complex to model. To keep this example as simple and clear as possible the hardware interaction routines are excluded. The following figure 1 shows the hardware of our fictitious microwave oven.
For this example we are using the Astah &lt;abbr title=&quot;Unified Modeling Language&quot;&gt;UML&lt;/abbr&gt; Modelling tool. If you use another supported &lt;abbr title=&quot;Unified Modeling Language&quot;&gt;UML&lt;/abbr&gt; tool the required steps are slightly different. But if you are familiar with your &lt;abbr title=&quot;Unified Modeling Language&quot;&gt;UML&lt;/abbr&gt; tool it should be no problem to follow the tutorial and create the model on your own.
In the appendix you will find hints on how to draw state diagrams for all the supported tools. It is recommended to have a quick look over the section that covers your tool. In addition the examples folder of your installation contains models for all supported tools (e.g. Enterprise Architect, UModel . . . ).
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://sinelabore.com/lib/exe/detail.php/wiki/getting_started/oven.jpg?id=wiki%3Agetting_started%3Aastah_mac_clang&quot; class=&quot;media&quot; title=&quot;wiki:getting_started:oven.jpg&quot;&gt;&lt;img src=&quot;https://sinelabore.com/lib/exe/fetch.php/wiki/getting_started/oven.jpg&quot; class=&quot;mediacenter&quot; loading=&quot;lazy&quot; title=&quot;Microwave Oven Image&quot; alt=&quot;Microwave Oven Image&quot; /&gt;&lt;/a&gt;
Figure 1: Fictitious microwave oven. With a wheel the cooking time can be adjusted between 0 – 60 seconds. The power can be set to high (II) or low (I).
&lt;/p&gt;

&lt;p&gt;
The oven controller should be able do the following things:
&lt;/p&gt;
&lt;ol&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Cooking time can be adjusted using a wheel between 0s and 60s.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Cooking starts if the cooking time is larger than zero. And the door is closed.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; If the door is opened during cooking the microwave generator is switched off. Cooking time stops.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Cooking continuous if the cooking time is not over and the door is closed again&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Cooking stops if the cooking time is over or the time is adjusted to zero.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Cooking time and power can be changed at any time.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;A Microwave Oven&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;a_microwave_oven&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;389-2102&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit3&quot; id=&quot;drawing_the_state_machine_diagram&quot;&gt;Drawing the State Machine Diagram&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
This example shows several &lt;abbr title=&quot;Unified Modeling Language&quot;&gt;UML&lt;/abbr&gt; state machine elements that make up a state machine. It is enough to generate production ready code out of it. Please note that the design presented here is not the only possible solution for the given requirements. Also some functions of a real microwave oven – e.g. control of a lamp in the oven – are still missing.
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://sinelabore.com/lib/exe/detail.php/wiki/getting_started/oven_astah_state_diagram.jpg?id=wiki%3Agetting_started%3Aastah_mac_clang&quot; class=&quot;media&quot; title=&quot;wiki:getting_started:oven_astah_state_diagram.jpg&quot;&gt;&lt;img src=&quot;https://sinelabore.com/lib/exe/fetch.php/wiki/getting_started/oven_astah_state_diagram.jpg&quot; class=&quot;mediacenter&quot; loading=&quot;lazy&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
Figure 2: Complete state machine design of the microwave oven. All necessary actions, guards, entry and exit code were added. The model was created with &lt;a href=&quot;https://sinelabore.com/doku.php/wiki/tools/supported_uml_tools&quot; class=&quot;wikilink1&quot; title=&quot;wiki:tools:supported_uml_tools&quot; data-wiki-id=&quot;wiki:tools:supported_uml_tools&quot;&gt;Astah&lt;/a&gt;. It is running on Windows and MacOS. One of the nice new features is a free plugin that shows you a state transition table of the state machine model. It gives you a quick overview of where you have modelled state transitions from and to. And where transitions might be missing.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Drawing the State Machine Diagram&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;drawing_the_state_machine_diagram&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;2103-3038&amp;quot;} --&gt;
&lt;h1 class=&quot;sectionedit4&quot; id=&quot;creating_code&quot;&gt;Creating Code&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
It is assumed you have Java and clang installed.
For a check if everything is installed correctly open a command window and change the working
directory to this folder. Then type in the following commands.
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;C:\&amp;gt;java −version
java -version
java version &amp;quot;13.0.2&amp;quot; 2020-01-14
Java(TM) SE Runtime Environment (build 13.0.2+8)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)&lt;/pre&gt;

&lt;p&gt;
Check that you have a compiler installed (call &lt;code&gt;clang -v&lt;/code&gt;). Otherwise install the developer tools for macOS.
&lt;/p&gt;

&lt;p&gt;
Your output should look similar. Details might differ depending on your installed program versions. Now change to the ready made example in the examples folder. Depending on your installation change to the following examples folder:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;your path\sinelaboreRT4.1\examples\microwave_handbook_astah_win32&lt;/pre&gt;

&lt;p&gt;
Type in &lt;code&gt;make clean&lt;/code&gt; to first remove existing built results. 
Then type in &lt;code&gt;make&lt;/code&gt; to build everything.
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;make
java -cp ../../bin/*:../*:/Applications/astahprofessional/astahprofessional.app/Contents/Java/* codegen.Main -l cx -v -p ASTAH -o oven -t &amp;quot;final:oven:machine&amp;quot;  oven_model.asta
Verbose mode on
Command line parsing success!
Open project: oven_model.asta
Starting robustness tests of state machine ...
State names: .............. 
Machine hierarchy: ........ 
Machine height = 2
Transitions: .............. 
Default states: ........... 
Final states: ............. 
Choices: .................. 
No. of children in composites: ... 
Connectivity of states: ...
M1054: State Error has no outgoing transitions which indicates a dead end -&amp;gt; check your design.
Can&amp;#039;t find the License.txt file or invalid file. Codegen is running in demo mode
Expected license file location: /Users/pmueller/develop/sinelabore/statemachine generator/Cadifra CodeGen/distribution_folder/sinelaboreRT4.1/bin/License.txt
Running in demo mode!
gcc -Wall -g -I. main.c -c -o main.o
java -cp ../../bin/*:../*:/Applications/astahprofessional/astahprofessional.app/Contents/Java/* codegen.Main -A -l cx -v -p ASTAH -o oven -t &amp;quot;final:oven:selftest&amp;quot;  oven_model.asta
Verbose mode on
Command line parsing success!
Parsing successfully finished.
Checking nodes ...
Checking for unique node names
Merging actions TestMicrowave and TestLamp
Merging actions a75992a1_3417_452d_8b54_1302dc8128b7 and TestSomethingElse
gcc -Wall -g -I. oven.c -c -o oven.o
gcc -Wall -g -I. oven_hlp.c -c -o oven_hlp.o
gcc -Wall -g -I. oven_selftest.c -c -o oven_selftest.o
gcc  -o oven.exe main.o oven.o oven_hlp.o oven_selftest.o&lt;/pre&gt;

&lt;p&gt;
The &lt;code&gt;oven&lt;/code&gt; binary should be built successfully now.
Start the program and type several times &lt;code&gt;+&lt;/code&gt; ti increment the cooking timer.
Then press &lt;code&gt;c&lt;/code&gt; to close the door. Watch what happens. Test the other events you can fire.
&lt;/p&gt;

&lt;p&gt;
It is now recommended to start your &lt;abbr title=&quot;Unified Modeling Language&quot;&gt;UML&lt;/abbr&gt; editor again. And play with the state diagram. Look into the generated code to get familiar with the many possibilities the code generator offers.
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://sinelabore.com/lib/exe/detail.php/wiki/getting_started/oven_macos.png?id=wiki%3Agetting_started%3Aastah_mac_clang&quot; class=&quot;media&quot; title=&quot;wiki:getting_started:oven_macos.png&quot;&gt;&lt;img src=&quot;https://sinelabore.com/lib/exe/fetch.php/wiki/getting_started/oven_macos.png&quot; class=&quot;mediacenter&quot; loading=&quot;lazy&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
Some additional notes:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; The code generator can also generate code from activity diagrams. The example also contains an activity diagram for the self test algorithm (basic, just as example).&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; The code generator also supports the generation from the Astah SysML tool.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Astah is a very nice cross platform tool not only available for macOS. Try it out if you have not used it so far.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
~~DISCUSSION|Leave your comments~~
&lt;/p&gt;
&lt;div class=&quot;tags&quot;&gt;&lt;span&gt;
	&lt;a href=&quot;https://sinelabore.com/doku.php/tag/windows?do=showtag&amp;amp;tag=%5BWindows&quot; class=&quot;wikilink1&quot; title=&quot;tag:windows&quot; rel=&quot;tag&quot;&gt;[Windows&lt;/a&gt;,
	&lt;a href=&quot;https://sinelabore.com/doku.php/tag/clang?do=showtag&amp;amp;tag=Clang&quot; class=&quot;wikilink1&quot; title=&quot;tag:clang&quot; rel=&quot;tag&quot;&gt;Clang&lt;/a&gt;,
	&lt;a href=&quot;https://sinelabore.com/doku.php/tag/astah?do=showtag&amp;amp;tag=Astah&quot; class=&quot;wikilink1&quot; title=&quot;tag:astah&quot; rel=&quot;tag&quot;&gt;Astah&lt;/a&gt;,
	&lt;a href=&quot;https://sinelabore.com/doku.php/tag/umltool?do=showtag&amp;amp;tag=UMLTool%5D&quot; class=&quot;wikilink1&quot; title=&quot;tag:umltool&quot; rel=&quot;tag&quot;&gt;UMLTool]&lt;/a&gt;
&lt;/span&gt;&lt;/div&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Creating Code&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;creating_code&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;3039-&amp;quot;} --&gt;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Fri, 03 May 2024 20:40:48 +0000</pubDate>
        </item>
        <item>
            <title>Getting started on Windows with Visual Studio and Astah</title>
            <link>https://sinelabore.com/doku.php/wiki/getting_started/astah_windows_visualstudio</link>
            <description>


&lt;h1 class=&quot;sectionedit1&quot; id=&quot;getting_started_on_windows_with_visual_studio_and_astah&quot;&gt;Getting started on Windows with Visual Studio and Astah&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
This section guides you through the whole development process from designing a state machine to integrating it into an application. This will help you to get familiar with the code generator and its features.
&lt;/p&gt;

&lt;p&gt;
All files for this tutorial are available in this folder: &lt;code&gt;examples/microwave_visual_studio_c&lt;/code&gt; and available &lt;a href=&quot;https://sinelabore.com/lib/exe/fetch.php/wiki/getting_started/microwave_visual_studio_c.zip&quot; class=&quot;media mediafile mf_zip&quot; title=&quot;wiki:getting_started:microwave_visual_studio_c.zip (173.5 KB)&quot;&gt;here as zip file&lt;/a&gt;.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Getting started on Windows with Visual Studio and Astah&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;getting_started_on_windows_with_visual_studio_and_astah&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;15-484&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;a_microwave_oven&quot;&gt;A Microwave Oven&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
In this section we create the model of a simple microwave oven using a state machine diagram. A microwave oven was chosen because it is self-explanatory and not too complex to model. To keep this example as simple and clear as possible the hardware interaction routines are excluded. The following figure 1 shows the hardware of our fictitious microwave oven.
For this example we are using Altova UModel. 
In the handbook you will find hints on how to draw state diagrams for all the supported tools. It is recommended to have a quick look into that section. 
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://sinelabore.com/lib/exe/detail.php/wiki/getting_started/oven.jpg?id=wiki%3Agetting_started%3Aastah_windows_visualstudio&quot; class=&quot;media&quot; title=&quot;wiki:getting_started:oven.jpg&quot;&gt;&lt;img src=&quot;https://sinelabore.com/lib/exe/fetch.php/wiki/getting_started/oven.jpg&quot; class=&quot;mediacenter&quot; loading=&quot;lazy&quot; title=&quot;Microwave Oven Image&quot; alt=&quot;Microwave Oven Image&quot; /&gt;&lt;/a&gt;
Figure 1: Simplified microwave oven. With a wheel the cooking time can be adjusted between 0 – 60 seconds. The power can be set to high (II) or low (I).
&lt;/p&gt;

&lt;p&gt;
The oven controller should be able do the following things:
&lt;/p&gt;
&lt;ol&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Cooking time can be adjusted using a wheel between 0s and 60s.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Cooking starts if the cooking time is larger than zero. And the door is closed.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; If the door is opened during cooking the microwave generator is switched off. Cooking time stops.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Cooking continuous if the cooking time is not over and the door is closed again&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Cooking stops if the cooking time is over or the time is adjusted to zero.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Cooking time and power can be changed at any time.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;A Microwave Oven&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;a_microwave_oven&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;485-1822&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit3&quot; id=&quot;drawing_the_state_machine_diagram&quot;&gt;Drawing the State Machine Diagram&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
To fulfil the requirements a hierarchical state machine was designed. Therefore events that should be handled from every state must only be modelled once on the outer (parent) state. 
&lt;/p&gt;

&lt;p&gt;
This example shows several &lt;abbr title=&quot;Unified Modeling Language&quot;&gt;UML&lt;/abbr&gt; state machine elements that make up a state machine. It is enough to generate production ready code out of it.
Please note that the design presented here is not the only possible solution for the given requirements. Also some functions of a real microwave oven – e.g. control of a lamp in the oven – are still missing.
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://sinelabore.com/lib/exe/detail.php/wiki/getting_started/oven_astah_state_diagram.jpg?id=wiki%3Agetting_started%3Aastah_windows_visualstudio&quot; class=&quot;media&quot; title=&quot;wiki:getting_started:oven_astah_state_diagram.jpg&quot;&gt;&lt;img src=&quot;https://sinelabore.com/lib/exe/fetch.php/wiki/getting_started/oven_astah_state_diagram.jpg&quot; class=&quot;mediacenter&quot; loading=&quot;lazy&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
Figure 2: Complete state machine design of the microwave oven. All necessary actions, guards, entry and exit code were added. The model was created with &lt;a href=&quot;https://sinelabore.com/doku.php/wiki/tools/supported_uml_tools&quot; class=&quot;wikilink1&quot; title=&quot;wiki:tools:supported_uml_tools&quot; data-wiki-id=&quot;wiki:tools:supported_uml_tools&quot;&gt;Astah&lt;/a&gt;. It is running on Windows and MacOS. One of the nice new features is a free plugin that shows you a state transition table of the state machine model. It gives you a quick overview of where you have modelled state transitions from and to. And where transitions might be missing.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Drawing the State Machine Diagram&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;drawing_the_state_machine_diagram&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;1823-2942&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit4&quot; id=&quot;creating_code&quot;&gt;Creating Code&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
It is assumed you have Java and the Visual Studio installed on your PC.
For a check whether everything is installed correctly open a command window and change the working
directory to this folder. Then type in the following commands.
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;C:\&amp;gt;java −version
java -version
java version &amp;quot;13.0.2&amp;quot; 2020-01-14
Java(TM) SE Runtime Environment (build 13.0.2+8)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)&lt;/pre&gt;

&lt;p&gt;
Your output should look similar. Details might differ depending on your installed java versions. Now change to the ready made example in the examples folder. Depending on your installation change to the following examples folder:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;cd &amp;quot;your path\sinelaboreRT4.3\examples\microwave_visual_studio_c&amp;quot;&lt;/pre&gt;

&lt;p&gt;
To recreate the code open a command window and start the generation batch file. Check whether the paths inside the script are ok for your installation. Most probably you have to adjust one or the other path. Your output should be similar:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;Verbose mode on
Command line parsing success!
Parsing successfully finished.
Checking nodes ...
Checking for unique node names
Merging actions TestMicrowave and TestLamp
Merging actions bdc3d21b_a5c3_4ec5_b4b1_e9fd41b68d98 and TestSomethingElse
Verbose mode on
Command line parsing success!
Open project: oven_model.asta
Starting robustness tests of state machine ...
State names: ..............
Machine hierarchy: ........
Machine height = 2
Transitions: ..............
Default states: ...........
Final states: .............
Choices: ..................
No. of children in composites: ...
Connectivity of states: ...
M1054: State Error has no outgoing transitions which indicates a dead end -&amp;gt; check your design.
Can&amp;#039;t find the License.txt file or invalid file. Codegen is running in demo mode
Expected license file location: /C:/sinelaboreRT4.3/bin/License.txt
Running in demo mode!&lt;/pre&gt;

&lt;p&gt;
Double click on the &lt;code&gt;sln&lt;/code&gt; file to load the project with Visual Studio. It is a C++ console project.
The files generated from the &lt;abbr title=&quot;Unified Modeling Language&quot;&gt;UML&lt;/abbr&gt; state machine and the activity diagram are all stored in the folder called &lt;code&gt;generated&lt;/code&gt;. A simulation of a timer and the microwave hardware is provided in &lt;code&gt;helpers&lt;/code&gt; folder.
&lt;/p&gt;

&lt;p&gt;
Next compile the solution in Visual Studio. There should be no compile errors.
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://sinelabore.com/lib/exe/detail.php/wiki/getting_started/visual_studio.png?id=wiki%3Agetting_started%3Aastah_windows_visualstudio&quot; class=&quot;media&quot; title=&quot;wiki:getting_started:visual_studio.png&quot;&gt;&lt;img src=&quot;https://sinelabore.com/lib/exe/fetch.php/wiki/getting_started/visual_studio.png&quot; class=&quot;mediacenter&quot; loading=&quot;lazy&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
Figure 3: Visual Studio Console Project. The batch file is used to create the code from the &lt;abbr title=&quot;Unified Modeling Language&quot;&gt;UML&lt;/abbr&gt; models.
&lt;/p&gt;

&lt;p&gt;
The &lt;code&gt;oven&lt;/code&gt; exe should be built successfully now.
Start the program and type several times &lt;code&gt;+&lt;/code&gt; to increment the cooking timer.
Then press &lt;code&gt;c&lt;/code&gt; to close the door. Watch what happens. Test the other events you can fire.
&lt;/p&gt;

&lt;p&gt;
It is now recommended to start your &lt;abbr title=&quot;Unified Modeling Language&quot;&gt;UML&lt;/abbr&gt; editor again. And play with the state diagram. Look into the generated code to get familiar with the many possibilities the code generator offers.
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://sinelabore.com/lib/exe/detail.php/wiki/getting_started/visual_studio_oven_exe.png?id=wiki%3Agetting_started%3Aastah_windows_visualstudio&quot; class=&quot;media&quot; title=&quot;wiki:getting_started:visual_studio_oven_exe.png&quot;&gt;&lt;img src=&quot;https://sinelabore.com/lib/exe/fetch.php/wiki/getting_started/visual_studio_oven_exe.png&quot; class=&quot;mediaright&quot; align=&quot;right&quot; loading=&quot;lazy&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
Figure 4: Executing the built oven simulation.
&lt;/p&gt;

&lt;p&gt;
Some additional notes:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; The code generator can also generate code from activity diagrams. The example also contains an activity diagram for the self test algorithm (basic, just as example).&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
~~DISCUSSION:closed|Leave your comments~~
&lt;/p&gt;
&lt;div class=&quot;tags&quot;&gt;&lt;span&gt;
	&lt;a href=&quot;https://sinelabore.com/doku.php/tag/windows?do=showtag&amp;amp;tag=%5BWindows&quot; class=&quot;wikilink1&quot; title=&quot;tag:windows&quot; rel=&quot;tag&quot;&gt;[Windows&lt;/a&gt;,
	&lt;a href=&quot;https://sinelabore.com/doku.php/tag/astah?do=showtag&amp;amp;tag=Astah&quot; class=&quot;wikilink1&quot; title=&quot;tag:astah&quot; rel=&quot;tag&quot;&gt;Astah&lt;/a&gt;,
	&lt;a href=&quot;https://sinelabore.com/doku.php/tag/visual?do=showtag&amp;amp;tag=Visual&quot; class=&quot;wikilink1&quot; title=&quot;tag:visual&quot; rel=&quot;tag&quot;&gt;Visual&lt;/a&gt;,
	&lt;a href=&quot;https://sinelabore.com/doku.php/tag/studio?do=showtag&amp;amp;tag=Studio%5D&quot; class=&quot;wikilink1&quot; title=&quot;tag:studio&quot; rel=&quot;tag&quot;&gt;Studio]&lt;/a&gt;
&lt;/span&gt;&lt;/div&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Creating Code&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;creating_code&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;2943-&amp;quot;} --&gt;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Fri, 03 May 2024 20:40:58 +0000</pubDate>
        </item>
        <item>
            <title>Getting started on Windows with Cadifra and MinGW</title>
            <link>https://sinelabore.com/doku.php/wiki/getting_started/cadifra_windows_mingw</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;getting_started_on_windows_with_cadifra_and_mingw&quot;&gt;Getting started on Windows with Cadifra and MinGW&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
This section guides you through the whole development process from designing a state machine to integrating it into an application. This will help you to get familiar with the code generator and its features.
&lt;/p&gt;

&lt;p&gt;
All files for this tutorial are available in this folder: examples/microwave_handbook_cadifra
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Getting started on Windows with Cadifra and MinGW&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;getting_started_on_windows_with_cadifra_and_mingw&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-371&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;a_microwave_oven&quot;&gt;A Microwave Oven&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
In this section we create the model of a simple microwave oven using a state machine diagram. A microwave oven was chosen because it is self-explanatory and not too complex to model. To keep this example as simple and clear as possible the hardware interaction routines are excluded. The following figure 1 shows the hardware of our fictitious microwave oven.
For this example we are using the Cadifra &lt;abbr title=&quot;Unified Modeling Language&quot;&gt;UML&lt;/abbr&gt; editor. If you use another supported &lt;abbr title=&quot;Unified Modeling Language&quot;&gt;UML&lt;/abbr&gt; tool the required steps are slightly different. But if you are familiar with your &lt;abbr title=&quot;Unified Modeling Language&quot;&gt;UML&lt;/abbr&gt; tool it should be no problem to follow the tutorial and create the model on your own.
In the appendix you will find hints on how to draw state diagrams for all the supported tools. It is recommended to have a quick look over the section that covers your tool. In addition the examples folder of your installation contains models for all supported tools (e.g. Enterprise Architect, UModel . . . ).
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://sinelabore.com/lib/exe/detail.php/wiki/getting_started/oven.jpg?id=wiki%3Agetting_started%3Acadifra_windows_mingw&quot; class=&quot;media&quot; title=&quot;wiki:getting_started:oven.jpg&quot;&gt;&lt;img src=&quot;https://sinelabore.com/lib/exe/fetch.php/wiki/getting_started/oven.jpg&quot; class=&quot;mediacenter&quot; loading=&quot;lazy&quot; title=&quot;Microwave Oven Image&quot; alt=&quot;Microwave Oven Image&quot; /&gt;&lt;/a&gt;
Figure 1: Fictitious microwave oven. With a wheel the cooking time can be adjusted between 0 – 60 seconds. The power can be set to high (II) or low (I).
&lt;/p&gt;

&lt;p&gt;
The oven controller should be able do the following things:
&lt;/p&gt;
&lt;ol&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Cooking time can be adjusted using a wheel between 0s and 60s.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Cooking starts if the cooking time is larger than zero. And the door is closed.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; If the door is opened during cooking the microwave generator is switched off. Cooking time stops.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Cooking continuous if the cooking time is not over and the door is closed again&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Cooking stops if the cooking time is over or the time is adjusted to zero.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Cooking time and power can be changed at any time.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;A Microwave Oven&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;a_microwave_oven&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;372-2079&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit3&quot; id=&quot;drawing_the_initial_diagram&quot;&gt;Drawing the Initial Diagram&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
To start designing a state machine diagram, you first have to start the Cadifra &lt;abbr title=&quot;Unified Modeling Language&quot;&gt;UML&lt;/abbr&gt; editor and select the state machine mode either from the tool bar or from the menu entry Diagram→State. Now you can draw states and transitions. Right click to the drawing area to select the state chart element you want to use. Create step by step the complete start chart. The next figure shows an initial diagram fulfilling the above requirements. You can either draw it yourself or load it from the folder example1 located in the installation directory.
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://sinelabore.com/lib/exe/detail.php/wiki/getting_started/example1a.png?id=wiki%3Agetting_started%3Acadifra_windows_mingw&quot; class=&quot;media&quot; title=&quot;wiki:getting_started:example1a.png&quot;&gt;&lt;img src=&quot;https://sinelabore.com/lib/exe/fetch.php/wiki/getting_started/example1a.png&quot; class=&quot;mediacenter&quot; loading=&quot;lazy&quot; title=&quot; Microwave Oven State Machine initial design&quot; alt=&quot; Microwave Oven State Machine initial design&quot; /&gt;&lt;/a&gt;
Figure 2: First state machine design of the microwave oven. Only states and events are modelled yet.
&lt;/p&gt;

&lt;p&gt;
Such an initial design is already useful. It can be used to discuss (e.g. with customers) if the requirements are fulfilled and it reacts to all events as expected. At this stage often unclear points in the the specification can be identified. E.g. in our design a user has to open the door once after the cooking time is over before cooking can be started again. This behavior is not explicitly specified in the requirements. It might be acceptable but it is also possible to go directly to state idle instead.
Our initial design is not optimal as you can easily see. Requirement six (power and cooking time can be adjusted at any time) leads to a lot of similar state transitions. To avoid this the design can be changed into a hierarchical one.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Drawing the Initial Diagram&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;drawing_the_initial_diagram&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;2080-3603&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit4&quot; id=&quot;the_hierarchical_version&quot;&gt;The hierarchical version&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
To convert the existing design into a hierarchical one move the existing states into a new parent state. The previous states are now children of the new state called Super. The power and time related events are now handled by the outer state. Please note that the outer state is a history state. This is necessary because we want to go back to the last inner state after event processing of events handled by the outer state.
So far the machine can receive events and change state as reaction. But some important details are still missing. For example a &lt;code&gt;close door&lt;/code&gt; event in state idle causes a state change to cooking even if the cooking time was not set to a value ≠ zero. This is in opposite to requirement two. To avoid a state change a guard must be added or alternatively a choice as done here. Furthermore action and entry/exit code is still missing all over the diagram. An additional &lt;code&gt;Error&lt;/code&gt; state was added too. It is entered if the hardware self test failed after power on.
The next figure 3 shows the final state machine design. Functions with prefix timer are helper functions providing timer functionality. Functions with prefix oven are functions related to power control. See next section for further details.
In this example we touched the most basic design elements of a state charts. In the next section we focus on code generation and execution of our design on a PC.
Please note that the design presented here is not the only possible solution for the given requirements. Also some functions of a real microwave oven – e.g. control of a lamp in the oven – are still missing.
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://sinelabore.com/lib/exe/detail.php/wiki/getting_started/example1c.png?id=wiki%3Agetting_started%3Acadifra_windows_mingw&quot; class=&quot;media&quot; title=&quot;wiki:getting_started:example1c.png&quot;&gt;&lt;img src=&quot;https://sinelabore.com/lib/exe/fetch.php/wiki/getting_started/example1c.png&quot; class=&quot;mediacenter&quot; loading=&quot;lazy&quot; title=&quot; Microwave Oven State Machine hierarchical design&quot; alt=&quot; Microwave Oven State Machine hierarchical design&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
Figure 3: Complete state machine design of the microwave oven. All necessary actions, guards, entry and exit code was added.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;The hierarchical version&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;the_hierarchical_version&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;3604-5468&amp;quot;} --&gt;
&lt;h1 class=&quot;sectionedit5&quot; id=&quot;creating_code&quot;&gt;Creating Code&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
It is assumed you have Java and &lt;a href=&quot;http://mingw.org&quot; class=&quot;urlextern&quot; title=&quot;http://mingw.org&quot; rel=&quot;ugc nofollow&quot;&gt; MinGW&lt;/a&gt; (a gcc compiler for Windows) installed.
For a check if everything is installed correctly open a command window and change the working
directory to this folder. Then type in the following commands.
&lt;/p&gt;

&lt;pre class=&#039;cli  &#039;&gt;&lt;span class=&quot;cli_output&quot;&gt;C:\&amp;gt;java −version&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;java version &amp;quot;1.8.0_231&amp;quot;&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;Java(TM) SE Runtime Environment ( build 1.8.0_231−b11)&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;Java HotSpot(TM) 64−Bit Server VM ( build 25.231−b11 , mixed mode)&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Add the bin folder of MinGW to your path and check if the compiler can be called now.
&lt;/p&gt;

&lt;pre class=&#039;cli  &#039;&gt;&lt;span class=&quot;cli_output&quot;&gt;C:\&amp;gt;path %path%;C:\MinGW\bin C:\&amp;gt;mingw32−gcc&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;mingw32−gcc: fatal error: no input files&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;compilation terminated .&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Your output should look similar. Details might differ depending on your installed program versions. Now change to the ready made example in the examples folder. I assume that the code generator is directly installed on &lt;code&gt;c:\&lt;/code&gt;.
&lt;/p&gt;

&lt;pre class=&#039;cli  &#039;&gt;&lt;span class=&quot;cli_output&quot;&gt;C:\&amp;gt;cd c:\sinelaboreRT4.1\examples\microwave_handbook_cadifra_win32&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Type in &lt;code&gt;mingw32-make clean&lt;/code&gt; to first remove existing built results. 
Then type in &lt;code&gt;mingw32-make&lt;/code&gt; to build everything.
&lt;/p&gt;

&lt;pre class=&#039;cli  &#039;&gt;&lt;span class=&quot;cli_output&quot;&gt;mingw32-make&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;java -cp &amp;quot;../../bin/*&amp;quot; codegen.Main -p CADIFRA -p Cadifra -l cx -doxygen -o oven first_example_step3.cdd&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;Create inline doxygen of state machine function&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;A linked note starts not with &amp;#039;Compartment&amp;#039; and is therefore ignored&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;Starting robustness tests of state machine ...&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;State names: ..............&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;Machine hierarchy: ........&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;Machine height = 2&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;Transitions: ..............&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;Default states: ...........&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;Final states: .............&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;Choices: ..................&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;No. of children in composites: ...&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;Connectivity of states: ...&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;M1054: State Error has no outgoing transitions which indicates a dead end -&amp;gt; check your design.&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;Can&amp;#039;t find the License.txt file or invalid file. Codegen is running in demo mode&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;Expected license file location: ../../bin/License.txt&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;Running in demo mode!&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;gcc -Wall -g main.c -c -o main.o&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;gcc -Wall -g oven_hlp.c -c -o oven_hlp.o&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;gcc -Wall -g oven.c -c -o oven.o&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;gcc  -o oven main.o oven_hlp.o oven.o&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;cli_output&quot;&gt;C:\sinelaboreRT4.1\examples\microwave_handbook_cadifra_win32&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
The &lt;code&gt;oven.exe&lt;/code&gt; file should be built successfully now.
Start the program and type several times &lt;code&gt;+&lt;/code&gt; ti increment the cooking timer.
Then press &lt;code&gt;c&lt;/code&gt; to close the door. Watch what happens. Test the other events you can fire.
&lt;/p&gt;

&lt;p&gt;
It is now recommended to start the Cadifra &lt;abbr title=&quot;Unified Modeling Language&quot;&gt;UML&lt;/abbr&gt; editor again. And play with the state diagram. Look into the generated code to get familiar with the many possibilities the code generator offers.
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://sinelabore.com/lib/exe/detail.php/wiki/getting_started/oven.gif?id=wiki%3Agetting_started%3Acadifra_windows_mingw&quot; class=&quot;media&quot; title=&quot;wiki:getting_started:oven.gif&quot;&gt;&lt;img src=&quot;https://sinelabore.com/lib/exe/fetch.php/wiki/getting_started/oven.gif&quot; class=&quot;mediacenter&quot; loading=&quot;lazy&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
~~DISCUSSION|Leave your comments~~
&lt;/p&gt;
&lt;div class=&quot;tags&quot;&gt;&lt;span&gt;
	&lt;a href=&quot;https://sinelabore.com/doku.php/tag/windows?do=showtag&amp;amp;tag=%5BWindows&quot; class=&quot;wikilink1&quot; title=&quot;tag:windows&quot; rel=&quot;tag&quot;&gt;[Windows&lt;/a&gt;,
	&lt;a href=&quot;https://sinelabore.com/doku.php/tag/mingw?do=showtag&amp;amp;tag=MinGW&quot; class=&quot;wikilink1&quot; title=&quot;tag:mingw&quot; rel=&quot;tag&quot;&gt;MinGW&lt;/a&gt;,
	&lt;a href=&quot;https://sinelabore.com/doku.php/tag/cadifra?do=showtag&amp;amp;tag=Cadifra%5D&quot; class=&quot;wikilink1&quot; title=&quot;tag:cadifra&quot; rel=&quot;tag&quot;&gt;Cadifra]&lt;/a&gt;
&lt;/span&gt;&lt;/div&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Creating Code&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;creating_code&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:5,&amp;quot;range&amp;quot;:&amp;quot;5469-&amp;quot;} --&gt;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Sat, 05 Jun 2021 14:40:33 +0000</pubDate>
        </item>
        <item>
            <title>Generate production quality code from state diagrams created with DrawIO Desktop</title>
            <link>https://sinelabore.com/doku.php/wiki/getting_started/drawio</link>
            <description>


&lt;h1 class=&quot;sectionedit1&quot; id=&quot;generate_production_quality_code_from_state_diagrams_created_with_drawio_desktop&quot;&gt;Generate production quality code from state diagrams created with DrawIO Desktop&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
&lt;a href=&quot;https://sinelabore.com/lib/exe/detail.php/wiki/landing_pages/oven.drawio.png?id=wiki%3Agetting_started%3Adrawio&quot; class=&quot;media&quot; title=&quot;wiki:landing_pages:oven.drawio.png&quot;&gt;&lt;img src=&quot;https://sinelabore.com/lib/exe/fetch.php/wiki/landing_pages/oven.drawio.png?w=600&amp;amp;tok=9974a7&quot; class=&quot;media&quot; loading=&quot;lazy&quot; alt=&quot;&quot; width=&quot;600&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
Sinelabore&lt;em&gt;RT&lt;/em&gt; generates readable and maintainable code from hierarchical &lt;abbr title=&quot;Unified Modeling Language&quot;&gt;UML&lt;/abbr&gt; state machines created with &lt;a href=&quot;https://github.com/jgraph/drawio-desktop/releases/tag/v21.6.8&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/jgraph/drawio-desktop/releases/tag/v21.6.8&quot; rel=&quot;ugc nofollow&quot;&gt;DrawIO&lt;/a&gt;. With its unique features Sinelabore&lt;em&gt;RT&lt;/em&gt; covers well the requirements of embedded real-time and low power application developers. 
With its other language backends it is also a perfect tool for developers of server or desktop applications.
&lt;/p&gt;

&lt;p&gt;
Key Features:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Automated robustness checks before code generation&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; No run-time environment needed &lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Can be used with any CPU and with or without &lt;abbr title=&quot;Operating System&quot;&gt;OS&lt;/abbr&gt;/&lt;abbr title=&quot;Real-Time Operating System&quot;&gt;RTOS&lt;/abbr&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Code generation especially for embedded real-time and high availability systems.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Fits well in different system designs (foreground/background, &lt;abbr title=&quot;Real-Time Operating System&quot;&gt;RTOS&lt;/abbr&gt;-based …)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; No gap between design and code&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Support for automatic test-case generation&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Simulation in interactive or batch mode.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Optionally generating trace code&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Generated code creates no trouble when using static code checkers&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Generate production quality code from state diagrams created with DrawIO Desktop&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;generate_production_quality_code_from_state_diagrams_created_with_drawio_desktop&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;24-1156&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit2&quot; id=&quot;how_to_get_started&quot;&gt;How to get started ?&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Download the code generator and use the DrawIO microwave example in the examples folder.
It shows a fully functional example of a microwave oven in C. Make changes in the model, re-create the state machine code and then compile/run the example again. This is the fastest way to learn how to use the code generator. To recreate the code from the model file you need a Posix like development environment.
&lt;/p&gt;

&lt;p&gt;
An example command like to generate C-code from a model called oven looks like this:
&lt;code&gt;java -cp “pathToCodegenJarFolder/*” codegen.Main  -p drawio -l cx -o oven oven.drawio&lt;/code&gt;
&lt;/p&gt;

&lt;p&gt;
Only special elements from the &lt;abbr title=&quot;Unified Modeling Language&quot;&gt;UML&lt;/abbr&gt; palette are supported from the parser. Below a list of supported elements is shown and an image where to find them.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;How to get started ?&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;how_to_get_started&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;1157-1920&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit3&quot; id=&quot;supported_state_machine_elements&quot;&gt;Supported State Machine Elements&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
The supported elements are:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Normal state&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Hierarchical state&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Flat / deep history (appending (H) and (H*) in the state name)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Final state&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Initial state&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; (Signal-)Events with event name, guard and action – Initial and final pseudo-states&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Comment&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Choice&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
&lt;a href=&quot;https://sinelabore.com/lib/exe/detail.php/wiki/landing_pages/drawio.png?id=wiki%3Agetting_started%3Adrawio&quot; class=&quot;media&quot; title=&quot;wiki:landing_pages:drawio.png&quot;&gt;&lt;img src=&quot;https://sinelabore.com/lib/exe/fetch.php/wiki/landing_pages/drawio.png?w=600&amp;amp;tok=be880e&quot; class=&quot;media&quot; loading=&quot;lazy&quot; alt=&quot;&quot; width=&quot;600&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Supported State Machine Elements&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;supported_state_machine_elements&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;1921-2294&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit4&quot; id=&quot;how_to&quot;&gt;How to&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
&lt;img src=&quot;https://sinelabore.com/lib/images/smileys/question.svg&quot; class=&quot;icon smiley&quot; alt=&quot;:?:&quot; /&gt; &lt;strong&gt; Connecting transitions to states &lt;/strong&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;https://sinelabore.com/lib/images/smileys/exclaim.svg&quot; class=&quot;icon smiley&quot; alt=&quot;:!:&quot; /&gt; Start drawing a transition using the arrow elements on a state. Make sure the transition starts and ends on the light green circles that appear when you hover over the state borders. A nice tutorial is available here: &lt;a href=&quot;https://www.drawio.com/doc/faq/connectors&quot; class=&quot;urlextern&quot; title=&quot;https://www.drawio.com/doc/faq/connectors&quot; rel=&quot;ugc nofollow&quot;&gt;https://www.drawio.com/doc/faq/connectors&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://sinelabore.com/lib/exe/fetch.php?tok=430a09&amp;amp;media=https%3A%2F%2Fwww.drawio.com%2Fassets%2Fimg%2Fblog%2Fconnector-floating-vs-fixed.gif&quot; class=&quot;media&quot; title=&quot;https://www.drawio.com/assets/img/blog/connector-floating-vs-fixed.gif&quot;&gt;&lt;img src=&quot;https://sinelabore.com/lib/exe/fetch.php?w=400&amp;amp;tok=50111e&amp;amp;media=https%3A%2F%2Fwww.drawio.com%2Fassets%2Fimg%2Fblog%2Fconnector-floating-vs-fixed.gif&quot; class=&quot;media&quot; loading=&quot;lazy&quot; title=&quot;Connecting nodes&quot; alt=&quot;Connecting nodes&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;https://sinelabore.com/lib/images/smileys/question.svg&quot; class=&quot;icon smiley&quot; alt=&quot;:?:&quot; /&gt; &lt;strong&gt; Setting guards on the outgoing transitions of choices &lt;/strong&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;https://sinelabore.com/lib/images/smileys/exclaim.svg&quot; class=&quot;icon smiley&quot; alt=&quot;:!:&quot; /&gt; Delete the default text of the choice element. Then double click on the transition and enter the guard text. Don&amp;#039;t forget the square brackets.
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;https://sinelabore.com/lib/images/smileys/question.svg&quot; class=&quot;icon smiley&quot; alt=&quot;:?:&quot; /&gt; &lt;strong&gt; Adding events/guards/actions to a transition &lt;/strong&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;https://sinelabore.com/lib/images/smileys/exclaim.svg&quot; class=&quot;icon smiley&quot; alt=&quot;:!:&quot; /&gt; Double click on the transition and add the event, optionally a guard in square brackets and optionally the action code which is introduced by a slash. Example: &lt;code&gt;ev1[i==4]/printf(“i=4”);&lt;/code&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;https://sinelabore.com/lib/images/smileys/question.svg&quot; class=&quot;icon smiley&quot; alt=&quot;:?:&quot; /&gt; &lt;strong&gt; How can I selected the diagram in my model file? &lt;/strong&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;https://sinelabore.com/lib/images/smileys/exclaim.svg&quot; class=&quot;icon smiley&quot; alt=&quot;:!:&quot; /&gt; Use the command line parameter &lt;code&gt;-t&lt;/code&gt;. Here is an example how to select diagram &lt;code&gt;oven&lt;/code&gt; from the model file: &lt;code&gt;-t oven&lt;/code&gt;. If no diagram is specified (e.g there is only one) the first diagram found in the model file is taken.
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;https://sinelabore.com/lib/images/smileys/question.svg&quot; class=&quot;icon smiley&quot; alt=&quot;:?:&quot; /&gt; &lt;strong&gt; How to add substates? &lt;/strong&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;https://sinelabore.com/lib/images/smileys/exclaim.svg&quot; class=&quot;icon smiley&quot; alt=&quot;:!:&quot; /&gt; Delete the text of the composite state and add the substates within the empty field. Unfortunately there is no option the have enty/exit/do code in a composite state and child states. In this case use a comment to specific the text of the composite state as shown in the picture above.
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;https://sinelabore.com/lib/images/smileys/question.svg&quot; class=&quot;icon smiley&quot; alt=&quot;:?:&quot; /&gt; &lt;strong&gt; How can I set include files for the generated state machine code file? &lt;/strong&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;https://sinelabore.com/lib/images/smileys/exclaim.svg&quot; class=&quot;icon smiley&quot; alt=&quot;:!:&quot; /&gt; Use an unconnected comment as shown above starting with &lt;code&gt;header:&lt;/code&gt; in the first line.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;How to&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;how_to&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;2295-&amp;quot;} --&gt;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Fri, 03 May 2024 20:41:36 +0000</pubDate>
        </item>
        <item>
            <title>Noteworthy per operating system</title>
            <link>https://sinelabore.com/doku.php/wiki/getting_started/operating_systems</link>
            <description>
&lt;h3 class=&quot;sectionedit1&quot; id=&quot;noteworthy_per_operating_system&quot;&gt;Noteworthy per operating system&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;/div&gt;

&lt;h4 id=&quot;all_systems_windows_mac_linux&quot;&gt;All systems (Windows, Mac, Linux ...)&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;

&lt;p&gt;
Usage of the code generator from the command line is most flexible. Integration in Makefiles or the like is super easy. A call from the command line looks like: &lt;br/&gt;

&lt;code&gt;java -cp “~/sinelaboreRT5.2/bin/*” codegen.Main …&lt;/code&gt;
&lt;/p&gt;

&lt;/div&gt;

&lt;h4 id=&quot;mac&quot;&gt;Mac&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;

&lt;p&gt;
A dmg file is provided. See &lt;a href=&quot;https://sinelabore.com/doku.php/wiki/accepted_download&quot; class=&quot;wikilink1&quot; title=&quot;wiki:accepted_download&quot; data-wiki-id=&quot;wiki:accepted_download&quot;&gt;Download&lt;/a&gt; for more information.
&lt;/p&gt;

&lt;/div&gt;

&lt;h4 id=&quot;windows&quot;&gt;Windows&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;

&lt;p&gt;
Windows users can use the code generator in two ways.
&lt;/p&gt;

&lt;p&gt;
&lt;em class=&quot;u&quot;&gt;Method 1:&lt;/em&gt; Install a Windows executable which wraps the Java jar file. An installer is available in the &lt;code&gt;bin&lt;/code&gt; folder of the download package. A double click on the installed executable opens the built in editor with an empty project. Right clicking a project file which was created previously with the integrated editor opens this project. Due to the fact that no configuration file is known at this point it is recommended to put a codegen.cfg file in the users home directory which at least contains the parameter &lt;code&gt;DotPathWin&lt;/code&gt;.&lt;br/&gt;

Example: &lt;code&gt;DotPathWin=“C:\\Graphviz-2.44.1\\bin\\dot.exe”&lt;/code&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;em class=&quot;u&quot;&gt;Method 2:&lt;/em&gt; Using the &lt;code&gt;codegen.jar&lt;/code&gt; file directly and call it with the java.exe installed on your system.&lt;br/&gt;

&lt;code&gt;Example: c:\jdk-11\bin\java.exe -cp “c:/sinelaboreRT5.2/bin/*” codegen.Main …&lt;/code&gt;
&lt;/p&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 19 Dec 2022 09:53:27 +0000</pubDate>
        </item>
        <item>
            <title>Generate production quality code from state diagrams created with StarUML</title>
            <link>https://sinelabore.com/doku.php/wiki/getting_started/staruml</link>
            <description>


&lt;h1 class=&quot;sectionedit1&quot; id=&quot;generate_production_quality_code_from_state_diagrams_created_with_staruml&quot;&gt;Generate production quality code from state diagrams created with StarUML&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_start&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;&lt;div class=&quot;wrap_center wrap_round wrap_info plugin_wrap&quot; style=&quot;width: 60%;&quot;&gt;
&lt;p&gt;
The StarUML parser is work in progress. If you are interested in this feature send us a mail expressing your interest and specific needs.
&lt;/p&gt;
&lt;/div&gt;&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;plugin_wrap_end&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;0-&amp;quot;} --&gt;
&lt;p&gt;
Sinelabore&lt;em&gt;RT&lt;/em&gt; generates readable and maintainable code from hierarchical &lt;abbr title=&quot;Unified Modeling Language&quot;&gt;UML&lt;/abbr&gt; state machines. With its unique features and the C code generator the tool covers well the requirements of embedded real-time and low power application developers. With its C++, Python and Java  backend it is also a perfect tool for developers of server or desktop applications.
&lt;/p&gt;

&lt;p&gt;
Key Features:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Automated robustness checks before code generation&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; No run-time environment needed &lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Can be used with any CPU and with or without &lt;abbr title=&quot;Operating System&quot;&gt;OS&lt;/abbr&gt;/&lt;abbr title=&quot;Real-Time Operating System&quot;&gt;RTOS&lt;/abbr&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Code generation especially for embedded real-time and high availability systems.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Fits well in different system designs (foreground/background, &lt;abbr title=&quot;Real-Time Operating System&quot;&gt;RTOS&lt;/abbr&gt;-based …)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; No gap between design and code&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Support for automatic test-case generation&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Simulation in interactive or batch mode.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Optionally generating trace code&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Generated code creates no trouble when using static code checkers&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Generate production quality code from state diagrams created with StarUML&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;generate_production_quality_code_from_state_diagrams_created_with_staruml&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;14-1204&amp;quot;} --&gt;
&lt;h1 class=&quot;sectionedit4&quot; id=&quot;drawing_the_state_machine_diagram&quot;&gt;Drawing the State Machine Diagram&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
StarUML allows efficient drawing of state diagrams as part of a class. The following example state diagram shows the features that are supported from the code generator right now. 
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://sinelabore.com/lib/exe/detail.php/wiki/getting_started/staruml.png?id=wiki%3Agetting_started%3Astaruml&quot; class=&quot;media&quot; title=&quot;wiki:getting_started:staruml.png&quot;&gt;&lt;img src=&quot;https://sinelabore.com/lib/exe/fetch.php/wiki/getting_started/staruml.png?w=400&amp;amp;tok=aa1526&quot; class=&quot;media&quot; loading=&quot;lazy&quot; alt=&quot;&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Drawing the State Machine Diagram&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;drawing_the_state_machine_diagram&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;1205-1479&amp;quot;} --&gt;
&lt;h1 class=&quot;sectionedit5&quot; id=&quot;creating_code&quot;&gt;Creating Code&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
It is assumed you have a recent Java version installed e.g. on a Mac.
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;java&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;--version&lt;/span&gt;
openjdk &lt;span class=&quot;nu0&quot;&gt;17&lt;/span&gt;-ea &lt;span class=&quot;nu0&quot;&gt;2021&lt;/span&gt;-09-&lt;span class=&quot;nu0&quot;&gt;14&lt;/span&gt;
OpenJDK Runtime Environment &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;build &lt;span class=&quot;nu0&quot;&gt;17&lt;/span&gt;-ea+&lt;span class=&quot;nu0&quot;&gt;29&lt;/span&gt;-&lt;span class=&quot;nu0&quot;&gt;2576&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
OpenJDK &lt;span class=&quot;nu0&quot;&gt;64&lt;/span&gt;-Bit Server VM &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;build &lt;span class=&quot;nu0&quot;&gt;17&lt;/span&gt;-ea+&lt;span class=&quot;nu0&quot;&gt;29&lt;/span&gt;-&lt;span class=&quot;nu0&quot;&gt;2576&lt;/span&gt;, mixed mode, sharing&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
To generate code first export your model to XMI using “File → Export → XMI”.
Then specify StarUML as modelling tool (&lt;code&gt;-p struml&lt;/code&gt;) as well as the path to the state diagram inside the model file (&lt;code&gt;-t “Model:class1”&lt;/code&gt; ). The command line to generate C-code looks like as follows:
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;java&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-cp&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;/path to codegen jar file/*&amp;quot;&lt;/span&gt; codegen.Main &lt;span class=&quot;re5&quot;&gt;-l&lt;/span&gt; cx &lt;span class=&quot;re5&quot;&gt;-p&lt;/span&gt; StarUML &lt;span class=&quot;re5&quot;&gt;-o&lt;/span&gt; testcase &lt;span class=&quot;re5&quot;&gt;-t&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Model:class1&amp;quot;&lt;/span&gt;  testcase.xmi&lt;/pre&gt;

&lt;p&gt;
This generates C-code from the specified state machine diagram.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Creating Code&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;creating_code&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:5,&amp;quot;range&amp;quot;:&amp;quot;1480-2242&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit6&quot; id=&quot;supported_state_machine_elements&quot;&gt;Supported State Machine Elements&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
The code-generator supports a relevant subset of the design elements provided by Magic Draw. The supported elements are:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Hierarchical states&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; (Signal-)Events with event name, guard and action &lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Initial and final pseudo-states&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; History states (deep, flat)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Choices&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
&lt;a href=&quot;https://sinelabore.com/doku.php/wiki/download&quot; class=&quot;wikilink1&quot; title=&quot;wiki:download&quot; data-wiki-id=&quot;wiki:download&quot;&gt;Download&lt;/a&gt; the demo version and try it right now. It includes many other examples.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Supported State Machine Elements&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;supported_state_machine_elements&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:6,&amp;quot;range&amp;quot;:&amp;quot;2243-2666&amp;quot;} --&gt;
&lt;h1 class=&quot;sectionedit7&quot; id=&quot;staruml_draw_howto&quot;&gt;StarUML Draw HowTo&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
&lt;img src=&quot;https://sinelabore.com/lib/images/smileys/question.svg&quot; class=&quot;icon smiley&quot; alt=&quot;:?:&quot; /&gt;&lt;strong&gt;I&amp;#039;m not able to define header code as specified in the header comment &lt;/strong&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;img src=&quot;https://sinelabore.com/lib/images/smileys/exclaim.svg&quot; class=&quot;icon smiley&quot; alt=&quot;:!:&quot; /&gt; StarUML unfortunately does not export linked comments to the XMI file. Therefore specify the comment in the configuration file. Example
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;AdditionalMachineImplementationInclude=#include &amp;lt;stdint.h&amp;gt;\n#include &amp;quot;testcase_ext.h&amp;quot;\n#include &amp;quot;testcase.h&amp;quot;\n#include &amp;lt;stdio.h&amp;gt;\nextern TESTCASE_EVENT_T msg;\n\n&lt;/pre&gt;
&lt;div class=&quot;tags&quot;&gt;&lt;span&gt;
	&lt;a href=&quot;https://sinelabore.com/doku.php/tag/umltool?do=showtag&amp;amp;tag=%5BUMLTool%5D&quot; class=&quot;wikilink1&quot; title=&quot;tag:umltool&quot; rel=&quot;tag&quot;&gt;[UMLTool]&lt;/a&gt;
&lt;/span&gt;&lt;/div&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;StarUML Draw HowTo&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;staruml_draw_howto&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:7,&amp;quot;range&amp;quot;:&amp;quot;2667-&amp;quot;} --&gt;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Fri, 03 May 2024 20:41:27 +0000</pubDate>
        </item>
        <item>
            <title>Getting started on Windows with Altova UModel and MinGW</title>
            <link>https://sinelabore.com/doku.php/wiki/getting_started/umodel_windows_mingw</link>
            <description>


&lt;h1 class=&quot;sectionedit1&quot; id=&quot;getting_started_on_windows_with_altova_umodel_and_mingw&quot;&gt;Getting started on Windows with Altova UModel and MinGW&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
This section guides you through the whole development process from designing a state machine to integrating it into an application. This will help you to get familiar with the code generator and its features.
&lt;/p&gt;

&lt;p&gt;
All files for this tutorial are available in this folder: examples/microwave_handbook_umodel_win32
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Getting started on Windows with Altova UModel and MinGW&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;getting_started_on_windows_with_altova_umodel_and_mingw&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;14-395&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;a_microwave_oven&quot;&gt;A Microwave Oven&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
In this section we create the model of a simple microwave oven using a state machine diagram. A microwave oven was chosen because it is self-explanatory and not too complex to model. To keep this example as simple and clear as possible the hardware interaction routines are excluded. The following figure 1 shows the hardware of our fictitious microwave oven.
For this example we are using Altova UModel. 
In the handbook you will find hints on how to draw state diagrams for all the supported tools. It is recommended to have a quick look into that section. 
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://sinelabore.com/lib/exe/detail.php/wiki/getting_started/oven.jpg?id=wiki%3Agetting_started%3Aumodel_windows_mingw&quot; class=&quot;media&quot; title=&quot;wiki:getting_started:oven.jpg&quot;&gt;&lt;img src=&quot;https://sinelabore.com/lib/exe/fetch.php/wiki/getting_started/oven.jpg&quot; class=&quot;mediacenter&quot; loading=&quot;lazy&quot; title=&quot;Microwave Oven Image&quot; alt=&quot;Microwave Oven Image&quot; /&gt;&lt;/a&gt;
Figure 1: Fictitious microwave oven. With a wheel the cooking time can be adjusted between 0 – 60 seconds. The power can be set to high (II) or low (I).
&lt;/p&gt;

&lt;p&gt;
The oven controller should be able do the following things:
&lt;/p&gt;
&lt;ol&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Cooking time can be adjusted using a wheel between 0s and 60s.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Cooking starts if the cooking time is larger than zero. And the door is closed.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; If the door is opened during cooking the microwave generator is switched off. Cooking time stops.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Cooking continuous if the cooking time is not over and the door is closed again&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Cooking stops if the cooking time is over or the time is adjusted to zero.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Cooking time and power can be changed at any time.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;A Microwave Oven&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;a_microwave_oven&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;396-1733&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit3&quot; id=&quot;drawing_the_state_machine_diagram&quot;&gt;Drawing the State Machine Diagram&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
To fulfil the requirements a hierarchical state machine was designed. Therefore events that should be handled from every state must only be modelled once on the outer (parent) state. 
&lt;/p&gt;

&lt;p&gt;
This example shows several &lt;abbr title=&quot;Unified Modeling Language&quot;&gt;UML&lt;/abbr&gt; state machine elements that make up a state machine. It is enough to generate production ready code out of it.
Please note that the design presented here is not the only possible solution for the given requirements. Also some functions of a real microwave oven – e.g. control of a lamp in the oven – are still missing.
&lt;/p&gt;

&lt;p&gt;
Figure 2&lt;a href=&quot;https://sinelabore.com/lib/exe/detail.php/wiki/getting_started/oven_umodel_state_diagrm.png?id=wiki%3Agetting_started%3Aumodel_windows_mingw&quot; class=&quot;media&quot; title=&quot;wiki:getting_started:oven_umodel_state_diagrm.png&quot;&gt;&lt;img src=&quot;https://sinelabore.com/lib/exe/fetch.php/wiki/getting_started/oven_umodel_state_diagrm.png&quot; class=&quot;mediacenter&quot; loading=&quot;lazy&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
Complete state machine design of the microwave oven. All necessary actions, guards, entry and exit code were added.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Drawing the State Machine Diagram&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;drawing_the_state_machine_diagram&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;1734-2503&amp;quot;} --&gt;
&lt;h1 class=&quot;sectionedit4&quot; id=&quot;creating_code&quot;&gt;Creating Code&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
It is assumed you have Java and the MinGW compiler is installed.
For a check if everything is installed correctly open a command window and change the working
directory to this folder. Then type in the following commands.
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;C:\&amp;gt;java −version
java -version
java version &amp;quot;13.0.2&amp;quot; 2020-01-14
Java(TM) SE Runtime Environment (build 13.0.2+8)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)&lt;/pre&gt;

&lt;p&gt;
Check that you have a compiler installed. Add the bin folder of MinGW to your path and check if the compiler can be called now.
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;C:\&amp;gt;path %path%;C:\MinGW\bin 
C:\&amp;gt;mingw32−gcc
mingw32−gcc: fatal error: no input files
compilation terminated .&lt;/pre&gt;

&lt;p&gt;
Your output should look similar. Details might differ depending on your installed program versions. Now change to the ready made example in the examples folder. Depending on your installation change to the following examples folder:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;your path\sinelaboreRT4.1\examples\microwave_handbook_umodel_win32&lt;/pre&gt;

&lt;p&gt;
Type in &lt;code&gt;mingw32-make clean&lt;/code&gt; to first remove existing built results. 
Then type in &lt;code&gt;mingw32-make&lt;/code&gt; to build everything.
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;mingw32-gcc.exe -Wall -g oven_hlp.c -c -o oven_hlp.o
mingw32-gcc.exe -Wall -g oven_selftest.c -c -o oven_selftest.o
java -cp &amp;quot;../../bin/*&amp;quot; codegen.Main -p UModel -l cx -t &amp;quot;MicrowaveOven:MachineClass&amp;quot; -doxygen -o oven oven.xmi
Create inline doxygen of state machine function
Starting robustness tests of state machine ...
State names: ..............
Machine hierarchy: ........
Machine height = 2
Transitions: ..............
Default states: ...........
Final states: .............
Choices: ..................
No. of children in composites: ...
Connectivity of states: ...
M1054: State Error has no outgoing transitions which indicates a dead end -&amp;gt; check your design.
Can&amp;#039;t find the License.txt file or invalid file. Codegen is running in demo mode
Expected license file location: /Y:/develop/sinelabore/statemachine generator/Cadifra CodeGen/distribution_folder/sinelaboreRT4.1/bin/License.txt
Running in demo mode!
java -cp &amp;quot;../../bin/*&amp;quot; codegen.Main -p UModel -A -l cx -t &amp;quot;MicrowaveOven:MachineClass&amp;quot; -o oven oven.xmi
Checking nodes ...
Checking for unique node names
mingw32-gcc.exe -Wall -g oven.c -c -o oven.o
mingw32-gcc.exe -Wall -g main.c -c -o main.o
mingw32-gcc.exe  -o oven oven_hlp.o oven_selftest.o oven.o main.o&lt;/pre&gt;

&lt;p&gt;
The &lt;code&gt;oven&lt;/code&gt; exe should be built successfully now.
Start the program and type several times &lt;code&gt;+&lt;/code&gt; ti increment the cooking timer.
Then press &lt;code&gt;c&lt;/code&gt; to close the door. Watch what happens. Test the other events you can fire.
&lt;/p&gt;

&lt;p&gt;
It is now recommended to start your &lt;abbr title=&quot;Unified Modeling Language&quot;&gt;UML&lt;/abbr&gt; editor again. And play with the state diagram. Look into the generated code to get familiar with the many possibilities the code generator offers.
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://sinelabore.com/lib/exe/detail.php/wiki/getting_started/oven_running.gif?id=wiki%3Agetting_started%3Aumodel_windows_mingw&quot; class=&quot;media&quot; title=&quot;wiki:getting_started:oven_running.gif&quot;&gt;&lt;img src=&quot;https://sinelabore.com/lib/exe/fetch.php/wiki/getting_started/oven_running.gif&quot; class=&quot;mediacenter&quot; loading=&quot;lazy&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
Some additional notes:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; The code generator can also generate code from activity diagrams. The example also contains an activity diagram for the self test algorithm (basic, just as example).&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
~~DISCUSSION:closed|Leave your comments~~
&lt;/p&gt;
&lt;div class=&quot;tags&quot;&gt;&lt;span&gt;
	&lt;a href=&quot;https://sinelabore.com/doku.php/tag/windows?do=showtag&amp;amp;tag=%5BWindows&quot; class=&quot;wikilink1&quot; title=&quot;tag:windows&quot; rel=&quot;tag&quot;&gt;[Windows&lt;/a&gt;,
	&lt;a href=&quot;https://sinelabore.com/doku.php/tag/altova?do=showtag&amp;amp;tag=Altova&quot; class=&quot;wikilink1&quot; title=&quot;tag:altova&quot; rel=&quot;tag&quot;&gt;Altova&lt;/a&gt;,
	&lt;a href=&quot;https://sinelabore.com/doku.php/tag/umodel?do=showtag&amp;amp;tag=UModel&quot; class=&quot;wikilink1&quot; title=&quot;tag:umodel&quot; rel=&quot;tag&quot;&gt;UModel&lt;/a&gt;,
	&lt;a href=&quot;https://sinelabore.com/doku.php/tag/mingw?do=showtag&amp;amp;tag=MinGW%5D&quot; class=&quot;wikilink1&quot; title=&quot;tag:mingw&quot; rel=&quot;tag&quot;&gt;MinGW]&lt;/a&gt;
&lt;/span&gt;&lt;/div&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Creating Code&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;creating_code&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;2504-&amp;quot;} --&gt;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Fri, 03 May 2024 20:41:18 +0000</pubDate>
        </item>
    </channel>
</rss>
