Commit bd373334 authored by Ludovic Apvrille's avatar Ludovic Apvrille

Merge branch 'CompareLatencyDetailedAnlysis' into 'master'

Compare latency detailed analysis

See merge request !323
parents 294ea97c c0760ff5
...@@ -231,6 +231,9 @@ using std::max; ...@@ -231,6 +231,9 @@ using std::max;
#define TAG_CURRTASKc "</currtask>" #define TAG_CURRTASKc "</currtask>"
#define TAG_ENERGYo "<energy>" #define TAG_ENERGYo "<energy>"
#define TAG_ENERGYc "</energy>" #define TAG_ENERGYc "</energy>"
#define TAG_MODELo "<model>"
#define TAG_MODELc "</model>"
#define EXT_SEP "." #define EXT_SEP "."
#define EXT_VCD ".vcd" #define EXT_VCD ".vcd"
......
...@@ -379,7 +379,7 @@ void Simulator::schedule2XML(std::ostringstream& glob,std::string& iTraceFileNam ...@@ -379,7 +379,7 @@ void Simulator::schedule2XML(std::ostringstream& glob,std::string& iTraceFileNam
for(BusList::const_iterator j=_simComp->getBusList().begin(); j != _simComp->getBusList().end(); ++j){ for(BusList::const_iterator j=_simComp->getBusList().begin(); j != _simComp->getBusList().end(); ++j){
(*j)->schedule2XML(glob,myfile); (*j)->schedule2XML(glob,myfile);
} }
glob << TAG_MODELo<< _simComp->getModelName() << TAG_MODELc; //name of model
glob << std::endl << TAG_GLOBALc << std::endl << TAG_STARTc << std::endl; glob << std::endl << TAG_GLOBALc << std::endl << TAG_STARTc << std::endl;
myfile << glob.str() << std::endl; myfile << glob.str() << std::endl;
......
...@@ -557,5 +557,20 @@ public class TMLArchitecture { ...@@ -557,5 +557,20 @@ public class TMLArchitecture {
return bridgeList; return bridgeList;
} }
public List<HwA> getHwA() {
List<HwA> hardwareAccList = new ArrayList<HwA>();
for (HwNode node : hwnodes) {
if (node instanceof HwA) {
HwA hardwareAcc = (HwA) node;
hardwareAccList.add(hardwareAcc);
}
}
return hardwareAccList;
}
} }
\ No newline at end of file
...@@ -311,8 +311,6 @@ public class ActionPerformer { ...@@ -311,8 +311,6 @@ public class ActionPerformer {
mgui.enhanceDiagram(); mgui.enhanceDiagram();
} else if (command.equals(mgui.actions[TGUIAction.ACT_NC].getActionCommand())) { } else if (command.equals(mgui.actions[TGUIAction.ACT_NC].getActionCommand())) {
mgui.NC(); mgui.NC();
} else if (command.equals(mgui.actions[TGUIAction.ACT_GEN_LATENCY_GRAPH].getActionCommand())) {
mgui.latencyDetailedAnalysis();
} else if (command.equals(mgui.actions[TGUIAction.EXTERNAL_ACTION_1].getActionCommand())) { } else if (command.equals(mgui.actions[TGUIAction.EXTERNAL_ACTION_1].getActionCommand())) {
mgui.executeUserCommand(ConfigurationTTool.ExternalCommand1Host, SpecConfigTTool.ExternalCommand1); mgui.executeUserCommand(ConfigurationTTool.ExternalCommand1Host, SpecConfigTTool.ExternalCommand1);
} else if (command.equals(mgui.actions[TGUIAction.EXTERNAL_ACTION_2].getActionCommand())) { } else if (command.equals(mgui.actions[TGUIAction.EXTERNAL_ACTION_2].getActionCommand())) {
......
...@@ -646,14 +646,7 @@ public class JMenuBarTurtle extends JMenuBar { ...@@ -646,14 +646,7 @@ public class JMenuBarTurtle extends JMenuBar {
menuItem = codeG.add(mgui.actions[TGUIAction.ACT_AVATAR_EXECUTABLE_GENERATION]); menuItem = codeG.add(mgui.actions[TGUIAction.ACT_AVATAR_EXECUTABLE_GENERATION]);
menuItem.setName("CodeG Executable"); menuItem.setName("CodeG Executable");
menuItem.addMouseListener(mgui.mouseHandler); menuItem.addMouseListener(mgui.mouseHandler);
if (mgui.isExperimentalOn()) {
vAndV.addSeparator();
menuItem = vAndV.add(mgui.actions[TGUIAction.ACT_GEN_LATENCY_GRAPH]);
menuItem.setName("Latency Detailed Analysis");
menuItem.addMouseListener(mgui.mouseHandler);
}
// View // View
menuItem = view.add(mgui.actions[TGUIAction.ACT_VIEW_BIRDEYES_EMB]); menuItem = view.add(mgui.actions[TGUIAction.ACT_VIEW_BIRDEYES_EMB]);
menuItem.setName("View Hide Birdeye"); menuItem.setName("View Hide Birdeye");
......
...@@ -68,7 +68,6 @@ import ui.avatarrd.AvatarRDPanel; ...@@ -68,7 +68,6 @@ import ui.avatarrd.AvatarRDPanel;
import ui.avatarsmd.AvatarSMDPanel; import ui.avatarsmd.AvatarSMDPanel;
import ui.cd.TClassDiagramPanel; import ui.cd.TClassDiagramPanel;
import ui.diplodocusmethodology.DiplodocusMethodologyDiagramPanel; import ui.diplodocusmethodology.DiplodocusMethodologyDiagramPanel;
import ui.directedgraph.JFrameLatencyDetailedAnalysis;
import ui.ebrdd.EBRDDPanel; import ui.ebrdd.EBRDDPanel;
import ui.eln.ELNDiagramPanel; import ui.eln.ELNDiagramPanel;
import ui.file.*; import ui.file.*;
...@@ -82,6 +81,7 @@ import ui.osad.TURTLEOSActivityDiagramPanel; ...@@ -82,6 +81,7 @@ import ui.osad.TURTLEOSActivityDiagramPanel;
import ui.prosmd.ProactiveSMDPanel; import ui.prosmd.ProactiveSMDPanel;
import ui.req.Requirement; import ui.req.Requirement;
import ui.req.RequirementDiagramPanel; import ui.req.RequirementDiagramPanel;
import ui.simulationtraceanalysis.latencyDetailedAnalysisMain;
import ui.syscams.SysCAMSComponentTaskDiagramPanel; import ui.syscams.SysCAMSComponentTaskDiagramPanel;
import ui.syscams.SysCAMSCompositeComponent; import ui.syscams.SysCAMSCompositeComponent;
import ui.tmlad.TMLActivityDiagramPanel; import ui.tmlad.TMLActivityDiagramPanel;
...@@ -106,12 +106,19 @@ import javax.swing.*; ...@@ -106,12 +106,19 @@ import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.filechooser.FileNameExtensionFilter; import javax.swing.filechooser.FileNameExtensionFilter;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPathExpressionException;
import org.xml.sax.SAXException;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.*; import java.util.*;
import java.util.List; import java.util.List;
...@@ -197,7 +204,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per ...@@ -197,7 +204,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per
public final static byte NOT_OPENED = 0; public final static byte NOT_OPENED = 0;
public final static byte OPENED = 1; public final static byte OPENED = 1;
public final static byte MODEL_OK = 2; public final static byte MODEL_OK = 2;
public final static byte MODEL_CHANGED = 3; public final static byte MODEL_CHANGED = 3;
public final static byte MODEL_SAVED = 4; public final static byte MODEL_SAVED = 4;
public final static byte RTLOTOS_OK = 5; public final static byte RTLOTOS_OK = 5;
public final static byte BACKWARD = 6; public final static byte BACKWARD = 6;
...@@ -329,7 +336,11 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per ...@@ -329,7 +336,11 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per
private JFrameInteractiveSimulation jfis; private JFrameInteractiveSimulation jfis;
private JFrameAvatarInteractiveSimulation jfais; private JFrameAvatarInteractiveSimulation jfais;
private JFrameCompareSimulationTraces cSimTrace; private JFrameCompareSimulationTraces cSimTrace;
private JFrameLatencyDetailedAnalysis latencyDetailedAnalysis;
private latencyDetailedAnalysisMain latencyDetailedAnalysisMain;
// Help // Help
private HelpManager helpManager; private HelpManager helpManager;
...@@ -339,10 +350,8 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per ...@@ -339,10 +350,8 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per
private Invariant currentInvariant; private Invariant currentInvariant;
// Thread for autosave // Thread for autosave
private PeriodicBehaviorThread pbt; private PeriodicBehaviorThread pbt;
private TMLArchiPanel tmlap; // Used to retrieve the currently opened architecture panel
// Plugin management // Plugin management
// public static PluginManager pluginManager; // public static PluginManager pluginManager;
...@@ -4061,7 +4070,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per ...@@ -4061,7 +4070,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per
} }
} }
} else if (tp instanceof TMLArchiPanel) { } else if (tp instanceof TMLArchiPanel) {
tmlap = (TMLArchiPanel) tp; TMLArchiPanel tmlap = (TMLArchiPanel) tp;
JDialogSelectTMLNodes.validated = tmlap.validated; JDialogSelectTMLNodes.validated = tmlap.validated;
JDialogSelectTMLNodes.ignored = tmlap.ignored; JDialogSelectTMLNodes.ignored = tmlap.ignored;
Vector<TGComponent> tmlNodesToValidate = new Vector<TGComponent>(); Vector<TGComponent> tmlNodesToValidate = new Vector<TGComponent>();
...@@ -9543,10 +9552,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per ...@@ -9543,10 +9552,7 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per
} }
// Get the currently opened architecture panel
public TMLArchiPanel getCurrentArchiPanel() {
return tmlap;
}
// DraggableTabbedPaneCallbackInterface // DraggableTabbedPaneCallbackInterface
public void hasBeenDragged(int initialPosition, int destinationPosition) { public void hasBeenDragged(int initialPosition, int destinationPosition) {
...@@ -9569,85 +9575,19 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per ...@@ -9569,85 +9575,19 @@ public class MainGUI implements ActionListener, WindowListener, KeyListener, Per
cSimTrace.setVisible(true); cSimTrace.setVisible(true);
} }
public void latencyDetailedAnalysis() { public void compareLatencyForXML(SimulationTrace selectedST, boolean b) {
Vector<TGComponent> tmlNodesToValidate = new Vector<TGComponent>(); latencyDetailedAnalysisMain = new latencyDetailedAnalysisMain(1,this,selectedST,b,false,0);
List<TMLComponentDesignPanel> cpanels;
TMLComponentDesignPanel compdp;
TURTLEPanel tp = getCurrentTURTLEPanel();
// tmlap = (TMLArchiPanel) tp;
if (gtm == null) {
} else {
if (gtm.getTMLMapping() != null) {
TMLMapping<TGComponent> map = gtm.getTMLMapping();
for (TGComponent component : tmlap.tmlap.getComponentList()) {
tmlNodesToValidate.add(component);
}
TGComponent tgc;
List<TMLArchiArtifact> artifacts;
String namePanel;
TURTLEPanel tup;
Iterator<? extends TGComponent> iterator = tmlNodesToValidate.listIterator();
cpanels = new ArrayList<TMLComponentDesignPanel>();
while (iterator.hasNext()) {
tgc = iterator.next();
if (tgc instanceof TMLArchiNode) {
artifacts = ((TMLArchiNode) (tgc)).getAllTMLArchiArtifacts();
for (TMLArchiArtifact artifact : artifacts) {
namePanel = artifact.getReferenceTaskName();
try {
tup = getTURTLEPanel(namePanel);
if (tup instanceof TMLComponentDesignPanel) {
compdp = (TMLComponentDesignPanel) (tup);
if (!cpanels.contains(compdp)) {
cpanels.add(compdp);
}
}
} catch (Exception e) {
// Just in case the mentionned panel is not a TML design Panel
}
}
}
}
latencyDetailedAnalysis = new JFrameLatencyDetailedAnalysis(map, cpanels);
latencyDetailedAnalysis.setIconImage(IconManager.img9);
GraphicLib.centerOnParent(latencyDetailedAnalysis, 900, 600);
latencyDetailedAnalysis.setVisible(true);
} else {
if (gtm.getArtificialTMLMapping() != null) {
TMLMapping<TGComponent> map = gtm.getArtificialTMLMapping();
TMLComponentDesignPanel tmlcdp = (TMLComponentDesignPanel) tp;
cpanels = new ArrayList<TMLComponentDesignPanel>();
cpanels.add(tmlcdp);
latencyDetailedAnalysis = new JFrameLatencyDetailedAnalysis(map, cpanels);
latencyDetailedAnalysis.setIconImage(IconManager.img9);
GraphicLib.centerOnParent(latencyDetailedAnalysis, 900, 600);
latencyDetailedAnalysis.setVisible(true);
} else {
}
}
}
// dp.getPanels();
} }
public JFrameLatencyDetailedAnalysis getLatencyDetailedAnalysis() { public void latencyDetailedAnalysisForXML(SimulationTrace selectedST, boolean b, boolean compare, int j) throws XPathExpressionException, ParserConfigurationException, SAXException, IOException {
return latencyDetailedAnalysis;
latencyDetailedAnalysisMain = new latencyDetailedAnalysisMain(2,this,selectedST,b ,compare,j);
} }
} // Class MainGUI } // Class MainGUI
...@@ -179,8 +179,7 @@ public class ModeManager { ...@@ -179,8 +179,7 @@ public class ModeManager {
actions[TGUIAction.ACT_GEN_CCODE].setEnabled(true); actions[TGUIAction.ACT_GEN_CCODE].setEnabled(true);
actions[TGUIAction.ACT_GEN_AUT].setEnabled(true); actions[TGUIAction.ACT_GEN_AUT].setEnabled(true);
actions[TGUIAction.ACT_GEN_AUTS].setEnabled(true); actions[TGUIAction.ACT_GEN_AUTS].setEnabled(true);
actions[TGUIAction.ACT_GEN_UPPAAL].setEnabled(true); actions[TGUIAction.ACT_GEN_UPPAAL].setEnabled(true);
actions[TGUIAction.ACT_GEN_LATENCY_GRAPH].setEnabled(true);
break; break;
case MainGUI.AVATAR_SYNTAXCHECKING_OK: case MainGUI.AVATAR_SYNTAXCHECKING_OK:
actions[TGUIAction.ACT_AVATAR_SIM].setEnabled(true); actions[TGUIAction.ACT_AVATAR_SIM].setEnabled(true);
...@@ -249,8 +248,7 @@ public class ModeManager { ...@@ -249,8 +248,7 @@ public class ModeManager {
actions[TGUIAction.ACT_AVATAR_FV_UPPAAL].setEnabled(false); actions[TGUIAction.ACT_AVATAR_FV_UPPAAL].setEnabled(false);
actions[TGUIAction.ACT_AVATAR_FV_PROVERIF].setEnabled(false); actions[TGUIAction.ACT_AVATAR_FV_PROVERIF].setEnabled(false);
actions[TGUIAction.ACT_AVATAR_FV_STATICANALYSIS].setEnabled(false); actions[TGUIAction.ACT_AVATAR_FV_STATICANALYSIS].setEnabled(false);
actions[TGUIAction.ACT_AVATAR_EXECUTABLE_GENERATION].setEnabled(false); actions[TGUIAction.ACT_AVATAR_EXECUTABLE_GENERATION].setEnabled(false);
actions[TGUIAction.ACT_GEN_LATENCY_GRAPH].setEnabled(false);
break; break;
case MainGUI.METHO_CHANGED: case MainGUI.METHO_CHANGED:
actions[TGUIAction.ACT_GEN_RTLOTOS].setEnabled(false); actions[TGUIAction.ACT_GEN_RTLOTOS].setEnabled(false);
...@@ -298,8 +296,7 @@ public class ModeManager { ...@@ -298,8 +296,7 @@ public class ModeManager {
actions[TGUIAction.ACT_AVATAR_FV_UPPAAL].setEnabled(false); actions[TGUIAction.ACT_AVATAR_FV_UPPAAL].setEnabled(false);
actions[TGUIAction.ACT_AVATAR_FV_PROVERIF].setEnabled(false); actions[TGUIAction.ACT_AVATAR_FV_PROVERIF].setEnabled(false);
actions[TGUIAction.ACT_AVATAR_FV_STATICANALYSIS].setEnabled(false); actions[TGUIAction.ACT_AVATAR_FV_STATICANALYSIS].setEnabled(false);
actions[TGUIAction.ACT_AVATAR_EXECUTABLE_GENERATION].setEnabled(false); actions[TGUIAction.ACT_AVATAR_EXECUTABLE_GENERATION].setEnabled(false);
actions[TGUIAction.ACT_GEN_LATENCY_GRAPH].setEnabled(false);
break; break;
case MainGUI.MODEL_SAVED: case MainGUI.MODEL_SAVED:
......
...@@ -682,8 +682,7 @@ public class TGUIAction extends AbstractAction { ...@@ -682,8 +682,7 @@ public class TGUIAction extends AbstractAction {
//-- //--
public static final int MOVE_ENABLED = 463; public static final int MOVE_ENABLED = 463;
public static final int FIRST_DIAGRAM = 464; public static final int FIRST_DIAGRAM = 464;
public static final int ACT_GEN_LATENCY_GRAPH = 519;
public static final int NB_ACTION = 528; public static final int NB_ACTION = 528;
private static final TAction [] actions = new TAction[NB_ACTION]; private static final TAction [] actions = new TAction[NB_ACTION];
...@@ -1425,7 +1424,7 @@ public class TGUIAction extends AbstractAction { ...@@ -1425,7 +1424,7 @@ public class TGUIAction extends AbstractAction {
actions[MOVE_ENABLED] = new TAction("Move", "Move enabled", IconManager.imgic780, IconManager.imgic780, "Move enabled (shift + arrow)", "Move", 0); actions[MOVE_ENABLED] = new TAction("Move", "Move enabled", IconManager.imgic780, IconManager.imgic780, "Move enabled (shift + arrow)", "Move", 0);
actions[FIRST_DIAGRAM] = new TAction("FirstDiagram", "First Diagram", IconManager.imgic142, IconManager.imgic142, "Switch the the first diagram", "Switch to the first diagram", 0); actions[FIRST_DIAGRAM] = new TAction("FirstDiagram", "First Diagram", IconManager.imgic142, IconManager.imgic142, "Switch the the first diagram", "Switch to the first diagram", 0);
actions[ACT_GEN_LATENCY_GRAPH] = new TAction("generate-latency-graph", "Analyze Latency Graph", IconManager.imgic1118, IconManager.imgic1118, "Analyze Latency Graph", "Analyze Latency Graph", '0');
} }
public String getActionCommand() { public String getActionCommand() {
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
* knowledge of the CeCILL license and that you accept its terms. * knowledge of the CeCILL license and that you accept its terms.
*/ */
package ui.directedgraph; package ui.simulationtraceanalysis;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
...@@ -389,6 +389,8 @@ public class JFrameLatencyDetailedPopup extends JFrame implements TableModelList ...@@ -389,6 +389,8 @@ public class JFrameLatencyDetailedPopup extends JFrame implements TableModelList
} }
} }
HashMap<String, ArrayList<ArrayList<Integer>>> delayTime = dgraph.getRowDelayDetailsByHW(row);
for (SimulationTransaction st : dgraph.getTaskMinMaxHWByRowDetails(row)) { for (SimulationTransaction st : dgraph.getTaskMinMaxHWByRowDetails(row)) {
...@@ -402,7 +404,35 @@ public class JFrameLatencyDetailedPopup extends JFrame implements TableModelList ...@@ -402,7 +404,35 @@ public class JFrameLatencyDetailedPopup extends JFrame implements TableModelList
dataDetailedByTask[deviceNames1.indexOf(dName)][columnnmber] = dgraph.getNameIDTaskList().get(st.id); dataDetailedByTask[deviceNames1.indexOf(dName)][columnnmber] = dgraph.getNameIDTaskList().get(st.id);
; ;
offPathBehavior.add(dgraph.getNameIDTaskList().get(st.id) + columnNames[columnnmber]); boolean causeDelay = false;
if (delayTime.containsKey(st.deviceName)) {
for (Entry<String, ArrayList<ArrayList<Integer>>> entry : delayTime.entrySet()) {
if (entry.getKey().equals(st.deviceName)) {
ArrayList<ArrayList<Integer>> timeList = entry.getValue();
for (int j = 0; j < timeList.size(); j++) {
if (Integer.valueOf(st.startTime) >= timeList.get(j).get(0)
&& Integer.valueOf(st.startTime) <= timeList.get(j).get(1)) {
causeDelay = true;
}
}
}
}
}
if (causeDelay) {
offPathBehaviorCausingDelay.add(dgraph.getNameIDTaskList().get(st.id) + columnNames[columnnmber]);
} else {
offPathBehavior.add(dgraph.getNameIDTaskList().get(st.id) + columnNames[columnnmber]);
}
} }
} }
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
* knowledge of the CeCILL license and that you accept its terms. * knowledge of the CeCILL license and that you accept its terms.
*/ */
package ui.directedgraph; package ui.simulationtraceanalysis;
import ui.util.IconManager; import ui.util.IconManager;
import ui.TAction; import ui.TAction;
...@@ -64,8 +64,12 @@ public class LatencyDetailedAnalysisActions extends AbstractAction { ...@@ -64,8 +64,12 @@ public class LatencyDetailedAnalysisActions extends AbstractAction {
public static final int ACT_LOAD_SIMULATION_TRACES = 4; public static final int ACT_LOAD_SIMULATION_TRACES = 4;
public static final int ACT_DETAILED_ANALYSIS = 5; public static final int ACT_DETAILED_ANALYSIS = 5;
public static final int ACT_Import_ANALYSIS = 6; public static final int ACT_Import_ANALYSIS = 6;
public static final int ACT_SHOW_GRAPH_FILE_1 = 7;
public static final int ACT_SHOW_GRAPH_FILE_2 = 8;
public static final int ACT_COMPARE_IN_DETAILS = 9;
public static final int NB_ACTION = 7; public static final int NB_ACTION = 10;
private static final TAction[] actions = new TAction[NB_ACTION]; private static final TAction[] actions = new TAction[NB_ACTION];
...@@ -117,6 +121,16 @@ public class LatencyDetailedAnalysisActions extends AbstractAction { ...@@ -117,6 +121,16 @@ public class LatencyDetailedAnalysisActions extends AbstractAction {
"show detailed analysis tables", "show detailed analysis tables", 'T'); "show detailed analysis tables", "show detailed analysis tables", 'T');
actions[ACT_Import_ANALYSIS] = new TAction("import-trace", "Save Directed Graph", IconManager.imgic341, IconManager.imgic341, actions[ACT_Import_ANALYSIS] = new TAction("import-trace", "Save Directed Graph", IconManager.imgic341, IconManager.imgic341,
"import Directed Graph", "Import Directed Graph", 'S'); "import Directed Graph", "Import Directed Graph", 'S');
actions[ACT_SHOW_GRAPH_FILE_1] = new TAction("show_graph_file_1", "Show Directed Graph 1", IconManager.imgic341, IconManager.imgic341,
"Show Directed Graph", "Show Directed Graph", 'S');
actions[ACT_SHOW_GRAPH_FILE_2] = new TAction("show_graph_file_2", "Show Directed Graph 2", IconManager.imgic341, IconManager.imgic341,
"Show Directed Graph", "Show Directed Graph", 'S');
actions[ACT_COMPARE_IN_DETAILS] = new TAction("compare_in_details", "Compare In Detials", IconManager.imgic53, IconManager.imgic53,
"Compare In Detials", "Compare In Detials", 'S');
} }
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
* knowledge of the CeCILL license and that you accept its terms. * knowledge of the CeCILL license and that you accept its terms.
*/ */
package ui.directedgraph; package ui.simulationtraceanalysis;
import javax.swing.JToolBar; import javax.swing.JToolBar;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
* knowledge of the CeCILL license and that you accept its terms. * knowledge of the CeCILL license and that you accept its terms.
*/ */
package ui.directedgraph; package ui.simulationtraceanalysis;
import javax.swing.JButton; import javax.swing.JButton;
......
package ui.directedgraph; package ui.simulationtraceanalysis;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
...@@ -18,12 +18,16 @@ class TableRenderer extends DefaultTableCellRenderer { ...@@ -18,12 +18,16 @@ class TableRenderer extends DefaultTableCellRenderer {
private Vector<Object> allCommands = new Vector<Object>(); private Vector<Object> allCommands = new Vector<Object>();
private Vector<Color> allColors = new Vector<Color>(); private Vector<Color> allColors = new Vector<Color>();
List<String> onPathBehaviors; List<String> onPathBehaviors = new Vector<String>();
List<String> offPathBehaviors; List<String> offPathBehaviors= new Vector<String>();
List<String> offPathBehaviorCausingDelay; List<String> offPathBehaviorCausingDelay = new Vector<String>();
public TableRenderer(List<String> onPathBehavior, List<String> offPathBehaviorCausingDelay, List<String> offPathBehavior) { public TableRenderer(List<String> onPathBehavior, List<String> offPathBehaviorCausingDelay, List<String> offPathBehavior) {
this.onPathBehaviors = new Vector<String>();
this.offPathBehaviorCausingDelay = new Vector<String>();
this.offPathBehaviors = new Vector<String>();
this.onPathBehaviors = onPathBehavior; this.onPathBehaviors = onPathBehavior;
this.offPathBehaviorCausingDelay = offPathBehaviorCausingDelay; this.offPathBehaviorCausingDelay = offPathBehaviorCausingDelay;
this.offPathBehaviors = offPathBehavior; this.offPathBehaviors = offPathBehavior;
...@@ -48,6 +52,7 @@ class TableRenderer extends DefaultTableCellRenderer { ...@@ -48,6 +52,7 @@ class TableRenderer extends DefaultTableCellRenderer {
randomColour = Color.red; randomColour = Color.red;
} else if (offPathBehaviors.contains(value.toString() + table.getColumnName(column))) { } else if (offPathBehaviors.contains(value.toString() + table.getColumnName(column))) {
randomColour = Color.orange; randomColour = Color.orange;
// randomColour = Color.red;
} }
} else { } else {
this.colorCell = false; this.colorCell = false;
......
...@@ -58,10 +58,16 @@ import javax.swing.event.TreeSelectionEvent; ...@@ -58,10 +58,16 @@ import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener; import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel; import javax.swing.tree.TreeSelectionModel;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.xpath.XPathExpressionException;
import org.xml.sax.SAXException;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseListener; import java.awt.event.MouseListener;
import java.io.IOException;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.Set; import java.util.Set;
...@@ -96,6 +102,8 @@ public class JDiagramTree extends javax.swing.JTree implements ActionListener, M ...@@ -96,6 +102,8 @@ public class JDiagramTree extends javax.swing.JTree implements ActionListener, M
protected JMenuItem jmiShowST; protected JMenuItem jmiShowST;
protected JMenuItem jmiShowInFinderST; protected JMenuItem jmiShowInFinderST;
protected JMenuItem jmiCompareST; protected JMenuItem jmiCompareST;
protected JMenuItem jmiLatencyAnalysisST;
protected JMenuItem jmiCompareLatencyAnalysisST;
protected JPopupMenu popupTree; protected JPopupMenu popupTree;
protected JPopupMenu popupTreeST; protected JPopupMenu popupTreeST;
protected RG selectedRG; protected RG selectedRG;
...@@ -259,9 +267,19 @@ public class JDiagramTree extends javax.swing.JTree implements ActionListener, M ...@@ -259,9 +267,19 @@ public class JDiagramTree extends javax.swing.JTree implements ActionListener, M
popupTreeST.add(jmiShowInFinderST); popupTreeST.add(jmiShowInFinderST);
if (selectedST.getType() == SimulationTrace.XML_DIPLO) { if (selectedST.getType() == SimulationTrace.XML_DIPLO) {
jmiCompareST = new JMenuItem("Compare");
jmiCompareST.addActionListener(this); jmiCompareST = new JMenuItem("Compare Simulation Traces");
jmiCompareST.addActionListener(this);
popupTreeST.add(jmiCompareST); popupTreeST.add(jmiCompareST);
jmiLatencyAnalysisST = new JMenuItem("Latency Analysis");
jmiLatencyAnalysisST.addActionListener(this);
popupTreeST.add(jmiLatencyAnalysisST);
jmiCompareLatencyAnalysisST = new JMenuItem("Compare Latency Analysis");
jmiCompareLatencyAnalysisST.addActionListener(this);
popupTreeST.add(jmiCompareLatencyAnalysisST);
} }
...@@ -516,7 +534,31 @@ public class JDiagramTree extends javax.swing.JTree implements ActionListener, M ...@@ -516,7 +534,31 @@ public class JDiagramTree extends javax.swing.JTree implements ActionListener, M
mgui.compareSimulationTraces(selectedST, true); mgui.compareSimulationTraces(selectedST, true);
} }
} else if (ae.getSource() == jmiLatencyAnalysisST) {
try {
mgui.latencyDetailedAnalysisForXML(selectedST, true , false,1);
} catch (XPathExpressionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ParserConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SAXException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}