Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
EMAM2Middleware
Commits
e3dae7d8
Commit
e3dae7d8
authored
Feb 16, 2018
by
Alexander David Hellwig
Browse files
Changed SimpleDist.tag to use new Syntax: simple RosConnection tag
parent
de3f01f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/generator/master/DistributedTargetGenerator.java
View file @
e3dae7d8
...
...
@@ -81,9 +81,11 @@ public class DistributedTargetGenerator extends CMakeMasterGenerator {
if
(
Objects
.
equals
(
connectorSymbol
.
getSourcePort
().
getComponentInstance
().
orElse
(
null
),
componentInstanceSymbol
))
{
//In port of supercomp
inferRosConnectionIfPossible
(
connectorSymbol
.
getSourcePort
(),
connectorSymbol
.
getTargetPort
());
generateRosConnectionIfPossible
(
connectorSymbol
);
}
else
if
(
Objects
.
equals
(
connectorSymbol
.
getTargetPort
().
getComponentInstance
().
orElse
(
null
),
componentInstanceSymbol
))
{
//out port of supercomp
inferRosConnectionIfPossible
(
connectorSymbol
.
getTargetPort
(),
connectorSymbol
.
getSourcePort
());
generateRosConnectionIfPossible
(
connectorSymbol
);
}
else
{
//In between subcomps
generateRosConnectionIfPossible
(
connectorSymbol
);
...
...
src/test/resources/tests/dist/DistComp.emam
View file @
e3dae7d8
package
tests
.
dist
;
component
DistComp
{
port
out
Q
resOut
;
component
SubComp1
{
ports
out
Q
out1
,
out
Q
out2
;
implementation
Math
{
out1
=
out1
+
1
;
out2
=
out2
+
2
;
}
}
component
SubComp2
{
ports
in
Q
in1
,
in
Q
in2
;
in
Q
in2
,
out
Q
resOut
;
implementation
Math
{
resOut
=
in1
+
in2
;
}
}
instance
SubComp1
sub1
;
...
...
@@ -16,4 +29,5 @@ component DistComp{
connect
sub1
.
out1
->
sub2
.
in1
;
connect
sub1
.
out2
->
sub2
.
in2
;
connect
sub2
.
resOut
->
resOut
;
}
\ No newline at end of file
src/test/resources/tests/dist/SimpleDist.tag
View file @
e3dae7d8
...
...
@@ -2,8 +2,10 @@ package tests.dist;
conforms
to
de
.
monticore
.
lang
.
monticar
.
generator
.
roscpp
.
RosToEmamTagSchema
;
tags
SimpleDist
{
tag
distComp
.
sub1
.
out1
with
RosConnection
=
{
topic
=
(
topicIn1
,
std_msgs
/
Float64
),
msgField
=
data
};
tag
distComp
.
sub1
.
out2
with
RosConnection
=
{
topic
=
(
topicIn2
,
std_msgs
/
Float64
),
msgField
=
data
};
tag
distComp
.
sub2
.
in1
with
RosConnection
=
{
topic
=
(
topicIn1
,
std_msgs
/
Float64
),
msgField
=
data
};
tag
distComp
.
sub2
.
in2
with
RosConnection
=
{
topic
=
(
topicIn2
,
std_msgs
/
Float64
),
msgField
=
data
};
tag
distComp
.
sub1
.
out1
with
RosConnection
;
tag
distComp
.
sub1
.
out2
with
RosConnection
;
tag
distComp
.
sub2
.
in1
with
RosConnection
;
tag
distComp
.
sub2
.
in2
with
RosConnection
;
tag
distComp
.
sub2
.
resOut
with
RosConnection
;
tag
distComp
.
resOut
with
RosConnection
;
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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