aboutsummaryrefslogtreecommitdiffstats
blob: b3031209b363e7259cf33dc8692c9613a73ae5b5 (plain)
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
<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="TutorialHelloWorldforJava.html" title="Tutorial HelloWorld for Java">
<link rel="prev" href="TutorialHelloWorldforJava.html" title="Tutorial HelloWorld for Java">
<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="emphasis"><em>File-&gt;New-&gt;Project</em></span> and create a new eTrice project and name it 
				<span class="emphasis"><em>HelloWorld</em></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 an 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="emphasis"><em>HelloWorld.room</em></span> was created. Open the 
				<span class="emphasis"><em>HelloWorld.room</em></span> file and delete the contents of the file. Open the content assist with Ctrl+Space and select 
				<span class="emphasis"><em>model skeleton</em></span>.
			</p>
<p>
				
</p>
<div class="mediaobject">
<img src="images/015-HelloWorld12.png"></div>
<p>   
			
</p>
<p>Edit the template variables by typing the new names and jumping with Tab from name to name.</p>
<p>The resulting model code should look like this:</p>
<div class="literallayout">
<p>
<code class="code">RoomModel&nbsp;HelloWorld&nbsp;{<br>

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

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

<br>
&nbsp;&nbsp;&nbsp;&nbsp;ActorClass&nbsp;HelloWorldTop&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<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 used. But as prerequisite for further versions the following elements can be defined:</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>the 
						<span class="emphasis"><em>LogicalSystem</em></span> (currently optional)
					</p>
</li>
<li class="listitem">
<p>at least one 
						<span class="emphasis"><em>SubSystemClass</em></span> (mandatory)
					</p>
</li>
<li class="listitem">
<p>at least one 
						<span class="emphasis"><em>ActorClass</em></span> (mandatory)
					</p>
</li>
</ul>
</div>
<p>The 
				<span class="emphasis"><em>LogicalSystem</em></span> represents the complete distributed system and contains at least one 
				<span class="emphasis"><em>SubSystemRef</em></span>. The 
				<span class="emphasis"><em>SubSystemClass</em></span> represents an address space and contains at least one 
				<span class="emphasis"><em>ActorRef</em></span>. The 
				<span class="emphasis"><em>ActorClass</em></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>