feat(tag reading): more tag reading updates, with more contorl now
station 1 and 2 are still pending but didnt have enough tags at the office trial it
This commit is contained in:
27
server/services/rfid/controller/stations/station3.ts
Normal file
27
server/services/rfid/controller/stations/station3.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Phase 1 we link the tag to the line only the line3.x where x is the line number
|
||||
* Phase 2 we will generate a label to be reprinted at staion 4
|
||||
*/
|
||||
|
||||
import {createLog} from "../../../logger/logger.js";
|
||||
import type {TagData} from "../tagData.js";
|
||||
import {tagStuff} from "../tags/crudTag.js";
|
||||
|
||||
export const station3Tags = async (tagData: TagData[]) => {
|
||||
// make sure we only have one tag or dont update
|
||||
if (tagData.length != 1) {
|
||||
createLog(
|
||||
"error",
|
||||
"rfid",
|
||||
"rfid",
|
||||
`There are ${tagData.length} tags, and ${tagData[0].reader} only allows 1 tag to create a label.`
|
||||
);
|
||||
// get tag data
|
||||
tagStuff(tagData);
|
||||
} else {
|
||||
//console.log("Generate the label and link it to the tag.");
|
||||
const tagdata = await tagStuff(tagData);
|
||||
|
||||
createLog("info", "rfid", "rfid", "Generate a label and link it to this tag.");
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user