use of com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult 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.TraceDirectoryResult in project VideoOptimzer by attdevsupport.
the class DeviceNetworkProfilePanel method refresh.
public void refresh(AROTraceData aModel) {
this.dateValueLabel.setText(aModel.getAnalyzerResult().getTraceresult().getTraceDateTime().toString());
File directory = new File(aModel.getAnalyzerResult().getTraceresult().getTraceDirectory());
this.traceValueLabel.setText(getTracePath(directory.getName()));
this.byteCountTotalLabel.setText(Long.toString(aModel.getAnalyzerResult().getStatistic().getTotalByte()));
this.profileValueLabel.setText(aModel.getAnalyzerResult().getProfile().getName());
if (TraceResultType.TRACE_DIRECTORY.equals(aModel.getAnalyzerResult().getTraceresult().getTraceResultType())) {
TraceDirectoryResult tracedirectoryResult = (TraceDirectoryResult) aModel.getAnalyzerResult().getTraceresult();
this.networkTypeValueLabel.setText(tracedirectoryResult.getNetworkTypesList());
CollectOptions collectOptions = tracedirectoryResult.getCollectOptions();
if (collectOptions != null) {
if (collectOptions.isAttnrProfile()) {
this.downlinkLabel.setText("Attenuation Profile: ");
this.downlinkValueLabel.setText(collectOptions.getAttnrProfileName());
this.uplinkLabel.setVisible(false);
this.uplinkValueLabel.setVisible(false);
} else {
int dsDelay = collectOptions.getDsDelay();
int usDelay = collectOptions.getUsDelay();
int speedThrottleDL = collectOptions.getThrottleDL();
int speedThrottleUL = collectOptions.getThrottleUL();
this.downlinkLabel.setText(ResourceBundleHelper.getMessageString("bestPractice.header.attenuator.downlink"));
this.uplinkLabel.setText(ResourceBundleHelper.getMessageString("bestPractice.header.attenuator.uplink"));
this.uplinkLabel.setVisible(true);
this.uplinkValueLabel.setVisible(true);
CommonHelper attenuator = new CommonHelper();
NumberFormat numFormat = NumberFormat.getIntegerInstance();
if (dsDelay > 0 || usDelay > 0) {
this.downlinkValueLabel.setText(attenuator.transferSignalSignDownload(dsDelay) + " - " + numFormat.format(dsDelay) + " ms");
this.uplinkValueLabel.setText(attenuator.transferSignalSignUpload(usDelay) + " - " + numFormat.format(usDelay) + " ms");
} else {
// check dl and ul
if (speedThrottleDL < 0) {
this.downlinkValueLabel.setText(ResourceBundleHelper.getMessageString("waterfall.na"));
} else {
this.downlinkValueLabel.setText(attenuator.numberTransferSignalDL(speedThrottleDL) + " - " + attenuator.messageConvert(speedThrottleDL));
}
if (speedThrottleUL < 0) {
this.uplinkValueLabel.setText(ResourceBundleHelper.getMessageString("waterfall.na"));
} else {
this.uplinkValueLabel.setText(attenuator.numberTransferSignalUL(speedThrottleUL) + " - " + attenuator.messageConvert(speedThrottleUL));
}
}
}
}
} else {
this.networkTypeValueLabel.setText("");
this.downlinkLabel.setText(ResourceBundleHelper.getMessageString("bestPractice.header.attenuator.downlink"));
this.uplinkLabel.setText(ResourceBundleHelper.getMessageString("bestPractice.header.attenuator.uplink"));
this.uplinkLabel.setVisible(true);
this.uplinkValueLabel.setVisible(true);
this.downlinkValueLabel.setText("");
this.uplinkValueLabel.setText("");
}
}
use of com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult in project VideoOptimzer by attdevsupport.
the class AttenuationConstantPanel method refresh.
/* (non-Javadoc)
* @see com.att.aro.ui.commonui.IUITabPanelLayoutUpdate#refresh(com.att.aro.core.pojo.AROTraceData)
*/
@Override
public void refresh(AROTraceData analyzerResult) {
TraceDirectoryResult traceResult = (TraceDirectoryResult) analyzerResult.getAnalyzerResult().getTraceresult();
CollectOptions collectOptions = traceResult.getCollectOptions();
refresh(collectOptions);
}
use of com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult in project VideoOptimzer by attdevsupport.
the class HtmlReportImplTest method reportGenerator_retunrIsTrue.
@Test
@Ignore
public void reportGenerator_retunrIsTrue() {
AccessingPeripheralResult access = new AccessingPeripheralResult();
access.setResultType(BPResultType.PASS);
CacheControlResult cache = new CacheControlResult();
cache.setResultType(BPResultType.FAIL);
List<AbstractBestPracticeResult> bpResults = new ArrayList<AbstractBestPracticeResult>();
bpResults.add(access);
bpResults.add(cache);
File tempFile = null;
try {
tempFile = folder.newFile("abc.html");
} catch (IOException e) {
e.printStackTrace();
}
if (tempFile != null) {
tempFile.deleteOnExit();
}
when(filereader.createFile(any(String.class))).thenReturn(tempFile);
AROTraceData results = new AROTraceData();
PacketAnalyzerResult analyzerResult = new PacketAnalyzerResult();
TraceDirectoryResult tracedirresult = new TraceDirectoryResult();
EnergyModel energyModel = new EnergyModel();
Statistic statistic = new Statistic();
statistic.setTotalByte(123);
statistic.setTotalHTTPSByte(123);
tracedirresult.setTraceDirectory("temp.txt");
analyzerResult.setTraceresult(tracedirresult);
analyzerResult.setEnergyModel(energyModel);
analyzerResult.setStatistic(statistic);
results.setAnalyzerResult(analyzerResult);
results.setBestPracticeResults(bpResults);
assertTrue(htmlReportImpl.reportGenerator("abc.html", results));
}
use of com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult 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