Commit ef09cbd1 authored by PONCELET's avatar PONCELET

Comment string loadable layers

parent 6712fd11
......@@ -2600,7 +2600,8 @@
"obligation": "M",
"comment": "Type of transmit pulse.",
"dims": [
"ping_timeDim"
"ping_timeDim",
"tx_beamDim"
],
"type": "transmit_t",
"attributes": [
......
......@@ -74,14 +74,22 @@ public class PredefinedLayersGenerator {
/** @return declaration code line **/
public String getDeclaration() {
String append="";
if(this.layerClass.contains("String")||this.layerClass.contains("VlenLoadableLayer") )
append="//";
return String.format(
"\n\t/** Layer: %s **/\n\tpublic static final PredefinedLayers<%s> %s = new PredefinedLayers<>(GROUP,\"%s\",\"%s\",\"%s\", DataKind.%s, %s::new);",
layerName, layerClass, layerName, name, longName, unit, datakind, layerClass);
"\n\t/** Layer: %s **/\n"
+ "\tpublic static final String %s_VARIABLE_NAME =\"%s\";\n"
+"\t"+append+"public static final PredefinedLayers<%s> %s = new PredefinedLayers<>(GROUP,\"%s\",\"%s\",\"%s\", DataKind.%s, %s::new);",
layerName, layerName,name, layerClass, layerName, name, longName, unit, datakind, layerClass);
}
/** @return required import code line **/
public String getImportLine() {
return String.format("import fr.ifremer.globe.model.sounderdatacontainer.layers.%s;", this.layerClass);
String code=String.format("import fr.ifremer.globe.model.sounderdatacontainer.layers.%s;", this.layerClass);
if(this.layerClass.contains("String") ||this.layerClass.contains("VlenLoadableLayer") )
return "//"+code;
return code;
}
......@@ -116,7 +124,7 @@ public class PredefinedLayersGenerator {
private void modelToSourceFiles(List<Group> groups, Path outputFolder) throws Exception {
//create layer objects
List<Layer> layers=new ArrayList<>();
String path="/root";
String path="";
groups.forEach(g-> {
try {
layers.addAll(parseGroup(g,path));
......@@ -320,7 +328,7 @@ public class PredefinedLayersGenerator {
//little hack while root group exist
relativePackage=relativePackage.replace("root.", "");
fileContent.add("package fr.ifremer.globe.model.sounderdatacontainer" + relativePackage + ";\n");
fileContent.add("package fr.ifremer.globe.model.sounderdatacontainer" + relativePackage.toLowerCase() + ";\n");
classToImport.forEach(importLine -> fileContent.add(importLine));
......
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