blob: 3ef714351a1290237b0f3b07a3e4adff1b4ba56d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
|
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd-->
<html xmlns="http://www.w3.org/1999/xhtml"
>
<head><title>Architecture</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)" />
<meta name="originator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)" />
<!-- xhtml,3,next,html -->
<meta name="src" content="etrice-doc.tex" />
<meta name="date" content="2015-06-30 18:08:00" />
<link rel="stylesheet" type="text/css" href="etrice-doc.css" />
</head><body
>
<!--l. 1--><div class="crosslinks"><p class="noindent">[<a
href="etrice-docse28.html" >next</a>] [<a
href="etrice-docch8.html" >prev</a>] [<a
href="etrice-docch8.html#tailetrice-docch8.html" >prev-tail</a>] [<a
href="#tailetrice-docse27.html">tail</a>] [<a
href="etrice-docch8.html#etrice-docse27.html" >up</a>] </p></div>
<h3 class="sectionHead"><span class="titlemark">8.1 </span> <a
id="x37-2370001"></a>Architecture</h3>
<!--l. 3--><p class="noindent" >The basic components of eTrice are depicted in the following diagram.
</p><!--l. 5--><p class="noindent" ><img
src="images/200-components.jpg" alt="PIC"
/>
</p><!--l. 7--><p class="noindent" >Additional to that the eTrice project comprises runtime libraries and unit tests which are treated in subsequent
sections.
<a
id="x37-237001r312"></a>
</p>
<h4 class="subsectionHead"><span class="titlemark">8.1.1 </span> <a
id="x37-2380001"></a>Editor and Generator Components</h4>
<ul class="itemize1">
<li class="itemize">core
<ul class="itemize2">
<li class="itemize">core.common is an Xtext based language which serves as a base for other eTrice languages. It consists
of the plug-ins <span
class="ec-lmtt-10">org.eclipse.etrice.core.common </span>and <span
class="ec-lmtt-10">org.eclipse.etrice.core.common.ui</span>. The
base grammar defines recurring items like numbers with literals, annotations and the like.
</li>
<li class="itemize">core.fsm is an Xtext based language that defines state machines in an abstract way. It consists of the
plug-ins <span
class="ec-lmtt-10">org.eclipse.etrice.core.fsm </span>and <span
class="ec-lmtt-10">org.eclipse.etrice.core.fsm.ui</span>. The FSM language
is abstract and has to be embedded in a model that defines containers for the state machine with interface
items (e.g. ROOM ports or Franca interfaces) and messages. The ROOM grammar of eTrice is derived
from this grammar.
</li>
<li class="itemize">core.room
is an Xtext based language called ROOM. It consists of the plug-ins <span
class="ec-lmtt-10">org.eclipse.etrice.core.room</span>
and <span
class="ec-lmtt-10">org.eclipse.etrice.core.room.ui</span>. ROOM is the basic modeling language of eTrice.
</li>
<li class="itemize">core.config is an Xtext based language called Config. It consists of
the plug-ins <span
class="ec-lmtt-10">org.eclipse.etrice.core.config </span>and <span
class="ec-lmtt-10">org.eclipse.etrice.core.config.ui</span>. Config
is a language designed for the data configuration of model
</li>
<li class="itemize">core.etphys is an
Xtext based language called etPhys. It consists of the plug-ins <span
class="ec-lmtt-10">org.eclipse.etrice.core.etphys </span>and
<span
class="ec-lmtt-10">org.eclipse.etrice.core.etphys.ui</span>. etPhys is a language designed for the description of physical
systems onto which the logical ROOM systems are deployed.
</li>
<li class="itemize">core.etmap is an Xtext based language called etMap. It consists of
the plug-ins <span
class="ec-lmtt-10">org.eclipse.etrice.core.etmap </span>and <span
class="ec-lmtt-10">org.eclipse.etrice.core.etmap.ui</span>. etMap is
a language designed for the mapping of logical to physical systems.
</li>
<li class="itemize">core.genmodel.fsm is an EMF based aggregation layer for finite state machines. It consists of the
plugin <span
class="ec-lmtt-10">org.eclipse.etrice.core.genmodel.fsm</span>. A <span
class="ec-lmtt-10">ModelComponent </span>can be transformed into a
<span
class="ec-lmtt-10">ExpandedModelComponent </span>which is an explicit version of the state machine with all the inherited items
contained.
</li>
<li class="itemize">core.genmodel is an EMF based aggregation layer for Room models. It consists of the plugin
<span
class="ec-lmtt-10">org.eclipse.etrice.core.genmodel</span>. A Room model can be transformed into a genmodel which allows
easy access to implicit relations of the Room model.</li></ul>
</li>
<li class="itemize">ui
<ul class="itemize2">
<li class="itemize">textual
<ul class="itemize3">
<li class="itemize">fsm.ui is
the ui counterpart of core.fsm. It consists of the plug-in <span
class="ec-lmtt-10">org.eclipse.etrice.core.fsm.ui</span>. This
plug-in realizes IDE concepts like content assist, error markers and navigation by hyper links for the
FSM language.
</li>
<li class="itemize">room.ui is the ui counterpart of core.room.
It consists of the plug-in <span
class="ec-lmtt-10">org.eclipse.etrice.core.room.ui</span>. This plug-in realizes IDE concepts
like content assist, error markers and navigation by hyper links for the Room language.
</li>
<li class="itemize">config.ui is the ui
counterpart of core.config. It consists of the plug-in <span
class="ec-lmtt-10">org.eclipse.etrice.core.config.ui</span>. This
plug-in realizes IDE concepts like content assist, error markers and navigation by hyper links for the
Config language.
</li>
<li class="itemize">etphys.ui is the ui
counterpart of core.etphys. It consists of the plug-in <span
class="ec-lmtt-10">org.eclipse.etrice.core.etphys.ui</span>. This
plug-in realizes IDE concepts like content assist, error markers and navigation by hyper links for the
etPhys language.
</li>
<li class="itemize">etmap.ui is the ui counterpart of core.etmap. It consists of the plug-in
<span
class="ec-lmtt-10">org.eclipse.etrice.core.etmap.ui</span>. This plug-in realizes IDE concepts like content assist, error
markers and navigation by hyper links for the etPhys language.</li></ul>
</li>
<li class="itemize">graphical
<ul class="itemize3">
<li class="itemize">ui.common.base is a set of common code for the diagram editors. It consists of the plug-in
<span
class="ec-lmtt-10">org.eclipse.etrice.ui.common.base</span>. It depends only on the FSM part but not on ROOM.
</li>
<li class="itemize">ui.common is a set of common code for the two diagram editors. It consists of the plug-in
<span
class="ec-lmtt-10">org.eclipse.etrice.ui.common</span>.
</li>
<li class="itemize">ui.commands encapsulates some commands related to the navigation between eTrice editors. It
consists of the plug-in <span
class="ec-lmtt-10">org.eclipse.etrice.ui.commands</span>.
</li>
<li class="itemize">ui.structure is the Graphiti based editor for the Actor structure. It consists of the plug-in
<span
class="ec-lmtt-10">org.eclipse.etrice.ui.structure</span>.
</li>
<li class="itemize">ui.behavior.fsm is implementing the major part for the graphical state machine editor. It consists of
the plug-in <span
class="ec-lmtt-10">org.eclipse.etrice.ui.behavior.fsm</span>. All property dialogs are handled in an abstract
way using a factory.
</li>
<li class="itemize">ui.behavior is the Graphiti based editor for the Actor behavior. It consists of the plug-in
<span
class="ec-lmtt-10">org.eclipse.etrice.ui.behavior</span>. It utilizes the ui.behavior.fsm and provides concrete property
dialogs.</li></ul>
</li></ul>
</li>
<li class="itemize">generators
<ul class="itemize2">
<li class="itemize">generator.fsm is a set of general classes and language independent parts of all generators. It consists of
the plug-in <span
class="ec-lmsso-10">org.eclipse.etrice.generator.fsm</span>. It depends only on FSM but not on ROOM.
</li>
<li class="itemize">generator is a set of general classes and language independent parts of all generators. It consists of the
plug-in <span
class="ec-lmsso-10">org.eclipse.etrice.generator</span>.
</li>
<li class="itemize">generator.c is the generator for the ANSI-C target language. It consists of the plug-in
<span
class="ec-lmtt-10">org.eclipse.etrice.generator.c</span>.
</li>
<li class="itemize">generator.cpp is the generator for the C++ target language. It consists of the plug-in
<span
class="ec-lmtt-10">org.eclipse.etrice.generator.cpp</span>.
</li>
<li class="itemize">generator.java is the generator for the Java target language. It consists of the plug-in
<span
class="ec-lmtt-10">org.eclipse.etrice.generator.java</span>.
</li>
<li class="itemize">generator.doc is the generator for the model documentation. It consists of the plug-in
<span
class="ec-lmtt-10">org.eclipse.etrice.generator.doc</span>.</li></ul>
</li></ul>
<a
id="x37-238001r315"></a>
<h4 class="subsectionHead"><span class="titlemark">8.1.2 </span> <a
id="x37-2390002"></a>The Abstract Finite State Machine Concept</h4>
<!--l. 109--><p class="noindent" >eTrice comes with an easy to re-use concept of hierarchical finite state machines (FSM for short). A powerful inheritance
concept is used and there is also state machine validation based on semantic rules for messages and abstract execution
available.
</p><!--l. 113--><p class="noindent" >State machines are an integral part of the ROOM language. But they can also be used independently from that
using
</p>
<ul class="itemize1">
<li class="itemize">for the model part
<ul class="itemize2">
<li class="itemize"><span
class="ec-lmtt-10">org.eclipse.etrice.core.common</span>
</li>
<li class="itemize"><span
class="ec-lmtt-10">org.eclipse.etrice.core.fsm</span>
</li>
<li class="itemize"><span
class="ec-lmtt-10">org.eclipse.etrice.core.genmodel.fsm</span></li></ul>
</li>
<li class="itemize">graphical state machine editor
<ul class="itemize2">
<li class="itemize"><span
class="ec-lmtt-10">org.eclipse.etrice.core.common.ui</span>
</li>
<li class="itemize"><span
class="ec-lmtt-10">org.eclipse.etrice.core.fsm.ui</span>
</li>
<li class="itemize"><span
class="ec-lmtt-10">org.eclipse.etrice.core.ui.common.base</span>
</li>
<li class="itemize"><span
class="ec-lmtt-10">org.eclipse.etrice.core.ui.common</span></li></ul>
</li>
<li class="itemize">base classes for code generation
<ul class="itemize2">
<li class="itemize"><span
class="ec-lmtt-10">org.eclipse.etrice.generator.fsm</span></li></ul>
</li>
<li class="itemize">validation by abstract execution
<ul class="itemize2">
<li class="itemize"><span
class="ec-lmtt-10">org.eclipse.etrice.abstractexec.behavior</span></li></ul>
</li></ul>
<!--l. 144--><p class="noindent" >The first three parts have to be used by concrete implementations that implement the abstract interface. eTrice itself uses the
abstract FSMs in exactly this way.
<a
id="Q1-37-317"></a>
</p>
<h5 class="likesubsubsectionHead"><a
id="x37-2400002"></a>Extending the FSM Model</h5>
<!--l. 149--><p class="noindent" >The eTrice FSM model has to be embedded in a model that introduces components, interfaces and messages. We
recommend to use a new Xtext language with a grammar derived from the FSM grammar. This grammar has to specify a
component derived from the <span
class="ec-lmtt-10">ModelComponent </span>of the FSM model. It further has to introduce concrete realizations
of interface items derived from <span
class="ec-lmtt-10">AbstractInterfaceItem</span>. The interface item is an object contained in a
component that has a name (role) and holds a reference to some kind of interface of the component (like a
Franca interface or a ROOM protocol). Finally a concrete message type derived from an <span
class="ec-lmtt-10">EObject </span>has to
be defined. The minimal requirement is that this concrete message has an attribute called ’name’ of type
String.
</p><!--l. 158--><p class="noindent" >The minimal interface to be implemented consists of </p>
<ul class="itemize1">
<li class="itemize">for the concrete interface item
<ul class="itemize2">
<li class="itemize"><span
class="ec-lmtt-10">EList<EObject> getAllIncomingAbstractMessages()</span>
</li>
<li class="itemize"><span
class="ec-lmtt-10">EList<EObject> getAllOutgoingAbstractMessages()</span>
</li>
<li class="itemize"><span
class="ec-lmtt-10">ProtocolSemantics getSemantics()</span></li></ul>
</li>
<li class="itemize">for the concrete model component
<ul class="itemize2">
<li class="itemize"><span
class="ec-lmtt-10">EList<AbstractInterfaceItem> getAbstractInterfaceItems </span>– the interface items contained in
this model component
</li>
<li class="itemize"><span
class="ec-lmtt-10">EList<AbstractInterfaceItem> getAllAbstractInterfaceItems </span>– all interface items including
inherited ones
</li>
<li class="itemize"><span
class="ec-lmtt-10">String getComponentName() </span>– should return the name of the model component</li></ul>
</li></ul>
<a
id="Q1-37-319"></a>
<h5 class="likesubsubsectionHead"><a
id="x37-2410002"></a>Extending the State Machine Editor</h5>
<!--l. 176--><p class="noindent" >The concrete state machine editor minimally needs to define </p>
<ul class="itemize1">
<li class="itemize">the editor class itself by deriving it from the <span
class="ec-lmtt-10">AbstractFSMEditor</span>
</li>
<li class="itemize">a diagram type provider (which may derive from <span
class="ec-lmtt-10">AbstractDiagramTypeProvider</span>)
</li>
<li class="itemize">a Google Guice module with bindings for
<ul class="itemize2">
<li class="itemize"><span
class="ec-lmtt-10">IFSMDialogFactory</span>
</li>
<li class="itemize"><span
class="ec-lmtt-10">DiagramAccessBase</span>
</li>
<li class="itemize"><span
class="ec-lmtt-10">IBehaviorQuickfixProvider</span>
</li>
<li class="itemize"><span
class="ec-lmtt-10">IResourceSetProvider</span></li></ul>
</li>
<li class="itemize">concrete implementations of all property dialogs the <span
class="ec-lmtt-10">IFSMDialogFactory </span>produces</li></ul>
<a
id="x37-241001r316"></a>
<h4 class="subsectionHead"><span class="titlemark">8.1.3 </span> <a
id="x37-2420003"></a>Runtimes</h4>
<!--l. 193--><p class="noindent" >Currently eTrice ships with a C and a Java runtime. The C++ runtime is still a prototype. The runtimes are libraries written
in the target language against which the generated code is compiled.
<a
id="x37-242001r321"></a>
</p>
<h4 class="subsectionHead"><span class="titlemark">8.1.4 </span> <a
id="x37-2430004"></a>Unit Tests</h4>
<!--l. 199--><p class="noindent" >Most plug-ins and other parts of the code have related unit tests.
</p>
<!--l. 201--><div class="crosslinks"><p class="noindent">[<a
href="etrice-docse28.html" >next</a>] [<a
href="etrice-docch8.html" >prev</a>] [<a
href="etrice-docch8.html#tailetrice-docch8.html" >prev-tail</a>] [<a
href="etrice-docse27.html" >front</a>] [<a
href="etrice-docch8.html#etrice-docse27.html" >up</a>] </p></div>
<!--l. 201--><p class="noindent" ><a
id="tailetrice-docse27.html"></a></p>
</body></html>
|