blob: 57b66f1c72a1a59ad3cd932fd39a75bd249c8c30 (
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
|
<!-- generated by featurizer -->
<p>’’’’’’</p>
<p>’’’<br/> ## room</p>
<pre><code> ```room
import room.basic.types.* from "../../../org.eclipse.etrice.modellib.c/model/Types.room"
ActorClass InternalEndPortExample {
Structure {
Port internalEndPort : PSimpleProtocol
ActorRef actorRef1 : SimpleActorClass1
// internalEndPort lives 'local'
// and thus needs a Binding to port of an ActorRef
Binding internalEndPort and actorRef1.externalPort
}
Behavior {
// send/receive messages from internalEndPorts
}
}
ActorClass Receiver {
Interface {
Port sender: PingPongProtocol
}
Structure {
external Port sender
SAP timing : PTimer
}
Behavior {
StateMachine {
Transition init: initial -> WaitingForPing { }
Transition tr0: WaitingForPing -> WaitingForAWhile {
triggers {
<ping: sender>
}
}
Transition tr1: WaitingForAWhile -> SentPong {
triggers {
<timeout: timing>
}
}
State WaitingForPing
State SentPong {
entry {
"sender.pong();"
}
}
State WaitingForAWhile {
entry {
"timing.startTimeout(1000);"
}
}
}
}
}
// eventdriven ProtocolClass (asynchronous message passing, bidirectional)
eventdriven ProtocolClass ProtocolClassEvt {
// ProtocolClass ProtocolClassEvt { // same like above because eventdriven is default
incoming {
// incoming means incoming for a regular port and outging for a conjugated port
Message message1() // message without data
Message message2(data: int32) // message with simple data
Message message3(data: DMessageData) // message with complex data (DataClass)
}
outgoing {
// outgoing means outging for a regular port and incoming for a conjugated port
Message message1(data: int32) // incoming and outgoing Messages can have the same name to enable symmetric protocols
}
}
// DataClass for sending complex data via message
DataClass DMessageData {
Attribute SomeData: int16
Attribute SomeMoreData: int32
}
```
## etMap
```etmap
MappingModel PingPongMapping {
import PingPong_Model.* from "PingPong.room"
import GenericPhysicalModel.* from "GenericPhysical.etphys"
Mapping LogSys -> PhysSys1 {
SubSystemMapping subSystemRef -> nodeRef1 {
ThreadMapping defaultThread -> PhysicalThread1
}
}
}
```
## etPhys
```etphys
PhysicalModel GenericPhysicalModel {
PhysicalSystem PhysSys1 {
NodeRef nodeRef1 : NodeClass1
}
NodeClass NodeClass1 {
runtime = RuntimeClass1
priomin = -10
priomax = 10
DefaultThread PhysicalThread1 {
execmode = mixed
interval = 100ms
prio = 0
stacksize = 1024
msgblocksize = 64
msgpoolsize = 100
}
}
RuntimeClass RuntimeClass1 {
model = multiThreaded
}
}
```
## config
```config
/*******************************************************************************
* Copyright (c) 2012 protos software gmbh (http://www.protos.de).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* CONTRIBUTORS:
* Thomas Schuetz (initial contribution)
*
*******************************************************************************/
ConfigModel trafficlight.example.config {
import TrafficLight_Model.* from "TrafficLight.room"
ActorInstanceConfig LSTraffic/mainSS/application/pedestrianLight {
Attr ipConfig{
Attr IPAddr="localhost"
Attr TcpPort=4443
}
}
}
```
<pre lang="no-highlight"><code>
```
"no highlighting" /* comment */
// nop
```
```no-highlight
"no highlighting" /* comment */
// nop
```
</code></pre>
```
"no highlighting" /* comment */
// nop
```
```no-highlight
"no highlighting" /* comment */
// nop
```
## TODO
Syntax highlighting for other languages like c:
```c
void etMessageQueue_push(etMessageQueue* self, etMessage* msg){
/* TODO: optimize queue for concurrent push / pop */
ET_MSC_LOGGER_SYNC_ENTRY("etMessageQueue", "push")
if (self->first == NULL) {
/*no message in queue*/
self->first = self->last = msg;
}
else {
/*at least one message in queue*/
self->last->next = msg;
self->last = msg;
}
msg->next = NULL; /*TODO: optimization: this line could be removed if we assume that all messages are initialized*/
if (++self->size > self->highWaterMark)
self->highWaterMark++;
ET_MSC_LOGGER_SYNC_EXIT
}
```
'''
</code></pre>
|