Filter NFC Cockpit log information and add required timestamping

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Filter NFC Cockpit log information and add required timestamping

589件の閲覧回数
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 返信

583件の閲覧回数
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 件の賞賛