Search in sources :

Example 1 with CollectOptions

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();
    }
}
Also used : CollectOptions(com.att.aro.core.peripheral.pojo.CollectOptions) FileInputStream(java.io.FileInputStream) InputStream(java.io.InputStream) StringReader(java.io.StringReader) Properties(java.util.Properties) FileInputStream(java.io.FileInputStream) IOException(java.io.IOException) InvalidPathException(java.nio.file.InvalidPathException) SuppressFBWarnings(edu.umd.cs.findbugs.annotations.SuppressFBWarnings)

Example 2 with 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();
    }
}
Also used : CollectOptions(com.att.aro.core.peripheral.pojo.CollectOptions) TraceDirectoryResult(com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult) PacketAnalyzerResult(com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)

Example 3 with CollectOptions

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);
}
Also used : CollectOptions(com.att.aro.core.peripheral.pojo.CollectOptions) TraceDirectoryResult(com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)

Example 4 with 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()));
}
Also used : CpuActivityList(com.att.aro.core.peripheral.pojo.CpuActivityList) NetworkTypeObject(com.att.aro.core.peripheral.pojo.NetworkTypeObject) BatteryInfo(com.att.aro.core.peripheral.pojo.BatteryInfo) ScreenStateInfo(com.att.aro.core.peripheral.pojo.ScreenStateInfo) CameraInfo(com.att.aro.core.peripheral.pojo.CameraInfo) LocationEvent(com.att.aro.core.peripheral.pojo.LocationEvent) BluetoothInfo(com.att.aro.core.peripheral.pojo.BluetoothInfo) TemperatureEvent(com.att.aro.core.peripheral.pojo.TemperatureEvent) VideoStreamStartupData(com.att.aro.core.peripheral.pojo.VideoStreamStartupData) GpsInfo(com.att.aro.core.peripheral.pojo.GpsInfo) ThermalStatusInfo(com.att.aro.core.peripheral.pojo.ThermalStatusInfo) UserEvent(com.att.aro.core.peripheral.pojo.UserEvent) WifiInfo(com.att.aro.core.peripheral.pojo.WifiInfo) RadioInfo(com.att.aro.core.peripheral.pojo.RadioInfo) CollectOptions(com.att.aro.core.peripheral.pojo.CollectOptions) AlarmInfo(com.att.aro.core.peripheral.pojo.AlarmInfo) ThermalStatusReaderImpl(com.att.aro.core.peripheral.impl.ThermalStatusReaderImpl)

Example 5 with CollectOptions

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("");
    }
}
Also used : CollectOptions(com.att.aro.core.peripheral.pojo.CollectOptions) CommonHelper(com.att.aro.ui.utils.CommonHelper) TraceDirectoryResult(com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult) File(java.io.File) NumberFormat(java.text.NumberFormat)

Aggregations

CollectOptions (com.att.aro.core.peripheral.pojo.CollectOptions)10 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)7 PacketAnalyzerResult (com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)2 NetworkTypeObject (com.att.aro.core.peripheral.pojo.NetworkTypeObject)2 File (java.io.File)2 IOException (java.io.IOException)2 InvalidPathException (java.nio.file.InvalidPathException)2 BaseTest (com.att.aro.core.BaseTest)1 ScheduledAlarmInfo (com.att.aro.core.packetanalysis.pojo.ScheduledAlarmInfo)1 IPacketListener (com.att.aro.core.packetreader.IPacketListener)1 IPPacket (com.att.aro.core.packetreader.pojo.IPPacket)1 ThermalStatusReaderImpl (com.att.aro.core.peripheral.impl.ThermalStatusReaderImpl)1 AlarmAnalysisInfo (com.att.aro.core.peripheral.pojo.AlarmAnalysisInfo)1 AlarmAnalysisResult (com.att.aro.core.peripheral.pojo.AlarmAnalysisResult)1 AlarmInfo (com.att.aro.core.peripheral.pojo.AlarmInfo)1 AppInfo (com.att.aro.core.peripheral.pojo.AppInfo)1 BatteryInfo (com.att.aro.core.peripheral.pojo.BatteryInfo)1 BluetoothInfo (com.att.aro.core.peripheral.pojo.BluetoothInfo)1 CameraInfo (com.att.aro.core.peripheral.pojo.CameraInfo)1 CpuActivityList (com.att.aro.core.peripheral.pojo.CpuActivityList)1