use of com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult in project VideoOptimzer by attdevsupport.
the class GpsPlot method populate.
@Override
public void populate(XYPlot plot, AROTraceData analysis) {
if (analysis == null) {
LOGGER.info("analysis data is null");
return;
}
gpsData.removeAllSeries();
locationData.removeAllSeries();
TraceResultType resultType = analysis.getAnalyzerResult().getTraceresult().getTraceResultType();
if (resultType.equals(TraceResultType.TRACE_FILE)) {
LOGGER.info("didn't get analysis trace data!");
} else {
try {
image = ImageIO.read(GpsPlot.class.getResourceAsStream("/images/location.png"));
image = ImageHelper.resize(image, 12, 12);
} catch (IOException e) {
e.printStackTrace();
}
// create the GPS dataset...
Map<GpsState, XYIntervalSeries> seriesMap = new EnumMap<GpsState, XYIntervalSeries>(GpsState.class);
for (GpsState eventType : GpsState.values()) {
XYIntervalSeries series = new XYIntervalSeries(eventType);
seriesMap.put(eventType, series);
gpsData.addSeries(series);
}
series = new XYSeries("location");
TraceDirectoryResult traceresult = (TraceDirectoryResult) analysis.getAnalyzerResult().getTraceresult();
listLocationEvent = (ArrayList<LocationEvent>) traceresult.getLocationEventInfos();
for (int idx = 0; idx < listLocationEvent.size(); idx++) {
series.add(listLocationEvent.get(idx).getTimeRecorded(), 0.5);
}
locationData.addSeries(series);
Iterator<GpsInfo> iter = analysis.getAnalyzerResult().getTraceresult().getGpsInfos().iterator();
if (iter.hasNext()) {
while (iter.hasNext()) {
GpsInfo gpsEvent = iter.next();
if (gpsEvent.getGpsState() != GpsState.GPS_DISABLED) {
seriesMap.get(gpsEvent.getGpsState()).add(gpsEvent.getBeginTimeStamp(), gpsEvent.getBeginTimeStamp(), gpsEvent.getEndTimeStamp(), 0.5, 0, 1);
}
}
}
XYItemRenderer renderer = plot.getRenderer(0);
// Looks like renderer is using the index descending order, so setting the index of the GPS background as 2 & location information index as 1.
if (renderer == null) {
renderer = plot.getRenderer(2);
}
renderer.setSeriesPaint(gpsData.indexOf(GpsState.GPS_STANDBY), Color.YELLOW);
renderer.setSeriesPaint(gpsData.indexOf(GpsState.GPS_ACTIVE), new Color(34, 177, 76));
// Assign ToolTip to renderer
renderer.setBaseToolTipGenerator(new XYToolTipGenerator() {
@Override
public String generateToolTip(XYDataset dataset, int series, int item) {
GpsState eventType = (GpsState) gpsData.getSeries(series).getKey();
return MessageFormat.format(ResourceBundleHelper.getMessageString("gps.tooltip"), dataset.getX(series, item), ResourceBundleHelper.getEnumString(eventType));
}
});
plot.setRenderer(2, renderer);
// Assign ToolTip to renderer
LocationImageRenderer renderer_loc = new LocationImageRenderer();
plot.setRenderer(1, renderer_loc);
renderer_loc.setBaseToolTipGenerator(new XYToolTipGenerator() {
@Override
public String generateToolTip(XYDataset dataset, int series, int item) {
// Update tooltip of location data
LocationEvent event = listLocationEvent.get(item);
StringBuffer displayInfo = new StringBuffer(ResourceBundleHelper.getMessageString("location.tooltip.prefix"));
displayInfo.append(MessageFormat.format(ResourceBundleHelper.getMessageString("location.tooltip.content"), event.getTimeRecorded(), event.getLatitude(), event.getLongitude(), event.getProvider(), event.getLocality()));
displayInfo.append(ResourceBundleHelper.getMessageString("location.tooltip.suffix"));
return displayInfo.toString();
}
});
}
plot.setDataset(2, gpsData);
plot.setDataset(1, locationData);
}
use of com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult in project VideoOptimzer by attdevsupport.
the class SpeedThrottlePlot method populate.
@Override
public void populate(XYPlot plot, AROTraceData analysis) {
serCollection.removeAllSeries();
if (analysis == null) {
LOGGER.info("There is no trace data in the pojo!");
} else {
TraceResultType resultType = analysis.getAnalyzerResult().getTraceresult().getTraceResultType();
if (resultType.equals(TraceResultType.TRACE_FILE)) {
LOGGER.info("This is trace file pojo so there is no speed throttle info involved here.");
} else {
XYSeries seriesDL = new XYSeries(0);
XYSeries seriesUP = new XYSeries(1);
TraceDirectoryResult traceresult = (TraceDirectoryResult) analysis.getAnalyzerResult().getTraceresult();
List<SpeedThrottleEvent> speedThrottleInfos = traceresult.getSpeedThrottleEvent();
calculateNode(seriesDL, seriesUP, speedThrottleInfos);
setDataPlot(plot, seriesDL, seriesUP);
}
}
}
use of com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult in project VideoOptimzer by attdevsupport.
the class NetworkTypePlot method populate.
@Override
public void populate(XYPlot plot, AROTraceData analysis) {
plot.setDataset(new XYIntervalSeriesCollection());
if (analysis == null) {
LOGGER.info("no trace data here");
} else {
if (analysis.getAnalyzerResult().getTraceresult().getTraceResultType() == TraceResultType.TRACE_FILE) {
LOGGER.info("no trace folder data here");
} else {
TraceDirectoryResult traceresult = (TraceDirectoryResult) analysis.getAnalyzerResult().getTraceresult();
final XYIntervalSeriesCollection networkDataSeries = new XYIntervalSeriesCollection();
final Map<NetworkType, XYIntervalSeries> seriesMap = new EnumMap<NetworkType, XYIntervalSeries>(NetworkType.class);
createDataSeriesForAllNetworkTypes(seriesMap, networkDataSeries);
Iterator<NetworkBearerTypeInfo> iter = traceresult.getNetworkTypeInfos().iterator();
if (iter.hasNext()) {
while (iter.hasNext()) {
NetworkBearerTypeInfo networkInfo = iter.next();
if (networkInfo.getNetworkType() != NetworkType.UNKNOWN) {
if (NetworkType.LTE == networkInfo.getNetworkType() && (NetworkType.OVERRIDE_NETWORK_TYPE_NR_NSA == networkInfo.getOverrideNetworkType() || NetworkType.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE == networkInfo.getOverrideNetworkType() || NetworkType.OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO == networkInfo.getOverrideNetworkType())) {
seriesMap.get(networkInfo.getOverrideNetworkType()).add(networkInfo.getBeginTimestamp(), networkInfo.getBeginTimestamp(), networkInfo.getEndTimestamp(), 0.5, 0, 1);
} else {
seriesMap.get(networkInfo.getNetworkType()).add(networkInfo.getBeginTimestamp(), networkInfo.getBeginTimestamp(), networkInfo.getEndTimestamp(), 0.5, 0, 1);
}
}
}
} else {
NetworkType nt = traceresult.getNetworkType();
if (nt != null && nt != NetworkType.UNKNOWN) {
seriesMap.get(nt).add(0, 0, traceresult.getTraceDuration(), 0.5, 0, 1);
}
}
XYItemRenderer renderer = plot.getRenderer();
setRenderingColorForDataSeries(renderer, networkDataSeries);
// Assign ToolTip to renderer
renderer.setBaseToolTipGenerator(new XYToolTipGenerator() {
@Override
public String generateToolTip(XYDataset dataset, int series, int item) {
NetworkType networkType = (NetworkType) networkDataSeries.getSeries(series).getKey();
return MessageFormat.format(ResourceBundleHelper.getMessageString("network.tooltip"), dataset.getX(series, item), ResourceBundleHelper.getEnumString(networkType));
}
});
plot.setDataset(networkDataSeries);
}
}
}
use of com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult in project VideoOptimzer by attdevsupport.
the class RadioPlot method populate.
@Override
public void populate(XYPlot plot, AROTraceData analysis) {
XYSeries series = new XYSeries(0);
if (analysis == null) {
LOGGER.info("no trace data here");
} else {
TraceResultType resultType = analysis.getAnalyzerResult().getTraceresult().getTraceResultType();
if (resultType.equals(TraceResultType.TRACE_FILE)) {
LOGGER.info("no trace folder data here");
} else {
TraceDirectoryResult traceResult = (TraceDirectoryResult) analysis.getAnalyzerResult().getTraceresult();
radioInfos = traceResult.getRadioInfos();
if (radioInfos.size() > 0 && analysis.getAnalyzerResult().getFilter().getTimeRange() != null) {
RadioInfo first = radioInfos.get(0);
series.add(analysis.getAnalyzerResult().getFilter().getTimeRange().getBeginTime().doubleValue(), first.getSignalStrength() < 0 ? first.getSignalStrength() : MIN_SIGNAL);
}
for (RadioInfo ri : radioInfos) {
series.add(ri.getTimeStamp(), ri.getSignalStrength() < 0 ? ri.getSignalStrength() : MIN_SIGNAL);
}
if (radioInfos.size() > 0) {
RadioInfo last = radioInfos.get(radioInfos.size() - 1);
if (analysis.getAnalyzerResult().getFilter().getTimeRange() != null) {
series.add(analysis.getAnalyzerResult().getFilter().getTimeRange().getEndTime().doubleValue(), last.getSignalStrength() < 0 ? last.getSignalStrength() : MIN_SIGNAL);
} else {
series.add(traceResult.getTraceDuration(), last.getSignalStrength() < 0 ? last.getSignalStrength() : MIN_SIGNAL);
}
}
// Assign ToolTip to renderer
XYItemRenderer renderer = plot.getRenderer();
renderer.setBaseToolTipGenerator(new XYToolTipGenerator() {
@Override
public String generateToolTip(XYDataset dataset, int series, int item) {
RadioInfo ri = radioInfos.get(Math.min(item, radioInfos.size() - 1));
if (ri.getSignalStrength() < 0) {
if (ri.isLte()) {
return MessageFormat.format(ResourceBundleHelper.getMessageString("radio.tooltip.lte"), ri.getLteRsrp(), ri.getLteRsrq());
} else {
return MessageFormat.format(ResourceBundleHelper.getMessageString("radio.tooltip"), ri.getSignalStrength());
}
} else {
return ResourceBundleHelper.getMessageString("radio.noSignal");
}
}
});
}
}
plot.setDataset(new XYSeriesCollection(series));
// return plot;
}
use of com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult in project VideoOptimzer by attdevsupport.
the class AttenuatorPlot method populate.
@Override
public void populate(XYPlot plot, AROTraceData analysis) {
if (analysis == null) {
LOGGER.info("didn't get analysis trace data!");
} else {
TraceResultType resultType = analysis.getAnalyzerResult().getTraceresult().getTraceResultType();
if (resultType.equals(TraceResultType.TRACE_FILE)) {
LOGGER.info("didn't get analysis trace folder!");
} else {
XYSeries seriesDL = new XYSeries(0);
XYSeries seriesUP = new XYSeries(1);
TraceDirectoryResult traceresult = (TraceDirectoryResult) analysis.getAnalyzerResult().getTraceresult();
List<AttenuatorEvent> attnrInfos = traceresult.getAttenautionEvent();
calculateNode(seriesDL, seriesUP, attnrInfos);
setDataPlot(plot, seriesDL, seriesUP);
}
}
}
Aggregations