Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 826ea9445e965fa7ed7f49f54c4c7bb8c265d630 (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
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Define Actor Structure and Behavior</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="TutorialSendingData.html" title="Tutorial Sending Data">
<link rel="prev" href="CreateMrPingandMrPongActors.html" title="Create MrPing and MrPong Actors">
<link rel="next" href="Definethetoplevel.html" title="Define the top level">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Define Actor Structure and Behavior</h1>
<div class="section" title="Define Actor Structure and Behavior">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="DefineActorStructureandBehavior"></a>Define Actor Structure and Behavior</h2>
</div>
</div>
</div>
<p>Save the model and visit the outline view. Within the outline view, right click on the 
				[<span class="citation">MrPong</span>] actor and select 
				[<span class="citation">Edit Structure</span>]. Select an 
				[<span class="citation">Interface Port</span>] from the toolbox and add it to MrPong. Name the Port 
				[<span class="citation">PingPongPort</span>] and select the 
				[<span class="citation">PingPongProtocol</span>]
			</p>
<p>
				
</p>
<div class="mediaobject">
<img src="images/025-SendingData02.png"></div>
<p>
			
</p>
<p>Do the same with MrPing but mark the port as 
				[<span class="citation">conjugated</span>]
			</p>
<div class="section" title="Define MrPongs behavior">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="DefineMrPongsbehavior"></a>Define MrPongs behavior</h3>
</div>
</div>
</div>
<p>Within the outline view, right click MrPong and select 
					[<span class="citation">Edit Behavior</span>]. Create the following state machine:
				</p>
<p>
					
</p>
<div class="mediaobject">
<img src="images/025-SendingData04.png"></div>
<p>
				
</p>
<p>The transition dialogues should look like this:
					For 
					[<span class="citation">ping</span>]:
				</p>
<p>
					
</p>
<div class="mediaobject">
<img src="images/025-SendingData05.png"></div>
<p>
				
</p>
<p>For 
					[<span class="citation">pingSimple</span>]:
				</p>
<p>
					
</p>
<div class="mediaobject">
<img src="images/025-SendingData06.png"></div>
<p>
				
</p>
</div>
<div class="section" title="Define MrPing behavior">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="DefineMrPingbehavior"></a>Define MrPing behavior</h3>
</div>
</div>
</div>
<p>Within the outline view double click MrPing. Navigate the cursor to the behavior of MrPing. With the help of content assist create a new operation.</p>
<p>
					
</p>
<div class="mediaobject">
<img src="images/025-SendingData07.png"></div>
<p>
				
</p>
<p>Name the operation 
					[<span class="citation">printData</span>] and define the DemoData as a parameter.
				</p>
<p>Fill in the following code:</p>
<div class="literallayout">
<p>
<code class="code">Operation&nbsp;printData(d:&nbsp;DemoData)&nbsp;:&nbsp;void&nbsp;{<br>
			"System.out.printf(\"d.int32Val:&nbsp;%d\\n\",d.int32Val);"<br>
			"System.out.printf(\"d.float64Val:&nbsp;%f\\n\",d.float64Val);"<br>
			"System.out.printf(\"d.int8Array:&nbsp;\");"<br>
			"for(int&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&lt;d.int8Array.length;&nbsp;i++)&nbsp;{"<br>
			"System.out.printf(\"%d&nbsp;\",d.int8Array[i]);}"<br>
			"System.out.printf(\"\\nd.stringVal:&nbsp;%s\\n\",d.stringVal);"<br>
		}<br>

</code>
</p>
</div>
<div class="blockquote">
<blockquote class="blockquote">
<p></p>
</blockquote>
</div>
<p>For MrPing create the following state machine:</p>
<p>
					
</p>
<div class="mediaobject">
<img src="images/025-SendingData08.png"></div>
<p>
				
</p>
<p>The transition dialogues should look like this:</p>
<p>For 
					[<span class="citation">init</span>]:
				</p>
<p>
					
</p>
<div class="mediaobject">
<img src="images/025-SendingData09.png"></div>
<p>
				
</p>
<p>For 
					[<span class="citation">wait1</span>]:
				</p>
<p>
					
</p>
<div class="mediaobject">
<img src="images/025-SendingData10.png"></div>
<p>
				
</p>
<p>For 
					[<span class="citation">next</span>]:
				</p>
<p>
					
</p>
<div class="mediaobject">
<img src="images/025-SendingData11.png"></div>
<p>
				
</p>
<p>For 
					[<span class="citation">wait2</span>]:
				</p>
<p>
					
</p>
<div class="mediaobject">
<img src="images/025-SendingData12.png"></div>
<p>
				
</p>
</div>
</div>
</body>
</html>

Back to the top