初始版本,接近数据不对
This commit is contained in:
66
sensorPara.py
Normal file
66
sensorPara.py
Normal file
@ -0,0 +1,66 @@
|
||||
from typing import List, Optional
|
||||
from ctypes import Structure, sizeof, c_float, c_uint32, c_uint16
|
||||
|
||||
|
||||
class DynamicYddsComTs(Structure):
|
||||
_fields_ = [
|
||||
("nf", c_float),
|
||||
("nfCap", c_uint32),
|
||||
("tf", c_float),
|
||||
("tfCap", c_uint32),
|
||||
("tfDir", c_uint16),
|
||||
("prox", c_uint32),
|
||||
]
|
||||
|
||||
#todo 其他三维力类型待补充
|
||||
|
||||
|
||||
class FingerHeatMap:
|
||||
def __init__(self, rows: int, cols: int, file_path: str, cap_count: int, cap_indices: List[int]):
|
||||
self.rows = rows
|
||||
self.cols = cols
|
||||
self.file_path = file_path
|
||||
self.cap_count = cap_count
|
||||
self.cap_indices = cap_indices
|
||||
|
||||
class FingerParamTS:
|
||||
def __init__(self, prg: int, pack_len: int, sensor_num: int, touch_num: int, ydds_num: int,
|
||||
s_prox_num: int, m_prox_num: int, cap_byte: int, ydds_type: int, had_err: int,
|
||||
cali_num: int, name: str, display_type_para: str, p_heat_map: Optional[List[FingerHeatMap]]):
|
||||
self.prg = prg
|
||||
self.pack_len = pack_len
|
||||
self.sensor_num = sensor_num
|
||||
self.touch_num = touch_num
|
||||
self.ydds_num = ydds_num
|
||||
self.s_prox_num = s_prox_num
|
||||
self.m_prox_num = m_prox_num
|
||||
self.cap_byte = cap_byte
|
||||
self.ydds_type = ydds_type
|
||||
self.had_err = had_err
|
||||
self.cali_num = cali_num
|
||||
self.name = name
|
||||
self.display_type_para = display_type_para
|
||||
self.p_heat_map = p_heat_map
|
||||
|
||||
# 定义 fingerHeatMap 数据
|
||||
finger2_power_cap_index = [
|
||||
FingerHeatMap(16, 8, "TS-F-A/heatMapPara16_8.dat", 7, [0, 1, 2, 3, 4, 5, 6, 255, 255, 255, 255, 255, 255, 255, 255, 255])
|
||||
]
|
||||
|
||||
finger17_power_cap_index = [
|
||||
FingerHeatMap(6, 7, "TS-T-A/weight6X7X6.dat", 6, [0, 1, 4, 5, 6, 7, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]),
|
||||
FingerHeatMap(6, 7, "TS-T-A/weight6X7X6.dat", 6, [2, 3, 8, 9, 10, 11, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255])
|
||||
]
|
||||
|
||||
# 定义 fingerParams 数据
|
||||
finger_params = [
|
||||
FingerParamTS(2, 62, 8, 7, 1, 1, 0, 4, 2, 0, 22, "通用手指", "TypeA", finger2_power_cap_index),
|
||||
FingerParamTS(17, 78, 16, 13, 2, 2, 1, 3, 4, 1, 22, "两指-大包", "TypeB", finger17_power_cap_index),
|
||||
FingerParamTS(18, 462, 50, 49, 50, 1, 0, 3, 4, 1, 22, "两指-阵列", "TypeC", finger2_power_cap_index),
|
||||
FingerParamTS(19, 62, 8, 7, 1, 0, 0, 4, 2, 0, 22, "通用手指New", "TypeA", finger2_power_cap_index),
|
||||
FingerParamTS(20, 45, 7, 6, 2, 1, 0, 3, 4, 1, 27, "强脑-大拇指(量)", "TypeD", finger2_power_cap_index),
|
||||
FingerParamTS(21, 69, 11, 8, 3, 2, 1, 3, 4, 1, 27, "强脑-食指(量)", "TypeE", finger2_power_cap_index),
|
||||
FingerParamTS(22, 69, 11, 8, 3, 2, 1, 3, 4, 1, 27, "强脑-中指(量)", "TypeE", finger2_power_cap_index),
|
||||
FingerParamTS(23, 69, 11, 8, 3, 2, 1, 3, 4, 1, 27, "强脑-无名指(量)", "TypeE", finger2_power_cap_index),
|
||||
FingerParamTS(24, 45, 7, 6, 2, 1, 0, 3, 4, 1, 27, "强脑-小拇指(量)", "TypeD", finger2_power_cap_index),
|
||||
]
|
||||
Reference in New Issue
Block a user