diff --git a/Makefile b/Makefile index aaaba0e653d43e1958d7ef5b9a9ee8ecf1d470f3..1202a771b5a722ac733113d66b6c13b9d65f5d33 100755 --- a/Makefile +++ b/Makefile @@ -91,7 +91,7 @@ ttooljar_std: launcher: rm -f $(TTOOL_BIN)/$(LAUNCHER_BINARY) - cd $(TTOOL_SRC);$(JAR) cmf $(LAUNCHER_JAR_TXT) $(TTOOL_BIN)/$(LAUNCHER_BINARY) RTLLauncher.class launcher/*.class + cd $(TTOOL_SRC);$(JAR) cmf $(LAUNCHER_JAR_TXT) $(TTOOL_BIN)/$(LAUNCHER_BINARY) RTLLauncher.class launcher/*.class myutil/*.class tiftranslator: rm -f $(TTOOL_BIN)/$(TIFTRANSLATOR_BINARY) diff --git a/modeling/proverif.xml b/modeling/proverif.xml index f2dc812c68daf27ba049daecec0a4eb2f284ea48..d348c18af4cf7d8c903d6a26c67e47fdf909622b 100644 --- a/modeling/proverif.xml +++ b/modeling/proverif.xml @@ -5,8 +5,8 @@ <Modeling type="AVATAR Design" nameTab="KeyMasterProtocol" > <AVATARBlockDiagramPanel name="AVATAR Block Diagram" minX="10" maxX="1400" minY="10" maxY="900" > <COMPONENT type="5000" id="25" > -<cdparam x="170" y="180" /> -<sizeparam width="135" height="214" minWidth="5" minHeight="2" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<cdparam x="82" y="180" /> +<sizeparam width="223" height="427" minWidth="5" minHeight="2" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="Block0" value="ECUN" /> @@ -3388,12 +3388,12 @@ <Modeling type="AVATAR Design" nameTab="AVATAR Design" > <AVATARBlockDiagramPanel name="AVATAR Block Diagram" minX="10" maxX="1400" minY="10" maxY="900" > -<CONNECTOR type="5002" id="3025" > +<CONNECTOR type="5002" id="1444" > <cdparam x="269" y="201" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector from Block0 to Block0" value="" /> -<P1 x="324" y="185" id="1459" /> -<P2 x="385" y="209" id="1485" /> +<P1 x="324" y="185" id="1483" /> +<P2 x="385" y="209" id="1457" /> <AutomaticDrawing data="true" /> <extraparam> <isd value="in fromnet()" /> @@ -3401,36 +3401,36 @@ <FIFOType asynchronous="true" size="1" blocking="false" /> </extraparam> </CONNECTOR> -<COMPONENT type="5000" id="1472" > +<COMPONENT type="5000" id="1469" > <cdparam x="385" y="133" /> <sizeparam width="131" height="102" minWidth="5" minHeight="2" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="Block0" value="Bob" /> -<TGConnectingPoint num="0" id="1473" /> -<TGConnectingPoint num="1" id="1474" /> -<TGConnectingPoint num="2" id="1475" /> -<TGConnectingPoint num="3" id="1476" /> -<TGConnectingPoint num="4" id="1477" /> -<TGConnectingPoint num="5" id="1478" /> -<TGConnectingPoint num="6" id="1479" /> -<TGConnectingPoint num="7" id="1480" /> -<TGConnectingPoint num="8" id="1481" /> -<TGConnectingPoint num="9" id="1482" /> -<TGConnectingPoint num="10" id="1483" /> -<TGConnectingPoint num="11" id="1484" /> -<TGConnectingPoint num="12" id="1485" /> -<TGConnectingPoint num="13" id="1486" /> -<TGConnectingPoint num="14" id="1487" /> -<TGConnectingPoint num="15" id="1488" /> -<TGConnectingPoint num="16" id="1489" /> -<TGConnectingPoint num="17" id="1490" /> -<TGConnectingPoint num="18" id="1491" /> -<TGConnectingPoint num="19" id="1492" /> -<TGConnectingPoint num="20" id="1493" /> -<TGConnectingPoint num="21" id="1494" /> -<TGConnectingPoint num="22" id="1495" /> -<TGConnectingPoint num="23" id="1496" /> +<TGConnectingPoint num="0" id="1445" /> +<TGConnectingPoint num="1" id="1446" /> +<TGConnectingPoint num="2" id="1447" /> +<TGConnectingPoint num="3" id="1448" /> +<TGConnectingPoint num="4" id="1449" /> +<TGConnectingPoint num="5" id="1450" /> +<TGConnectingPoint num="6" id="1451" /> +<TGConnectingPoint num="7" id="1452" /> +<TGConnectingPoint num="8" id="1453" /> +<TGConnectingPoint num="9" id="1454" /> +<TGConnectingPoint num="10" id="1455" /> +<TGConnectingPoint num="11" id="1456" /> +<TGConnectingPoint num="12" id="1457" /> +<TGConnectingPoint num="13" id="1458" /> +<TGConnectingPoint num="14" id="1459" /> +<TGConnectingPoint num="15" id="1460" /> +<TGConnectingPoint num="16" id="1461" /> +<TGConnectingPoint num="17" id="1462" /> +<TGConnectingPoint num="18" id="1463" /> +<TGConnectingPoint num="19" id="1464" /> +<TGConnectingPoint num="20" id="1465" /> +<TGConnectingPoint num="21" id="1466" /> +<TGConnectingPoint num="22" id="1467" /> +<TGConnectingPoint num="23" id="1468" /> <extraparam> <Attribute access="0" id="receivedData" value="" type="8" typeOther="" /> <Attribute access="0" id="m" value="" type="5" typeOther="Message" /> @@ -3439,36 +3439,36 @@ </extraparam> </COMPONENT> -<COMPONENT type="5000" id="1445" > +<COMPONENT type="5000" id="1494" > <cdparam x="201" y="103" /> <sizeparam width="123" height="110" minWidth="5" minHeight="2" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="Block0" value="Alice" /> -<TGConnectingPoint num="0" id="1446" /> -<TGConnectingPoint num="1" id="1447" /> -<TGConnectingPoint num="2" id="1448" /> -<TGConnectingPoint num="3" id="1449" /> -<TGConnectingPoint num="4" id="1450" /> -<TGConnectingPoint num="5" id="1451" /> -<TGConnectingPoint num="6" id="1452" /> -<TGConnectingPoint num="7" id="1453" /> -<TGConnectingPoint num="8" id="1454" /> -<TGConnectingPoint num="9" id="1455" /> -<TGConnectingPoint num="10" id="1456" /> -<TGConnectingPoint num="11" id="1457" /> -<TGConnectingPoint num="12" id="1458" /> -<TGConnectingPoint num="13" id="1459" /> -<TGConnectingPoint num="14" id="1460" /> -<TGConnectingPoint num="15" id="1461" /> -<TGConnectingPoint num="16" id="1462" /> -<TGConnectingPoint num="17" id="1463" /> -<TGConnectingPoint num="18" id="1464" /> -<TGConnectingPoint num="19" id="1465" /> -<TGConnectingPoint num="20" id="1466" /> -<TGConnectingPoint num="21" id="1467" /> -<TGConnectingPoint num="22" id="1468" /> -<TGConnectingPoint num="23" id="1469" /> +<TGConnectingPoint num="0" id="1470" /> +<TGConnectingPoint num="1" id="1471" /> +<TGConnectingPoint num="2" id="1472" /> +<TGConnectingPoint num="3" id="1473" /> +<TGConnectingPoint num="4" id="1474" /> +<TGConnectingPoint num="5" id="1475" /> +<TGConnectingPoint num="6" id="1476" /> +<TGConnectingPoint num="7" id="1477" /> +<TGConnectingPoint num="8" id="1478" /> +<TGConnectingPoint num="9" id="1479" /> +<TGConnectingPoint num="10" id="1480" /> +<TGConnectingPoint num="11" id="1481" /> +<TGConnectingPoint num="12" id="1482" /> +<TGConnectingPoint num="13" id="1483" /> +<TGConnectingPoint num="14" id="1484" /> +<TGConnectingPoint num="15" id="1485" /> +<TGConnectingPoint num="16" id="1486" /> +<TGConnectingPoint num="17" id="1487" /> +<TGConnectingPoint num="18" id="1488" /> +<TGConnectingPoint num="19" id="1489" /> +<TGConnectingPoint num="20" id="1490" /> +<TGConnectingPoint num="21" id="1491" /> +<TGConnectingPoint num="22" id="1492" /> +<TGConnectingPoint num="23" id="1493" /> <extraparam> <Attribute access="0" id="secretData" value="" type="8" typeOther="" /> <Attribute access="0" id="m" value="" type="5" typeOther="Message" /> @@ -3477,39 +3477,39 @@ </extraparam> </COMPONENT> -<COMPONENT type="5003" id="2735" > +<COMPONENT type="5003" id="1503" > <cdparam x="380" y="246" /> <sizeparam width="116" height="77" minWidth="5" minHeight="2" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="DataType0" value="Message" /> -<TGConnectingPoint num="0" id="2727" /> -<TGConnectingPoint num="1" id="2728" /> -<TGConnectingPoint num="2" id="2729" /> -<TGConnectingPoint num="3" id="2730" /> -<TGConnectingPoint num="4" id="2731" /> -<TGConnectingPoint num="5" id="2732" /> -<TGConnectingPoint num="6" id="2733" /> -<TGConnectingPoint num="7" id="2734" /> +<TGConnectingPoint num="0" id="1495" /> +<TGConnectingPoint num="1" id="1496" /> +<TGConnectingPoint num="2" id="1497" /> +<TGConnectingPoint num="3" id="1498" /> +<TGConnectingPoint num="4" id="1499" /> +<TGConnectingPoint num="5" id="1500" /> +<TGConnectingPoint num="6" id="1501" /> +<TGConnectingPoint num="7" id="1502" /> <extraparam> <Attribute access="0" id="data" value="" type="0" typeOther="" /> </extraparam> </COMPONENT> -<COMPONENT type="5003" id="2744" > +<COMPONENT type="5003" id="1512" > <cdparam x="201" y="244" /> <sizeparam width="130" height="76" minWidth="5" minHeight="2" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="DataType0" value="Key" /> -<TGConnectingPoint num="0" id="2736" /> -<TGConnectingPoint num="1" id="2737" /> -<TGConnectingPoint num="2" id="2738" /> -<TGConnectingPoint num="3" id="2739" /> -<TGConnectingPoint num="4" id="2740" /> -<TGConnectingPoint num="5" id="2741" /> -<TGConnectingPoint num="6" id="2742" /> -<TGConnectingPoint num="7" id="2743" /> +<TGConnectingPoint num="0" id="1504" /> +<TGConnectingPoint num="1" id="1505" /> +<TGConnectingPoint num="2" id="1506" /> +<TGConnectingPoint num="3" id="1507" /> +<TGConnectingPoint num="4" id="1508" /> +<TGConnectingPoint num="5" id="1509" /> +<TGConnectingPoint num="6" id="1510" /> +<TGConnectingPoint num="7" id="1511" /> <extraparam> <Attribute access="0" id="data" value="" type="8" typeOther="" /> </extraparam> @@ -3518,27 +3518,27 @@ </AVATARBlockDiagramPanel> -<AVATARStateMachineDiagramPanel name="Alice" minX="10" maxX="1400" minY="10" maxY="900" > -<COMPONENT type="5100" id="1470" > +<AVATARStateMachineDiagramPanel name="Bob" minX="10" maxX="1400" minY="10" maxY="900" > +<COMPONENT type="5100" id="1514" > <cdparam x="400" y="50" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="start state" value="null" /> -<TGConnectingPoint num="0" id="1471" /> +<TGConnectingPoint num="0" id="1513" /> </COMPONENT> </AVATARStateMachineDiagramPanel> -<AVATARStateMachineDiagramPanel name="Bob" minX="10" maxX="1400" minY="10" maxY="900" > -<COMPONENT type="5100" id="1497" > +<AVATARStateMachineDiagramPanel name="Alice" minX="10" maxX="1400" minY="10" maxY="900" > +<COMPONENT type="5100" id="1516" > <cdparam x="400" y="50" /> <sizeparam width="15" height="15" minWidth="0" minHeight="0" maxWidth="1000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> <cdrectangleparam minX="10" maxX="1400" minY="10" maxY="900" /> <infoparam name="start state" value="null" /> -<TGConnectingPoint num="0" id="1498" /> +<TGConnectingPoint num="0" id="1515" /> </COMPONENT> diff --git a/src/avatartranslator/directsimulation/AvatarSpecificationSimulation.java b/src/avatartranslator/directsimulation/AvatarSpecificationSimulation.java index 44efa3b6ef9b933c9efd7b9eb8bc276e2236590f..e47326c625644fa0ecf88ee19086e4f1f0f770a6 100644 --- a/src/avatartranslator/directsimulation/AvatarSpecificationSimulation.java +++ b/src/avatartranslator/directsimulation/AvatarSpecificationSimulation.java @@ -86,7 +86,7 @@ public class AvatarSpecificationSimulation { private long bunchid; - + private boolean nbOfCommandsActivated = false; private int nbOfCommands = -1; // means: until it blocks private int indexSelectedTransaction = -1; @@ -266,7 +266,7 @@ public class AvatarSpecificationSimulation { setState(TERMINATED); TraceManager.addDev("No more pending transactions"); } else { - if (nbOfCommands < 1) { + if ((nbOfCommandsActivated) && (nbOfCommands < 1)) { if (getSilentTransactionToExecute(pendingTransactions) == null) { setState(DONT_EXECUTE); } else { @@ -289,7 +289,9 @@ public class AvatarSpecificationSimulation { } else { if (performSelectedTransactions(selectedTransactions)) { if (!silentTransactionExecuted) { - nbOfCommands --; + if (nbOfCommandsActivated) { + nbOfCommands --; + } } if (asi != null) { asi.updateTransactionAndTime(allTransactions.size(), clockValue); @@ -407,10 +409,14 @@ public class AvatarSpecificationSimulation { public void setNbOfCommands(int _nbOfCommands) { nbOfCommands = _nbOfCommands; + if (nbOfCommands > 0) { + nbOfCommandsActivated = true; + } } public void unsetNbOfCommands() { nbOfCommands = -1; + nbOfCommandsActivated = false; } // External control functions @@ -868,7 +874,7 @@ public class AvatarSpecificationSimulation { return; } - TraceManager.addDev("Backward size="+ allTransactions.size()); + //TraceManager.addDev("Backward size="+ allTransactions.size()); // Remove one transaction // Getting last transaction @@ -912,7 +918,7 @@ public class AvatarSpecificationSimulation { return; } - TraceManager.addDev("Backward size="+ allTransactions.size()); + //TraceManager.addDev("Backward size="+ allTransactions.size()); if (allTransactions.size() > 0) { bunchid = (allTransactions.get(allTransactions.size()-1).bunchid) + 1; diff --git a/src/remotesimulation/CommandParser.java b/src/remotesimulation/CommandParser.java index ef47d5cf463e65aeb30011fe3f8945feed949d52..577a55f21f366238591281b2b9037dabd0d77fd0 100755 --- a/src/remotesimulation/CommandParser.java +++ b/src/remotesimulation/CommandParser.java @@ -251,7 +251,12 @@ public class CommandParser { sc = new SimulationCommand("get-benchmark", "gb", "10", params, paramNames, "Returns information on hardware nodes of the architecture"); commandList.add(sc); - + // get-executed-operators + params = new int[0]; + paramNames = new String[0]; + sc = new SimulationCommand("get-executed-operators", "geo", "21", params, paramNames, "Returns the list of executed operators"); + commandList.add(sc); + // get-hash-code params = new int[0]; paramNames = new String[0]; diff --git a/src/tmltranslator/TMLActivity.java b/src/tmltranslator/TMLActivity.java index 6d0a0605ccc7ee384f374051e140dc92dd187cb1..25e6d80f2d1dd1e2cf3a1821aae81f3d80266644 100755 --- a/src/tmltranslator/TMLActivity.java +++ b/src/tmltranslator/TMLActivity.java @@ -385,6 +385,26 @@ public class TMLActivity extends TMLElement { splitActionStatesWithDollars(tmlas, _task); } + + public int computeMaxID() { + int max = -1; + TMLActivityElement ae; + for(int i=0; i<elements.size(); i++) { + ae = (TMLActivityElement)(elements.elementAt(i)); + max = Math.max(max, ae.getID()); + } + return max; + } + + public void computeCorrespondance(TMLElement [] _correspondance) { + _correspondance[getID()] = this; + TMLActivityElement ae; + for(int i=0; i<elements.size(); i++) { + ae = (TMLActivityElement)(elements.elementAt(i)); + _correspondance[ae.getID()] = ae; + } + + } } \ No newline at end of file diff --git a/src/tmltranslator/TMLModeling.java b/src/tmltranslator/TMLModeling.java index 15786bc844523b59ce62a8f6696dd00c6d3710dc..d05fa5f513c1cda10a85538e83f2fd345c6796c2 100755 --- a/src/tmltranslator/TMLModeling.java +++ b/src/tmltranslator/TMLModeling.java @@ -57,6 +57,8 @@ public class TMLModeling { private ArrayList<TMLRequest> requests; private ArrayList<TMLEvent> events; + private TMLElement correspondance[]; + private boolean optimized = false; private String[] ops = {">", "<", "+", "-", "*", "/", "[", "]", "(", ")", ":", "=", "==", ","}; @@ -1247,5 +1249,66 @@ public class TMLModeling { } } } + + public TMLElement getCorrespondance(int _id) { + if (correspondance == null) { + return null; + } + + if (_id <0) { + return null; + } + + if (_id >= correspondance.length) { + return null; + } + + return correspondance[_id]; + } + + public int computeMaxID() { + int max = -1; + for(TMLTask task: tasks) { + max = Math.max(max, task.computeMaxID()); + } + + for(TMLChannel channel: channels) { + max = Math.max(max, channel.getID()); + } + + for(TMLRequest request: requests) { + max = Math.max(max, request.getID()); + } + + for(TMLEvent event: events) { + max = Math.max(max, event.getID()); + } + + return max; + } + + public void computeCorrespondance() { + int max = computeMaxID(); + + //TraceManager.addDev("Max ID=" + max); + + correspondance = new TMLElement[max+1]; + + for(TMLTask task: tasks) { + task.computeCorrespondance(correspondance); + } + + for(TMLChannel channel: channels) { + correspondance[channel.getID()] = channel; + } + + for(TMLRequest request: requests) { + correspondance[request.getID()] = request; + } + + for(TMLEvent event: events) { + correspondance[event.getID()] = event; + } + } } \ No newline at end of file diff --git a/src/tmltranslator/TMLTask.java b/src/tmltranslator/TMLTask.java index f8437176ddb5576e4f360c5b39de275801b7ea44..a67ba25f86ef7f1c1c7f7b787e0c9042316351da 100755 --- a/src/tmltranslator/TMLTask.java +++ b/src/tmltranslator/TMLTask.java @@ -206,5 +206,21 @@ public class TMLTask extends TMLElement { } return v; } + + public int computeMaxID() { + int max = getID(); + if (activity != null) { + max = Math.max(max, activity.computeMaxID()); + } + return max; + } + + public void computeCorrespondance(TMLElement [] _correspondance) { + _correspondance[getID()] = this; + if (activity != null) { + activity.computeCorrespondance(_correspondance); + } + + } } \ No newline at end of file diff --git a/src/ui/TGComponent.java b/src/ui/TGComponent.java index 36341507f83e0d7ffd1418ce70d3870adf7e968f..e5f44554834ab82f8c5943447e0f81c3b316b0ef 100755 --- a/src/ui/TGComponent.java +++ b/src/ui/TGComponent.java @@ -105,6 +105,7 @@ public abstract class TGComponent implements CDElement, GenericTree { // DIPLODOCUS ID private int DIPLOID = -1; private boolean DIPLO_running = false; + private int DIPLO_met = 0; // AVATAR ID private int AVATARID = -1; @@ -482,6 +483,35 @@ public abstract class TGComponent implements CDElement, GenericTree { } } + public void setDIPLOMet(int _nb) { + DIPLO_met = _nb; + } + + public void drawDIPLOMet(Graphics g) { + int dech = 8; + int decw = 12; + g.setColor(ColorManager.CURRENT_COMMAND_RUNNING); + int myx, myy, mywidth; + if (this instanceof TGConnector) { + TGConnector tgco = (TGConnector)this; + myx = tgco.getMiddleFirstSegment().x; + myy = tgco.getMiddleFirstSegment().y; + mywidth = 2; + } else { + myx = getX(); + myy = getY(); + mywidth = width+1; + } + + g.drawLine(myx+mywidth, myy+1+dech/2, myx+mywidth + decw/3, myy+dech); + g.drawLine(myx+mywidth + decw/3, myy+dech, myx+mywidth + decw, myy); + + if (DIPLO_met > 1) { + g.drawString(""+ DIPLO_met, myx+mywidth + decw + 1, myy); + } + + } + public void setAVATARMet(boolean _b) { AVATAR_met = _b; } @@ -713,6 +743,11 @@ public abstract class TGComponent implements CDElement, GenericTree { if (tdp.DIPLO_ID_ON) { drawDiploID(g); } + + if (DIPLO_met > 0) { + drawDIPLOMet(g); + } + ri = tdp.getMGUI().isRunningID(getDIPLOID()); if (ri != null) { drawRunningDiploID(g, ri); diff --git a/src/ui/interactivesimulation/JFrameInteractiveSimulation.java b/src/ui/interactivesimulation/JFrameInteractiveSimulation.java index 8ec4f2bcbc5e9298798af3b86ad5e231ebea35f4..80ae779c0009751f2814a6197e77cd8aa6c51c5e 100755 --- a/src/ui/interactivesimulation/JFrameInteractiveSimulation.java +++ b/src/ui/interactivesimulation/JFrameInteractiveSimulation.java @@ -76,6 +76,7 @@ public class JFrameInteractiveSimulation extends JFrame implements ActionListene protected static final String SIMULATION_TASK = "task"; protected static final String SIMULATION_CPU = "cpu"; protected static final String SIMULATION_BUS = "bus"; + protected static final String SIMULATION_COMMAND = "cmd"; private static String buttonStartS = "Start simulator"; private static String buttonCloseS = "Close"; @@ -208,6 +209,7 @@ public class JFrameInteractiveSimulation extends JFrame implements ActionListene if (tmap != null) { tmap.makeMinimumMapping(); hashCode = tmap.getHashCode(); + tmap.getTMLModeling().computeCorrespondance(); } else { hashOK = false; } @@ -1135,8 +1137,8 @@ public class JFrameInteractiveSimulation extends JFrame implements ActionListene return false; } Element elt, elt0; - Node node, node0; - NodeList nl; + Node node, node0, node00; + NodeList nl, nl0; String tmp; @@ -1223,6 +1225,30 @@ public class JFrameInteractiveSimulation extends JFrame implements ActionListene hash = node0.getTextContent(); } + nl = elt.getElementsByTagName(SIMULATION_COMMAND); + for(int kk=0; kk<nl.getLength(); kk++) { + node0 = nl.item(kk); + elt0 = (Element)node0; + id = null; + name = null; + command = null; + id = elt0.getAttribute("id"); + //TraceManager.addDev("nl:" + nl + " value=" + node0.getNodeValue() + " content=" + node0.getTextContent()); + nl0 = elt0.getElementsByTagName("exectimes"); + if ((nl0 != null) && (nl0.getLength() > 0)) { + node00 = nl0.item(0); + //TraceManager.addDev("nl0:" + nl0 + " value=" + node00.getNodeValue() + " content=" + node00.getTextContent()); + util = node00.getTextContent(); + } + + //TraceManager.addDev("Got info on command " + id + " util=" + util); + + if ((id != null) && (util != null)) { + //TraceManager.addDev("Updating command"); + updateCommandExecutionState(id, util); + } + } + } if (hashOK) { @@ -1398,6 +1424,8 @@ public class JFrameInteractiveSimulation extends JFrame implements ActionListene updateBusState(id, util); } } + + } } } @@ -1834,6 +1862,18 @@ public class JFrameInteractiveSimulation extends JFrame implements ActionListene }*/ } + private void updateExecutedCommands() { + if (tmap == null) { + return; + } + + if (mode != STARTED_AND_CONNECTED) { + return; + } + + sendCommand("get-executed-operators"); + } + private void updateRunningCommand(String id, String command, String progression, String startTime, String finishTime, String nextCommand, String transStartTime, String transFinishTime, String _state) { @@ -2102,11 +2142,32 @@ public class JFrameInteractiveSimulation extends JFrame implements ActionListene } } + private void updateCommandExecutionState(String _id, String _nbOfExec) { + Integer id = getInteger(_id); + Integer nbOfExec = getInteger(_nbOfExec); + + //TraceManager.addDev("Updating execution of command " + _id + " to " + _nbOfExec); + + if (tmap != null) { + TMLElement tmle = tmap.getTMLModeling().getCorrespondance(id); + if (tmle != null) { + Object o = tmle.getReferenceObject(); + if ((o != null) && (o instanceof TGComponent)) { + //TraceManager.addDev("Setting met DIPLO = " + o); + ((TGComponent)o).setDIPLOMet(nbOfExec); + } + } + } + + //tmap.getElementByID(); + } + public void askForUpdate() { sendCommand("time"); if (hashOK) { if (animate.isSelected()) { updateTaskCommands(); + updateExecutedCommands(); } if (update.isSelected()) { updateTasks();