diff --git a/modeling/DIPLODOCUS/ModelsForZ3Tests/Z3SimpleTestCase.xml b/modeling/DIPLODOCUS/ModelsForZ3Tests/Z3SimpleTestCase.xml index bf72c5fe056d403f76cde1ab488f48687502666f..14f30248318b315bbbd4dd22b30cd26b6a554531 100644 --- a/modeling/DIPLODOCUS/ModelsForZ3Tests/Z3SimpleTestCase.xml +++ b/modeling/DIPLODOCUS/ModelsForZ3Tests/Z3SimpleTestCase.xml @@ -107,32 +107,32 @@ <cdparam x="869" y="173" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="Connector between ports" /> -<P1 x="863" y="206" id="64" /> -<P2 x="1055" y="308" id="40" /> +<P1 x="850" y="193" id="64" /> +<P2 x="1068" y="295" id="40" /> <AutomaticDrawing data="true" /> </CONNECTOR> <CONNECTOR type="126" id="35" > <cdparam x="873" y="587" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="Connector between ports" /> -<P1 x="874" y="555" id="53" /> -<P2 x="1055" y="361" id="38" /> +<P1 x="861" y="542" id="53" /> +<P2 x="1068" y="348" id="38" /> <AutomaticDrawing data="true" /> </CONNECTOR> <CONNECTOR type="126" id="36" > <cdparam x="412" y="359" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="Connector between ports" /> -<P1 x="412" y="359" id="79" /> -<P2 x="648" y="550" id="51" /> +<P1 x="399" y="346" id="79" /> +<P2 x="661" y="537" id="51" /> <AutomaticDrawing data="true" /> </CONNECTOR> <CONNECTOR type="126" id="37" > <cdparam x="412" y="305" /> <sizeparam width="0" height="0" minWidth="0" minHeight="0" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <infoparam name="connector" value="Connector between ports" /> -<P1 x="412" y="305" id="77" /> -<P2 x="637" y="203" id="66" /> +<P1 x="399" y="292" id="77" /> +<P2 x="650" y="190" id="66" /> <AutomaticDrawing data="true" /> </CONNECTOR> <COMPONENT type="1202" id="50" > @@ -3667,9 +3667,9 @@ <SUBCOMPONENT type="1101" id="1758" > <father id="1783" num="0" /> <cdparam x="747" y="169" /> -<sizeparam width="107" height="40" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="112" height="40" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="0" maxX="43" minY="0" maxY="60" /> +<cdrectangleparam minX="0" maxX="38" minY="0" maxY="60" /> <infoparam name="TGComponent" value="DEBA::taskD" /> <TGConnectingPoint num="0" id="1750" /> <TGConnectingPoint num="1" id="1751" /> @@ -3794,9 +3794,9 @@ <SUBCOMPONENT type="1101" id="1842" > <father id="1867" num="0" /> <cdparam x="581" y="169" /> -<sizeparam width="105" height="40" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="111" height="40" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="0" maxX="45" minY="0" maxY="60" /> +<cdrectangleparam minX="0" maxX="39" minY="0" maxY="60" /> <infoparam name="TGComponent" value="DEBA::taskE" /> <TGConnectingPoint num="0" id="1834" /> <TGConnectingPoint num="1" id="1835" /> @@ -3849,9 +3849,9 @@ <SUBCOMPONENT type="1101" id="1876" > <father id="1910" num="0" /> <cdparam x="1140" y="145" /> -<sizeparam width="106" height="40" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="111" height="40" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="0" maxX="44" minY="0" maxY="60" /> +<cdrectangleparam minX="0" maxX="39" minY="0" maxY="60" /> <infoparam name="TGComponent" value="DEBA::taskA" /> <TGConnectingPoint num="0" id="1868" /> <TGConnectingPoint num="1" id="1869" /> @@ -3868,9 +3868,9 @@ <SUBCOMPONENT type="1101" id="1885" > <father id="1910" num="1" /> <cdparam x="1140" y="171" /> -<sizeparam width="105" height="40" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> +<sizeparam width="111" height="40" minWidth="100" minHeight="1" maxWidth="2000" maxHeight="2000" minDesiredWidth="0" minDesiredHeight="0" /> <hidden value="false" /> -<cdrectangleparam minX="0" maxX="45" minY="0" maxY="60" /> +<cdrectangleparam minX="0" maxX="39" minY="0" maxY="60" /> <infoparam name="TGComponent" value="DEBA::taskB" /> <TGConnectingPoint num="0" id="1877" /> <TGConnectingPoint num="1" id="1878" /> diff --git a/src/main/java/ui/GTURTLEModeling.java b/src/main/java/ui/GTURTLEModeling.java index 4228e5b84050bb760d09c193fe30a307f58aedb0..e4f5defd34d0225b817d5aceebb96749bd83c9ef 100644 --- a/src/main/java/ui/GTURTLEModeling.java +++ b/src/main/java/ui/GTURTLEModeling.java @@ -1560,10 +1560,16 @@ public class GTURTLEModeling { public boolean generateGraphicalMapping(TMLMapping map) { TURTLEPanel tmlap = tmap.getCorrespondanceList().getTG(tmap.getArch().getFirstCPU()).getTDiagramPanel().tp; int arch = mgui.tabs.indexOf(tmlap); - mgui.cloneRenameTab(arch, "enc"); + mgui.cloneRenameTab(arch, "Z3"); TMLArchiPanel newArch = (TMLArchiPanel) mgui.tabs.get(mgui.tabs.size() - 1); TMLArchiDiagramPanel panel = newArch.tmlap; + if (panel == null) { + return false; + } + + panel.removeAllArtifacts(); + List<HwExecutionNode> nodes = map.getNodes(); HwExecutionNode node; List<TMLTask> tasks = map.getMappedTasks(); diff --git a/src/main/java/ui/TGComponent.java b/src/main/java/ui/TGComponent.java index 6cd458c86f62df4dafcd760b19b554145417aa21..7839e8076d8c8d46d4609ae0774acfd66d7f238a 100644 --- a/src/main/java/ui/TGComponent.java +++ b/src/main/java/ui/TGComponent.java @@ -2905,6 +2905,17 @@ public abstract class TGComponent extends AbstractCDElement implements /*CDElem return false; } + + public boolean removeAllInternalComponents() { + for(TGComponent tgc: tgcomponent) { + tgc.actionOnRemove(); + tdp.actionOnRemove(tgc); + } + tgcomponent = new TGComponent[0]; + nbInternalTGComponent = 0; + return true; + } + public boolean removeInternalComponent(TGComponent t) { //TGComponent tgc; for (int i = 0; i < nbInternalTGComponent; i++) { diff --git a/src/main/java/ui/tmldd/TMLArchiArtifact.java b/src/main/java/ui/tmldd/TMLArchiArtifact.java index 6b5efcbe148137456a720e40ab59c8a3379398d8..df70f0877568fb04a6f5b43944b46d7516dfb89b 100755 --- a/src/main/java/ui/tmldd/TMLArchiArtifact.java +++ b/src/main/java/ui/tmldd/TMLArchiArtifact.java @@ -96,7 +96,7 @@ public class TMLArchiArtifact extends TGCWithoutInternalComponent implements Swa editable = true; removable = true; userResizable=true; - value = "TMLDesign::task "; + value = "TMLDesign::task"; taskName = "name"; referenceTaskName = "TMLTask"; @@ -231,7 +231,7 @@ public class TMLArchiArtifact extends TGCWithoutInternalComponent implements Swa } - private void makeFullValue() { + public void makeFullValue() { value = referenceTaskName + "::" + taskName; } diff --git a/src/main/java/ui/tmldd/TMLArchiDiagramPanel.java b/src/main/java/ui/tmldd/TMLArchiDiagramPanel.java index 5f5d390e5528a998e04c9c3955de9bfee7904ceb..dbfd3410e91ca61718a8329b41feb7442c21a819 100755 --- a/src/main/java/ui/tmldd/TMLArchiDiagramPanel.java +++ b/src/main/java/ui/tmldd/TMLArchiDiagramPanel.java @@ -481,16 +481,27 @@ public class TMLArchiDiagramPanel extends TDiagramPanel implements TDPWithAttrib return res; } + public void removeAllArtifacts() { + for(TGComponent tgc: componentList) { + if (tgc instanceof SwallowTGComponent) { + tgc.removeAllInternalComponents(); + } + } + } + public boolean addTaskToNode(String nodeName, String taskName) { + int ID = 10; for(TGComponent tgc: componentList) { if (tgc instanceof TMLArchiNode) { TMLArchiNode node = (TMLArchiNode)tgc; if (node.getName().compareTo(nodeName) == 0) { if ((node instanceof TMLArchiCPUNode) || (node instanceof TMLArchiFPGANode) || (node instanceof TMLArchiHWANode)) { - TMLArchiArtifact arti = new TMLArchiArtifact(node.getX() + 10, node.getY() + 10, + TMLArchiArtifact arti = new TMLArchiArtifact(node.getX() + ID, node.getY() + ID, node.getCurrentMinX(), node.getCurrentMaxX(), node.getCurrentMinY(), node.getCurrentMaxY(), true, node, this); + ID += 5; arti.setTaskName(taskName); + arti.makeFullValue(); node.addSwallowedTGComponent(arti, 5, 5); return true; } diff --git a/src/main/java/ui/window/JDialogDSEZ3.java b/src/main/java/ui/window/JDialogDSEZ3.java index 2bdf57867cd67fc40d3a47194a1f0c6b1bf6eb98..1be97aa1d5963b22e4b63709f5fe85d93296ed22 100644 --- a/src/main/java/ui/window/JDialogDSEZ3.java +++ b/src/main/java/ui/window/JDialogDSEZ3.java @@ -353,14 +353,14 @@ public class JDialogDSEZ3 extends JDialog implements ActionListener, ListSelecti outputText.append("ERROR: " + result.error); } else { if (result.mappingFound) { - outputText.append("Optimized mapping found"); + outputText.append("Optimized mapping found\n"); outputText.append(result.result); - outputText.append("Generating graphical mapping"); + outputText.append("\nGenerating graphical mapping\n"); boolean b = mgui.gtm.generateGraphicalMapping(result.resultingMapping); if (!b) { - outputText.append("Error when creating graphical model"); + outputText.append("*Error* when creating graphical model\n"); } else { - outputText.append("Graphical model created"); + outputText.append("Graphical model created\n"); } } else { outputText.append("No suitable mapping could be found");