From f8c85fd4867a8bfafd17ad7f750611be2ba9aea6 Mon Sep 17 00:00:00 2001 From: Ludovic Apvrille <ludovic.apvrille@telecom-paristech.fr> Date: Mon, 10 May 2010 14:40:30 +0000 Subject: [PATCH] Update on random sequence --- src/Main.java | 8 ++++++++ src/tmltranslator/TMLMapping.java | 8 ++++++++ src/ui/GTURTLEModeling.java | 2 ++ src/ui/interactivesimulation/TaskVariableTableModel.java | 5 ++++- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/Main.java b/src/Main.java index 5c4f8ec13a..eb1f60db37 100755 --- a/src/Main.java +++ b/src/Main.java @@ -52,6 +52,7 @@ import java.net.URL; import javax.swing.ImageIcon; import javax.swing.*; +import myutil.*; import ui.*; import ui.window.*; @@ -68,6 +69,8 @@ public class Main implements ActionListener { public static boolean avatar = false ; // avatar profile public static void main(String[] args) { + + TraceManager.devPolicy = TraceManager.TO_DEVNULL; System.out.println("\n*** TTool version: " + DefaultText.getFullVersion() + " ***\n"); @@ -171,6 +174,11 @@ public class Main implements ActionListener { if (args[i].compareTo("-config") == 0) { config = args[Math.min(args.length-1, i+1)]; } + + if (args[i].compareTo("-debug") == 0) { + TraceManager.devPolicy = TraceManager.TO_CONSOLE; + } + } // Icons diff --git a/src/tmltranslator/TMLMapping.java b/src/tmltranslator/TMLMapping.java index 55813dd151..c0779d154f 100755 --- a/src/tmltranslator/TMLMapping.java +++ b/src/tmltranslator/TMLMapping.java @@ -72,6 +72,8 @@ public class TMLMapping { } } + + public void makeMinimumMapping() { HwCPU cpu; HwMemory mem; @@ -474,4 +476,10 @@ public class TMLMapping { } return onnodes.get(i); } + + public void removeAllRandomSequences() { + if (tmlm != null) { + tmlm.removeAllRandomSequences(); + } + } } \ No newline at end of file diff --git a/src/ui/GTURTLEModeling.java b/src/ui/GTURTLEModeling.java index 6e0f84c42a..d4ef5da738 100755 --- a/src/ui/GTURTLEModeling.java +++ b/src/ui/GTURTLEModeling.java @@ -5156,11 +5156,13 @@ public class GTURTLEModeling { //System.out.println("New TML Mapping"); GTMLModeling gtmlm = new GTMLModeling(tmlap, true); + gtmlm.setNodes(nodesToTakeIntoAccount); tmlm = null; tm = null; tmState = 1; tmap = gtmlm.translateToTMLMapping(); + tmap.removeAllRandomSequences(); listE = gtmlm.getCorrespondanceTable(); diff --git a/src/ui/interactivesimulation/TaskVariableTableModel.java b/src/ui/interactivesimulation/TaskVariableTableModel.java index 3b8479095d..05ce8df8bd 100755 --- a/src/ui/interactivesimulation/TaskVariableTableModel.java +++ b/src/ui/interactivesimulation/TaskVariableTableModel.java @@ -180,7 +180,10 @@ public class TaskVariableTableModel extends AbstractTableModel { size = task.getAttributes().size(); cpt += size; if (row < cpt) { - String val = task.getAttributes().get(row+size-cpt).getInitialValue(); + String val = null ; + try { + val = task.getAttributes().get(row+size-cpt).getInitialValue(); + } catch (Exception e) {} if ((val == null) | (val.length() == 0)) { return " - "; } else { -- GitLab