@measurequick/measurequick-report-generator 1.0.56 → 1.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,6 +2,7 @@ import { PDFDocument } from 'pdf-lib';
|
|
|
2
2
|
import * as base64 from './graphics.js';
|
|
3
3
|
|
|
4
4
|
export async function generateReport(payload) {
|
|
5
|
+
|
|
5
6
|
// fetch and load form
|
|
6
7
|
const formPdfBytes = _base64ToArrayBuffer(base64.systemVitalsPdfTemplate)
|
|
7
8
|
const pdfDoc = await PDFDocument.load(formPdfBytes);
|
|
@@ -93,7 +94,7 @@ export async function generateReport(payload) {
|
|
|
93
94
|
form.getTextField('Subcooling').setText(`${textFields.subcooling} °${payload.units.temperature}`);
|
|
94
95
|
form.getTextField('CondenserApproach').setText(`${textFields.approach} °${payload.units.temperature}`);
|
|
95
96
|
form.getTextField('TemperatureSplit').setText(`${textFields.tempSplit} °${payload.units.temperature}`);
|
|
96
|
-
form.getTextField('TotalExternalStaticPressure').setText(`${textFields.tesp}
|
|
97
|
+
form.getTextField('TotalExternalStaticPressure').setText(`${textFields.tesp} "WC`);
|
|
97
98
|
form.getTextField('FilterFaceVelocity').setText(`${textFields.fltrFace} FPM`);
|
|
98
99
|
|
|
99
100
|
// print targets and range icons
|
|
@@ -108,7 +109,7 @@ export async function generateReport(payload) {
|
|
|
108
109
|
let high = +payload.test.targets[`${targetKeys[i]}_ideal_high`];
|
|
109
110
|
low = mid - low;
|
|
110
111
|
high = mid + high;
|
|
111
|
-
if (targetKeys[i] == "pressure_static_total_external") high =
|
|
112
|
+
if (targetKeys[i] == "pressure_static_total_external") high = mid * 1.4;
|
|
112
113
|
else if (targetKeys[i] == "velocity_face_filter1") high = 500;
|
|
113
114
|
if (actual < low && targetKeys[i] != "velocity_face_filter1") iconPlacement = "Low";
|
|
114
115
|
else if (actual > high) iconPlacement = "High";
|