添加二指大包支持
This commit is contained in:
50
cap_read.py
50
cap_read.py
@ -30,7 +30,7 @@ class ClassCapRead:
|
||||
|
||||
# 最大连接5个手指
|
||||
self.fingers = list() # 传感器列表
|
||||
for i in range(5):
|
||||
for i in range(2):
|
||||
self.fingers.append(ClassFinger(2+i, self.ch341))
|
||||
|
||||
self.currCh341State = 0 # 当前ch341连接状态
|
||||
@ -71,6 +71,34 @@ class ClassCapRead:
|
||||
if self.vofaClient:
|
||||
self.vofaClient.close()
|
||||
|
||||
def debugPrint(self):
|
||||
if self.socketConnected == True:
|
||||
fingerIndex = 0
|
||||
_log1 = ""
|
||||
# 输出原始通道数值
|
||||
# for index in range(0, self.fingers[fingerIndex].projectPara.sensor_num):
|
||||
# _log1 += str(self.fingers[fingerIndex].readData.channelCapData[index])
|
||||
# _log1 += ','
|
||||
for index in range(0, self.fingers[fingerIndex].projectPara.ydds_num):
|
||||
_log1 += str(int(self.fingers[fingerIndex].readData.nf[index]*1000))
|
||||
_log1 += ','
|
||||
_log1 += str(int(self.fingers[fingerIndex].readData.tf[index]*1000))
|
||||
_log1 += ','
|
||||
_log1 += str(self.fingers[fingerIndex].readData.tfDir[index])
|
||||
_log1 += ','
|
||||
for index in range(0, self.fingers[fingerIndex].projectPara.s_prox_num):
|
||||
_log1 += str(self.fingers[fingerIndex].readData.sProxCapData[index])
|
||||
_log1 += ','
|
||||
for index in range(0, self.fingers[fingerIndex].projectPara.m_prox_num):
|
||||
_log1 += str(self.fingers[fingerIndex].readData.mProxCapData[index])
|
||||
_log1 += ','
|
||||
|
||||
_log1 += str(0)
|
||||
_log1 += '\r\n'
|
||||
#print(_log1)
|
||||
if self.socketConnected == 1:
|
||||
self.vofaClient.send(_log1.encode())
|
||||
|
||||
def set_sensor_enable(self, idx):
|
||||
_pack = list()
|
||||
_pack.append(idx)
|
||||
@ -130,25 +158,7 @@ class ClassCapRead:
|
||||
self.fingers[fingerIndex].capRead()
|
||||
connectedSensorCnt += 1
|
||||
|
||||
if self.socketConnected == True:
|
||||
fingerIndex = 0
|
||||
_log1 = ""
|
||||
# 输出原始通道数值
|
||||
for index in range(0, self.fingers[fingerIndex].projectPara.sensor_num):
|
||||
_log1 += str(self.fingers[fingerIndex].readData.channelCapData[index])
|
||||
_log1 += ','
|
||||
for index in range(0, self.fingers[fingerIndex].projectPara.ydds_num):
|
||||
_log1 += str(int(self.fingers[fingerIndex].readData.nf[index]*1000))
|
||||
_log1 += ','
|
||||
_log1 += str(int(self.fingers[fingerIndex].readData.tf[index]*1000))
|
||||
_log1 += ','
|
||||
_log1 += str(self.fingers[fingerIndex].readData.tfDir[index])
|
||||
_log1 += ','
|
||||
_log1 += str(0)
|
||||
_log1 += '\r\n'
|
||||
#print(_log1)
|
||||
if self.socketConnected == 1:
|
||||
self.vofaClient.send(_log1.encode())
|
||||
self.debugPrint()
|
||||
|
||||
# 大于1个传感器连接需要设置接近采集序列
|
||||
if connectedSensorCnt > 1 and (time.time() - self.syncTimer) > DEF_CDC_SYNC_MS:
|
||||
|
||||
Reference in New Issue
Block a user