Skip to content

Commit 3dee89b

Browse files
committed
Added Message Payload Example to training examples.
1 parent 05b5205 commit 3dee89b

5 files changed

Lines changed: 42 additions & 6 deletions

File tree

sysml/src/training/20. Messaging/Messaging Example.sysml renamed to sysml/src/training/20. Asynchronous Messaging/Messaging Example.sysml

File renamed without changes.

sysml/src/training/20. Messaging/Messaging with Ports.sysml renamed to sysml/src/training/20. Asynchronous Messaging/Messaging with Ports.sysml

File renamed without changes.

sysml/src/training/26. Occurrences/Interaction Example-1.sysml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package 'Interaction Example-1' {
22
import 'Event Occurrence Example'::*;
33

4-
attribute def SetSpeed;
5-
attribute def SensedSpeed;
6-
attribute def FuelCommand;
4+
item def SetSpeed;
5+
item def SensedSpeed;
6+
item def FuelCommand;
77

88
occurrence def CruiseControlInteraction {
99
ref part :>> driver;

sysml/src/training/26. Occurrences/Interaction Example-2.sysml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package 'Interaction Example-2' {
22
import 'Event Occurrence Example'::*;
33

4-
attribute def SetSpeed;
5-
attribute def SensedSpeed;
6-
attribute def FuelCommand;
4+
item def SetSpeed;
5+
item def SensedSpeed;
6+
item def FuelCommand;
77

88
occurrence def CruiseControlInteraction {
99

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package 'Message Payload Example' {
2+
import 'Event Occurrence Example'::*;
3+
4+
item def SetSpeed;
5+
item def SensedSpeed;
6+
item def FuelCommand {
7+
attribute fuelFlow : ScalarValues::Real;
8+
}
9+
10+
part def EngineController;
11+
12+
part vehicle1 :> vehicle {
13+
part engineController : EngineController {
14+
event occurrence fuelCommandReceived;
15+
then event occurrence fuelCommandForwarded;
16+
}
17+
}
18+
19+
occurrence def CruiseControlInteraction {
20+
ref part :>> driver;
21+
ref part vehicle :>> vehicle1;
22+
23+
message setSpeedMessage of SetSpeed
24+
from driver.setSpeedSent to vehicle.cruiseController.setSpeedReceived;
25+
26+
then message sensedSpeedMessage of SensedSpeed
27+
from vehicle.speedometer.sensedSpeedSent to vehicle.cruiseController.sensedSpeedReceived;
28+
29+
then message fuelCommandMessage of fuelCommand : FuelCommand
30+
from vehicle.cruiseController.fuelCommandSent to vehicle.engineController.fuelCommandReceived;
31+
32+
then message fuelCommandForwardingMessage of fuelCommand : FuelCommand = fuelCommandMessage.fuelCommand
33+
from vehicle.engineController.fuelCommandForwarded to vehicle.engine.fuelCommandReceived;
34+
35+
}
36+
}

0 commit comments

Comments
 (0)