Added test: 2 dimensional Matrices

parent ca55f31b
......@@ -262,4 +262,25 @@ public class GenerationTest extends AbstractSymtabTest {
middlewareGenerator.generate(componentInstanceSymbol, taggingResolver);
}
@Test
public void testTwoDimMatrix() throws IOException {
TaggingResolver taggingResolver = createSymTabAndTaggingResolver("src/test/resources/");
//register the middleware tag types
RosToEmamTagSchema.registerTagTypes(taggingResolver);
ExpandedComponentInstanceSymbol componentInstanceSymbol = taggingResolver.<ExpandedComponentInstanceSymbol>resolve("tests.matrix.twoDimMatrixComp", ExpandedComponentInstanceSymbol.KIND).orElse(null);
assertNotNull(componentInstanceSymbol);
//make sure the middleware tags are loaded
TagHelper.resolveTags(taggingResolver, componentInstanceSymbol);
MiddlewareGenerator middlewareGenerator = new MiddlewareGenerator();
middlewareGenerator.setGenerationTargetPath("./target/generated-sources-cmake/twoDimMatrixComp/src/");
//generator for component itself
middlewareGenerator.add(new CPPGenImpl(), "cpp");
//generator for the ros connection
middlewareGenerator.add(new RosCppGenImpl(), "roscpp");
middlewareGenerator.generate(componentInstanceSymbol, taggingResolver);
}
}
package tests.matrix;
component TwoDimMatrixComp{
ports in Q^{3,224} in1,
in Z^{3,224} in2,
//in B^{3,224} in3,
out Q^{3,224} out1,
out Z^{3,224} out2;
//out B^{3,224} out3;
}
\ No newline at end of file
package tests.matrix;
conforms to de.monticore.lang.monticar.generator.roscpp.RosToEmamTagSchema;
tags TwoDimMatrixComp{
tag twoDimMatrixComp.in1 with RosConnection = {topic=(/topicName1,std_msgs/Float64MultiArray)};
tag twoDimMatrixComp.in2 with RosConnection = {topic=(/topicName2,std_msgs/Int32MultiArray)};
//tag twoDimMatrixComp.in3 with RosConnection = {topic=(/topicName3,std_msgs/ByteMultiArray)};
tag twoDimMatrixComp.out1 with RosConnection = {topic=(/topicName4,std_msgs/Float64MultiArray)};
tag twoDimMatrixComp.out2 with RosConnection = {topic=(/topicName5,std_msgs/Int32MultiArray)};
//tag twoDimMatrixComp.out3 with RosConnection = {topic=(/topicName6,std_msgs/ByteMultiArray)};
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment