Skip to content
Snippets Groups Projects
Commit 426ae21e authored by Ludovic Apvrille's avatar Ludovic Apvrille
Browse files

Adding computation time for PLAN - diplodocus

parent bc30fa6f
No related branches found
No related tags found
No related merge requests found
......@@ -510,6 +510,8 @@ public class JFrameLatencyDetailedAnalysis extends JFrame implements ActionListe
protected void generateDirectedGraph(TMLMapping<TGComponent> tmap, List<TMLComponentDesignPanel> cpanels) {
try {
long timeStart = System.currentTimeMillis();
dgraph = new DependencyGraphTranslator(tmap);
tc.setDgraph(dgraph);
pbar.setMaximum(dgraph.getNodeNbProgressBar());
......@@ -531,8 +533,9 @@ public class JFrameLatencyDetailedAnalysis extends JFrame implements ActionListe
}
});
dgraph.DrawDirectedGraph();
long timeEnd = System.currentTimeMillis();
jta.append("A directed graph with " + dgraph.getGraphsize() + " vertices and " + dgraph.getGraphEdgeSet()
+ " edges has been successfully generated.\n");
+ " edges has been successfully generated.\nThe computation took " + (timeEnd-timeStart) + " ms\n");
// buttonSaveDGraph.setEnabled(true);
if (dgraph.getWarnings().size() > 0) {
jta.append("Warnings: \n ");
......@@ -700,8 +703,10 @@ public class JFrameLatencyDetailedAnalysis extends JFrame implements ActionListe
} else if (command.equals(actions[LatencyDetailedAnalysisActions.ACT_CHECK_PATH].getActionCommand())) {
String task1 = tasksDropDownCombo1.getSelectedItem().toString();
String task2 = tasksDropDownCombo2.getSelectedItem().toString();
long timeStart = System.currentTimeMillis();
String message = dgraph.checkPath(task1, task2);
jta.append(message + " :" + task1 + " and " + task2 + ".\n");
long timeEnd = System.currentTimeMillis();
jta.append(message + " :" + task1 + " and " + task2 + ".\nThe computation took " + (timeEnd-timeStart) + " ms\n");
} else if (command.equals(actions[LatencyDetailedAnalysisActions.ACT_ADD_RULE].getActionCommand())) {
String node1 = tasksDropDownCombo3.getSelectedItem().toString();
String node2 = tasksDropDownCombo4.getSelectedItem().toString();
......@@ -858,6 +863,7 @@ public class JFrameLatencyDetailedAnalysis extends JFrame implements ActionListe
}
protected void preciselatencyAnalysis(int row1) throws InterruptedException {
tc.getT().join();
Boolean taint = taintFirstOp.isSelected();
int selectedIndex = resultTab.getSelectedIndex();
......@@ -912,6 +918,7 @@ public class JFrameLatencyDetailedAnalysis extends JFrame implements ActionListe
protected void latencyDetailedAnalysis() {
try {
long timeStart = System.currentTimeMillis();
preciseAnalysisbutton.setEnabled(false);
String task1 = tasksDropDownCombo1.getSelectedItem().toString();
String task2 = tasksDropDownCombo2.getSelectedItem().toString();
......@@ -986,7 +993,9 @@ public class JFrameLatencyDetailedAnalysis extends JFrame implements ActionListe
scrollPane11.revalidate();
scrollPane11.repaint();
// scrollPane11.setVisible(true);
jta.append("Latency has been computed...Please refer to the tables in the Latency Analysis section for the results.\n");
long timeEnd = System.currentTimeMillis();
jta.append("Latency has been computed...Please refer to the tables in the Latency Analysis section for the results.\n The computation " +
"took " + (timeEnd - timeStart) + " ms\n");
latencybutton.setEnabled(true);
this.pack();
this.setVisible(true);
......@@ -1046,6 +1055,10 @@ public class JFrameLatencyDetailedAnalysis extends JFrame implements ActionListe
return checkedTransactions;
}
public void preciseLatencyCompute(String text, long computationTime) {
jta.append("The computation of " + text + " took " + computationTime + " ms\n");
}
@Override
public void stateChanged(ChangeEvent e) {
}
......
......@@ -266,38 +266,38 @@ public class JFrameLatencyDetailedPopup extends JFrame implements TableModelList
c01.weighty = 1.0;
c01.weightx = 1.0;
c01.gridwidth = 1;
c01.gridx = 0;
c01.gridy = 0;
c01.gridx = 10;
c01.gridy = 1;
//JLabel pBarLabel0 = new JLabel(TABLE_LEGEND);
JPanel legendpanel = new JPanel(gridbag01);
//lengedpanel.add(pBarLabel0, c01);
c01.gridwidth = GridBagConstraints.REMAINDER;
c01.gridx = 1;
c01.gridy = 0;
c01.gridy = 1;
JLabel pBarLabel = new JLabel(MANDATORY_TRANSACTIONS, JLabel.RIGHT);
legendpanel.add(pBarLabel, c01);
c01.gridx = 1;
c01.gridy = 0;
c01.gridy = 1;
JLabel pBarLabel2 = new JLabel(" ", JLabel.LEFT);
pBarLabel2.setOpaque(true);
pBarLabel2.setBackground(Color.GREEN);
legendpanel.add(pBarLabel2, c01);
c01.gridx = 4;
c01.gridy = 0;
c01.gridy = 1;
JLabel pBarLabel3 = new JLabel(NON_MAND_CONT_TRAN, JLabel.RIGHT);
legendpanel.add(pBarLabel3, c01);
c01.gridx = 3;
c01.gridy = 0;
c01.gridy = 1;
JLabel pBarLabel4 = new JLabel(" ", JLabel.LEFT);
pBarLabel4.setOpaque(true);
pBarLabel4.setBackground(Color.RED);
legendpanel.add(pBarLabel4, c01);
c01.gridx = 6;
c01.gridy = 0;
c01.gridy = 1;
JLabel pBarLabel5 = new JLabel(NON_MAND_NO_CONT_TRAN, JLabel.RIGHT);
legendpanel.add(pBarLabel5, c01);
c01.gridx = 5;
c01.gridy = 0;
c01.gridy = 1;
JLabel pBarLabel6 = new JLabel(" ", JLabel.LEFT);
pBarLabel6.setOpaque(true);
pBarLabel6.setBackground(Color.ORANGE);
......
......@@ -43,8 +43,11 @@ public class LatencyAnalysisParallelAlgorithms implements Runnable {
if (algorithmId == 1) {
jFrameLDA.generateDirectedGraph(tmap, cpanels);
} else if (algorithmId == 2) {
long timeStart = System.currentTimeMillis();
dataDetailedByTask = dgraph.getTaskByRowDetails(row);
dataMandatoryOptional = dgraph.getMandatoryOptionalByRow(row);
long timeEnd = System.currentTimeMillis();
jFrameLDA.preciseLatencyCompute("precise latency analysis", timeEnd - timeStart);
} else if (algorithmId == 3) {
dataDetailedByTask = dgraph.getTaskByRowDetailsMinMaxTaint(row);
} else if (algorithmId == 4) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment