diff --git a/src/avatartranslator/directsimulation/AvatarSimulationBlock.java b/src/avatartranslator/directsimulation/AvatarSimulationBlock.java index 5dff83b4b34a03e759f22e0471074cff0bc8afaa..636d445618ac8d677183890fd4a08cb57aa740fd 100644 --- a/src/avatartranslator/directsimulation/AvatarSimulationBlock.java +++ b/src/avatartranslator/directsimulation/AvatarSimulationBlock.java @@ -299,7 +299,10 @@ public class AvatarSimulationBlock { ast.id = ast.setID(); if (_aspt != null) { ast.silent = _aspt.isSilent; + } else { + ast.silent = true; } + TraceManager.addDev("Transaction " + ast.id + " silent=" + ast.silent); if (_aspt != null) { _aspt.clockValueAtEnd = _clockValue; if (_aspt.hasClock) { diff --git a/src/avatartranslator/directsimulation/AvatarSpecificationSimulation.java b/src/avatartranslator/directsimulation/AvatarSpecificationSimulation.java index a74fe77c4881779ed7c221a4f41b24ac3cdcd81b..44efa3b6ef9b933c9efd7b9eb8bc276e2236590f 100644 --- a/src/avatartranslator/directsimulation/AvatarSpecificationSimulation.java +++ b/src/avatartranslator/directsimulation/AvatarSpecificationSimulation.java @@ -103,7 +103,9 @@ public class AvatarSpecificationSimulation { executeEmptyTransition = true; executeStateEntering = true; - setState(INITIALIZE); + initialize(); + reset(); + setState(GATHER); } public AvatarSpecification getAvatarSpecification() { @@ -684,7 +686,7 @@ public class AvatarSpecificationSimulation { } } // State entering? - } else if ((tr.elementToExecute instanceof AvatarState) && (executeStateEntering)) { + } else if (((tr.elementToExecute instanceof AvatarState) || (tr.elementToExecute instanceof AvatarStopState)) && (executeStateEntering)) { if (nbOfTransactions(tr.asb, _pendingTransactions) < 2) { tr.isSilent = true; return tr; @@ -713,13 +715,19 @@ public class AvatarSpecificationSimulation { if ((tr.elementToExecute instanceof AvatarTransition) && (executeEmptyTransition)) { AvatarTransition atr = (AvatarTransition)(tr.elementToExecute); if (!(atr.hasDelay()) && !(atr.hasCompute()) && !(atr.hasActions())){ + TraceManager.addDev("Empty transition?"); if (nbOfTransactions(tr.asb, _pendingTransactions) < 2) { + tr.isSilent = true; + TraceManager.addDev("Yes"); return tr; } } // State entering? - } else if ((tr.elementToExecute instanceof AvatarState) && (executeStateEntering)) { + } else if (((tr.elementToExecute instanceof AvatarState) || (tr.elementToExecute instanceof AvatarStopState)) && (executeStateEntering)) { + TraceManager.addDev("Empty state enter?"); if (nbOfTransactions(tr.asb, _pendingTransactions) < 2) { + tr.isSilent = true; + TraceManager.addDev("Yes"); return tr; } } @@ -848,6 +856,10 @@ public class AvatarSpecificationSimulation { } public synchronized void backOneTransactionBunch() { + backOneTransactionBunch(false); + } + + public synchronized void backOneTransactionBunch(boolean _rec) { if ( (state != DONT_EXECUTE) && (state != TERMINATED)) { return; } @@ -862,11 +874,11 @@ public class AvatarSpecificationSimulation { // Getting last transaction AvatarSimulationTransaction ast = allTransactions.get(allTransactions.size()-1); - long bunchid = ast.bunchid; + long bunchid_tmp = ast.bunchid; boolean isAllSilent = true; - while((ast != null) && (ast.bunchid == bunchid)) { + while((ast != null) && (ast.bunchid == bunchid_tmp)) { allTransactions.removeElementAt(allTransactions.size()-1); if (ast.asb != null) { ast.asb.removeLastTransaction(ast); @@ -892,9 +904,19 @@ public class AvatarSpecificationSimulation { } } - if (ast != null) { + if (isAllSilent) { + backOneTransactionBunch(true); + } + + if (_rec) { + return; + } + + TraceManager.addDev("Backward size="+ allTransactions.size()); + + if (allTransactions.size() > 0) { bunchid = (allTransactions.get(allTransactions.size()-1).bunchid) + 1; - clockValue = ast.clockValueWhenFinished; + clockValue = (allTransactions.get(allTransactions.size()-1)).clockValueWhenFinished; } else { bunchid = 0; clockValue = 0; @@ -902,13 +924,7 @@ public class AvatarSpecificationSimulation { AvatarSimulationTransaction.setID(allTransactions.size()); - - TraceManager.addDev("Backward size="+ allTransactions.size()); - - if (isAllSilent) { - backOneTransactionBunch(); - } - + setNbOfCommands(0); newState = true; notifyAll(); } diff --git a/src/ui/avatarinteractivesimulation/BlockTableModel.java b/src/ui/avatarinteractivesimulation/BlockTableModel.java index f4676aaadc0a9e2b2bfcd60ca1bccc3a4d0da5b8..b8aef127db5e6448d4f3d31514fbd60d62751d2d 100755 --- a/src/ui/avatarinteractivesimulation/BlockTableModel.java +++ b/src/ui/avatarinteractivesimulation/BlockTableModel.java @@ -144,10 +144,10 @@ public class BlockTableModel extends AbstractTableModel { if (ass.getSimulationBlocks() != null) { nbOfRows = ass.getSimulationBlocks().size(); + } else { + nbOfRows = -1; } - nbOfRows = -1; - return; } diff --git a/src/ui/tmlcompd/TMLComponentTaskDiagramPanel.java b/src/ui/tmlcompd/TMLComponentTaskDiagramPanel.java index fb0481cab414e98dedea4fefd1b864c699c70c5b..4a02cd1bd64c8d9726e3f2bcccc1f44368de0892 100755 --- a/src/ui/tmlcompd/TMLComponentTaskDiagramPanel.java +++ b/src/ui/tmlcompd/TMLComponentTaskDiagramPanel.java @@ -304,9 +304,9 @@ public class TMLComponentTaskDiagramPanel extends TDiagramPanel implements TDPWi //TraceManager.addDev("Considering port1 = " +port1.getPortName() + " size of connecting ports:" + portstome.size()); ListIterator ite = portstome.listIterator(); - while(ite.hasNext()) { + //while(ite.hasNext()) { //TraceManager.addDev("port=" + ((TMLCPrimitivePort)(ite.next())).getPortName()); - } + //} if (portstome.size() == 1) { port2 = (TMLCPrimitivePort)(portstome.get(0)); diff --git a/src/ui/window/JDialogCommunicationArtifact.java b/src/ui/window/JDialogCommunicationArtifact.java index f7d8b966366165b47f5757993214cb3905473429..aa2d934782690762c9fc53e21f4b134f82dc2aa0 100755 --- a/src/ui/window/JDialogCommunicationArtifact.java +++ b/src/ui/window/JDialogCommunicationArtifact.java @@ -56,6 +56,8 @@ import ui.*; import ui.tmldd.*; +import myutil.*; + public class JDialogCommunicationArtifact extends javax.swing.JDialog implements ActionListener { @@ -80,8 +82,15 @@ public class JDialogCommunicationArtifact extends javax.swing.JDialog implements //System.out.println("New window"); + TraceManager.addDev("init components"); + initComponents(); + + TraceManager.addDev("my init components"); + myInitComponents(); + + TraceManager.addDev("pack"); pack(); } @@ -116,6 +125,7 @@ public class JDialogCommunicationArtifact extends javax.swing.JDialog implements c1.fill = GridBagConstraints.HORIZONTAL; panel2.add(new JLabel("Task:"), c2); c1.gridwidth = GridBagConstraints.REMAINDER; //end row + TraceManager.addDev("Getting communications"); Vector<String> list = artifact.getTDiagramPanel().getMGUI().getAllTMLCommunicationNames(); int index = 0; if (list.size() == 0) { @@ -126,6 +136,9 @@ public class JDialogCommunicationArtifact extends javax.swing.JDialog implements index = indexOf(list, artifact.getFullValue()); //System.out.println("name=" + artifact.getFullValue() + " index=" + index); } + + TraceManager.addDev("Got communications"); + referenceCommunicationName = new JComboBox(list); referenceCommunicationName.setSelectedIndex(index); referenceCommunicationName.addActionListener(this);