remove console.log and comments

This commit is contained in:
Alex Moreno 2024-05-31 12:01:40 +02:00
parent 08b37c1261
commit c4654dc445
3 changed files with 1 additions and 122 deletions

View File

@ -19,7 +19,4 @@ $ npm run start | pino-pretty
For test.
```
DELETE expedition in vn.expeditionScan
```
Nuevas RFID
519 a 527 511
DELETE expedition in vn.expeditionScan

View File

@ -1,109 +0,0 @@
import con from '../db/connect.js';
export default async(parsed, conf) => {
const palletFkFinding = 0;
const attempt = 0;
if (conf.env != 'dev') return;
// TOTAL
// console.log('TOTAL BUFFER: ', parsed.codes.size);
// console.log('BUFFER: ', parsed.codes);
// console.log('BUFFER_EXTEND: ', parsed);
// 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);
console.log('UNIQUE READ ANTENNA:', uniqueRead[0].size, uniqueRead[1].size, uniqueRead[2].size, uniqueRead[3].size);
// console.log(uniqueRead[0], uniqueRead[1]);
// console.log(uniqueRead[2], uniqueRead[3]);
// AL QUAD
let quad1 = [...uniqueRead[0]].filter(value => uniqueRead[1].has(value));
let quad2 = [...uniqueRead[2]].filter(value => uniqueRead[3].has(value));
const quad = quad1.filter(value => new Set(quad2).has(value));
console.log('UNIQUE READ QUAD:', quad.length);
// await con.query(`
// INSERT INTO vn.algorithm (palletFk, attempt, expeditionArray, expeditionCount, model, power)
// VALUES(?, ?, ?, ?, ?, ?);
// `, [
// palletFkFinding,
// attempt,
// quad.join(','),
// quad.length,
// 'QUAD',
// quad[0]?.transmitPowerCdbm
// ]);
// AL TRI
let tri1 = [...uniqueRead[1]];
let tri2 = [...uniqueRead[2]].filter(value => uniqueRead[3].has(value));
const tri = tri1.filter(value => new Set(tri2).has(value));
console.log('UNIQUE READ TRI:', tri.length);
// await con.query(`
// INSERT INTO vn.algorithm (palletFk, attempt, expeditionArray, expeditionCount, model, power)
// VALUES(?, ?, ?, ?, ?, ?);
// `, [
// palletFkFinding,
// attempt,
// tri.join(','),
// tri.length,
// 'TRI',
// tri[0]?.transmitPowerCdbm
// ]);
// AL BI
// const uniqueReadLeft = new Set([...uniqueRead[0], ...uniquaeRead[1]]);
// const uniqueReadRight = new Set([...uniqueRead[2], ...uniqueRead[3]]);
// const bi = [...uniqueReadLeft].filter(value => uniqueReadRight.has(value));
// console.log('UNIQUE READ BI:', bi.length);
// console.log('UNIQUE READ: 1', [...uniqueRead[0]].length);
console.log('UNIQUE READ:', new Set([...uniqueRead[0], ...uniqueRead[1], ...uniqueRead[2], ...uniqueRead[3]]));
console.log('UNIQUE READ:', new Set([...uniqueRead[0], ...uniqueRead[1], ...uniqueRead[2], ...uniqueRead[3]]).size);
// console.log('UNIQUE READ:', new Set([...uniqueRead[0], ...uniqueRead[1], ...uniqueRead[2], ...uniqueRead[3]]).size); //USE for test
console.logger.info('UNIQUE READ:', new Set([...uniqueRead[0], ...uniqueRead[1], ...uniqueRead[2], ...uniqueRead[3]]));
// await con.query(`
// INSERT INTO vn.algorithm (palletFk, attempt, expeditionArray, expeditionCount, model, power)
// VALUES(?, ?, ?, ?, ?, ?);
// `, [
// palletFkFinding,
// attempt,
// bi.join(','),
// bi.length,
// 'BI',
// bi[0]?.transmitPowerCdbm
// ]);
// // // AL BEST PEAK
// MIRAR SI DOS LA HAN LEIDO ENTONCES BUENA, O TAMBIEN SE PUEDE MIRAR QUE SI EL PEAK ES MEJOR A X COJERLA POR BUENA
// const allExpedition = [];
// for ()
// console.log('UNIQUE READ BI:', bi.length);
// await con.query(`
// INSERT INTO vn.algorithm (palletFk, attempt, expeditionArray, expeditionCount, model)
// VALUES(?, ?, ?, ?, ?, ?);
// `, [
// palletFkFinding,
// attempt,
// bi,
// bi.length,
// 'BI'
// ]);
// // WARNING IF AN ANTENNA READS LESS THAN IT SHOULD
// for (const [index, set] of uniqueRead.entries()) {
// if (((set.size * 100) / parsed.codes.size) < 25)
// console.logger.warn(`[ANTENNA]: ${index + 1} ONLY ${set.size}`);
// }
console.log('----------------------------------------------------------------');
};

View File

@ -22,15 +22,6 @@ export default async(parsed, conf) => {
const quad = quad1.filter(value => new Set(quad2).has(value));
console.log('UNIQUE READ QUAD:', quad.length);
// AL TRI
// let tri1 = [...uniqueRead[1]];
// let tri2 = [...uniqueRead[2]].filter(value => uniqueRead[3].has(value));
// const tri = tri1.filter(value => new Set(tri2).has(value));
// const uniqueReads = new Set([...uniqueRead[0], ...uniqueRead[1], ...uniqueRead[2], ...uniqueRead[3]]);
// console.log('UNIQUE READ TRI:', tri.length);
// console.log('UNIQUE READ:', new Set([...uniqueRead[0], ...uniqueRead[1], ...uniqueRead[2], ...uniqueRead[3]]));
// console.log('UNIQUE READ:', new Set([...uniqueRead[0], ...uniqueRead[1], ...uniqueRead[2], ...uniqueRead[3]]).size);
// console.logger.info('UNIQUE READ:', uniqueReads);
debugMissing(uniqueRead);
console.log('----------------------------------------------------------------');
};