Commit 2afa9ef2 authored by Ludovic Apvrille's avatar Ludovic Apvrille

Update onCPU node dialog window

parent 67a3edc1
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -42,6 +42,7 @@
package ui.tmldd;
import myutil.GraphicLib;
import myutil.TraceManager;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
......@@ -222,6 +223,8 @@ public class TMLArchiBUSNode extends TMLArchiCommunicationNode implements Swallo
GraphicLib.centerOnParent(dialog, 500, 450);
dialog.setVisible( true ); // blocked until dialog has been closed
TraceManager.addDev("Bus 1");
if (!dialog.isRegularClose()) {
return false;
}
......
......@@ -39,7 +39,9 @@
package ui.tmldd;
import myutil.GraphicLib;
import myutil.TraceManager;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
......@@ -195,14 +197,18 @@ public class TMLArchiCPUNode extends TMLArchiNode implements SwallowTGComponent,
JDialogCPUNode dialog = new JDialogCPUNode(getTDiagramPanel().getMainGUI(), frame, "Setting CPU attributes", this, MECType, transactions);
dialog.setSize(500, 450);
GraphicLib.centerOnParent(dialog, 500, 450);
// dialog.show(); // blocked until dialog has been closed
dialog.setVisible(true);
dialog.setVisible(true); // blocked until dialog has been closed
MECType = dialog.getMECType();
//TraceManager.addDev("CPU core 1");
if (!dialog.isRegularClose()) {
return false;
}
//TraceManager.addDev("CPU core 2");
if (dialog.getNodeName().length() != 0) {
tmpName = dialog.getNodeName();
tmpName = tmpName.trim();
......@@ -213,6 +219,7 @@ public class TMLArchiCPUNode extends TMLArchiNode implements SwallowTGComponent,
name = tmpName;
}
}
// TraceManager.addDev("CPU core 3");
schedulingPolicy = dialog.getSchedulingPolicy();
if (schedulingPolicy == HwCPU.BASIC_ROUND_ROBIN) {
......@@ -238,18 +245,21 @@ public class TMLArchiCPUNode extends TMLArchiNode implements SwallowTGComponent,
}
}
//TraceManager.addDev("CPU core 4");
if (dialog.getNbOfCores().length() != 0) {
try {
tmp = nbOfCores;
nbOfCores = Integer.decode(dialog.getNbOfCores()).intValue();
TraceManager.addDev("Nb of cores=" + nbOfCores);
if (nbOfCores <= 0) {
nbOfCores = tmp;
error = true;
errors += "Data size ";
errors += "Nb of cores ";
}
} catch (Exception e) {
error = true;
errors += "Data size ";
errors += "nb of cores ";
}
}
......@@ -495,6 +505,8 @@ public class TMLArchiCPUNode extends TMLArchiNode implements SwallowTGComponent,
//
try {
//TraceManager.addDev("Extra param of CPU node " + this.getValue());
NodeList nli;
Node n1, n2;
Element elt;
......@@ -525,10 +537,15 @@ public class TMLArchiCPUNode extends TMLArchiNode implements SwallowTGComponent,
}
if (elt.getTagName().equals("attributes")) {
//TraceManager.addDev("LOADING attributes");
try {
// the "try" statement is for retro compatibility
nbOfCores = Integer.decode(elt.getAttribute("nbOfCores")).intValue();
//TraceManager.addDev("Setting cores to:" + nbOfCores);
} catch (Exception e) {
//TraceManager.addDev("Coud not load number of cores");
}
byteDataSize = Integer.decode(elt.getAttribute("byteDataSize")).intValue();
schedulingPolicy = Integer.decode(elt.getAttribute("schedulingPolicy")).intValue();
......
......@@ -132,7 +132,7 @@ public class JDialogCPUNode extends JDialogBase implements ActionListener {
//issue 183
private void buttonClick(JButton but, HelpEntry he) {
setModalityType(ModalityType.MODELESS);
//setModalityType(ModalityType.MODELESS);
but.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
......@@ -589,16 +589,21 @@ public class JDialogCPUNode extends JDialogBase implements ActionListener {
}
public void closeDialog() {
//TraceManager.addDev("Save and close");
regularClose = true;
MECType = ArchUnitMEC.Types.get( MECTypeCB.getSelectedIndex() );
dispose();
}
public void cancelDialog() {
//TraceManager.addDev("Cancel dialog");
dispose();
}
public boolean isRegularClose() {
TraceManager.addDev("regularclose=" + regularClose);
return regularClose;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment