Commit bbd65fa2 authored by Alexander David Hellwig's avatar Alexander David Hellwig
Browse files

Moved getRosType from RosConnectionSymbol -> String and removed unnecessary dependencies

parent 11d46fba
......@@ -21,10 +21,10 @@
<mc.grammars.assembly.version>0.0.6-SNAPSHOT</mc.grammars.assembly.version>
<SIUnit.version>0.0.10-SNAPSHOT</SIUnit.version>
<Common-MontiCar.version>0.0.10-SNAPSHOT</Common-MontiCar.version>
<Embedded-MontiArc.version>0.0.11c-SNAPSHOT</Embedded-MontiArc.version>
<Embedded-MontiArc.version>0.0.11-SNAPSHOT</Embedded-MontiArc.version>
<Embedded-MontiArc-Behaviour.version>0.0.11-SNAPSHOT</Embedded-MontiArc-Behaviour.version>
<Math.version>0.0.11-SNAPSHOT</Math.version>
<Embedded-MontiArc-Math.version>0.0.11c-SNAPSHOT</Embedded-MontiArc-Math.version>
<Embedded-MontiArc-Math.version>0.0.11-SNAPSHOT</Embedded-MontiArc-Math.version>
<tagging.version>0.0.1</tagging.version>
<!-- .. Libraries .................................................. -->
<guava.version>18.0</guava.version>
......
package de.monticore.lang.monticar.generator.rosmsg;
import de.monticore.lang.embeddedmontiarc.tagging.RosConnectionSymbol;
import de.monticore.lang.monticar.ts.MCASTTypeSymbol;
import de.monticore.lang.monticar.ts.MCTypeSymbol;
import de.monticore.lang.monticar.ts.references.MCTypeReference;
......@@ -26,16 +25,16 @@ public class GeneratorRosMsg {
return files;
}
public RosConnectionSymbol getRosTopic(MCTypeReference<? extends MCTypeSymbol> typeReference){
public String getRosType(MCTypeReference<? extends MCTypeSymbol> typeReference){
MCTypeSymbol type = typeReference.getReferencedSymbol();
if(type.isKindOf(MCASTTypeSymbol.KIND)){
MCASTTypeSymbol mcastTypeSymbol = (MCASTTypeSymbol) type;
if(mcastTypeSymbol.getName().equals("Q")){
return new RosConnectionSymbol("","std_msgs/Float64");
return "std_msgs/Float64";
}else if(mcastTypeSymbol.getName().equals("Z")){
return new RosConnectionSymbol("","std_msgs/Int32");
return "std_msgs/Int32";
}else if(mcastTypeSymbol.getName().equals("B")){
return new RosConnectionSymbol("","std_msgs/Bool");
return "std_msgs/Bool";
}else{
Log.error("Case not handled! MCASTTypeSymbol " + mcastTypeSymbol.getName());
}
......
......@@ -26,9 +26,9 @@ public class BasicTypesTest extends AbstractSymtabTest {
assertNotNull(inZ);
assertNotNull(inB);
assertEquals(generatorRosMsg.getRosTopic(inQ.getTypeReference()).getTopicType(),"std_msgs/Float64");
assertEquals(generatorRosMsg.getRosTopic(inZ.getTypeReference()).getTopicType(),"std_msgs/Int32");
assertEquals(generatorRosMsg.getRosTopic(inB.getTypeReference()).getTopicType(),"std_msgs/Bool");
assertEquals(generatorRosMsg.getRosType(inQ.getTypeReference()),"std_msgs/Float64");
assertEquals(generatorRosMsg.getRosType(inZ.getTypeReference()),"std_msgs/Int32");
assertEquals(generatorRosMsg.getRosType(inB.getTypeReference()),"std_msgs/Bool");
}
......
Supports Markdown
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