From c4654dc4456788d4831065de076df07b2402115e Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 31 May 2024 12:01:40 +0200 Subject: [PATCH] remove console.log and comments --- README.md | 5 +- util/debugStream copy.js | 109 --------------------------------------- util/debugStream.js | 9 ---- 3 files changed, 1 insertion(+), 122 deletions(-) delete mode 100644 util/debugStream copy.js diff --git a/README.md b/README.md index 432aa92..4c28ee6 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,4 @@ $ npm run start | pino-pretty For test. ``` -DELETE expedition in vn.expeditionScan -``` -Nuevas RFID -519 a 527 511 \ No newline at end of file +DELETE expedition in vn.expeditionScan \ No newline at end of file diff --git a/util/debugStream copy.js b/util/debugStream copy.js deleted file mode 100644 index 0a1ca55..0000000 --- a/util/debugStream copy.js +++ /dev/null @@ -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('----------------------------------------------------------------'); -}; diff --git a/util/debugStream.js b/util/debugStream.js index 4a34161..f31cc08 100644 --- a/util/debugStream.js +++ b/util/debugStream.js @@ -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('----------------------------------------------------------------'); };