vn-rfid/util/debugStream.js

22 lines
750 B
JavaScript
Raw Normal View History

2024-05-31 10:04:22 +00:00
import debugMissing from './debugMissing.js';
2024-03-04 10:42:48 +00:00
export default async(parsed, conf) => {
2023-01-27 11:40:09 +00:00
if (conf.env != 'dev') return;
// TOTAL READS BY ANTENNA
const totalRead = [0, 0, 0, 0];
for (let read of parsed.extended)
totalRead[read.antenna - 1]++;
console.log('TOTAL READ ANTENNA:', totalRead);
// UNIQUE READS BY ANTENNA
const uniqueRead = [new Set(), new Set(), new Set(), new Set()];
for (let read of parsed.extended)
uniqueRead[read.antenna - 1].add(read.code);
2023-01-27 11:40:09 +00:00
console.log('UNIQUE READ ANTENNA:', uniqueRead[0].size, uniqueRead[1].size, uniqueRead[2].size, uniqueRead[3].size);
2024-04-04 11:52:04 +00:00
debugMissing(uniqueRead);
2023-01-27 11:40:09 +00:00
console.log('----------------------------------------------------------------');
};