diff --git a/bin/cli.exe b/bin/cli.exe index 9714bdcc17148a99f8f530b0dcb1c67d97310880..4ab047ca214c0fe7cd0c78bc568937175f0465be 100755 --- a/bin/cli.exe +++ b/bin/cli.exe @@ -1 +1 @@ -cd /Users/ludovicapvrille/TTool/bin&&java -Xmx2048m -jar ttool-cli.jar -debug script1 +cd /Users/ludovicapvrille/TTool/bin&&java -Xmx2048m -jar ttool-cli.jar -debug -show script1 diff --git a/simulators/c++2/vcddump.css b/simulators/c++2/vcddump.css new file mode 100644 index 0000000000000000000000000000000000000000..29df5dfce21be18b6efae7ad2b59fa9ad554dc0f --- /dev/null +++ b/simulators/c++2/vcddump.css @@ -0,0 +1,243 @@ +table{ + border-collapse: collapse; + empty-cells: show; + margin: 0.4cm; + } + td{ + padding: 10px 5px; + border: 1px solid black; + max-width: 5px; + } + th{ + padding: 5px; + border-left: 1px dotted black; + border-right: 1px dotted black; + } + .sc{ + border-style: none; + padding: 0px; + } + h2 { + border-bottom: 1px solid #666; + } + h2 span { + position: relative; + left: -0.3em; + bottom: -0.6em; + padding: 1px 0.5em; + border-style: solid; + border-width: 1px 1px 1px 0.8em; + border-color: #666 #666 #666 #008; + background-color: #ddd; + } + .space{border-style: none;} + .not{background-color: white;} + .notfirst { + background-color: white; + border-style: solid none solid solid; + } + .notmid { + background-color: white; + border-style: solid none solid none; + } + .notlast { + background-color: white; + border-style: solid solid solid none; + } + .t0{background-color: yellow;} + .t0first { + background-color: yellow; + border-style: solid none solid solid; + } + .t0mid { + background-color: yellow; + border-style: solid none solid none; + } + .t0last { + background-color: yellow; + border-style: solid solid solid none; + } + .t1{background-color: purple;} + .t1first { + background-color: purple; + border-style: solid none solid solid; + } + .t1mid { + background-color: purple; + border-style: solid none solid none; + } + .t1last { + background-color: purple; + border-style: solid solid solid none; + } + .t2{background-color: red;} + .t2first { + background-color: red; + border-style: solid none solid solid; + } + .t2mid { + background-color: red; + border-style: solid none solid none; + } + .t2last { + background-color: red; + border-style: solid solid solid none; + } + .t3{background-color: silver;} + .t3first { + background-color: silver; + border-style: solid none solid solid; + } + .t3mid { + background-color: silver; + border-style: solid none solid none; + } + .t3last { + background-color: silver; + border-style: solid solid solid none; + } + .t4{background-color: teal;} + .t4first { + background-color: teal; + border-style: solid none solid solid; + } + .t4mid { + background-color: teal; + border-style: solid none solid none; + } + .t4last { + background-color: teal; + border-style: solid solid solid none; + } + .t5{background-color: aqua;} + .t5first { + background-color: aqua; + border-style: solid none solid solid; + } + .t5mid { + background-color: aqua; + border-style: solid none solid none; + } + .t5last { + background-color: aqua; + border-style: solid solid solid none; + } + .t6{background-color: olive;} + .t6first { + background-color: olive; + border-style: solid none solid solid; + } + .t6mid { + background-color: olive; + border-style: solid none solid none; + } + .t6last { + background-color: olive; + border-style: solid solid solid none; + } + .t7{background-color: navy;} + .t7first { + background-color: navy; + border-style: solid none solid solid; + } + .t7mid { + background-color: navy; + border-style: solid none solid none; + } + .t7last { + background-color: navy; + border-style: solid solid solid none; + } + .t8{background-color: maroon;} + .t8first { + background-color: maroon; + border-style: solid none solid solid; + } + .t8mid { + background-color: maroon; + border-style: solid none solid none; + } + .t8last { + background-color: maroon; + border-style: solid solid solid none; + } + .t9{background-color: lime;} + .t9first { + background-color: lime; + border-style: solid none solid solid; + } + .t9mid { + background-color: lime; + border-style: solid none solid none; + } + .t9last { + background-color: lime; + border-style: solid solid solid none; + } + .t10{background-color: green;} + .t10first { + background-color: green; + border-style: solid none solid solid; + } + .t10mid { + background-color: green; + border-style: solid none solid none; + } + .t10last { + background-color: green; + border-style: solid solid solid none; + } + .t11{background-color: gray;} + .t11first { + background-color: gray; + border-style: solid none solid solid; + } + .t11mid { + background-color: gray; + border-style: solid none solid none; + } + .t11last { + background-color: gray; + border-style: solid solid solid none; + } + .t12{background-color: fuchsia;} + .t12first { + background-color: fuchsia; + border-style: solid none solid solid; + } + .t12mid { + background-color: fuchsia; + border-style: solid none solid none; + } + .t12last { + background-color: fuchsia; + border-style: solid solid solid none; + } + .t13{background-color: blue;} + .t13first { + background-color: blue; + border-style: solid none solid solid; + } + .t13mid { + background-color: blue; + border-style: solid none solid none; + } + .t13last { + background-color: blue; + border-style: solid solid solid none; + } + .t14{ + background-color: LightGoldenRodYellow; +} + .t14first { + background-color: LightGoldenRodYellow; + border-style: solid none solid solid; + } + .t14mid { + background-color: LightGoldenRodYellow; + border-style: solid none solid none; + } + .t14last { + background-color: LightGoldenRodYellow; + border-style: solid solid solid none; + } \ No newline at end of file diff --git a/src/main/java/cli/Interpreter.java b/src/main/java/cli/Interpreter.java index 29ab312fab045e5f2bcf3a3a9fd979f802d08fa0..3270e84c7210a6ddb7abb45bee59cb7b35a3aa4b 100644 --- a/src/main/java/cli/Interpreter.java +++ b/src/main/java/cli/Interpreter.java @@ -39,8 +39,14 @@ package cli; +import common.ConfigurationTTool; +import common.SpecConfigTTool; +import launcher.RTLLauncher; import myutil.Conversion; +import myutil.PluginManager; import myutil.TraceManager; +import ui.MainGUI; +import ui.util.IconManager; import java.util.*; @@ -72,7 +78,8 @@ public class Interpreter { private final static String TTOOL_ALREADY_STARTED ="TTool is already started. Cannot execute command."; private String script; - InterpreterOutputInterface printInterface; + private InterpreterOutputInterface printInterface; + private boolean show; // State management private HashMap<String, String> variables; @@ -81,10 +88,11 @@ public class Interpreter { - public Interpreter(String script, InterpreterOutputInterface printInterface) { + public Interpreter(String script, InterpreterOutputInterface printInterface, boolean show) { this.script = script; this.printInterface = printInterface; variables = new HashMap<>(); + this.show = show; } public void interpret() { @@ -146,7 +154,7 @@ public class Interpreter { String nextCommand; String args; - if (index != -1) { + if (index == -1) { nextCommand = action; args = ""; } else { @@ -201,6 +209,27 @@ public class Interpreter { error = TTOOL_ALREADY_STARTED; return false; } + + TraceManager.addDev("Laoding images"); + IconManager.loadImg(); + + TraceManager.addDev("Preparing plugins"); + PluginManager.pluginManager = new PluginManager(); + PluginManager.pluginManager.preparePlugins(ConfigurationTTool.PLUGIN_PATH, ConfigurationTTool.PLUGIN, ConfigurationTTool.PLUGIN_PKG); + + + TraceManager.addDev("Starting launcher"); + Thread t = new Thread(new RTLLauncher()); + t.start(); + + TraceManager.addDev("Creating main window"); + MainGUI mainGUI = new MainGUI(false, true, true, true, + true, true, true, true, true, true, + true, false, true); + mainGUI.build(); + mainGUI.start(show); + + return true; } diff --git a/src/main/java/ui/MainGUI.java b/src/main/java/ui/MainGUI.java index e5d2aa5796f51d7f3d25ea582f940fae8f649569..96c9ef063c27c1f688b2f2e174c7b82cc85be494 100644 --- a/src/main/java/ui/MainGUI.java +++ b/src/main/java/ui/MainGUI.java @@ -1777,7 +1777,11 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per } } + public void start() { + start(true); + } + public void start(boolean show) { // Main window is ready to be drawn on screen if (frame == null) { ErrorGUI.exit(ErrorGUI.GUI); @@ -1809,7 +1813,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per //TraceManager.addDev("No default window attributes"); } - frame.setVisible(true); + frame.setVisible(show); //split1.setDividerLocation(0.90); //split.setDividerLocation(0.2); diff --git a/ttool-cli/src/main/java/TToolCLI.java b/ttool-cli/src/main/java/TToolCLI.java index bba5316789bba84c85f353a40e5aa3c0db699014..bda66262b51ad2c95937dba86765aad2e059287d 100755 --- a/ttool-cli/src/main/java/TToolCLI.java +++ b/ttool-cli/src/main/java/TToolCLI.java @@ -68,6 +68,7 @@ public class TToolCLI implements InterpreterOutputInterface { public static void printUsage() { System.out.println("ttool-cli: usage"); System.out.println("ttool-cli <script file>"); + System.out.println("options: -debug -show"); } public static boolean checkArgs(String[] args) { @@ -84,6 +85,16 @@ public class TToolCLI implements InterpreterOutputInterface { return false; } + public static boolean hasShow(String[] args) { + for (String s : args) { + if (s.equals("-show")) { + return true; + } + + } + return false; + } + public static String getInputFile(String[] args) { return args[args.length - 1]; } @@ -106,6 +117,11 @@ public class TToolCLI implements InterpreterOutputInterface { TraceManager.devPolicy = TraceManager.TO_DEVNULL; } + boolean show = false; + if (hasShow(args)) { + show = true; + } + TToolCLI cli = new TToolCLI(); cli.print("Loading script:" + getInputFile(args)); // Load script file @@ -117,7 +133,7 @@ public class TToolCLI implements InterpreterOutputInterface { String script = FileUtils.loadFileData(f); // Call Interpreter - Interpreter interpret = new Interpreter(script, (InterpreterOutputInterface)cli); + Interpreter interpret = new Interpreter(script, (InterpreterOutputInterface)cli, show); interpret.interpret(); }