Lines Matching refs:SLOT
30 # Define FingerPath class to keep track of the slot, and a list of tid packets
32 class FingerPath(namedtuple('FingerPath', ['slot', 'tid_packets'])):
33 """This keeps the slot number and the list of tid packets of a finger."""
157 # Extract slot data from the snapshot of the state machine.
160 syn_time, slot, tid, point, pressure = slot_data
161 try_to_add(final_state_packet, (syn_time, EV_ABS, ABS_MT_SLOT, slot))
321 tracking ID before assigning a positive value to the slot first.)
322 - Should not assign X, Y, or PRESSURE data to a slot without a positive
345 this slot 1.
359 # slot event
378 # access a slot attribute before finger arriving
403 # Set the default slot to 0 as it may not be displayed in the MTB events
413 self.slot = 0
414 self.slot_to_tid = {self.slot: self.tid}
424 for slot in self.leaving_slots:
425 del self.slot_to_tid[slot]
431 self.slot_to_tid[self.slot] = self.tid
444 # Switch the slot.
446 self.slot = event[MTB.EV_VALUE]
452 # A slot is leaving.
453 # Do not delete this slot until this last packet is reported.
455 self.leaving_slots.append(self.slot)
460 if (not self.slot in self.slot_to_tid and
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]
483 for slot, tid in self.slot_to_tid.items():
484 slot_data = [self.syn_time, slot, tid,
498 for slot, tid in self.slot_to_tid.items():
517 current_tid_data.append((tid, slot, tid_packet))
604 """Extract x and y positions in the target slot."""
605 # The default slot is slot 0 if no slot number is assigned.
607 # the change. Slot 0 would not be reported by evdev if last time
608 # the last finger left the touch device was at slot 0.
609 slot = 0
619 if (slot == target_slot and slot == 0 and not target_slot_live and
625 slot = event[MTB.EV_VALUE]
626 if slot == target_slot and not target_slot_live:
628 if slot != target_slot:
669 slot=0
680 the touch device continuously. The same slot number, e.g., slot 0 or
681 slot 1, may be used for multiple times.
684 be equal to the slot numbers in practice. However, this assumption
705 for tid, slot, tid_packet in sm.get_current_tid_data_for_all_tids(
708 tid, FingerPath(slot, []))
729 def get_slot_data(self, slot, attr):
730 """Extract the attribute data of the specified slot.
736 if finger_path.slot == slot:
769 # Set the initial slot number to 0 because evdev is a state machine,
770 # and may not present slot 0.
771 slot = 0
781 slot = event[MTB.EV_VALUE]
782 if slot not in target_slots:
787 slot_exists[slot] = True
789 slot_exists[slot] = False
791 x[slot] = event[MTB.EV_VALUE]
793 y[slot] = event[MTB.EV_VALUE]
802 # append x and y to the list of that slot.
817 points_list = [zip(list_x[slot], list_y[slot]) for slot in target_slots]
840 """Get the points in the target slot."""
845 """Get the distances of neighbor points in the target slot."""
870 """Get the total motion in the target slot."""
873 slot = None
877 slot = event[MTB.EV_VALUE]
879 slot == target_slot):
884 slot == target_slot):
890 def get_max_distance(self, slot, unit):
891 """Get the max distance between any two points of the specified slot."""
892 points = self.get_slot_data(slot, 'point')
911 """Get the largest gap ratio in the target slot.
1003 """Get the displacement in the target slot."""
1021 if finger_path.slot < min_slot:
1032 displacements[tid][MTB.SLOT] = finger_path.slot
1152 in the target slot.
1213 """Get the number of packets in the target slot."""