private void AddTouchEventToSummary(ADBLogEvent logEvent, Dictionary <string, int> TouchSummary) { if ((logEvent.OpCode == "EV_SYN") || (logEvent.EventType == "ABS_MT_TRACKING_ID")) { AddTouchEvent(logEvent, TouchSummary); } }
private void ParseLogEvents() { Dataset = new ADBTouchEventsDataset(); foreach (string[] unparsedEvent in UnparsedEvents) { ADBLogEvent parsedEvent = ParseADBLogEvent(unparsedEvent); Dataset.DataEntries.Add(parsedEvent); } }
private void AddTouchEvent(ADBLogEvent logEvent, Dictionary <string, int> TouchSummary) { string key = logEvent.EventType + " " + logEvent.EventValue; if (!TouchSummary.ContainsKey(key)) { TouchSummary.Add(key, 1); } else { TouchSummary[key] += 1; } }
private void AddFeatureEventToSummary(ADBLogEvent logEvent, Dictionary <string, int> FeatureSummary) { if (logEvent.OpCode == "EV_ABS") { string key = logEvent.EventType; if (!FeatureSummary.ContainsKey(key)) { FeatureSummary.Add(key, 1); } else { FeatureSummary[key] += 1; } } }
private ADBLogEvent ParseADBLogEvent(string[] unparsedEvent) { double timestamp = double.Parse(unparsedEvent[0], CultureInfo.InvariantCulture.NumberFormat) * 1000; // logs keeep seconds and not milliseconds string device = unparsedEvent[1]; string opCode = unparsedEvent[2]; string eventType = unparsedEvent[3]; int value = GetEventValue(eventType, unparsedEvent[4]); ADBLogEvent result = new ADBLogEvent(timestamp, device, opCode, eventType, value); return(result); }
public string ValidateSync() { string result = ""; ADBLogEvent previous = null; foreach (ADBLogEvent entry in DataEntries) { if ((previous != null) && (previous.EventType == "SYN_MT_REPORT") && (entry.EventType != "SYN_REPORT")) { result += previous.ToString() + " -> " + entry.ToString() + "\n"; } previous = entry; } return(result); }