Commit 6e49e6ff authored by Fabien Tessier's avatar Fabien Tessier
Browse files

Config nc generation for .ttool project

parent e302c5ca
......@@ -56,6 +56,8 @@ public class SpecConfigTTool {
public static String VCDPath="";
public static String ExternalCommand1="";
public static String NCDirectory="";
private static String ProjectSystemCCodeDirectory = "/c++_code/";
private static String ProjectCCodeDirectory = "/c_code/";
......@@ -69,6 +71,7 @@ public class SpecConfigTTool {
private static String ProjectTGraphDirectory="/graphs";
private static String ProjectUPPAALCodeDirectory="/uppaal/";
private static String ProjectVCDDirectory="/c++_code/";
private static String ProjectNCDirectory="/nc/";
public static int lastPanel = -1;
public static int lastTab = -1;
......@@ -107,6 +110,8 @@ public class SpecConfigTTool {
VCDPath = ConfigurationTTool.VCDPath;
ExternalCommand1 = ConfigurationTTool.ExternalCommand1;
NCDirectory = ConfigurationTTool.NCDirectory;
}
public static void setDirConfig(File dir) {
......@@ -122,6 +127,7 @@ public class SpecConfigTTool {
TGraphPath = dir.getAbsolutePath() + ProjectTGraphDirectory;
UPPAALCodeDirectory = dir.getAbsolutePath() + ProjectUPPAALCodeDirectory;
VCDPath = dir.getAbsolutePath() + ProjectVCDDirectory;
NCDirectory = dir.getAbsolutePath() + ProjectNCDirectory;
SystemCCodeCompileCommand = ConfigurationTTool.SystemCCodeCompileCommand.replace(ConfigurationTTool.SystemCCodeDirectory, SystemCCodeDirectory);
SystemCCodeExecuteCommand = ConfigurationTTool.SystemCCodeExecuteCommand.replace(ConfigurationTTool.SystemCCodeDirectory, SystemCCodeDirectory);
......
......@@ -172,7 +172,8 @@ public class FileUtils extends org.apache.commons.io.FileUtils{
return false;
if (!s.equals(ConfigurationTTool.ProVerifCodeDirectory)) {
File readme = new File(ConfigurationTTool.ProVerifCodeDirectory + "README");
FileUtils.copyFileToDirectory(readme, f, false);
if (readme.exists())
FileUtils.copyFileToDirectory(readme, f, false);
}
return true;
}
......@@ -189,7 +190,8 @@ public class FileUtils extends org.apache.commons.io.FileUtils{
return false;
if (!s.equals(ConfigurationTTool.TMLCodeDirectory)) {
File readme = new File(ConfigurationTTool.TMLCodeDirectory + "README_TML");
FileUtils.copyFileToDirectory(readme, f, false);
if (readme.exists())
FileUtils.copyFileToDirectory(readme, f, false);
}
return true;
}
......@@ -206,7 +208,8 @@ public class FileUtils extends org.apache.commons.io.FileUtils{
return false;
if (!s.equals(ConfigurationTTool.CCodeDirectory)) {
File readme = new File(ConfigurationTTool.CCodeDirectory + "README");
FileUtils.copyFileToDirectory(readme, f, false);
if (readme.exists())
FileUtils.copyFileToDirectory(readme, f, false);
}
return true;
}
......@@ -223,7 +226,8 @@ public class FileUtils extends org.apache.commons.io.FileUtils{
return false;
if (!s.equals(ConfigurationTTool.UPPAALCodeDirectory)) {
File readme = new File(ConfigurationTTool.UPPAALCodeDirectory + "README");
FileUtils.copyFileToDirectory(readme, f, false);
if (readme.exists())
FileUtils.copyFileToDirectory(readme, f, false);
}
return true;
}
......
......@@ -8924,15 +8924,20 @@ public class GTURTLEModeling {
} else {
// Generate XML file
try {
if (SpecConfigTTool.NCDirectory != null) {
File dir = new File(SpecConfigTTool.NCDirectory);
if (!dir.exists())
dir.mkdirs();
}
String fileName = "network.xml";
if (ConfigurationTTool.NCDirectory != null) {
fileName = ConfigurationTTool.NCDirectory + fileName;
if (SpecConfigTTool.NCDirectory != null) {
fileName = SpecConfigTTool.NCDirectory + fileName;
}
TraceManager.addDev("Saving in network structure in file: " + fileName);
FileUtils.saveFile(fileName, ncs.toISAENetworkXML());
fileName = "traffics.xml";
if (ConfigurationTTool.NCDirectory != null) {
fileName = ConfigurationTTool.NCDirectory + fileName;
if (SpecConfigTTool.NCDirectory != null) {
fileName = SpecConfigTTool.NCDirectory + fileName;
}
TraceManager.addDev("Saving in traffics in file: " + fileName);
FileUtils.saveFile(fileName, ncs.toISAETrafficsXML());
......
......@@ -59,7 +59,7 @@
<AVATARExecutableSoclibCodeExecuteCommand data="make -C ../MPSoC/ runsoclib" />
<AVATARExecutableSoclibCodeTraceCommand data="make -C ../MPSoC/ runsoclib-trace" />
<AVATARExecutableSoclibTraceFile data="../Prog/soclib/soclib/platform/topcells/caba-vgmn-mutekh_kernel_tutorial/trace" />
<NCDirectory data="../nc/"/>
<ExternalCommand1Host data="localhost"/>
<ExternalCommand1 data="gtkwave ../simulators/c++2/vcddump.vcd"/>
......
......@@ -57,7 +57,7 @@
<AVATARExecutableSoclibCodeExecuteCommand data="make -C ../MPSoC/ runsoclib" />
<AVATARExecutableSoclibCodeTraceCommand data="make -C ../MPSoC/ runsoclib-trace" />
<AVATARExecutableSoclibTraceFile data="../Prog/soclib/soclib/platform/topcells/caba-vgmn-mutekh_kernel_tutorial/trace" />
<NCDirectory data="../nc/"/>
<ExternalCommand1Host data="localhost"/>
<ExternalCommand1 data="gtkwave ../simulators/c++2/vcddump.vcd"/>
......
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