Search in sources :

Example 1 with AttenuatorEvent

use of com.att.aro.core.peripheral.pojo.AttenuatorEvent in project VideoOptimzer by attdevsupport.

the class AttenuationEventReaderImpl method processAttnrData.

private AttenuatorEvent processAttnrData(String line) {
    AttenuatorEvent attnrEvent = null;
    try {
        String[] tokens = line.split(DELIMITER);
        AttnrEventFlow atnrFL = AttnrEventFlow.valueOf(tokens[0].trim());
        int delayTime = Integer.valueOf(tokens[1].trim());
        long timeStamp = Long.valueOf(tokens[2].trim());
        attnrEvent = new AttenuatorEvent(atnrFL, delayTime, timeStamp);
    } catch (NumberFormatException numberException) {
        LOGGER.error("Invalid number format : " + line, numberException);
        return new AttenuatorEvent(AttnrEventFlow.DL, 0, 0L);
    } catch (Exception exception) {
        LOGGER.error("Invalid input: " + line, exception);
        return new AttenuatorEvent(AttnrEventFlow.DL, 0, 0L);
    }
    return attnrEvent;
}
Also used : AttnrEventFlow(com.att.aro.core.peripheral.pojo.AttenuatorEvent.AttnrEventFlow) IOException(java.io.IOException) AttenuatorEvent(com.att.aro.core.peripheral.pojo.AttenuatorEvent)

Example 2 with AttenuatorEvent

use of com.att.aro.core.peripheral.pojo.AttenuatorEvent in project VideoOptimzer by attdevsupport.

the class AttenuatorPlot method calculateNode.

/**
 * @param seriesDL
 * @param seriesUP
 * @param attnrInfos
 */
private void calculateNode(XYSeries seriesDL, XYSeries seriesUP, List<AttenuatorEvent> attnrInfos) {
    try {
        if (attnrInfos.size() > 1) {
            double firstTimeDTamp = 0L;
            double firstTimeUTemp = 0L;
            // initial time
            firstTimeDTamp = attnrInfos.get(0).getTimeStamp();
            firstTimeUTemp = attnrInfos.get(1).getTimeStamp();
            for (AttenuatorEvent event : attnrInfos) {
                if (AttnrEventFlow.DL.equals(event.getAtnrFL())) {
                    double tempTime1 = (event.getTimeStamp() - firstTimeDTamp) / 1000;
                    seriesDL.add(tempTime1, (double) event.getDelayTime());
                    LOGGER.info("Time stamp: " + tempTime1 + " " + event.getDelayTime());
                } else if (AttnrEventFlow.UL.equals(event.getAtnrFL())) {
                    double tempTime2 = (event.getTimeStamp() - firstTimeUTemp) / 1000;
                    seriesUP.add(tempTime2, (double) event.getDelayTime());
                    LOGGER.info("Time stamp: " + tempTime2 + " " + event.getDelayTime());
                } else {
                    LOGGER.info("wrong record for attenuation event");
                }
            }
        } else {
            // no data
            return;
        }
    } catch (IndexOutOfBoundsException exception1) {
        LOGGER.info("No sufficient data in the attenuation log file", exception1);
    } catch (Exception exception2) {
        LOGGER.info("Wrong Format", exception2);
    }
}
Also used : AttenuatorEvent(com.att.aro.core.peripheral.pojo.AttenuatorEvent)

Example 3 with AttenuatorEvent

use of com.att.aro.core.peripheral.pojo.AttenuatorEvent 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)

Aggregations

AttenuatorEvent (com.att.aro.core.peripheral.pojo.AttenuatorEvent)3 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)1 TraceResultType (com.att.aro.core.packetanalysis.pojo.TraceResultType)1 AttnrEventFlow (com.att.aro.core.peripheral.pojo.AttenuatorEvent.AttnrEventFlow)1 IOException (java.io.IOException)1 XYSeries (org.jfree.data.xy.XYSeries)1