Commit d665c72f authored by Georg Vinogradov's avatar Georg Vinogradov
Browse files

Small name adjustments

parent 2c24c072
Pipeline #158265 passed with stages
in 3 minutes and 25 seconds
...@@ -20,15 +20,10 @@ public class GeneratorMqtt ...@@ -20,15 +20,10 @@ public class GeneratorMqtt
List<File> files = new ArrayList<>(); List<File> files = new ArrayList<>();
List<String> contents = new ArrayList<String>(); List<String> contents = new ArrayList<String>();
List<FileWriter> frs = new ArrayList<FileWriter>(); List<FileWriter> frs = new ArrayList<FileWriter>();
// Get info about the ports from the component
Collection<EMAPortInstanceSymbol> ports = component.getPortInstanceList();
// Create and fill model // Create and fill model
MqttAdapterModel model = new MqttAdapterModel(component.getFullName()); MqttAdapterModel model = new MqttAdapterModel(component.getFullName());
model.addPorts(ports);
//Generate files and write to project //Generate files and write to project
contents.add(MqttTemplates.generateMqttAdapterH(model)); contents.add(MqttTemplates.generateMqttAdapterH(model));
files.add(new File("./target/generated-sources/MqttAdapter_"+model.getEscapedCompName()+".h")); files.add(new File("./target/generated-sources/MqttAdapter_"+model.getEscapedCompName()+".h"));
...@@ -103,7 +98,7 @@ public class GeneratorMqtt ...@@ -103,7 +98,7 @@ public class GeneratorMqtt
// Create and fill model // Create and fill model
MqttAdapterModel model = new MqttAdapterModel(component.getFullName()); MqttAdapterModel model = new MqttAdapterModel(component.getFullName());
model.addPorts(ports); model.addPortsDesc(ports);
//Generate files and write to project //Generate files and write to project
String content = MqttTemplates.generatePrettyPrint(model); String content = MqttTemplates.generatePrettyPrint(model);
......
...@@ -33,7 +33,7 @@ public class MqttAdapterModel { ...@@ -33,7 +33,7 @@ public class MqttAdapterModel {
} }
// Parse through component to find information about its ports // Parse through component to find information about its ports
public void addPorts(Collection<EMAPortInstanceSymbol> ports) public void addPortsDesc(Collection<EMAPortInstanceSymbol> ports)
{ {
for (EMAPortInstanceSymbol port : ports) for (EMAPortInstanceSymbol port : ports)
{ {
...@@ -51,7 +51,7 @@ public class MqttAdapterModel { ...@@ -51,7 +51,7 @@ public class MqttAdapterModel {
} }
} }
public List<String> getPorts() public List<String> getPortsDesc()
{ {
return this.ports; return this.ports;
} }
......
...@@ -14,7 +14,7 @@ import de.se_rwth.commons.logging.Log; ...@@ -14,7 +14,7 @@ import de.se_rwth.commons.logging.Log;
public class MqttTemplates { public class MqttTemplates {
private static final Template PrettyPrint; private static final Template MQTT_PRETTYPRINT;
private static final Template MQTT_CMAKELISTS; private static final Template MQTT_CMAKELISTS;
private static final Template MQTT_ADAPTER_H; private static final Template MQTT_ADAPTER_H;
private static final Template MQTT_ADAPTER_CPP; private static final Template MQTT_ADAPTER_CPP;
...@@ -29,7 +29,7 @@ public class MqttTemplates { ...@@ -29,7 +29,7 @@ public class MqttTemplates {
conf.setLogTemplateExceptions(false); conf.setLogTemplateExceptions(false);
conf.setClassForTemplateLoading(MqttTemplates.class, ""); conf.setClassForTemplateLoading(MqttTemplates.class, "");
try { try {
PrettyPrint = conf.getTemplate("PrettyPrint.ftl"); MQTT_PRETTYPRINT = conf.getTemplate("PrettyPrint.ftl");
MQTT_CMAKELISTS = conf.getTemplate("CMakeLists.ftl"); MQTT_CMAKELISTS = conf.getTemplate("CMakeLists.ftl");
MQTT_ADAPTER_H = conf.getTemplate("Adapter.h.ftl"); MQTT_ADAPTER_H = conf.getTemplate("Adapter.h.ftl");
MQTT_ADAPTER_CPP = conf.getTemplate("Adapter.cpp.ftl"); MQTT_ADAPTER_CPP = conf.getTemplate("Adapter.cpp.ftl");
...@@ -75,7 +75,7 @@ public class MqttTemplates { ...@@ -75,7 +75,7 @@ public class MqttTemplates {
public static String generatePrettyPrint(MqttAdapterModel model) { public static String generatePrettyPrint(MqttAdapterModel model) {
HashMap<String, Object> data = new HashMap<>(); HashMap<String, Object> data = new HashMap<>();
data.put("model", model); data.put("model", model);
return generate(PrettyPrint, data); return generate(MQTT_PRETTYPRINT, data);
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
......
...@@ -4,6 +4,6 @@ Component name: ${model.getCompName()} ...@@ -4,6 +4,6 @@ Component name: ${model.getCompName()}
Ports: Ports:
<#list model.getPorts() as gen> <#list model.getPortsDesc() as gen>
${gen} ${gen}
</#list> </#list>
\ 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