Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/projections/Tools/TimeProfile/ThreadedFileReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import projections.gui.MainWindow;

/** The reader threads for Time Profile tool. This class ought to be generalized for all the other tools needing similar functionality. */
class ThreadedFileReader implements Runnable {
public class ThreadedFileReader implements Runnable {

private int pe;
// int p; // Which index am I into the flattened array of potentially sparse pe's
Expand Down Expand Up @@ -38,7 +38,7 @@ class ThreadedFileReader implements Runnable {
* @param intervalSize
* @param phaseMarkers
* */
protected ThreadedFileReader(int pe, long intervalSize, int myRun, int startInterval, int endInterval,
public ThreadedFileReader(int pe, long intervalSize, int myRun, int startInterval, int endInterval,
TreeMap<Double, String> phaseMarkers, double[][] graphData){
this.phaseMarkers = phaseMarkers;
this.pe = pe;
Expand Down
43 changes: 2 additions & 41 deletions src/projections/Tools/TimeProfile/TimeProfileWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
import projections.analysis.ProjMain;
import projections.analysis.TimedProgressThreadExecutor;
import projections.gui.Clickable;
import projections.gui.GenericGraphColorer;
import projections.gui.GenericGraphWindow;
import projections.gui.IntervalChooserPanel;
import projections.gui.JPanelToImage;
import projections.gui.MainWindow;
import projections.gui.RangeDialog;
import projections.gui.TimeProfileColorer;
import projections.gui.U;
import projections.gui.Util;

Expand Down Expand Up @@ -508,45 +508,6 @@ public void done() {
}
}



/** A class that provides the colors for the display */
public class TimeProfileColorer implements GenericGraphColorer {
int myRun = 0;
int outSize;
int numIntervals;

TimeProfileColorer(int outSize, int numIntervals){
this.outSize = outSize;
this.numIntervals = numIntervals;
}

public Paint[] getColorMap() {
Paint[] outColors = new Paint[outSize];
for (int i=0; i<numIntervals; i++) {
int count = 0;
for (int ep=0; ep<numEPs+special; ep++) {
if (stateArray[ep]) {
outputData[i][count] = graphData[i][ep];
if(ep == numEPs){
outColors[count++] = MainWindow.runObject[myRun].getOverheadColor();
}
else if (ep == numEPs+1){
outColors[count++] = MainWindow.runObject[myRun].getIdleColor();
}
else
outColors[count++] = MainWindow.runObject[myRun].getEPColorMap()[ep];
}
}
}

return outColors;
}

}



private void setOutputGraphData() {
// need first pass to decide the size of the outputdata
int outSize = 0;
Expand All @@ -572,7 +533,7 @@ private void setOutputGraphData() {
setYAxis("Percentage Utilization", "%");
String xAxisLabel = "Time (" + U.humanReadableString(intervalSize) + " resolution)";
setXAxis(xAxisLabel, "Time", startTime, intervalSize);
setDataSource("Time Profile", outputData, new TimeProfileColorer(outSize, numIntervals), thisWindow);
setDataSource("Time Profile", outputData, new TimeProfileColorer(outSize, numIntervals, numEPs, outputData, graphData, stateArray), thisWindow);
graphCanvas.setMarkers(phaseMarkers);
refreshGraph();
}
Expand Down
26 changes: 26 additions & 0 deletions src/projections/analysis/Pair.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package projections.analysis;

public class Pair {
private long start, end;

public Pair(long x, long y) {
start = x;
end = y;
}

public void setEnd(long end) {
this.end = end;
}

public void setStart(long start) {
this.start = start;
}

public long getEnd() {
return end;
}

public long getStart() {
return start;
}
}
Loading