Commit 2895044a authored by Sascha Niklas Schneiders's avatar Sascha Niklas Schneiders
Browse files

added component reporting to generator fixed some model errors

parent 69c89c01
......@@ -39,7 +39,7 @@ public final class TestsGeneratorCPP {
private Set<String> testedComponents;
private List<FileContent> files;
private TestsMainEntryViewModel viewModelForMain;
public static Set<ComponentSymbol> availableComponents;
public static Set<String> availableComponents;
TestsGeneratorCPP(GeneratorCPP generator) {
this.generator = Log.errorIfNull(generator);
......@@ -93,8 +93,8 @@ public final class TestsGeneratorCPP {
private String getExistingComponentNames() {
String result = "Components:\n";
for (ComponentSymbol cs : availableComponents) {
result += " " + cs.getFullName() + "\n";
for (String s : availableComponents) {
result += " " + s + "\n";
}
return result;
}
......
......@@ -13,8 +13,8 @@ public class SimulatorTSTest extends AbstractSymtab{
@Test
public void resolveModelDoorStatus() {
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources/simulator-ts/visualization");
ExpandedComponentInstanceSymbol instanceSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("doors.doorStatus",
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources");
ExpandedComponentInstanceSymbol instanceSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("simulatorts.visualization.doors.doorStatus",
ExpandedComponentInstanceSymbol.KIND).orElse(null);
Assert.assertNotNull(instanceSymbol);
......@@ -22,8 +22,8 @@ public class SimulatorTSTest extends AbstractSymtab{
@Test
public void resolveModelGameOverTrigger() {
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources/simulator-ts/visualization");
ExpandedComponentInstanceSymbol instanceSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("feature.gameOverTrigger",
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources");
ExpandedComponentInstanceSymbol instanceSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("simulatorts.visualization.feature.gameOverTrigger",
ExpandedComponentInstanceSymbol.KIND).orElse(null);
Assert.assertNotNull(instanceSymbol);
......@@ -31,8 +31,8 @@ public class SimulatorTSTest extends AbstractSymtab{
@Test
public void resolveModelBrakeLightsControl() {
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources/simulator-ts/visualization");
ExpandedComponentInstanceSymbol instanceSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("lights.brakeLightsControl",
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources");
ExpandedComponentInstanceSymbol instanceSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("simulatorts.visualization.lights.brakeLightsControl",
ExpandedComponentInstanceSymbol.KIND).orElse(null);
Assert.assertNotNull(instanceSymbol);
......@@ -40,8 +40,8 @@ public class SimulatorTSTest extends AbstractSymtab{
@Test
public void resolveModelIndicatorStatus() {
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources/simulator-ts/visualization");
ExpandedComponentInstanceSymbol instanceSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("lights.indicatorStatus",
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources");
ExpandedComponentInstanceSymbol instanceSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("simulatorts.visualization.lights.indicatorStatus",
ExpandedComponentInstanceSymbol.KIND).orElse(null);
Assert.assertNotNull(instanceSymbol);
......@@ -49,8 +49,8 @@ public class SimulatorTSTest extends AbstractSymtab{
@Test
public void resolveModelsLightTimer() {
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources/simulator-ts/visualization");
ExpandedComponentInstanceSymbol instanceSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("lights.lightTimer",
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources");
ExpandedComponentInstanceSymbol instanceSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("simulatorts.visualization.lights.lightTimer",
ExpandedComponentInstanceSymbol.KIND).orElse(null);
Assert.assertNotNull(instanceSymbol);
......@@ -60,8 +60,8 @@ public class SimulatorTSTest extends AbstractSymtab{
@Ignore
@Test
public void resolveModel() {
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources/simulator-ts/visualization");
ExpandedComponentInstanceSymbol instanceSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("main.sDCS",
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources");
ExpandedComponentInstanceSymbol instanceSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("simulatorts.visualization.main.sDCS",
ExpandedComponentInstanceSymbol.KIND).orElse(null);
Assert.assertNotNull(instanceSymbol);
......@@ -69,8 +69,8 @@ public class SimulatorTSTest extends AbstractSymtab{
@Test
public void resolveModelsConstantVelocity() {
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources/simulator-ts/visualization");
ExpandedComponentInstanceSymbol instanceSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("movement.constantVelocity",
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources");
ExpandedComponentInstanceSymbol instanceSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("simulatorts.visualization.movement.constantVelocity",
ExpandedComponentInstanceSymbol.KIND).orElse(null);
Assert.assertNotNull(instanceSymbol);
......@@ -80,8 +80,8 @@ public class SimulatorTSTest extends AbstractSymtab{
@Ignore
@Test
public void resolveModelsSteeringControl() {
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources/simulator-ts/visualization");
ExpandedComponentInstanceSymbol instanceSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("movement.steeringControl",
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources");
ExpandedComponentInstanceSymbol instanceSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("simulatorts.visualization.movement.steeringControl",
ExpandedComponentInstanceSymbol.KIND).orElse(null);
Assert.assertNotNull(instanceSymbol);
......
......@@ -32,6 +32,6 @@ public class TestsGenTest extends AbstractSymtabTest {
generatorCPP.setGenerationTargetPath("./target/generated-sources-cpp/MySuperAwesomeComponent1/");
generatorCPP.setCheckModelDir(true);
List<File> files = generatorCPP.generateFiles(symTab, componentSymbol, symTab);
assertEquals(16, files.size());
assertEquals(17, files.size());
}
}
......@@ -11,7 +11,7 @@ component Distronic_Enabled {
out (-oo:d:oo) BrakeForce_Distronic_pc,
out (-oo:d:oo) Decelerator_pc;
instance SwitchMultiport3<(-oo:d:oo)> switch1;
instance SwitchMultiport<(-oo:d:oo)> switch1;
instance SwitchB<(-oo:d:oo)> switch2;
instance Multiplication<(-oo:d:oo)> mult1, mult2, mult3;
instance PlusMinusPlus<(-oo:d:oo)> pmp1;
......
......@@ -21,7 +21,7 @@ component CC_SetValue {
instance GreaterEquals<(-oo:d:oo)> greaterEq;
instance And and1, and2;
instance And3 and3;
instance And<3> and3;
instance Or<(-oo:d:oo)> or1;
instance Not<B> not1, not2, not3, not4;
instance SwitchB<(-oo:d:oo)> switch1, switch2;
......
......@@ -21,7 +21,7 @@ component CC_SetValue_edited {
instance GreaterEquals<(-oo:d:oo)> greaterEq;
instance And and1, and2;
instance And3 and3;
instance And<3> and3;
instance Or<(-oo:d:oo)> or1;
instance Not<B> not1, not2, not3, not4;
instance SwitchB<(-oo:d:oo)> switch1, switch2;
......
......@@ -19,8 +19,8 @@ component CC_ChangeSetValue_Lvl2_Repeater {
instance Equals<(-oo:d:oo)> eq1, eq2, eq3, eq4;
instance Or4<B> or;
instance Or3<B> or2;
instance Or<B,4> or;
instance Or<B,3> or2;
instance Not<B> not1, not2;
instance Memory<B>(0) mem1;
instance CountDown cDown;
......
......@@ -19,7 +19,7 @@ component V_SetValue_MinusLvl2 {
//Tag auf >=20 setzen
instance SwitchM<(-oo:d:oo)> switch4;
//Tag auf !=0 setzen
instance SwitchM2<(-oo:d:oo)> switch5;
instance SwitchM<(-oo:d:oo)> switch5;
instance Mod<(-oo:d:oo)> mod1;
connect trigger -> greater1.in1, switch1.in1;
......
......@@ -19,7 +19,7 @@ component V_SetValueMinusLvl2 {
//Tag auf >=20 setzen
instance SwitchM<(-oo:d:oo)> switch4;
//Tag auf !=0 setzen
instance SwitchM2<(-oo:d:oo)> switch5;
instance SwitchM<(-oo:d:oo)> switch5;
instance Mod<(-oo:d:oo)> mod1;
connect trigger -> greater1.in1, switch1.in1;
......
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