This commit is contained in:
Tyrel Souza 2023-10-20 16:47:36 -04:00
parent fcaa05b489
commit ec4eb418d5
No known key found for this signature in database
GPG Key ID: F3614B02ACBE438E
3 changed files with 9 additions and 33 deletions

View File

@ -1,30 +1,4 @@
# Benchtop Devices Project # 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

View File

@ -99,7 +99,6 @@ function calculateLimitsAndTolerances(calibrationDatum, accuracy) {
value = parseInt(value); value = parseInt(value);
} }
let limit = accuracy * value * 1000 let limit = accuracy * value * 1000
for (const mv of calibrationDatum["Master Values"]) { for (const mv of calibrationDatum["Master Values"]) {
const reading = parseInt(mv["Value"].split(" ")[0]) * 1000; const reading = parseInt(mv["Value"].split(" ")[0]) * 1000;
@ -110,10 +109,13 @@ function calculateLimitsAndTolerances(calibrationDatum, accuracy) {
for (const i in calibrationDatum["Gauge Reading"]) { for (const i in calibrationDatum["Gauge Reading"]) {
let gr = calibrationDatum["Gauge Reading"][i]; let gr = calibrationDatum["Gauge Reading"][i];
const mv = calibrationDatum["Master Values"][i]; const mv = calibrationDatum["Master Values"][i];
const value = parseInt(gr["Value"].split(" ")[0]) * 1000; const [val, unit] = gr["Value"].split(" ")
gr["Value"] = value; const reading = parseInt(val) * 1000;
gr["In Range"] = isInRange(value, mv)
gr["Delta"] = calculateDelta(value, mv) 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"]) outOfTolerance(calibrationDatum["Gauge Reading"])

View File

@ -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`
*/ */