Search in sources :

Example 6 with TraceResultType

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);
        }
    }
}
Also used : XYSeries(org.jfree.data.xy.XYSeries) SpeedThrottleEvent(com.att.aro.core.peripheral.pojo.SpeedThrottleEvent) TraceDirectoryResult(com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult) TraceResultType(com.att.aro.core.packetanalysis.pojo.TraceResultType)

Example 7 with TraceResultType

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;
}
Also used : XYSeries(org.jfree.data.xy.XYSeries) RadioInfo(com.att.aro.core.peripheral.pojo.RadioInfo) TraceDirectoryResult(com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult) XYDataset(org.jfree.data.xy.XYDataset) XYItemRenderer(org.jfree.chart.renderer.xy.XYItemRenderer) XYToolTipGenerator(org.jfree.chart.labels.XYToolTipGenerator) TraceResultType(com.att.aro.core.packetanalysis.pojo.TraceResultType) XYSeriesCollection(org.jfree.data.xy.XYSeriesCollection)

Example 8 with TraceResultType

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);
        }
    }
}
Also used : XYSeries(org.jfree.data.xy.XYSeries) TraceDirectoryResult(com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult) TraceResultType(com.att.aro.core.packetanalysis.pojo.TraceResultType) AttenuatorEvent(com.att.aro.core.peripheral.pojo.AttenuatorEvent)

Example 9 with TraceResultType

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;
}
Also used : XYSeries(org.jfree.data.xy.XYSeries) BatteryInfo(com.att.aro.core.peripheral.pojo.BatteryInfo) AnalysisFilter(com.att.aro.core.packetanalysis.pojo.AnalysisFilter) TraceResultType(com.att.aro.core.packetanalysis.pojo.TraceResultType) TraceDirectoryResult(com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult) XYDataset(org.jfree.data.xy.XYDataset) XYItemRenderer(org.jfree.chart.renderer.xy.XYItemRenderer) XYToolTipGenerator(org.jfree.chart.labels.XYToolTipGenerator) XYSeriesCollection(org.jfree.data.xy.XYSeriesCollection)

Example 10 with TraceResultType

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);
    }
}
Also used : TraceDirectoryResult(com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult) TraceResultType(com.att.aro.core.packetanalysis.pojo.TraceResultType)

Aggregations

TraceResultType (com.att.aro.core.packetanalysis.pojo.TraceResultType)14 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)13 XYToolTipGenerator (org.jfree.chart.labels.XYToolTipGenerator)9 XYItemRenderer (org.jfree.chart.renderer.xy.XYItemRenderer)9 XYDataset (org.jfree.data.xy.XYDataset)9 XYSeries (org.jfree.data.xy.XYSeries)7 XYIntervalSeries (org.jfree.data.xy.XYIntervalSeries)6 XYSeriesCollection (org.jfree.data.xy.XYSeriesCollection)4 EnumMap (java.util.EnumMap)3 XYIntervalSeriesCollection (org.jfree.data.xy.XYIntervalSeriesCollection)3 AnalysisFilter (com.att.aro.core.packetanalysis.pojo.AnalysisFilter)2 Color (java.awt.Color)2 HashMap (java.util.HashMap)2 AbstractTraceResult (com.att.aro.core.packetanalysis.pojo.AbstractTraceResult)1 ScheduledAlarmInfo (com.att.aro.core.packetanalysis.pojo.ScheduledAlarmInfo)1 AlarmInfo (com.att.aro.core.peripheral.pojo.AlarmInfo)1 AlarmType (com.att.aro.core.peripheral.pojo.AlarmInfo.AlarmType)1 AttenuatorEvent (com.att.aro.core.peripheral.pojo.AttenuatorEvent)1 BatteryInfo (com.att.aro.core.peripheral.pojo.BatteryInfo)1 CpuActivity (com.att.aro.core.peripheral.pojo.CpuActivity)1