Home | History | Annotate | Download | only in firmware_TouchMTB

Lines Matching refs:Mtb

5 """This module provides MTB parser and related packet methods."""
16 from firmware_constants import AXIS, GV, MTB, UNIT, VAL
44 """ A helper function to get mtb packets by parsing the event file.
48 return Mtb(packets=MtbParser().parse_file(event_file))
57 pretty_event.append('time %.6f,' % event[MTB.EV_TIME])
58 if event.get(MTB.SYN_REPORT):
61 ev_type = event[MTB.EV_TYPE]
63 ev_code = event[MTB.EV_CODE]
66 pretty_event.append('value %d' % event[MTB.EV_VALUE])
78 if event.get(MTB.SYN_REPORT):
79 evemu_event = evemu_format_syn_report % event[MTB.EV_TIME]
81 evemu_event = evemu_format % (event[MTB.EV_TIME],
82 event[MTB.EV_TYPE],
83 event[MTB.EV_CODE],
84 event[MTB.EV_VALUE])
178 """Determine what an MTB event is.
181 MTB event classification.
186 return (not event.get(MTB.SYN_REPORT) and
187 event[MTB.EV_TYPE] == EV_ABS and
188 event[MTB.EV_CODE] == ABS_MT_TRACKING_ID)
193 return cls.is_ABS_MT_TRACKING_ID(event) and event[MTB.EV_VALUE] != -1
198 return cls.is_ABS_MT_TRACKING_ID(event) and event[MTB.EV_VALUE] == -1
203 return (not event.get(MTB.SYN_REPORT) and
204 event[MTB.EV_TYPE] == EV_ABS and
205 event[MTB.EV_CODE] == ABS_MT_SLOT)
210 return (not event.get(MTB.SYN_REPORT) and
211 event[MTB.EV_TYPE] == EV_ABS and
212 event[MTB.EV_CODE] == ABS_MT_POSITION_X)
217 return (not event.get(MTB.SYN_REPORT) and
218 event[MTB.EV_TYPE] == EV_ABS and
219 event[MTB.EV_CODE] == ABS_MT_POSITION_Y)
224 return (not event.get(MTB.SYN_REPORT) and
225 event[MTB.EV_TYPE] == EV_ABS and
226 event[MTB.EV_CODE] == ABS_MT_PRESSURE)
237 return (not event.get(MTB.SYN_REPORT) and event[MTB.EV_TYPE] == EV_KEY)
242 return (cls.is_EV_KEY(event) and event[MTB.EV_CODE] == BTN_LEFT)
247 return (cls.is_BTN_LEFT(event) and event[MTB.EV_VALUE] == value)
253 event[MTB.EV_CODE] == BTN_TOOL_FINGER)
259 event[MTB.EV_CODE] == BTN_TOOL_DOUBLETAP)
265 event[MTB.EV_CODE] == BTN_TOOL_TRIPLETAP)
271 event[MTB.EV_CODE] == BTN_TOOL_QUADTAP)
277 event[MTB.EV_CODE] == BTN_TOOL_QUINTTAP)
283 event[MTB.EV_CODE] == BTN_TOUCH)
288 return event.get(MTB.SYN_REPORT, False)
292 """A simplified class provides MTB utilities for evemu event format."""
294 self.mtb = Mtb(device=device)
316 """Sanity check for MTB format correctness.
361 curr_slot_id = event[MTB.EV_VALUE]
367 slot_to_tid.update({curr_slot_id: event[MTB.EV_VALUE]})
393 """The state machine for MTB events.
403 # Set the default slot to 0 as it may not be displayed in the MTB events
440 @param event: an MTB event
446 self.slot = event[MTB.EV_VALUE]
450 self._add_new_tracking_id(event[MTB.EV_VALUE])
466 self.point[self.slot_to_tid[self.slot]].x = event[MTB.EV_VALUE]
470 self.point[self.slot_to_tid[self.slot]].y = event[MTB.EV_VALUE]
474 self.pressure[self.slot_to_tid[self.slot]] = event[MTB.EV_VALUE]
478 self.syn_time = event[MTB.EV_TIME]
524 class Mtb:
525 """An MTB class providing MTB format related utility methods."""
625 slot = event[MTB.EV_VALUE]
633 prev_x = event[MTB.EV_VALUE]
636 prev_y = event[MTB.EV_VALUE]
781 slot = event[MTB.EV_VALUE]
791 x[slot] = event[MTB.EV_VALUE]
793 y[slot] = event[MTB.EV_VALUE]
860 x = event[MTB.EV_VALUE]
864 y = event[MTB.EV_VALUE]
877 slot = event[MTB.EV_VALUE]
880 x = event[MTB.EV_VALUE]
885 y = event[MTB.EV_VALUE]
1032 displacements[tid][MTB.SLOT] = finger_path.slot
1233 [packet[-1].get(MTB.EV_TIME) for packet in self.packets])
1244 event_value = event[MTB.EV_VALUE]
1388 """Touch device MTB event Parser."""
1394 """Construct the regular expression search pattern of MTB events.
1432 ev_dict = {MTB.EV_TIME: ev_time,
1433 MTB.EV_TYPE: ev_type,
1434 MTB.EV_CODE: ev_code,
1435 MTB.EV_VALUE: ev_value}
1442 ev_dict[MTB.EV_TIME] = float(syn_time)
1443 ev_dict[MTB.SYN_REPORT] = True
1464 return ev_dict.get(MTB.SYN_REPORT, False)
1484 last_ev_time = ev_list[-1][MTB.EV_TIME]