use of com.att.aro.core.packetanalysis.pojo.TraceResultType 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.TraceResultType 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.TraceResultType 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);
}
}
}
use of com.att.aro.core.packetanalysis.pojo.TraceResultType in project VideoOptimzer by attdevsupport.
the class BatteryPlot method populate.
@Override
public void populate(XYPlot plot, AROTraceData analysis) {
XYSeries series = new XYSeries(0);
if (analysis == null) {
LOGGER.info("analysis data is null");
} else {
TraceResultType resultType = analysis.getAnalyzerResult().getTraceresult().getTraceResultType();
if (resultType.equals(TraceResultType.TRACE_FILE)) {
LOGGER.info("didn't get analysis trace data!");
} else {
TraceDirectoryResult traceresult = (TraceDirectoryResult) analysis.getAnalyzerResult().getTraceresult();
AnalysisFilter filter = analysis.getAnalyzerResult().getFilter();
batteryInfos = traceresult.getBatteryInfos();
if (batteryInfos.size() > 0 && filter.getTimeRange() != null) {
BatteryInfo first = batteryInfos.get(0);
series.add(filter.getTimeRange().getBeginTime().doubleValue(), first.getBatteryLevel());
}
for (BatteryInfo bi : batteryInfos) {
series.add(bi.getBatteryTimeStamp(), bi.getBatteryLevel());
}
if (batteryInfos.size() > 0) {
BatteryInfo last = batteryInfos.get(batteryInfos.size() - 1);
if (filter.getTimeRange() != null) {
series.add(filter.getTimeRange().getEndTime().doubleValue(), last.getBatteryLevel());
} else {
series.add(traceresult.getTraceDuration(), last.getBatteryLevel());
}
}
XYItemRenderer renderer = plot.getRenderer();
renderer.setBaseToolTipGenerator(new XYToolTipGenerator() {
@Override
public String generateToolTip(XYDataset dataset, int series, int item) {
BatteryInfo bi = batteryInfos.get(Math.min(item, batteryInfos.size() - 1));
StringBuffer displayInfo = new StringBuffer(ResourceBundleHelper.getMessageString("battery.tooltip.prefix"));
displayInfo.append(MessageFormat.format(ResourceBundleHelper.getMessageString("battery.tooltip.content"), bi.getBatteryLevel(), bi.getBatteryTemp(), bi.isBatteryState() ? ResourceBundleHelper.getMessageString("battery.tooltip.connected") : ResourceBundleHelper.getMessageString("battery.tooltip.disconnected")));
displayInfo.append(ResourceBundleHelper.getMessageString("battery.tooltip.suffix"));
return displayInfo.toString();
}
});
}
plot.setDataset(new XYSeriesCollection(series));
}
// return plot;
}
use of com.att.aro.core.packetanalysis.pojo.TraceResultType in project VideoOptimzer by attdevsupport.
the class VideoUtil method isVideoLandscape.
/**
* the method is for check video orientation so we can display video recording with landscpae mode
* @param traceResult
* @return
*/
public static boolean isVideoLandscape(AbstractTraceResult traceResult) {
String videoOrientation = "";
if (traceResult == null) {
return false;
} else {
TraceResultType resultType = traceResult.getTraceResultType();
if (resultType.equals(TraceResultType.TRACE_FILE)) {
return false;
} else {
TraceDirectoryResult traceresult = (TraceDirectoryResult) traceResult;
videoOrientation = traceresult.getCollectOptions().getOrientation();
}
return TraceDataConst.UserEvent.KEY_LANDSCAPE.equalsIgnoreCase(videoOrientation);
}
}
Aggregations