Filter NFC Cockpit log information and add required timestamping

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Filter NFC Cockpit log information and add required timestamping

2,263 次查看
BrunoSenzio
Contributor III

We would like to share a way and script to create custom logs form the NFC Cockpit GUI, could be of use if timing is needing for detecting reading distances.

Just copy all the information from the log window and create a random file to then filter out with a custom script.

Hoping it to be of use.

Best,

 

BSSB

0 项奖励
回复
1 回复

2,257 次查看
BrunoSenzio
Contributor III

# NFC Cockpit Parsing script

import csv

if __name__ == "__main_":

with open('log_nfc.txt') as f:
log = f.readlines()


output = []
for line in log:
if "INFO" in line:
time_data = line[12:20]
hour, min, sec = time_data.split(':')
output.append([hour, min, sec])

fields = ['Hour', 'Minute', 'Second']
with open('parsed_nfc.csv', 'w') as f:
write = csv.writer(f)
write.writerow(fields)
write.writerows(output)

0 项奖励
回复