use of com.att.aro.core.packetanalysis.pojo.AbstractTraceResult in project VideoOptimzer by attdevsupport.
the class MissingTraceFiles method retrieveMissingFiles.
public Set<File> retrieveMissingFiles() {
Set<File> missingFiles = new LinkedHashSet<File>();
addMissingFileMaybe(TraceDataConst.FileName.APPNAME_FILE, missingFiles);
addMissingFileMaybe(TraceDataConst.FileName.DEVICEINFO_FILE, missingFiles);
addMissingFileMaybe(TraceDataConst.FileName.DEVICEDETAILS_FILE, missingFiles);
// addMissingFileMaybe(TraceDataConst.FileName.NETWORKINFO_FILE, missingFiles);
addMissingFileMaybe(TraceDataConst.FileName.CPU_FILE, missingFiles);
addMissingFileMaybe(TraceDataConst.FileName.GPS_FILE, missingFiles);
addMissingFileMaybe(TraceDataConst.FileName.BLUETOOTH_FILE, missingFiles);
addMissingFileMaybe(TraceDataConst.FileName.WIFI_FILE, missingFiles);
addMissingFileMaybe(TraceDataConst.FileName.CAMERA_FILE, missingFiles);
addMissingFileMaybe(TraceDataConst.FileName.SCREEN_STATE_FILE, missingFiles);
addMissingFileMaybe(TraceDataConst.FileName.USER_EVENTS_FILE, missingFiles);
// addMissingFileMaybe(TraceDataConst.FileName.SCREEN_ROTATIONS_FILE, missingFiles);
addMissingFileMaybe(TraceDataConst.FileName.ALARM_END_FILE, missingFiles);
addMissingFileMaybe(TraceDataConst.FileName.ALARM_START_FILE, missingFiles);
addMissingFileMaybe(TraceDataConst.FileName.KERNEL_LOG_FILE, missingFiles);
addMissingFileMaybe(TraceDataConst.FileName.BATTERY_FILE, missingFiles);
addMissingFileMaybe(TraceDataConst.FileName.BATTERYINFO_FILE, missingFiles);
addMissingFileMaybe(TraceDataConst.FileName.TEMPERATURE_FILE, missingFiles);
addMissingFileMaybe(TraceDataConst.FileName.LOCATION_FILE, missingFiles);
addMissingFileMaybe(TraceDataConst.FileName.RADIO_EVENTS_FILE, missingFiles);
if (isFilePresent(ResourceBundleHelper.getMessageString("video.videoDisplayFile")) || isFilePresent(ResourceBundleHelper.getMessageString("video.videoFileOnDevice"))) {
addMissingFileMaybe(TraceDataConst.FileName.VIDEO_TIME_FILE, missingFiles);
}
if (isFilePresent(ResourceBundleHelper.getMessageString("video.exVideoDisplayFile")) || isExternalVideoSourceFilePresent("video.mp4", "video.mov")) {
addMissingFileMaybe(TraceDataConst.FileName.EXVIDEO_TIME_FILE, missingFiles);
}
// UI shoule not be doing this!!!
if (model != null) {
AbstractTraceResult traceResult = model.getAnalyzerResult().getTraceresult();
if (traceResult instanceof TraceDirectoryResult) {
((TraceDirectoryResult) traceResult).setMissingFiles(getModelMissingFiles(missingFiles));
}
}
return missingFiles;
}
use of com.att.aro.core.packetanalysis.pojo.AbstractTraceResult in project VideoOptimzer by attdevsupport.
the class AccessingPeripheralImpl method runTest.
@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
AccessingPeripheralResult result = new AccessingPeripheralResult();
AbstractTraceResult traceResult = tracedata.getTraceresult();
TraceDirectoryResult trresult = null;
if (traceResult != null && traceResult instanceof TraceDirectoryResult) {
trresult = (TraceDirectoryResult) traceResult;
}
if (trresult != null && isPeripheralDataAvailable(trresult)) {
double activeGPSRatio = 0.0;
double activeBluetoothRatio = 0.0;
double activeCameraRatio = 0.0;
double gpsActiveDuration = 0.0;
double bluetoothActiveDuration = 0.0;
double cameraActiveDuration = 0.0;
double duration = 0.0;
boolean accessingPeripherals = true;
TimeRange timeRange = null;
if (tracedata.getFilter() != null) {
timeRange = tracedata.getFilter().getTimeRange();
}
if (tracedata.getTraceresult().getTraceResultType() == TraceResultType.TRACE_DIRECTORY) {
gpsActiveDuration = trresult.getGpsActiveDuration();
bluetoothActiveDuration = trresult.getBluetoothActiveDuration();
cameraActiveDuration = trresult.getCameraActiveDuration();
}
if (timeRange != null) {
duration = timeRange.getEndTime() - timeRange.getBeginTime();
} else {
duration = tracedata.getTraceresult().getTraceDuration();
}
activeGPSRatio = (gpsActiveDuration * 100) / duration;
activeBluetoothRatio = (bluetoothActiveDuration * 100) / duration;
activeCameraRatio = (cameraActiveDuration * 100) / duration;
result.setActiveBluetoothRatio(activeBluetoothRatio);
result.setActiveCameraRatio(activeCameraRatio);
result.setActiveGPSRatio(activeGPSRatio);
result.setActiveBluetoothDuration(bluetoothActiveDuration);
result.setActiveCameraDuration(cameraActiveDuration);
result.setActiveGPSDuration(gpsActiveDuration);
if (activeGPSRatio > PERIPHERAL_ACTIVE_LIMIT || activeBluetoothRatio > PERIPHERAL_ACTIVE_LIMIT || activeCameraRatio > PERIPHERAL_ACTIVE_LIMIT) {
accessingPeripherals = false;
}
String cameraPer = "0";
NumberFormat nfor = NumberFormat.getIntegerInstance();
if (cameraActiveDuration != 0.0) {
if (activeCameraRatio < 1.0) {
cameraPer = Util.percentageFormat(activeCameraRatio);
} else {
cameraPer = nfor.format(activeCameraRatio);
}
}
String key = "";
if (accessingPeripherals) {
result.setResultType(BPResultType.PASS);
key = this.textResultPass;
} else {
// ref. old analyzer give warning in this best practice
result.setResultType(BPResultType.WARNING);
key = this.textResults;
}
String text = MessageFormat.format(key, activeGPSRatio, activeBluetoothRatio, cameraPer);
result.setResultText(text);
result.setResultExcelText(MessageFormat.format(textExcelResults, result.getResultType().getDescription(), activeGPSRatio, activeBluetoothRatio, cameraPer));
} else {
result.setResultText(noData);
result.setResultType(BPResultType.NO_DATA);
result.setResultExcelText(BPResultType.NO_DATA.getDescription());
}
result.setAboutText(aboutText);
result.setDetailTitle(detailTitle);
result.setLearnMoreUrl(learnMoreUrl);
result.setOverviewTitle(overviewTitle);
result.setExportAllBTDesc(exportAllBTDesc);
result.setExportAllCamDesc(exportAllCamDesc);
result.setExportAllGPSDesc(exportAllGPSDesc);
return result;
}
Aggregations