diff --git a/README.md b/README.md index 59b7042..51aa7dc 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,4 @@ # Benchtop Devices Project +VueJS app for converting Hardware Calibration, and Transducer Verify reports from text dumps, to PDFs. -Django app to parse data from Transducers and Hardware Calibration. - -Returns a PDF and prints a label - - -## App Structure - -``` -├── benchtopdevices # Django Project -│   ├── benchtopdevices -│   └── sheets -└── BenchtopPDF # C# PDF Generator Project -    ├── BenchtopPDF -    └── packages -``` - - - -## TODO - -- [x] Django app to take in data -- [x] Parse "BOTH" -- [ ] Parse and Prompt AS LEFT -- [ ] Parse and Prompt AS FOUND -- [ ] Generate PDF -- [ ] Generate Label -- [ ] Docker stuff diff --git a/benchtop-fe/src/parsers/Hardware.js b/benchtop-fe/src/parsers/Hardware.js index eb4eb61..debf931 100644 --- a/benchtop-fe/src/parsers/Hardware.js +++ b/benchtop-fe/src/parsers/Hardware.js @@ -99,7 +99,6 @@ function calculateLimitsAndTolerances(calibrationDatum, accuracy) { value = parseInt(value); } - let limit = accuracy * value * 1000 for (const mv of calibrationDatum["Master Values"]) { const reading = parseInt(mv["Value"].split(" ")[0]) * 1000; @@ -110,10 +109,13 @@ function calculateLimitsAndTolerances(calibrationDatum, accuracy) { for (const i in calibrationDatum["Gauge Reading"]) { let gr = calibrationDatum["Gauge Reading"][i]; const mv = calibrationDatum["Master Values"][i]; - const value = parseInt(gr["Value"].split(" ")[0]) * 1000; - gr["Value"] = value; - gr["In Range"] = isInRange(value, mv) - gr["Delta"] = calculateDelta(value, mv) + const [val, unit] = gr["Value"].split(" ") + const reading = parseInt(val) * 1000; + + gr["Value"] = reading; // Update the original, ignoring the units + gr["Unit"] = unit; + gr["In Range"] = isInRange(reading, mv) + gr["Delta"] = calculateDelta(reading, mv) } outOfTolerance(calibrationDatum["Gauge Reading"]) diff --git a/benchtop-fe/src/parsers/__tests__/parseHardware.test.js b/benchtop-fe/src/parsers/__tests__/parseHardware.test.js index 0f1e843..89b220b 100644 --- a/benchtop-fe/src/parsers/__tests__/parseHardware.test.js +++ b/benchtop-fe/src/parsers/__tests__/parseHardware.test.js @@ -16,6 +16,6 @@ describe("Test for all files", () => { /* -? With hardware - is it still accuracy limits are 0.05% (or w.e specified) of `3LPM` + ? With hardware - is it still accuracy limits are 0.05% (or w.e specified) of `3LPM` */ \ No newline at end of file