use of com.att.aro.core.peripheral.pojo.CollectOptions in project VideoOptimzer by attdevsupport.
the class CollectOptionsReaderImpl method readNewFormat.
@SuppressFBWarnings("RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSION")
CollectOptions readNewFormat(File file) {
Properties properties = new Properties();
try (InputStream inStream = new FileInputStream(file)) {
if (Util.isWindowsOS()) {
String theString = IOUtils.toString(inStream, StandardCharsets.UTF_8);
properties.load(new StringReader(theString.replace("\\", "\\\\")));
} else {
properties.load(inStream);
}
return new CollectOptions(properties);
} catch (Exception ex) {
logger.error("Failed to read collection details file: " + file.getPath(), ex);
return new CollectOptions();
}
}
use of com.att.aro.core.peripheral.pojo.CollectOptions in project VideoOptimzer by attdevsupport.
the class BpTestStatisticsPanel method refresh.
@Override
public void refresh(AROTraceData model) {
PacketAnalyzerResult analyzerResults = model.getAnalyzerResult();
// Total Data Transferred\:
totalDataLabel.setText(MessageFormat.format(ResourceBundleHelper.getMessageString("bestPractices.totalDataTransferedValue"), intFormat.format(analyzerResults.getStatistic().getTotalByte())));
// Total Payload Data Transferred\:
totalPayloadDataLabel.setText(MessageFormat.format(ResourceBundleHelper.getMessageString("bestPractices.totalPayloadDataValue"), intFormat.format(analyzerResults.getStatistic().getTotalPayloadBytes())));
// Duration:
String duration = decFormat.format(analyzerResults.getTraceresult().getTraceDuration() / 60);
durationLabel.setText(MessageFormat.format(ResourceBundleHelper.getMessageString("bestPractices.durationValue"), duration));
// Energy Consumed:
energyConsumedLabel.setText(MessageFormat.format(ResourceBundleHelper.getMessageString("bestPractices.energyConsumedValue"), decFormat.format(analyzerResults.getEnergyModel().getTotalEnergyConsumed())));
// Attenuator :
if (TraceResultType.TRACE_DIRECTORY.equals(model.getAnalyzerResult().getTraceresult().getTraceResultType())) {
TraceDirectoryResult traceResult = (TraceDirectoryResult) model.getAnalyzerResult().getTraceresult();
CollectOptions collectOptions = traceResult.getCollectOptions();
if (collectOptions != null) {
setSpeedThrottleValue(collectOptions);
}
} else {
clearSpeedThrottleValue();
}
}
use of com.att.aro.core.peripheral.pojo.CollectOptions in project VideoOptimzer by attdevsupport.
the class AttenuationProfilePanel 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.peripheral.pojo.CollectOptions in project VideoOptimzer by attdevsupport.
the class TraceDataReaderImpl method readFileUtil.
/**
* some of the trace files read here
*
* Parses the user event trace
*
* @throws IOException
*
* Reads the screen rotations information contained in the
* "screen_rotations" file found inside the trace directory and adds
* them to the user events list.
* @throws IOException
* Reads the CPU trace information from the CPU file.
*
* @throws IOException
* Method to read the GPS data from the trace file and store it in
* the gpsInfos list. It also updates the active duration for GPS.
* Method to read the Bluetooth data from the trace file and store
* it in the bluetoothInfos list. It also updates the active
* duration for Bluetooth.
*
* @throws IOException
* Method to read the Camera data from the trace file and store it
* in the cameraInfos list. It also updates the active duration for
* Camera.
*
* Method to read the WIFI data from the trace file and store it in
* the wifiInfos list. It also updates the active duration for Wifi.
*
* Method to read the Screen State data from the trace file and
* store it in the ScreenStateInfos list.
*
* Method to read the Battery data from the trace file and store it
* in the batteryInfos list.
*
* Method to read the alarm event from the trace file and store it
* in the alarmInfos list.
*
* Reads the Radio data from the file and stores it in the
* RadioInfo.
* @param result
*/
public void readFileUtil(TraceDirectoryResult result) {
NetworkTypeObject obj = networktypereader.readData(result.getTraceDirectory(), result.getPcapTime0(), result.getTraceDuration());
if (obj != null) {
result.setNetworkTypeInfos(obj.getNetworkTypeInfos());
result.setNetworkTypesList(obj.getNetworkTypesList());
}
CollectOptions collectOptions = collectOptionsReader.readData(result.getTraceDirectory());
result.setCollectOptions(collectOptions);
List<UserEvent> userEvents = usereventreader.readData(result.getTraceDirectory(), result.getEventTime0(), result.getPcapTime0());
result.setUserEvents(userEvents);
List<UserEvent> list = this.screenrotationreader.readData(result.getTraceDirectory(), result.getPcapTime0());
result.setScreenRotationCounter(list.size());
result.getUserEvents().addAll(list);
List<TemperatureEvent> temperatureEvents = cputemperaturereader.readData(result.getTraceDirectory(), result.getPcapTime0());
result.setTemperatureInfos(temperatureEvents);
List<LocationEvent> locationEvents = locationreader.readData(result.getTraceDirectory(), result.getPcapTime0());
result.setLocationEventInfos(locationEvents);
CpuActivityList cpuActivityList = cpureader.readData(result.getTraceDirectory(), result.getPcapTime0());
result.setCpuActivityList(cpuActivityList);
List<GpsInfo> gpsInfos = gpsreader.readData(result.getTraceDirectory(), result.getPcapTime0(), result.getTraceDuration());
result.setGpsInfos(gpsInfos);
result.setGpsActiveDuration(gpsreader.getGpsActiveDuration());
List<BluetoothInfo> bluetoothInfos = bluetoothreader.readData(result.getTraceDirectory(), result.getPcapTime0(), result.getTraceDuration());
result.setBluetoothInfos(bluetoothInfos);
result.setBluetoothActiveDuration(bluetoothreader.getBluetoothActiveDuration());
List<WifiInfo> wifiInfos = wifireader.readData(result.getTraceDirectory(), result.getPcapTime0(), result.getTraceDuration());
result.setWifiInfos(wifiInfos);
result.setWifiActiveDuration(wifireader.getWifiActiveDuration());
List<CameraInfo> cameraInfos = camerareader.readData(result.getTraceDirectory(), result.getPcapTime0(), result.getTraceDuration());
result.setCameraInfos(cameraInfos);
result.setCameraActiveDuration(camerareader.getActiveDuration());
List<ThermalStatusInfo> thermalStatusInfos = new ThermalStatusReaderImpl(filereader).readData(result.getTraceDirectory(), result.getPcapTime0(), result.getTraceDuration());
result.setThermalstatusInfos(thermalStatusInfos);
List<ScreenStateInfo> screenStateInfos = screenstatereader.readData(result.getTraceDirectory(), result.getPcapTime0(), result.getTraceDuration());
result.setScreenStateInfos(screenStateInfos);
List<BatteryInfo> batteryInfos = batteryinforeader.readData(result.getTraceDirectory(), result.getPcapTime0());
result.setBatteryInfos(batteryInfos);
// alarm info from kernel log file
List<AlarmInfo> alarmInfos = alarminforeader.readData(result.getTraceDirectory(), result.getDumpsysEpochTimestamp(), result.getDumpsysElapsedTimestamp(), result.getTraceDateTime());
result.setAlarmInfos(alarmInfos);
List<RadioInfo> radioInfos = radioinforeader.readData(result.getTraceDirectory(), result.getPcapTime0());
result.setRadioInfos(radioInfos);
VideoStreamStartupData videoStreamStartupData = videoStartupReader.readData(result.getTraceDirectory());
result.setVideoStartupData(videoStreamStartupData);
result.setMetaData(metaDataReadWrite.readData(result.getTraceDirectory()));
}
use of com.att.aro.core.peripheral.pojo.CollectOptions 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("");
}
}
Aggregations