@measurequick/measurequick-report-generator 1.4.11 → 1.4.13
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.
package/package.json
CHANGED
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
} from 'pdf-lib';
|
|
4
4
|
import * as base64 from '../base-64/icons.js';
|
|
5
5
|
import * as util from '../util.js';
|
|
6
|
-
import * as pdf from '../base-64/measurement-details-page.js';
|
|
6
|
+
import * as pdf from '../base-64/measurement-details-acca-page.js';
|
|
7
7
|
|
|
8
8
|
let embeddedIconsTestIn = {};
|
|
9
9
|
let embeddedIconsTestOut = {};
|
|
10
10
|
|
|
11
|
-
export async function getReport(payload) { // DAVID TODO
|
|
11
|
+
export async function getReport(payload) { // DAVID TODO
|
|
12
12
|
try {
|
|
13
13
|
const pdfDocPg1 = await PDFDocument.load(util._base64ToArrayBuffer(pdf.base64));
|
|
14
14
|
const pdfDocPg2 = await PDFDocument.load(util._base64ToArrayBuffer(pdf.base64));
|
|
@@ -27,7 +27,7 @@ export async function getReport(payload) { // DAVID TODO: WRITE CODE TO PRINT BL
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
let labels = ["iconRangeHigh", "iconRangeLow", "iconRangeNormal", "iconTesto", "iconCalculator", "iconFieldpiece",
|
|
30
|
+
let labels = ["iconRangeHigh", "iconRangeLow", "iconRangeNormal", "iconTesto", "iconCalculator", "iconFieldpiece", "iconRangeGreen", "iconRangeYellow", "iconRangeRed",
|
|
31
31
|
"iconUei", "iconSporlanPro", "iconSporlanLegacy", "iconIconnect", "iconImanifold", "iconSensi", "iconDg8", "iconJb",
|
|
32
32
|
"iconBluflame", "iconSauermann", "iconRedfish510", "iconRedfish510333", "iconRedfish550", "iconDg1000", "iconTrueflow", "iconThumbprintRed", "iconThumbprintGreen", "iconThumbprintYellow"
|
|
33
33
|
];
|
|
@@ -143,7 +143,21 @@ export async function getReport(payload) { // DAVID TODO: WRITE CODE TO PRINT BL
|
|
|
143
143
|
if (val == null || val == "null") val = "--";
|
|
144
144
|
form.getTextField(`Block${blockNum}-Row${rowNum}-Col1`).setText(`${measurement.label}`);
|
|
145
145
|
if (blockNum == 5) {
|
|
146
|
-
|
|
146
|
+
let passFails = ["ambient_pass_fail", "control_system_pass_fail", "electrical_system_pass_fail", "air_distribution_system_pass_fail", "air_filtration_system_pass_fail", "condensate_drain_system_pass_fail", "indoor_equipment_pass_fail", "venting_system_pass_fail", "fuel_delivery_system_pass_fail", "make_up_air_system_pass_fail", "heat_exchanger_pass_fail", "safety_system_pass_fail", "heating_operation_pass_fail", "combustion_pass_fail", "heating_efficiency_pass_fail"];
|
|
147
|
+
let pfLabels = ["Ambient CO", "Control system (thermostat)", "Electrical system", 'Air distribution system', "Air filtration system", "Condensate drain system", "Indoor equipment", "Venting system", "Fuel delivery system", "Make up air (CAZ)", "Heat exchanger", "Safety system", "Heating operation", "Combustion Safety", "Combustion efficiency"];
|
|
148
|
+
if (payload.meta.report_mode == 'cooling') {
|
|
149
|
+
passFails = ["electrical_system_pass_fail", "air_distribution_system_pass_fail", "air_filtration_system_pass_fail", "condensate_drain_system_pass_fail", "refrigerant_charge_pass_fail", "outdoor_equipment_pass_fail", "indoor_equipment_pass_fail", "cooling_capacity_pass_fail", "cooling_electrical_efficiency_pass_fail"];
|
|
150
|
+
pfLabels = ["Electrical system", "Air distribution system", "Air filtration system", "Condensate drain system", "Refrigerant charge", "Outdoor equipment", "Indoor equipment", "Cooling capacity", "Cooling electrical efficiency"];
|
|
151
|
+
}
|
|
152
|
+
for (let i = 0; i < passFails.length; i++) {
|
|
153
|
+
let meas = test[passFails[i]];
|
|
154
|
+
let icon = meas == "Pass" || meas == "High" || meas == "Mid" ? iconRangeGreen : iconRangeRed;
|
|
155
|
+
if (passFails[i] == 'heating_efficiency_pass_fail') icon = iconRangeGreen;
|
|
156
|
+
let suffix = test[passFails[i] + '_override'] ? ' *' : '';
|
|
157
|
+
if (meas == "Caution" || suffix == ' *') icon = iconRangeYellow;
|
|
158
|
+
form.getTextField(`SSR${i + 1}`).setText(pfLabels[i] + suffix);
|
|
159
|
+
form.getButton(`SSR${i + 1}`).setImage(icon);
|
|
160
|
+
}
|
|
147
161
|
} else form.getTextField(`Block${blockNum}-Row${rowNum}-Col2`).setText(`${val}`);
|
|
148
162
|
} else break;
|
|
149
163
|
}
|