5144-improveArc #5

Merged
alexm merged 12 commits from 5144-improveArc into master 2024-06-05 12:19:34 +00:00
2 changed files with 4 additions and 22 deletions
Showing only changes of commit 4f2cfd032a - Show all commits

View File

@ -1,10 +1,4 @@
import con from '../db/connect.js';
export default async data => {
const palletFkFinding = 0;
const attempt = 0;
const sensitivity = null;
data = data.toString();
const crudeRfids = data.split('\n');
@ -21,7 +15,7 @@ export default async data => {
epcHex = epcHex.replace(RFID_PREFIX, '');
epcHex = epcHex.substring(0, 1) == 0 ? epcHex.substring(1) : epcHex;
// console.log(jsonResult);
const rfidParsed = {
code: parseInt(epcHex),
created: jsonResult.timestamp,
@ -30,19 +24,7 @@ export default async data => {
antenna: jsonResult.tagInventoryEvent.antennaPort,
transmitPowerCdbm: jsonResult.tagInventoryEvent.transmitPowerCdbm
};
// await con.query(`
// INSERT INTO vn.rfidTest (palletFk, expeditionFk, peakRssi, antenna, attempt, power, sensitivity)
// VALUES(?, ?, ?, ?, ?, ?, ?);
// `, [
// palletFkFinding,
// rfidParsed.code,
// rfidParsed.peakRssi,
// rfidParsed.antenna,
// attempt,
// jsonResult.tagInventoryEvent.transmitPowerCdbm,
// sensitivity
// ]);
// console.log(rfidParsed);
rfidsParsedExtended.push(rfidParsed);
rfidsParsed.add(rfidParsed.code);
}

View File

@ -39,8 +39,8 @@ export default async(conf, cb) => {
function createPallet() {
clearTimeout(interval);
// if (!conf.minimum || rfidbuffer.size > conf.minimum)
// newPallet(rfidbuffer, conf.arcId);
if (!conf.minimum || rfidbuffer.size > conf.minimum)
newPallet(rfidbuffer, conf.arcId);
rfidbuffer = new Set();
rfidbufferExtend = [];
}