Skip to content

Commit 9fee455

Browse files
committed
SYSML2_-766 Updated SysML examples for constructor notation.
1 parent e022f7e commit 9fee455

26 files changed

Lines changed: 87 additions & 87 deletions

sysml/src/examples/Arrowhead Framework Example/AHFNorwayTopics.sysml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ package AHFNorway {
5757
// Call apisp::APIS_HTTP::giveItems(in allitems: String = "All the items", out ackback:Boolean);
5858

5959
state TellUbehavior{
60-
entry send CallGiveItems("All the items") via apisp.APIS_HTTP;
60+
entry send new CallGiveItems("All the items") via apisp.APIS_HTTP;
6161
then Wait;
6262
state Wait;
6363
accept rs:ResultGiveItems
@@ -81,21 +81,21 @@ package AHFNorway {
8181
{ in itms:String; out ack:Boolean;
8282
/* Forward itms and return an ack */
8383
first start;
84-
then send Return_AllItems(itms) via apisc.APIS_MQTT;
84+
then send new Return_AllItems(itms) via apisc.APIS_MQTT;
8585
success = true;
8686
bind ack = success;
8787
}
8888

8989
state APISPbehavior{
90-
entry send Publish("Return_AllItems") via apisc.APIS_MQTT;
90+
entry send new Publish("Return_AllItems") via apisc.APIS_MQTT;
9191
then WaitOnData;
9292

9393
state WaitOnData;
9494
accept cl:CallGiveItems via tellu.APIS_HTTP
9595
do action {
9696
first start;
9797
then action giveItems{ in itms=cl.itms; out ack=x; }
98-
then send ResultGiveItems(x) via tellu.APIS_HTTP;
98+
then send new ResultGiveItems(x) via tellu.APIS_HTTP;
9999
}
100100
then WaitOnData;
101101
}
@@ -110,7 +110,7 @@ package AHFNorway {
110110

111111
// Now sending signal to the remote behavior through the port functionality
112112
state MQTT_APISP {
113-
entry send Subscribe("Return_AllItems") via apisp.APIS_MQTT;
113+
entry send new Subscribe("Return_AllItems") via apisp.APIS_MQTT;
114114
then Idle;
115115
state Idle;
116116
accept Return_AllItems via apisp.APIS_MQTT

sysml/src/examples/Geometry Examples/CarWithShapeAndCSG.sysml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ package CarWithShapeAndCSG {
1515
* Car with simple engine
1616
*/
1717

18-
item :>> shape = Cuboid(4800 [mm], 1840 [mm], 1350 [mm]);
18+
item :>> shape = new Cuboid(4800 [mm], 1840 [mm], 1350 [mm]);
1919

2020
attribute datum :>> coordinateFrame {
2121
:>> mRefs = (mm, mm, mm);
@@ -26,7 +26,7 @@ package CarWithShapeAndCSG {
2626
:>> mRefs = datum.mRefs;
2727
:>> transformation : TranslationRotationSequence {
2828
:>> source = datum;
29-
:>> elements = ( Translation((3800, (1840-190)/2, 40)[datum]) );
29+
:>> elements = ( new Translation((3800, (1840-190)/2, 40)[datum]) );
3030
}
3131
}
3232
}
@@ -61,7 +61,7 @@ package CarWithShapeAndCSG {
6161
attribute :>> coordinateFrame {
6262
:>> transformation : TranslationRotationSequence {
6363
:>> source = ecf;
64-
:>> elements = (Translation( (rearCylinderSpacing, rawEngineBlock.shape.width/2, -10)[ecf]));
64+
:>> elements = (new Translation( (rearCylinderSpacing, rawEngineBlock.shape.width/2, -10)[ecf]));
6565
}
6666
}
6767
}
@@ -75,7 +75,7 @@ package CarWithShapeAndCSG {
7575
attribute :>> coordinateFrame {
7676
:>> transformation : TranslationRotationSequence {
7777
:>> source = ecf;
78-
:>> elements = ( Translation((rearCylinderSpacing + cylinderSpacing, rawEngineBlock.shape.width/2, -10)[ecf]) );
78+
:>> elements = ( new Translation((rearCylinderSpacing + cylinderSpacing, rawEngineBlock.shape.width/2, -10)[ecf]) );
7979
}
8080
}
8181
}

sysml/src/examples/Geometry Examples/SimpleQuadcopter.sysml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ package SimpleQuadcopter {
3131
}
3232
attribute :>> coordinateFrame {
3333
:>> transformation : TranslationRotationSequence {
34-
:>> elements = (Translation( (0, shape.width/2, 0)[source]));
34+
:>> elements = (new Translation( (0, shape.width/2, 0)[source]));
3535
}
3636
}
3737
}
@@ -41,7 +41,7 @@ package SimpleQuadcopter {
4141
item :>> shape = motorShape.shape;
4242
attribute :>> coordinateFrame {
4343
:>> transformation : TranslationRotationSequence {
44-
:>> elements = (Translation( (175, 0, -1)[source]));
44+
:>> elements = (new Translation( (175, 0, -1)[source]));
4545
}
4646
}
4747
}
@@ -64,7 +64,7 @@ package SimpleQuadcopter {
6464
}
6565
attribute :>> coordinateFrame {
6666
:>> transformation : TranslationRotationSequence {
67-
:>> elements = (Translation( (175, 0, 31)[source]));
67+
:>> elements = (new Translation( (175, 0, 31)[source]));
6868
}
6969
}
7070
}
@@ -73,7 +73,7 @@ package SimpleQuadcopter {
7373
item :>> shape = motorShape.shape;
7474
attribute :>> coordinateFrame {
7575
:>> transformation : TranslationRotationSequence {
76-
:>> elements = (Translation( (175, 0, 0)[source]));
76+
:>> elements = (new Translation( (175, 0, 0)[source]));
7777
}
7878
}
7979
}
@@ -103,7 +103,7 @@ package SimpleQuadcopter {
103103
}
104104
attribute :>> coordinateFrame {
105105
:>> transformation : TranslationRotationSequence {
106-
:>> elements = (Rotation( (0, 1, 0)[source], 180['°']));
106+
:>> elements = (new Rotation( (0, 1, 0)[source], 180['°']));
107107
}
108108
}
109109
}
@@ -132,7 +132,7 @@ package SimpleQuadcopter {
132132
}
133133
attribute :>> coordinateFrame {
134134
:>> transformation : TranslationRotationSequence {
135-
:>> elements = (Translation( (0, shape.width/2, 0)[source]));
135+
:>> elements = (new Translation( (0, shape.width/2, 0)[source]));
136136
}
137137
}
138138
}
@@ -146,8 +146,8 @@ package SimpleQuadcopter {
146146
}
147147
attribute :>> coordinateFrame {
148148
:>> transformation : TranslationRotationSequence {
149-
:>> elements = (Translation( (0, -shape.length/sqrt(2), -10)[source]),
150-
Rotation((0, 0, 1)[source], 45['°']));
149+
:>> elements = (new Translation( (0, -shape.length/sqrt(2), -10)[source]),
150+
new Rotation((0, 0, 1)[source], 45['°']));
151151
}
152152
}
153153
}
@@ -170,65 +170,65 @@ package SimpleQuadcopter {
170170
part strut1 : Strut {
171171
attribute :>> coordinateFrame {
172172
:>> transformation : TranslationRotationSequence {
173-
:>> elements = (Translation( (xStrut.num, yStrut.num, zStrut.num)[source]),
174-
Rotation((0, 0, 1)[source], 45['°']));
173+
:>> elements = (new Translation( (xStrut.num, yStrut.num, zStrut.num)[source]),
174+
new Rotation((0, 0, 1)[source], 45['°']));
175175
}
176176
}
177177
}
178178
part strut2 : Strut {
179179
attribute :>> coordinateFrame {
180180
:>> transformation : TranslationRotationSequence {
181-
:>> elements = (Translation( (-xStrut.num, yStrut.num, zStrut.num)[source]),
182-
Rotation((0, 0, 1)[source], 135['°']));
181+
:>> elements = (new Translation( (-xStrut.num, yStrut.num, zStrut.num)[source]),
182+
new Rotation((0, 0, 1)[source], 135['°']));
183183
}
184184
}
185185
}
186186
part strut3 : Strut {
187187
attribute :>> coordinateFrame {
188188
:>> transformation : TranslationRotationSequence {
189-
:>> elements = (Translation( (-xStrut.num, -yStrut.num, zStrut.num)[source]),
190-
Rotation((0, 0, 1)[source], 225['°']));
189+
:>> elements = (new Translation( (-xStrut.num, -yStrut.num, zStrut.num)[source]),
190+
new Rotation((0, 0, 1)[source], 225['°']));
191191
}
192192
}
193193
}
194194
part strut4 : Strut {
195195
attribute :>> coordinateFrame {
196196
:>> transformation : TranslationRotationSequence {
197-
:>> elements = (Translation( (xStrut.num, -yStrut.num, zStrut.num)[source]),
198-
Rotation((0, 0, 1)[source], 315['°']));
197+
:>> elements = (new Translation( (xStrut.num, -yStrut.num, zStrut.num)[source]),
198+
new Rotation((0, 0, 1)[source], 315['°']));
199199
}
200200
}
201201
}
202202

203203
part propellerMotorAssy1 : PropellerMotorAssy {
204204
attribute :>> coordinateFrame {
205205
:>> transformation : TranslationRotationSequence {
206-
:>> elements = (Translation( (xStrut.num, yStrut.num, zPMAssy.num)[source]),
207-
Rotation((0, 0, 1)[source], 45['°']));
206+
:>> elements = (new Translation( (xStrut.num, yStrut.num, zPMAssy.num)[source]),
207+
new Rotation((0, 0, 1)[source], 45['°']));
208208
}
209209
}
210210
}
211211
part propellerMotorAssy2 : PropellerMotorAssy {
212212
attribute :>> coordinateFrame {
213213
:>> transformation : TranslationRotationSequence {
214-
:>> elements = (Translation( (-xStrut.num, yStrut.num, zPMAssy.num)[source]),
215-
Rotation((0, 0, 1)[source], 135['°']));
214+
:>> elements = (new Translation( (-xStrut.num, yStrut.num, zPMAssy.num)[source]),
215+
new Rotation((0, 0, 1)[source], 135['°']));
216216
}
217217
}
218218
}
219219
part propellerMotorAssy3 : PropellerMotorAssy {
220220
attribute :>> coordinateFrame {
221221
:>> transformation : TranslationRotationSequence {
222-
:>> elements = (Translation( (-xStrut.num, -yStrut.num, zPMAssy.num)[source]),
223-
Rotation((0, 0, 1)[source], 225['°']));
222+
:>> elements = (new Translation( (-xStrut.num, -yStrut.num, zPMAssy.num)[source]),
223+
new Rotation((0, 0, 1)[source], 225['°']));
224224
}
225225
}
226226
}
227227
part propellerMotorAssy4 : PropellerMotorAssy {
228228
attribute :>> coordinateFrame {
229229
:>> transformation : TranslationRotationSequence {
230-
:>> elements = (Translation( (xStrut.num, -yStrut.num, zPMAssy.num)[source]),
231-
Rotation((0, 0, 1)[source], 315['°']));
230+
:>> elements = (new Translation( (xStrut.num, -yStrut.num, zPMAssy.num)[source]),
231+
new Rotation((0, 0, 1)[source], 315['°']));
232232
}
233233
}
234234
}
@@ -237,8 +237,8 @@ package SimpleQuadcopter {
237237
part camera : Camera {
238238
attribute :>> coordinateFrame {
239239
:>> transformation : TranslationRotationSequence {
240-
:>> elements = (Translation( (59, 0, 2)[source]),
241-
Rotation((0, 1, 0)[source], 50['°']));
240+
:>> elements = (new Translation( (59, 0, 2)[source]),
241+
new Rotation((0, 1, 0)[source], 50['°']));
242242
}
243243
}
244244
}

sysml/src/examples/Geometry Examples/VehicleGeometryAndCoordinateFrames.sysml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ package VehicleGeometryAndCoordinateFrames {
2121
part def Vehicle :> SpatialItem;
2222

2323
part def Chassis :> SpatialItem {
24-
item :>> shape = Box(4800 [mm], 1840 [mm], 1350 [mm]);
24+
item :>> shape = new Box(4800 [mm], 1840 [mm], 1350 [mm]);
2525
}
2626

2727
part def Wheel :> SpatialItem {
@@ -58,7 +58,7 @@ package VehicleGeometryAndCoordinateFrames {
5858
private attribute trs : TranslationRotationSequence {
5959
:>> source = wcf;
6060
:>> target = lbcf;
61-
:>> elements = Translation((lbpr*cos((i-1)*lbda), lbpr*sin((i-1)*lbda), -8)[wcf]);
61+
:>> elements = new Translation((lbpr*cos((i-1)*lbda), lbpr*sin((i-1)*lbda), -8)[wcf]);
6262
}
6363
lbcf.transformation == trs
6464
}
@@ -85,7 +85,7 @@ package VehicleGeometryAndCoordinateFrames {
8585
attribute :>> coordinateFrame {
8686
attribute :>> transformation : TranslationRotationSequence {
8787
attribute :>> source = datum;
88-
attribute :>> elements = Translation((-(shape as Box).length/2, -(shape as Box).width/2, 0)[datum]);
88+
attribute :>> elements = new Translation((-(shape as Box).length/2, -(shape as Box).width/2, 0)[datum]);
8989
}
9090
}
9191
}
@@ -99,31 +99,31 @@ package VehicleGeometryAndCoordinateFrames {
9999
attribute :>> coordinateFrame {
100100
attribute :>> transformation : TranslationRotationSequence {
101101
attribute :>> source = datum;
102-
attribute :>> elements = (Translation((frontWheelXShift, wheelYShift, 80)[datum]), Rotation(plusXAxis[datum], -90['°']));
102+
attribute :>> elements = (new Translation((frontWheelXShift, wheelYShift, 80)[datum]), new Rotation(plusXAxis[datum], -90['°']));
103103
}
104104
}
105105
}
106106
part rightFrontWheel : Wheel[1] :> componentItems {
107107
attribute :>> coordinateFrame {
108108
attribute :>> transformation : TranslationRotationSequence {
109109
attribute :>> source = datum;
110-
attribute :>> elements = (Translation((frontWheelXShift, -wheelYShift, 80)[datum]), Rotation((1, 0, 0)[datum], 90['°']));
110+
attribute :>> elements = (new Translation((frontWheelXShift, -wheelYShift, 80)[datum]), new Rotation((1, 0, 0)[datum], 90['°']));
111111
}
112112
}
113113
}
114114
part leftRearWheel : Wheel[1] :> componentItems {
115115
attribute :>> coordinateFrame {
116116
attribute :>> transformation : TranslationRotationSequence {
117117
attribute :>> source = datum;
118-
attribute :>> elements = (Translation((rearWheelXShift, wheelYShift, 80)[datum]), Rotation((1, 0, 0)[datum], 90['°']));
118+
attribute :>> elements = (new Translation((rearWheelXShift, wheelYShift, 80)[datum]), new Rotation((1, 0, 0)[datum], 90['°']));
119119
}
120120
}
121121
}
122122
part rightRearWheel : Wheel[1] :> componentItems {
123123
attribute :>> coordinateFrame {
124124
attribute :>> transformation : TranslationRotationSequence {
125125
attribute :>> source = datum;
126-
attribute :>> elements = (Translation((rearWheelXShift, -wheelYShift, 80)[datum]), Rotation((-1, 0, 0)[datum], 90['°']));
126+
attribute :>> elements = (new Translation((rearWheelXShift, -wheelYShift, 80)[datum]), new Rotation((-1, 0, 0)[datum], 90['°']));
127127
}
128128
}
129129
}

sysml/src/examples/Interaction Sequencing Examples/ServerSequenceOutsideRealization-2.sysml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ package ServerSequenceOutsideRealization_2 {
1313
attribute someTopic : String;
1414
private item somePublication;
1515
/* Requiring FIFO sort (as opposed to just default) to make arrival/leave ordering
16-
* in ServerSequenceModelOutside.sysml equivalent to accept/send ordering in
16+
* in ServerSequenceModelOutside.sysml equivalent to accept/send new ordering in
1717
* ServerSquenceRealization-2.sysml. */
1818
:>> incomingTransferSort = Occurrences::earlierFirstIncomingTransferSort;
1919

2020
port publicationPort : ~PublicationPort;
2121

2222
perform action producerBehavior {
23-
action publish send Publish(someTopic, somePublication) via publicationPort;
23+
action publish send new Publish(someTopic, somePublication) via publicationPort;
2424
}
2525
}
2626

@@ -45,7 +45,7 @@ package ServerSequenceOutsideRealization_2 {
4545
first waitForPublication
4646
accept pub : Publish via publicationPort
4747
if pub.topic == subscribing.sub.topic
48-
do send Deliver(pub.publication) to subscribing.sub.subscriber
48+
do send new Deliver(pub.publication) to subscribing.sub.subscriber
4949
then waitForPublication;
5050
}
5151
}
@@ -59,7 +59,7 @@ package ServerSequenceOutsideRealization_2 {
5959
port subscriptionPort : ~SubscriptionPort;
6060

6161
perform action consumerBehavior {
62-
action subscribe send Subscribe(myTopic, consumer_2) to server_2;
62+
action subscribe send new Subscribe(myTopic, consumer_2) to server_2;
6363
then action delivery accept Deliver via consumer_2;
6464
}
6565
}

sysml/src/examples/Interaction Sequencing Examples/ServerSequenceOutsideRealization-3.sysml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ package ServerSequenceOutsideRealization_3 {
3434

3535
perform action producerBehavior {
3636
action publish {
37-
out ref request : Publish[1] = Publish(someTopic, somePublication);
37+
out ref request : Publish[1] = new Publish(someTopic, somePublication);
3838
}
3939
}
4040

@@ -85,7 +85,7 @@ package ServerSequenceOutsideRealization_3 {
8585
then action delivering {
8686
in topic : String[1] = subscribing.topic;
8787
in publication[1] = publishing.publication;
88-
out ref response : Deliver = Deliver(publication);
88+
out ref response : Deliver = new Deliver(publication);
8989
}
9090
then continuePublishing;
9191

@@ -112,7 +112,7 @@ package ServerSequenceOutsideRealization_3 {
112112

113113
perform action consumerBehavior {
114114
action subscribe {
115-
out ref request : Subscribe = Subscribe(myTopic);
115+
out ref request : Subscribe = new Subscribe(myTopic);
116116
}
117117
then action delivery {
118118
in ref response : Deliver;

sysml/src/examples/Interaction Sequencing Examples/ServerSequenceRealization-2.sysml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package ServerSequenceRealization_2 {
1616
port publicationPort : ~PublicationPort;
1717

1818
perform action producerBehavior {
19-
action publish send Publish(someTopic, somePublication) via publicationPort;
19+
action publish send new Publish(someTopic, somePublication) via publicationPort;
2020
}
2121
}
2222

@@ -40,7 +40,7 @@ package ServerSequenceRealization_2 {
4040
first waitForPublication
4141
accept pub : Publish via publicationPort
4242
if pub.topic == subscribing.sub.topic
43-
do send Deliver(pub.publication) to subscribing.sub.subscriber
43+
do send new Deliver(pub.publication) to subscribing.sub.subscriber
4444
then waitForPublication;
4545
}
4646
}
@@ -53,7 +53,7 @@ package ServerSequenceRealization_2 {
5353
port subscriptionPort : ~SubscriptionPort;
5454

5555
perform action consumerBehavior {
56-
action subscribe send Subscribe(myTopic, consumer_2) to server_2;
56+
action subscribe send new Subscribe(myTopic, consumer_2) to server_2;
5757
then action delivery accept Deliver via consumer_2;
5858
}
5959
}

0 commit comments

Comments
 (0)