Skip to content

Commit

Permalink
support !XXX in readFichiersDe API, to exclude RESULT FILE from input
Browse files Browse the repository at this point in the history
  • Loading branch information
richetyann authored Oct 26, 2023
1 parent bee7f6d commit 57bd211
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
20 changes: 15 additions & 5 deletions src/main/java/org/funz/Telemac/TelemacHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,21 @@ public static String[] readFichiersDe(File cas, String what) {
continue;
}

if ((lines[i].trim().contains(fichier_de_title) || lines[i].trim().contains(file_title)) && lines[i].trim().contains(what)) {
if (lines[i].trim().endsWith("=")) {
fde.add(lines[i + 1].replace("'", "").trim());
} else {
fde.add(Parser.after(lines[i], "=").replace("'", "").trim());
if (lines[i].trim().contains(fichier_de_title) || lines[i].trim().contains(file_title)) {
if (what.length>0 && what.charAt(0)=='!') { // support negative 'what'
if (!lines[i].trim().contains(what.substring(1))) {
if (lines[i].trim().endsWith("=")) {
fde.add(lines[i + 1].replace("'", "").trim());
} else {
fde.add(Parser.after(lines[i], "=").replace("'", "").trim());
}
}
} else if (lines[i].trim().contains(what)) {
if (lines[i].trim().endsWith("=")) {
fde.add(lines[i + 1].replace("'", "").trim());
} else {
fde.add(Parser.after(lines[i], "=").replace("'", "").trim());
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/funz/Telemac/TelemacIOPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public LinkedList<File> getRelatedFiles(File cas) {
if (file.isFile() && file.getName().endsWith(".poi"))
toimport.add(file);
}
String[] deps = TelemacHelper.readFichiersDe(cas, ""); // get any possible deps
String[] deps = TelemacHelper.readFichiersDe(cas, "!RESULT"); // get any possible deps but results
for (String d : deps) {
//System.err.println("? "+d);
File f = new File(cas.getAbsoluteFile().getParentFile(),d);
Expand Down

0 comments on commit 57bd211

Please sign in to comment.