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;
}
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);
}
}
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);
}
}
}
Aggregations