Search in sources :

Example 6 with UserEvent

use of com.att.aro.core.peripheral.pojo.UserEvent in project VideoOptimzer by attdevsupport.

the class PktAnazlyzerTimeRangeImpl method getUserEventsForTheTimeRange.

private void getUserEventsForTheTimeRange(TraceDirectoryResult result, double beginTime, double endTime) {
    List<UserEvent> orifilteredUserEvents = result.getUserEvents();
    List<UserEvent> filteredUserEvents = new ArrayList<UserEvent>();
    for (UserEvent userEvent : orifilteredUserEvents) {
        if (userEvent.getPressTime() >= beginTime && userEvent.getReleaseTime() <= endTime) {
            filteredUserEvents.add(userEvent);
        }
    }
    result.setUserEvents(filteredUserEvents);
}
Also used : ArrayList(java.util.ArrayList) UserEvent(com.att.aro.core.peripheral.pojo.UserEvent)

Example 7 with UserEvent

use of com.att.aro.core.peripheral.pojo.UserEvent 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 8 with UserEvent

use of com.att.aro.core.peripheral.pojo.UserEvent in project VideoOptimzer by attdevsupport.

the class StartupDelayDialog method makeInitialSelections.

/**
 * Sets initial start times and selected table items
 *
 * @param videoStream
 */
public void makeInitialSelections(VideoStream videoStream) {
    if (startTime == 0) {
        setStartTime(videoStream.getFirstSegment().getDLLastTimestamp());
    }
    segmentFramePanel.setImage(frameMap.firstEntry().getValue());
    if (!allUserEventList.isEmpty()) {
        double timestamp;
        if ((selectedVideoEvent = makeSegmentSelection(0)) != null) {
            selectedUserEvent = videoStreamStartup.getUserEvent();
            if (getUserEventTimeStamp(selectedUserEvent) > manifestRequestTime) {
                UserEvent tempUserEvent = findPriorUserEvent(manifestRequestTime);
                selectedUserEvent = tempUserEvent != null ? tempUserEvent : selectedUserEvent;
            }
            if ((timestamp = videoStreamStartup.getPlayRequestedTime()) == 0) {
                timestamp = getUserEventTimeStamp(selectedUserEvent);
                updateUserEventSelection(timestamp);
            } else {
                int index = findUserEventIndex(selectedUserEvent);
                makeUserEventSelection(index);
                updateUserEventSelection(index);
                setTimeJTextField(playRequestedTime, timestamp);
            }
            updateStartTime(playRequestedTime, userEventSlider);
        } else {
            makeUserEventSelection(0);
        }
        updateUserEventJListData();
        userEventJList.repaint();
    }
    updateSegmentJListData();
    segmentJList.repaint();
}
Also used : UserEvent(com.att.aro.core.peripheral.pojo.UserEvent)

Example 9 with UserEvent

use of com.att.aro.core.peripheral.pojo.UserEvent in project VideoOptimzer by attdevsupport.

the class StartupDelayDialog method prepUserEvents.

public void prepUserEvents(List<UserEvent> userEventList) {
    allUserEventList.clear();
    if (!userEventList.isEmpty()) {
        double pivotTime = -1.0;
        int totalUserEvents = 0;
        int skipEvent = 0;
        for (UserEvent userEvent : userEventList) {
            if (UserEventType.SCREEN_TOUCH.equals(userEvent.getEventType())) {
                totalUserEvents++;
                double deltaTime = userEvent.getPressTime() - pivotTime;
                if (deltaTime >= 1) {
                    activeUserEventMap.put(userEvent.getPressTime(), userEvent);
                    allUserEventList.add(userEvent);
                    pivotTime = userEvent.getPressTime();
                } else {
                    LOG.debug("skip time event : " + userEvent.getPressTime() + " delta time: " + deltaTime);
                    skipEvent++;
                }
            }
        }
        LOG.debug("Skip event: " + skipEvent + " Total touch event: " + totalUserEvents);
    }
}
Also used : UserEvent(com.att.aro.core.peripheral.pojo.UserEvent)

Example 10 with UserEvent

use of com.att.aro.core.peripheral.pojo.UserEvent in project VideoOptimzer by attdevsupport.

the class StartupDelayDialog method makeUserEventSelection.

/**
 * Locate UserEvent in allUserEventList/userEventTableItems
 * Report index in field variable selectedIdxUE
 * make selection in userEventJTable and firePropertyChange
 *
 * @param indexKey
 * @return UserEvent
 */
public UserEvent makeUserEventSelection(int indexKey) {
    UserEventItem userEventItem;
    selectedIdxUE = 0;
    if (indexKey < 0 || indexKey >= allUserEventList.size()) {
        userEventItem = userEventItemList.get(selectedIdxUE);
    } else {
        UserEvent userEvent = allUserEventList.get(indexKey);
        userEventItem = userEventItemList.get(indexKey);
        if (userEventItem.getUserEvent().equals(userEvent)) {
            selectedIdxUE = indexKey;
        } else {
            for (int index = 0; index < userEventItemList.size(); index++) {
                if (userEventItemList.get(index).getUserEvent().equals(userEvent)) {
                    userEventItem = userEventItemList.get(index);
                    selectedIdxUE = index;
                    break;
                }
            }
        }
        userEventItem.setSelected(true);
    }
    return userEventItem.getUserEvent();
}
Also used : UserEvent(com.att.aro.core.peripheral.pojo.UserEvent)

Aggregations

UserEvent (com.att.aro.core.peripheral.pojo.UserEvent)19 ArrayList (java.util.ArrayList)10 BaseTest (com.att.aro.core.BaseTest)6 Test (org.junit.Test)6 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)4 CpuActivity (com.att.aro.core.peripheral.pojo.CpuActivity)4 IOException (java.io.IOException)4 HashSet (java.util.HashSet)4 BurstCollectionAnalysisData (com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData)3 RrcStateRange (com.att.aro.core.packetanalysis.pojo.RrcStateRange)3 Session (com.att.aro.core.packetanalysis.pojo.Session)3 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)3 DomainNameSystem (com.att.aro.core.packetreader.pojo.DomainNameSystem)3 TCPPacket (com.att.aro.core.packetreader.pojo.TCPPacket)3 UDPPacket (com.att.aro.core.packetreader.pojo.UDPPacket)3 UserEventType (com.att.aro.core.peripheral.pojo.UserEvent.UserEventType)3 VideoStreamStartupData (com.att.aro.core.peripheral.pojo.VideoStreamStartupData)3 InetAddress (java.net.InetAddress)3 HashMap (java.util.HashMap)3 BatteryInfo (com.att.aro.core.peripheral.pojo.BatteryInfo)2