Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 76f50dc29ecc84bc1bb97dbbf5d970376b045752 (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
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Create a new model from scratch</title>
<link href="book.css" rel="stylesheet" type="text/css">
<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
<link rel="home" href="index.html" title="eTrice User Guide">
<link rel="up" href="TutorialHelloWorld.html" title="Tutorial HelloWorld">
<link rel="prev" href="TutorialHelloWorld.html" title="Tutorial HelloWorld">
<link rel="next" href="Createastatemachine.html" title="Create a state machine">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Create a new model from scratch</h1>
<div class="section" title="Create a new model from scratch">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="Createanewmodelfromscratch"></a>Create a new model from scratch</h2>
</div>
</div>
</div>
<p>The easiest way to create a new eTrice Project is to use the eclipse project wizard. From the eclipse file menu select 
				[<span class="citation">File-&gt;New-&gt;Project</span>] and create a new eTrice project and name it 
				[<span class="citation">HelloWorld</span>]
			</p>
<p>
				
</p>
<div class="mediaobject">
<img src="images/015-HelloWorld10.PNG"></div>
<p>
			
</p>
<p>The wizard creates everything that is needed to create, build and run a eTrice model. The resulting project should look like this:</p>
<p>
				
</p>
<div class="mediaobject">
<img src="images/015-HelloWorld11.PNG"></div>
<p>
			
</p>
<p>Within the model directory the model file 
				[<span class="citation">HelloWorld.room</span>] was created. Open the 
				[<span class="citation">HelloWorld.room</span>] file and position the cursor at the very beginning of the file. Open the content assist with Ctrl+Space and select 
				[<span class="citation">model skeleton</span>].
			</p>
<p>
				
</p>
<div class="mediaobject">
<img src="images/015-HelloWorld12.PNG"></div>
<p>   
			
</p>
<p>Edit the template variables and remove the artefacts from the wizard. </p>
<p>The resulting model code should look like this:</p>
<div class="literallayout">
<p>
<code class="code">RoomModel&nbsp;HelloWorld&nbsp;{<br>

<br>
	LogicalSystem&nbsp;System_HelloWorld&nbsp;{<br>
		SubSystemRef&nbsp;subsystem&nbsp;:&nbsp;SubSystem_HelloWorld<br>
	}<br>

<br>
	SubSystemClass&nbsp;SubSystem_HelloWorld&nbsp;{<br>
		ActorRef&nbsp;application&nbsp;:&nbsp;HelloWorldTop<br>
	}<br>

<br>
	ActorClass&nbsp;HelloWorldTop&nbsp;{<br>
	}<br>
}&nbsp;<br>

</code>
</p>
</div>
<div class="blockquote">
<blockquote class="blockquote">
<p></p>
</blockquote>
</div>
<p>The goal of eTrice is to describe distributed systems on a logical level. In the current version not all elements will be supported. But as prerequisite for further versions the following elements are mandatory for an eTrice model:</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>the 
						[<span class="citation">LogicalSystem</span>] 
					</p>
</li>
<li class="listitem">
<p>at least one 
						[<span class="citation">SubSystemClass</span>]
					</p>
</li>
<li class="listitem">
<p>at least one 
						[<span class="citation">ActorClass</span>]
					</p>
</li>
</ul>
</div>
<p>The 
				[<span class="citation">LogicalSystem</span>] represents the complete distributed system and contains at least one 
				[<span class="citation">SubSystemRef</span>]. The 
				[<span class="citation">SubSystemClass</span>] represents an address space and contains at least one 
				[<span class="citation">ActorRef</span>]. The 
				[<span class="citation">ActorClass</span>] is the building block of which an application will be built of. It is in general a good idea to define a top level actor that can be used as reference within the subsystem.
			</p>
<p>The outline view of the textual ROOM editor shows the main modeling elements in an easy to navigate tree.</p>
<p>
				
</p>
<div class="mediaobject">
<img src="images/015-HelloWorld02.PNG"></div>
<p>
			
</p>
</div>
</body>
</html>

Back to the top