From 5de82f05a2275f7586a765863656a55807f10263 Mon Sep 17 00:00:00 2001 From: apvrille <ludovic.apvrille@eurecom.fr> Date: Thu, 15 Feb 2018 14:25:44 +0100 Subject: [PATCH] Diff on SpecConfig for better code generation --- doc/config_linux.xml | 1 + doc/config_macosx.xml | 1 + doc/config_windows.xml | 1 + src/main/java/common/SpecConfigTTool.java | 30 +++++++++++++------ .../JDialogLoadingNetworkModel.java | 2 ++ 5 files changed, 26 insertions(+), 9 deletions(-) diff --git a/doc/config_linux.xml b/doc/config_linux.xml index 018a7d853e..41256f6989 100755 --- a/doc/config_linux.xml +++ b/doc/config_linux.xml @@ -4,6 +4,7 @@ <DOTTYPath data="/bin/dotty" /> <DOTTYHost data="localhost" /> <FILEPath data="../modeling/" /> +<DownloadedFILEPath data="../modeling/" /> <LIBPath data="../lib" /> <IMGPath data="../figures" /> <LOTOSPath data="../lotos/" /> diff --git a/doc/config_macosx.xml b/doc/config_macosx.xml index 25aa742733..051791d18a 100755 --- a/doc/config_macosx.xml +++ b/doc/config_macosx.xml @@ -4,6 +4,7 @@ <DOTTYPath data="/bin/dotty" /> <DOTTYHost data="localhost" /> <FILEPath data="../modeling/" /> +<DownloadedFILEPath data="../modeling/" /> <LIBPath data="../lib" /> <IMGPath data="../figures" /> <LOTOSPath data="../lotos/" /> diff --git a/doc/config_windows.xml b/doc/config_windows.xml index 2e9af8b6b7..5b62ce8058 100755 --- a/doc/config_windows.xml +++ b/doc/config_windows.xml @@ -4,6 +4,7 @@ <DOTTYPath data="/bin/dotty" /> <DOTTYHost data="localhost" /> <FILEPath data="../modeling/" /> +<DownloadedFILEPath data="../modeling/" /> <LIBPath data="../lib" /> <IMGPath data="../figures" /> <LOTOSPath data="../lotos/" /> diff --git a/src/main/java/common/SpecConfigTTool.java b/src/main/java/common/SpecConfigTTool.java index e46d7b61b0..2287b901a2 100644 --- a/src/main/java/common/SpecConfigTTool.java +++ b/src/main/java/common/SpecConfigTTool.java @@ -61,6 +61,10 @@ import java.io.IOException; * @version 1.0 */ public class SpecConfigTTool { + + public static String DEFAULT_CONFIG = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n\n<PROJECTCONFIGURATION>\n<LastVCD data=\"\"/>\n<LastOpenDiagram tab=\"0\" panel=\"0\"/>\n</PROJECTCONFIGURATION>\n"; + + public static String SystemCCodeDirectory = ""; public static String SystemCCodeCompileCommand = ""; public static String SystemCCodeExecuteCommand = ""; @@ -168,12 +172,12 @@ public class SpecConfigTTool { VCDPath = dir.getAbsolutePath() + ProjectVCDDirectory; NCDirectory = dir.getAbsolutePath() + ProjectNCDirectory; - TraceManager.addDev("Before replace SystemCCodeCompileCommand:" + SystemCCodeCompileCommand + " with " + ConfigurationTTool.SystemCCodeDirectory + - " to " + SystemCCodeDirectory); + //TraceManager.addDev("Before replace SystemCCodeCompileCommand:" + SystemCCodeCompileCommand + " with " + ConfigurationTTool.SystemCCodeDirectory + + // " to " + SystemCCodeDirectory); SystemCCodeCompileCommand = ConfigurationTTool.SystemCCodeCompileCommand.replace( ConfigurationTTool.SystemCCodeDirectory, SystemCCodeDirectory); - TraceManager.addDev("After replace SystemCCodeCompileCommand:" + SystemCCodeCompileCommand); + //TraceManager.addDev("After replace SystemCCodeCompileCommand:" + SystemCCodeCompileCommand); SystemCCodeExecuteCommand = ConfigurationTTool.SystemCCodeExecuteCommand.replace(ConfigurationTTool.SystemCCodeDirectory, SystemCCodeDirectory); SystemCCodeInteractiveExecuteCommand = ConfigurationTTool.SystemCCodeInteractiveExecuteCommand.replace(ConfigurationTTool.SystemCCodeDirectory, SystemCCodeDirectory); @@ -207,7 +211,15 @@ public class SpecConfigTTool { TGraph.mkdir(); } - File test = new File("./"); + File projectConfig = new File(dir + File.separator + "project_config.xml"); + try { + FileUtils.saveFile(projectConfig, DEFAULT_CONFIG); + return projectConfig; + } catch (Exception e) { + System.err.println(e.getMessage()); + } + + /*File test = new File("./"); File base; if (test.getAbsolutePath().contains("TTool/bin/")) base = new File("../ttool/project_config.xml"); @@ -218,19 +230,19 @@ public class SpecConfigTTool { return new File(dir + File.separator + "project_config.xml"); } catch (IOException e) { System.err.println(e.getMessage()); - } + }*/ return null; } public static void loadConfigFile(File f) throws MalformedConfigurationException { if (!FileUtils.checkFileForOpen(f)) { - throw new MalformedConfigurationException("Filepb"); + throw new MalformedConfigurationException("Filepb 1"); } String data = FileUtils.loadFileData(f); if (data == null) { - throw new MalformedConfigurationException("Filepb"); + throw new MalformedConfigurationException("Filepb 2"); } loadConfigurationFromXML(data); @@ -286,13 +298,13 @@ public class SpecConfigTTool { boolean write = false; if (!FileUtils.checkFileForOpen(f)) { - throw new MalformedConfigurationException("Filepb"); + throw new MalformedConfigurationException("Filepb 3"); } String data = FileUtils.loadFileData(f); if (data == null) { - throw new MalformedConfigurationException("Filepb"); + throw new MalformedConfigurationException("Filepb 4"); } index0 = data.indexOf("LastVCD"); diff --git a/src/main/java/ui/networkmodelloader/JDialogLoadingNetworkModel.java b/src/main/java/ui/networkmodelloader/JDialogLoadingNetworkModel.java index fea1d4ee98..287d223eb5 100644 --- a/src/main/java/ui/networkmodelloader/JDialogLoadingNetworkModel.java +++ b/src/main/java/ui/networkmodelloader/JDialogLoadingNetworkModel.java @@ -249,6 +249,8 @@ public class JDialogLoadingNetworkModel extends javax.swing.JFrame implements Ac // Loading main file describing models, giving information on this, and filling the array of models // Accessing the main file try { + + int delay = 10000; //milliseconds ActionListener taskPerformer = new ActionListener() { public void actionPerformed(ActionEvent evt) { -- GitLab