concepts.textile 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. h1. Yakindu Statechart tool concepts
  2. h2. Modeling
  3. Yakindu Statechart Models are based on statecharts as defined by David Harel and are close to UML state machines. Thus, they support all structural model elements as defined by the UML specification, which are States (orthogonal and hierarchical), Regions, Transitions and Pseudo States (History, Deep History, Initial, Final, Choice, Join / Fork).
  4. In addition, Yakindu Statechart Models specify interfaces that define the interaction of the state machine with its environment. Besides some more advanced concepts like Entry / Exit Points, an interface basically consists of in and out Events as well as Variables including types. These well-defined statechart interfaces are especially useful in the context of component models and product line engineering.
  5. For defining interfaces and modeling the dynamic aspects of statecharts (triggers, guards and actions) SCT provides a statically typed, textual action language. It tightly integrates into the graphical editor and supports the user with code completion, syntax highlighting, cross referencing and validation during modeling.
  6. Declarations of interfaces, events, variables etc. are done in a textual modeling field in the editor. The language expressions that define actions are directly added to the elements like states or transitions.
  7. h2. Simulation
  8. Yakindu Statechart Models can be executed via an integrated simulation engine. The simulation engine supports two different types of execution semantics:
  9. * cycle based
  10. * event driven
  11. The default execution semantic is *cycle based* which executes a statechart cycle within a fixed period of time and thus allows processing of concurrent events. In contrast, the *event based* approach executes a statechart cycle as soon as an event occurrs.
  12. During simulation, the currently active states and the transition path including the previous states are highlighted in the editor for visual debugging. An additional view shows the variable values and allows to raise events.
  13. Apart from that, the engine uses a *virtual time* during simulation. The user can provide a time scaling factor that is multiplied with the real time. This is especially useful during debugging, if the statechart model contains very tight or long running time triggers.
  14. h2. Code Generation
  15. Yakindu Statechart Tools currently support the generation of Java, C and C++ Code. All generators can be customized with a *generator model*. This is a textual model file where generator features, like the execution type (event or cycle based), or the interface styles (static or generic), can be specified. The code generation process can either be executed with a builder that starts code generation on resource change or manually with a context menu action.
  16. h2. Domain specific adaptability
  17. Yakindu Statechart Tools were developed with a domain specific adaptability in mind. Several extension points allow the customization of all mentioned aspects. It is possible to contribute a custom type system or custom action languages which may be a dialect of the textual description language or a complete new language.
  18. Also, the different code generators can be customized or new code generators for other target languages can be plugged in easily.
  19. h2. Yakindu SC Modeling perspective
  20. For state machine modeling purposes open the Yakindu *SC Modeling* perspective by clicking *Window* > *Open Perspective* > *SC Modeling*. This perspective is optimized for statechart modeling. It consists of
  21. * "Project Explorer":PLUGIN_ROOT/org.eclipse.platform.doc.user/concepts/cnav.htm on the left
  22. * "Outline":PLUGIN_ROOT/org.eclipse.platform.doc.user/concepts/coutline.htm View on the right
  23. * YAKINDU Statechart Editor at the top
  24. * "Problems":PLUGIN_ROOT/org.eclipse.platform.doc.user/concepts/cprbview.htm and "Properties View":PLUGIN_ROOT/org.eclipse.platform.doc.user/concepts/cpropview.htm at the bottom
  25. !../02_Getting_Started/images/sc_modeling_perspective.jpg!
  26. h2. Yakindu SC Simulation perspective
  27. To simulate a state machine use the Yakindu *SC Simulation* perspective by clicking *Window* > *Open Perspective* > *SC Simulation*. This perspective is optimized for simulation purposes and consists of:
  28. * "Project Explorer":PLUGIN_ROOT/org.eclipse.platform.doc.user/concepts/cnav.htm on the left
  29. * "Outline":PLUGIN_ROOT/org.eclipse.platform.doc.user/concepts/coutline.htm view on the right top
  30. * Simulation View on the right bottom
  31. * Debug view at the top
  32. * YAKINDU Statechart Editor at the bottom
  33. !../02_Getting_Started/images/sc_simulation_perspective.jpg!
  34. h2. YAKINDU Statechart Editor
  35. With the YAKINDU Statechart editor you create or modify state models. The editor automatically opens on .sct files. To create a new YAKINDU statechart model click *File* > *New* > *Other...* > *YAKINDU Statechart model*. Give it a speaking name and click *Finish*. The newly created model opens in the statechart editor. Also the SC Modeling perspective opens.
  36. !../02_Getting_Started/images/sc_editor_01.jpg!
  37. The editor consists of three parts:
  38. * the graphic canvas to design the state machine
  39. * the palette on the right that owns the elements to design the state machine
  40. * a textual modeling field on the left
  41. You can use the textual modeling field to define internal behavior of states and declare events or variables. The "reference":../05_Reference/reference.html#Statechartdescriptionlanguage explains this language.
  42. Elements that cause problems get warning and error markers attached. For more details about the problems open the *Problems View*.
  43. h2. Simulation View
  44. The simulation view is an interactive view to watch and control the state machine simulation. To get it open the simulation perspective.
  45. Start a simulation by clicking *Run* > *Run*.
  46. !../02_Getting_Started/images/simulation_view_active.jpg!
  47. During the simulation in the statechart editor the active state gets a red color. The previous transition is green. The simulation view shows the events that trigger the states. You can change values here to trigger events. Beneath the table there are two clocks. One for the _virtual time_ and one for the _real time_ and a slider to change virtual time.
  48. You can also select an _event driven_ or _cycle based_ run configuration.
  49. h2. YAKINDU SCT Nature
  50. YAKINDU model projects are associated with the *YAKINDU SCT nature*. On projects with *YAKINDU SCT nature* _.sct_ and _.sgen_ files are automatically build and checked for problems. So you get fast feedback during editing. You can toggle the SCT nature by right clicking *Configure* > *Add* or *Remove YAKINDU SCT Nature* on the project.