Search in sources :

Example 6 with AnalysisFilter

use of com.att.aro.core.packetanalysis.pojo.AnalysisFilter in project VideoOptimzer by attdevsupport.

the class DLPacketPlot method populate.

// private static final Logger logger = LogManager.getLogger(DLPacketPlot.class.getName());
@Override
public void populate(XYPlot plot, AROTraceData analysis) {
    LinkedHashMap<Color, PacketSeries> dlDatasets = new LinkedHashMap<Color, PacketSeries>();
    AnalysisFilter filter = null;
    // logger.info("isDownloadPacket(): "+ isDownloadPacket());
    if (analysis != null) {
        filter = analysis.getAnalyzerResult().getFilter();
        for (Session session : analysis.getAnalyzerResult().getSessionlist()) {
            addSeries(session, dlDatasets, filter);
        }
    }
    // Create the XY data set
    YIntervalSeriesCollection coll = new YIntervalSeriesCollection();
    XYItemRenderer renderer = plot.getRenderer();
    for (PacketSeries series : dlDatasets.values()) {
        coll.addSeries(series);
        renderer.setSeriesPaint(coll.indexOf(series.getKey()), series.getColor());
    }
    // Create tooltip generator
    renderer.setBaseToolTipGenerator(new PacketToolTipGenerator());
    plot.setDataset(coll);
// return plot;
}
Also used : YIntervalSeriesCollection(org.jfree.data.xy.YIntervalSeriesCollection) AnalysisFilter(com.att.aro.core.packetanalysis.pojo.AnalysisFilter) Color(java.awt.Color) XYItemRenderer(org.jfree.chart.renderer.xy.XYItemRenderer) LinkedHashMap(java.util.LinkedHashMap) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 7 with AnalysisFilter

use of com.att.aro.core.packetanalysis.pojo.AnalysisFilter 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 8 with AnalysisFilter

use of com.att.aro.core.packetanalysis.pojo.AnalysisFilter in project VideoOptimzer by attdevsupport.

the class PrivateDataDialog method refresh.

/**
 * re-analyze best practices
 */
private void refresh() {
    AnalysisFilter filter = getCurrentPktAnalyzerResult().getFilter();
    ((MainFrame) parent).updateFilter(filter);
}
Also used : AnalysisFilter(com.att.aro.core.packetanalysis.pojo.AnalysisFilter) MainFrame(com.att.aro.ui.view.MainFrame)

Example 9 with AnalysisFilter

use of com.att.aro.core.packetanalysis.pojo.AnalysisFilter in project VideoOptimzer by attdevsupport.

the class ExcludeTimeRangeAnalysisDialog method closeWindow.

private void closeWindow() {
    AnalysisFilter filter = ((MainFrame) parent).getController().getTheModel().getAnalyzerResult().getFilter();
    filter.setTimeRange(new TimeRange(initTimeRangeStartTime, initTimeRangeEndTime));
    dispose();
}
Also used : TimeRange(com.att.aro.core.packetanalysis.pojo.TimeRange) AnalysisFilter(com.att.aro.core.packetanalysis.pojo.AnalysisFilter)

Example 10 with AnalysisFilter

use of com.att.aro.core.packetanalysis.pojo.AnalysisFilter in project VideoOptimzer by attdevsupport.

the class FilterApplicationsAndIpDialog method getOkButton.

/**
 * Initializes and returns the ok Button.
 */
private JButton getOkButton() {
    if (okButton == null) {
        okButton = new JButton();
        okButton.setText(ResourceBundleHelper.getMessageString(DialogItem.Button_ok));
        okButton.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent arg0) {
                if (ipv4Selection || ipv6Selection) {
                    if (tcpSelection || udpSelection || dnsSelection) {
                        if (getCurrentPktAnalyzerResult().getFilter() != null) {
                            AnalysisFilter filter = getCurrentPktAnalyzerResult().getFilter();
                            Map<InetAddress, String> domainNames = filter.getDomainNames();
                            Map<String, ApplicationSelection> appSelections = new HashMap<String, ApplicationSelection>(filter.getAppSelections().size());
                            for (ApplicationSelection sel : filter.getAppSelections().values()) {
                                if (domainNames != null) {
                                    sel.setDomainNames(domainNames);
                                }
                                appSelections.put(sel.getAppName(), new ApplicationSelection(sel));
                            }
                            filter.setIpv4Sel(ipv4Selection);
                            filter.setIpv6Sel(ipv6Selection);
                            filter.setTcpSel(tcpSelection);
                            filter.setUdpSel(udpSelection);
                            filter.setDnsSelection(dnsSelection);
                            if (!selectionReturnsData()) {
                                noResultsError(ResourceBundleHelper.getMessageString("filter.noResultData.error"));
                            } else {
                                ((MainFrame) parent).updateFilter(filter);
                                dispose();
                            }
                        }
                    } else {
                        noResultsError(ResourceBundleHelper.getMessageString("filter.noProtocolSelection.error"));
                    }
                } else {
                    noResultsError(ResourceBundleHelper.getMessageString("filter.noIpSelection.error"));
                }
            }

            private void noResultsError(String error) {
                MessageDialogFactory.getInstance().showErrorDialog(FilterApplicationsAndIpDialog.this, error);
            }
        });
    }
    return okButton;
}
Also used : ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) AnalysisFilter(com.att.aro.core.packetanalysis.pojo.AnalysisFilter) JButton(javax.swing.JButton) ApplicationSelection(com.att.aro.core.packetanalysis.pojo.ApplicationSelection) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

AnalysisFilter (com.att.aro.core.packetanalysis.pojo.AnalysisFilter)23 TimeRange (com.att.aro.core.packetanalysis.pojo.TimeRange)8 ApplicationSelection (com.att.aro.core.packetanalysis.pojo.ApplicationSelection)6 HashMap (java.util.HashMap)5 MainFrame (com.att.aro.ui.view.MainFrame)4 ArrayList (java.util.ArrayList)4 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)3 Session (com.att.aro.core.packetanalysis.pojo.Session)3 Statistic (com.att.aro.core.packetanalysis.pojo.Statistic)3 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)3 ActionEvent (java.awt.event.ActionEvent)3 ActionListener (java.awt.event.ActionListener)3 InetAddress (java.net.InetAddress)3 Map (java.util.Map)3 JButton (javax.swing.JButton)3 BaseTest (com.att.aro.core.BaseTest)2 Profile (com.att.aro.core.configuration.pojo.Profile)2 ProfileLTE (com.att.aro.core.configuration.pojo.ProfileLTE)2 TimeRangeAnalysis (com.att.aro.core.packetanalysis.impl.TimeRangeAnalysis)2 BurstCollectionAnalysisData (com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData)2