SinelaboreRT Header Logo

SinelaboreRT

As simple as possible, but not any simpler!

User Tools

Site Tools


wiki:news:18may2014

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
wiki:news:18may2014 [2014/05/18 18:34] – created pmuellerwiki:news:18may2014 [2014/05/18 18:41] (current) pmueller
Line 4: Line 4:
 In the manual a simplified microwave oven is used to explain the generation of source code from state machine diagrams. This example was updated here to show how to generate code also from activity diagrams. In the manual a simplified microwave oven is used to explain the generation of source code from state machine diagrams. This example was updated here to show how to generate code also from activity diagrams.
  
-The state machine of the oven is shown below. During startup of the oven a hardware selftest should happen. The hardware test happens on the incoming transition of the choice. Depending on the result of the selftest the machine enters an error state (marked in red) or the normal operation state (super). +The extended state machine of the oven is shown below. For demonstration on how to use activities the oven performs a hardware selftest at startup. The hardware test happens on the incoming transition of the choice. Depending on the result of the selftest the machine enters an error state (marked in red) or the normal operation state (super)
 +The hardware selftest routine was modelled as activity diagram.
  
 {{ :wiki:news:oven_sm.png?nolink |}}  {{ :wiki:news:oven_sm.png?nolink |}} 
  
-The following code snipped shows the call of the hardware selftest which was fully generated from the code generator.+The following code snipped shows the call of the hardware selftest. The selftest function itself was fully generated from the code generator
  
 <code c> <code c>
Line 36: Line 37:
 </code> </code>
  
-The hardware selftest function was modelled in an own activity diagram. A class can have one or more activity diagrams. The code generator generates an own c-file/header per activity. The activity of the hardware test function is shown below. The single steps do not really anything and only the most basic features of an activity diagram are used. But it shows the principles.+The hardware selftest function was modelled in an own activity diagram. A class can have one or more activity diagrams. The code generator generates an own c-file/header per activity. The activity of the hardware test function is shown below. The single steps do not really do anything useful and only the most basic features of an activity diagram are used. But it shows the principles and how well both generators complement each other.
  
 {{:wiki:news:oven_activity.png?nolink|}} {{:wiki:news:oven_activity.png?nolink|}}
  
-To generate code from the diagram call the code generator as follows. The -A enables the generation of code from activity diagrams. Without this flag state machine code is generated. To generate both call the generator twice.+To generate code from the diagram call the code generator as follows. The ''-A'' enables the generation of code from activity diagrams. Without this flag state machine code is generated. To generate both call the generator twice.
 <code> <code>
 java -jar codegen.jar -p EA -A -t "Model:Class Model:first_example_step3" -o oven  first_example_step3.xml java -jar codegen.jar -p EA -A -t "Model:Class Model:first_example_step3" -o oven  first_example_step3.xml
wiki/news/18may2014.1400430866.txt.gz · Last modified: 2014/05/18 18:34 by pmueller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki