diff --git a/src/tmltranslator/TMLTextSpecification.java b/src/tmltranslator/TMLTextSpecification.java index 2fb19c2fb554ef8c5f3d2abf90da5e8517e6cdf6..25b392a1ccd97fa93ddad0a3f1ab54280a2def9b 100755 --- a/src/tmltranslator/TMLTextSpecification.java +++ b/src/tmltranslator/TMLTextSpecification.java @@ -1614,12 +1614,12 @@ public class TMLTextSpecification { } if (parses.size() == 0) { - error = "SEQ: corresponding SELECTEVT not found"; + error = "SEQ: corresponding RANDOMSEQ not found"; addError(0, _lineNb, 0, error); return -1; } else { parseElt = parses.get(0); - if (parseElt.type != TMLParserSaveElt.SELECTEVT) { + if (parseElt.type != TMLParserSaveElt.RANDOMSEQ) { error = "SEQ: corresponding RANDOMSEQ not found"; addError(0, _lineNb, 0, error); return -1; @@ -1631,7 +1631,7 @@ public class TMLTextSpecification { inTaskDec = false; inTaskBehavior = true; - if(_split.length >0 ) { + if(_split.length >1 ) { error = "A SEQ has no parameter"; addError(0, _lineNb, 0, error); return -1; diff --git a/src/ui/GTURTLEModeling.java b/src/ui/GTURTLEModeling.java index 6b925f89ebea68c2289d9a9ea20336382fc11875..4bbe60b994c37e9bcb6b07d71639303446046e06 100755 --- a/src/ui/GTURTLEModeling.java +++ b/src/ui/GTURTLEModeling.java @@ -118,7 +118,7 @@ public class GTURTLEModeling { // private Vector panels; /* analysis, design, deployment, tml design */ private TURTLEModeling tm; - private int tmState; // 0:generated, 1: to be generated from mapping + private int tmState; // 0:generated, 1: to be generated from mapping, 2: to be generated from TML modeling private TMLModeling tmlm; private TMLMapping artificialtmap; private TMLMapping tmap; @@ -5045,12 +5045,15 @@ public class GTURTLEModeling { warningsOptimize = tmlm.optimize(); } - TML2TURTLE tt = new TML2TURTLE(tmlm); - tm = tt.generateTURTLEModeling(); - tmState = 0; + //TML2TURTLE tt = new TML2TURTLE(tmlm); + //tm = tt.generateTURTLEModeling(); + tmState = 2; + mgui.resetAllDIPLOIDs(); + listE.useDIPLOIDs(); + return true; //TraceManager.addDev("tm generated:"); //tm.print(); - checkingErrors = tt.getCheckingErrors(); + /*checkingErrors = tt.getCheckingErrors(); if ((checkingErrors != null) && (checkingErrors.size() > 0)){ analyzeErrors(); return false; @@ -5073,7 +5076,7 @@ public class GTURTLEModeling { mgui.setMode(MainGUI.GEN_DESIGN_OK); return true; } - } + }*/ } } @@ -5116,12 +5119,15 @@ public class GTURTLEModeling { warningsOptimize = tmlm.optimize(); } - TML2TURTLE tt = new TML2TURTLE(tmlm); - tm = tt.generateTURTLEModeling(); - tmState = 0; + //TML2TURTLE tt = new TML2TURTLE(tmlm); + //tm = tt.generateTURTLEModeling(); + tmState = 2; TraceManager.addDev("tm generated:"); + mgui.resetAllDIPLOIDs(); + listE.useDIPLOIDs(); + return true; //tm.print(); - checkingErrors = tt.getCheckingErrors(); + /*checkingErrors = tt.getCheckingErrors(); if ((checkingErrors != null) && (checkingErrors.size() > 0)){ analyzeErrors(); return false; @@ -5145,6 +5151,29 @@ public class GTURTLEModeling { listE.useDIPLOIDs(); return true; } + }*/ + } + } + + public boolean translateTMLModeling() { + TML2TURTLE tt = new TML2TURTLE(tmlm); + tm = tt.generateTURTLEModeling(); + if ((checkingErrors != null) && (checkingErrors.size() > 0)){ + analyzeErrors(); + return false; + } else { + // Optimize + //TraceManager.addDev("Optimize"); + tm.optimize(); + //TraceManager.addDev("Optimize done"); + TURTLEModelChecker tmc = new TURTLEModelChecker(tm); + checkingErrors = tmc.syntaxAnalysisChecking(); + if ((checkingErrors != null) && (checkingErrors.size() > 0)){ + analyzeErrors(); + return false; + } else { + mgui.setMode(MainGUI.GEN_DESIGN_OK); + return true; } } } diff --git a/src/ui/MainGUI.java b/src/ui/MainGUI.java index d086c3a86a90b43fc00b3c3c7679ec628fac72b1..2a5ec315d9bf2cd81243a1fe864f7c67029cf4fe 100755 --- a/src/ui/MainGUI.java +++ b/src/ui/MainGUI.java @@ -2432,12 +2432,12 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener { public void oneClickLOTOSRG() { boolean ret; if (!checkModelingSyntax(true)) { - System.out.println("Syntax error"); + TraceManager.addDev("Syntax error"); return; } if (!generateLOTOS(true)) { - System.out.println("Generate LOTOS: error"); + TraceManager.addDev("Generate LOTOS: error"); return; } @@ -2447,12 +2447,12 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener { public void oneClickRTLOTOSRG() { boolean ret; if (!checkModelingSyntax(true)) { - System.out.println("Syntax error"); + TraceManager.addDev("Syntax error"); return; } if (!generateRTLOTOS(true)) { - System.out.println("Generate RT-LOTOS: error"); + TraceManager.addDev("Generate RT-LOTOS: error"); return; } @@ -2897,7 +2897,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener { public boolean generateLOTOS(boolean automatic) { - if (gtm.getTURTLEModelingState() == 1) { + if (gtm.getTURTLEModelingState() > 0) { if (!generateTURTLEModelingFromState(gtm.getTURTLEModelingState(), automatic, LOTOS)) { dtree.toBeUpdated(); return false; @@ -2930,6 +2930,9 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener { if (state == 1) { return generateTIFFromMapping(automatic, generator); } + if (state == 2) { + return generateTIFFromTMLModeling(automatic, generator); + } return false; } @@ -2979,6 +2982,10 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener { return false; } + + public boolean generateTIFFromTMLModeling(boolean automatic, int generator) { + return gtm.translateTMLModeling(); + } public void generateAUT() { JDialogGenAUT jdgaut = new JDialogGenAUT(frame, this, "Generation of automata", ConfigurationTTool.BcgioPath, ConfigurationTTool.AldebaranHost, ConfigurationTTool.TGraphPath);