Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 64074521865ddff809d7dd751b5ae0ecbacf2fe3 (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
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Import the Timing Service</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="TutorialBlinkyJava.html" title="Tutorial Blinky (Java)">
<link rel="prev" href="Createanewprotocol.html" title="Create a new protocol">
<link rel="next" href="Finishthemodelstructure.html" title="Finish the model structure">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Import the Timing Service</h1>
<div class="section" title="Import the Timing Service">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="ImporttheTimingService"></a>Import the Timing Service</h2>
</div>
</div>
</div>
<p>Switching on and off the LED is timing controlled. The timing service is provided from the model library and must be imported before it can be used from the model.</p>
<p>This is the first time you use an element from the modellib. Make sure that your Java Build Path has the appropriate entry to the modellib. Otherwise the jave code, which will be generated from the modellib, can not be referenced.
				(right click to 
				<span class="emphasis"><em>Blinky</em></span> and select properties. Select the 
				<span class="emphasis"><em>Java Build Path</em></span> tab) 
			</p>
<p>
				
</p>
<div class="mediaobject">
<img src="images/020-Blinky16.png"></div>
<p> 
			
</p>
<p>After the build path is set up return to the model and navigate the cursor at the beginning of the model and import the timing service: </p>
<div class="literallayout">
<p>
<code class="code">RoomModel&nbsp;Blinky&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;import&nbsp;room.basic.service.timing.*&nbsp;from&nbsp;"../../org.eclipse.etrice.modellib/models/TimingService.room"&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;LogicalSystem&nbsp;System_Blinky&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SubSystemRef&nbsp;subsystem:&nbsp;SubSystem_Blinky<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
}<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>

</code>
</p>
</div>
<div class="blockquote">
<blockquote class="blockquote">
<p></p>
</blockquote>
</div>
<p>Make sure that the path fits to your folder structure. The original tutorial code is different due to the folder structure.  </p>
<p>Now it can be used within the model. Right click to 
				<span class="bold"><strong>SubSystem_Blinky</strong></span> within the outline view. Select 
				<span class="emphasis"><em>Edit Structure</em></span>. The 
				<span class="emphasis"><em>application</em></span> is already referenced in the subsystem. Drag and Drop an 
				<span class="emphasis"><em>ActorRef</em></span> to the 
				<span class="bold"><strong>SubSystem_Blinky</strong></span> and name it 
				<span class="emphasis"><em>timingService</em></span>. From the actor class drop down list select 
				<span class="emphasis"><em>room.basic.service.timing.ATimingService</em></span>. Draw a 
				<span class="emphasis"><em>LayerConnection</em></span> from 
				<span class="emphasis"><em>application</em></span> to each service provision point (SPP) of the 
				<span class="emphasis"><em>timingService</em></span>. The resulting structure should look like this:
			</p>
<p>
				
</p>
<div class="mediaobject">
<img src="images/020-Blinky06.png"></div>
<p> 
			
</p>
<p>The current version of eTrice does not provide a graphical element for a service access point (SAP). Therefore the SAPs to access the timing service must be added in the .room file. Open the 
				<span class="emphasis"><em>Blinky.room</em></span> file and navigate to the 
				<span class="emphasis"><em>Blinky</em></span> actor. Add the following line to the structure of the actor:
			</p>
<div class="literallayout">
<p>
<code class="code">SAP&nbsp;timer:&nbsp;room.basic.service.timing.PTimeout<br>

</code>
</p>
</div>
<p>Do the same thing for 
				<span class="emphasis"><em>BlinkyController</em></span>.
			</p>
<p>The resulting code should look like this:</p>
<p>
				
</p>
<div class="mediaobject">
<img src="images/020-Blinky07.png"></div>
<p>
			
</p>
</div>
</body>
</html>

Back to the top