Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
E
EMAM2Middleware
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
monticore
EmbeddedMontiArc
generators
EMAM2Middleware
Commits
fff4f399
Commit
fff4f399
authored
Apr 02, 2018
by
Alexander David Hellwig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Model: added Rectangle struct
parent
4c88328a
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
93 additions
and
38 deletions
+93
-38
src/test/resources/ba/System.emam
src/test/resources/ba/System.emam
+2
-1
src/test/resources/ba/collisionDetection/CollisionDetectionGeneric.emam
...rces/ba/collisionDetection/CollisionDetectionGeneric.emam
+4
-3
src/test/resources/ba/struct/Point.struct
src/test/resources/ba/struct/Point.struct
+6
-0
src/test/resources/ba/struct/RectToPoints.emam
src/test/resources/ba/struct/RectToPoints.emam
+13
-0
src/test/resources/ba/struct/Rectangle.struct
src/test/resources/ba/struct/Rectangle.struct
+8
-0
src/test/resources/ba/util/PointsToLine.emam
src/test/resources/ba/util/PointsToLine.emam
+15
-0
src/test/resources/ba/util/RectIntersection.emam
src/test/resources/ba/util/RectIntersection.emam
+3
-3
src/test/resources/ba/util/RectToLines.emam
src/test/resources/ba/util/RectToLines.emam
+21
-31
src/test/resources/ba/util/SingleSetCompareRectangle.emam
src/test/resources/ba/util/SingleSetCompareRectangle.emam
+21
-0
No files found.
src/test/resources/ba/System.emam
View file @
fff4f399
...
...
@@ -4,6 +4,7 @@ import ba.util.RelToAbsTrajectory;
import
ba
.
util
.
CommQuality
;
import
ba
.
vehicle
.
VelocityController
;
import
ba
.
collisionDetection
.
CollisionDetectionGeneric
;
import
ba
.
struct
.
Rectangle
;
//
component
System
<
N1
n
=
2
,
N1
x
=
1
,
N1
m
=
5
,
N1
m1
=
4
,
N1
m2
=
10
>{
component
System
{
//
Intersection
ports
...
...
@@ -12,7 +13,7 @@ component System{
in
Q
^{
3
,
5
}
absTrajectory
[
2
];
//
Collision
detection
ports
ports
in
Q
(
0
m
:
10000000
m
)^{
2
,
4
}
hullsIn
[
2
],
ports
in
Rectangle
hullsIn
[
2
],
out
B
collisionOut
;
//
Vehicle
ports
...
...
src/test/resources/ba/collisionDetection/CollisionDetectionGeneric.emam
View file @
fff4f399
package
ba
.
collisionDetection
;
import
ba
.
util
.
RectIntersection
;
import
ba
.
util
.
SingleSetCompare
Matrix
;
import
ba
.
util
.
SingleSetCompare
Rectangle
;
import
ba
.
util
.
MultiOr
;
import
ba
.
struct
.
Rectangle
;
component
CollisionDetectionGeneric
<
N1
n
=
2
,
N1
x
=
1
>{
//
component
CollisionDetection
{
ports
in
Q
^{
2
,
4
}
hulls
[
n
],
ports
in
Rectangle
hulls
[
n
],
out
B
collision
;
instance
SingleSetCompare
Matrix
<
2
,
4
,
2
,
1
>
singleSetCompare
;
instance
SingleSetCompare
Rectangle
<
2
,
1
>
singleSetCompare
;
instance
RectIntersection
rectIntersection
[
x
];
instance
MultiOr
<
1
>
multiOr
;
...
...
src/test/resources/ba/struct/Point.struct
0 → 100644
View file @
fff4f399
package
ba
.
struct
;
struct
Point
{
Q
posX
;
Q
posY
;
}
\ No newline at end of file
src/test/resources/ba/struct/RectToPoints.emam
0 → 100644
View file @
fff4f399
package
ba
.
struct
;
component
RectToPoints
{
ports
in
Rectangle
rect
,
out
Point
points
[
4
];
implementation
Math
{
points
(
1
)
=
rect
.
pointA
;
points
(
2
)
=
rect
.
pointB
;
points
(
3
)
=
rect
.
pointC
;
points
(
4
)
=
rect
.
pointD
;
}
}
\ No newline at end of file
src/test/resources/ba/struct/Rectangle.struct
View file @
fff4f399
package
ba
.
struct
;
struct
Rectangle
{
Point
pointA
;
Point
pointB
;
Point
pointC
;
Point
pointD
;
}
\ No newline at end of file
src/test/resources/ba/util/PointsToLine.emam
0 → 100644
View file @
fff4f399
package
ba
.
util
;
import
ba
.
struct
.
Point
;
component
PointsToLine
{
ports
in
Point
pointA
,
in
Point
pointB
,
out
Q
^{
4
,
1
}
line
;
implementation
Math
{
line
(
1
,
1
)
=
pointA
.
posX
;
line
(
2
,
1
)
=
pointA
.
posY
;
line
(
3
,
1
)
=
pointB
.
posX
;
line
(
4
,
1
)
=
pointB
.
posY
;
}
}
\ No newline at end of file
src/test/resources/ba/util/RectIntersection.emam
View file @
fff4f399
package
ba
.
util
;
import
ba
.
struct
.
Rectangle
;
component
RectIntersection
{
//
TODO
:
make
rect
type
clearer
.
Current
:
4
points
going
clockwise
around
the
rect
ports
in
Q
^{
2
,
4
}
rect1
,
in
Q
^{
2
,
4
}
rect2
,
ports
in
Rectangle
rect1
,
in
Rectangle
rect2
,
out
B
collision
;
//
check
intersection
of
4
*
4
lines
w
/
o
permutations
...
...
src/test/resources/ba/util/RectToLines.emam
View file @
fff4f399
package
ba
.
util
;
import
ba
.
struct
.
Rectangle
;
import
ba
.
struct
.
RectToPoints
;
component
RectToLines
{
ports
in
Q
^{
2
,
4
}
rect
,
ports
in
Rectangle
rect
,
out
Q
^{
4
,
1
}
lines
[
4
];
implementation
Math
{
Q
^{
4
,
1
}
tmpLine
;
for
i
=
1
:
4
Z
j
;
if
i
==
4
j
=
1
;
else
j
=
i
+
1
;
end
//
x1
,
y1
,
x2
,
y2
tmpLine
(
1
,
1
)
=
rect
(
1
,
i
);
tmpLine
(
2
,
1
)
=
rect
(
2
,
i
);
tmpLine
(
3
,
1
)
=
rect
(
1
,
j
);
tmpLine
(
4
,
1
)
=
rect
(
2
,
j
);
lines
(
i
)
=
tmpLine
;
//
TODO
:
as
array
once
issue
is
resolved
//
if
i
==
1
//
lineA
=
tmpLine
;
//
elseif
i
==
2
//
lineB
=
tmpLine
;
//
elseif
i
==
3
//
lineC
=
tmpLine
;
//
elseif
i
==
4
//
lineD
=
tmpLine
;
//
end
end
}
instance
RectToPoints
rectToPoints
;
instance
PointsToLine
pointsToLine
[
4
];
connect
rect
->
rectToPoints
.
rect
;
connect
rectToPoints
.
points
[
1
]
->
pointsToLine
[
1
].
pointA
;
connect
rectToPoints
.
points
[
2
]
->
pointsToLine
[
1
].
pointB
;
connect
rectToPoints
.
points
[
2
]
->
pointsToLine
[
2
].
pointA
;
connect
rectToPoints
.
points
[
3
]
->
pointsToLine
[
2
].
pointB
;
connect
rectToPoints
.
points
[
3
]
->
pointsToLine
[
3
].
pointA
;
connect
rectToPoints
.
points
[
4
]
->
pointsToLine
[
3
].
pointB
;
connect
rectToPoints
.
points
[
4
]
->
pointsToLine
[
4
].
pointA
;
connect
rectToPoints
.
points
[
1
]
->
pointsToLine
[
4
].
pointB
;
connect
pointsToLine
[:].
line
->
lines
[:];
}
\ No newline at end of file
src/test/resources/ba/util/SingleSetCompareRectangle.emam
0 → 100644
View file @
fff4f399
package
ba
.
util
;
import
ba
.
struct
.
Rectangle
;
//
TODO
:
x
has
to
be
(
n
-
1
)
n
/
2
//
TODO
:
EMAM2Cpp
does
not
work
with
struct
generics
component
SingleSetCompareRectangle
<
N1
n
=
2
,
N1
x
=
1
>{
ports
in
Rectangle
setIn
[
n
],
out
Rectangle
outA
[
x
],
out
Rectangle
outB
[
x
];
implementation
Math
{
Z
counter
=
1
;
for
i
=
1
:
n
for
j
=
(
i
+
1
):
n
outA
(
counter
)
=
setIn
(
i
);
outB
(
counter
)
=
setIn
(
j
);
counter
=
counter
+
1
;
end
end
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment