SinelaboreRT Header Logo

SinelaboreRT

As simple as possible, but not any simpler!

User Tools

Site Tools


wiki:landing_pages:ea

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:landing_pages:ea [2012/10/22 22:09] – [Watch the code generator in action] pmuellerwiki:landing_pages:ea [2023/07/20 16:52] (current) – [Enterprise Architect HowTo] webmin
Line 1: Line 1:
 +~~NOTOC~~
 ====== Generate production quality code from state diagrams created with Enterprise Architect ====== ====== Generate production quality code from state diagrams created with Enterprise Architect ======
  
-Sinelabore//RT// generates readable and maintainable code from hierarchical UML state machines. With its unique features the tool covers well the requirements of embedded real-time and low power application developers.  +Sinelabore//RT// generates readable and maintainable code from hierarchical UML 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.
-With its new C++, Java and C#  backend it is also a perfect tool for developers of server or desktop applications.+
  
 Key Features: Key Features:
Line 15: Line 15:
   * Optionally generating trace code   * Optionally generating trace code
   * Generated code creates no trouble when using static code checkers   * Generated code creates no trouble when using static code checkers
- 
 ==== Watch the code generator in action ==== ==== Watch the code generator in action ====
    
 The following example shows how the code generator works by means of a simple microwave oven.  The following example shows how the code generator works by means of a simple microwave oven. 
  
-{{ :wiki:landing_pages:ea_landing_image_microwave_oven.png?nolink |}}+{{ :wiki:landing_pages:ea_landing_image_microwave_oven.png?nolink |microwave oven with requirements}}
  
 Requirements: Requirements:
Line 33: Line 32:
 The sate machine below shows a possible solution.  The sate machine below shows a possible solution. 
  
-{{ :wiki:landing_pages:ea_landing_oven_sc.png?nolink |}}+{{ :wiki:landing_pages:ea_landing_oven_sc.png?nolink |State machine of a simple microwave oven}}
  
  
Line 47: Line 46:
  
 Look into the generated files: Look into the generated files:
-<code - oven.c> +{{:wiki:landing_pages:src_ea:oven.c|}} 
-</code> +{{:wiki:landing_pages:src_ea:oven.h|}} 
-<code - oven.h> +{{:wiki:landing_pages:src_ea:oven_ext.h|}}
-</code> +
-<code - oven_ext.h+
-</code>+
  
 +In the examples folder you will find the complete code ready to be tested and expanded by you.
  
-Find out more about the code generator+==== Supported State Machine Elements ==== 
 +The code-generator supports a subset of the design elements provided by Enterprise Architect. The supported elements are: 
 +  * Hierarchical states 
 +  * (Signal-)Events with event name, guard and action – Initial and final pseudo-states 
 +  * History states (deep, flat) 
 +  * Choices 
 +  * Junctions 
 +  * Constraints 
 +  * Sub-machine states on various levels 
 +  * Entry and exit pseudo-states 
 +  * Regions on various levels 
 + 
 +==== Find out more about the code generator ====
   * How sinelabore supports [[wiki:toolbox:model-based_testing_of_state_machines_i|model based testing]] of state diagrams   * How sinelabore supports [[wiki:toolbox:model-based_testing_of_state_machines_i|model based testing]] of state diagrams
   * How to [[wiki:toolbox:model-based_testing_of_state_machines_ii|interactively simulate]] your state diagram and generating trace code   * How to [[wiki:toolbox:model-based_testing_of_state_machines_ii|interactively simulate]] your state diagram and generating trace code
 +  * Read section "Drawing State-Charts with Enterprise Architect" in the {{:wiki:downloads:sinelaborert.pdf|manual}} 
 +  * How easy it is to add attributes and operations to the stateful class like shown below. Operations are mapped to C-functions. Attributes to members of the instance data of the state machine. This allows to add entry/exit code functions or other helper functions. Even the body code can be easily added with EA if you want. Presently attributes and operations are only generated in the C-backend. 
 +{{ :wiki:landing_pages:src_ea:ea_adding_features_to_class.jpg |Classes have attributes and operations}}
  
 [[wiki:download|Download]] the demo version and try it right now. It includes many other examples. [[wiki:download|Download]] the demo version and try it right now. It includes many other examples.
 +
 +
 +
 +{{description>Enterprise Architect HowTo}}
 +
 +
 +====== Enterprise Architect HowTo ======
 +
 +Below some tips and tricks are listed that simplify the state-chart creation using Enterprise Architect. If you have further hints let us know and we add them here. For a short intro on on how to use EA with the codegen go on reading [[wiki:landing_pages:ea|here]].
 +
 +:?: ** Where to put the events to:**
 +
 +:!: States should be put “below” the class containing the state diagram. See next figure.
 +
 +{{ :wiki:howto:ea_howto_model_browser_ea9.jpg?nolink |}}
 +
 +
 +----
 +
 +
 +:?: ** How to define the path to the state machine:**
 +
 +:!: Since version 9.0 of Enterprise architect it looks like that always a view package is required. This package must appear in the path you specify on the codegen command line. In the figure above the path to the state machine is -t "Model:test:testclass"
 +
 +
 +----
 +
 +
 +:?: ** I always get the error message ‘Can't find path element ....’. But I’m sure the path is correct:**
 +
 +:!: Most probably you have not selected to root element (e.g. Model in the figure above) before exporting the XMI file. Select the root model element and then export to XMI.
 +
 +
 +----
 +
 +
 +:?: ** How to specify multiple lines entry/exit/do action code:**
 +
 +
 +:!: There are some different ways.
 +
 +The codegen can take the activity name as code. But only one line can be specified then. 
 +
 +{{ :wiki:landing_pages:ea_state_actions.png?nolink |}}
 +
 +It is also possible to specify multiple lines of action code in the behaviour field. The name of the action is not used anymore as code line if code is found in the behavior field. 
 +
 +The third way is to use the code field. It has syntax highlighting activated which is nice.
 +
 +{{ :wiki:landing_pages:src_ea:code_window.png??nolink |}}
 +
 +:?: ** Where do I find the "export to XMI" dialog? **
 +
 +:!: In recent versions of EA the export to XMI is available under ''Publish -> Export XMI''
wiki/landing_pages/ea.1350936588.txt.gz · Last modified: 2012/10/22 22:09 by pmueller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki