@measurequick/measurequick-report-generator 1.5.98 → 1.5.101

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measurequick/measurequick-report-generator",
3
- "version": "1.5.98",
3
+ "version": "1.5.101",
4
4
  "description": "Generates PDF documents for various measureQuick applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -193,13 +193,9 @@ export async function getReport(payload, _test) {
193
193
  payload.project.tests[payload.project.tests.length - 1].testInfo.data &&
194
194
  payload.project.tests[payload.project.tests.length - 1].testInfo.data
195
195
  .cep_ratio
196
- ? (
197
- payload.project.tests[payload.project.tests.length - 1].testInfo
198
- .data.cep_ratio * 100
199
- )
200
- .toFixed(0)
201
- .toString() + "%"
202
- : "N/A";
196
+ ? payload.project.tests[payload.project.tests.length - 1].testInfo.data
197
+ .cep_ratio * 100
198
+ : null;
203
199
  let cep_description =
204
200
  "Your equipment is designed by the manufacturer to deliver a specific amount of air into your home. The Equipment " +
205
201
  "Performance Score is the percentage of the measured capacity delivered into your home compared to the equipment rated capacity. " +
@@ -213,31 +209,41 @@ export async function getReport(payload, _test) {
213
209
  payload.project.tests[payload.project.tests.length - 1].testInfo.data &&
214
210
  payload.project.tests[payload.project.tests.length - 1].testInfo.data
215
211
  .csp_ratio
216
- ? (
217
- payload.project.tests[payload.project.tests.length - 1].testInfo
218
- .data.csp_ratio * 100
219
- )
220
- .toFixed(0)
221
- .toString() + "%"
222
- : "N/A";
212
+ ? payload.project.tests[payload.project.tests.length - 1].testInfo.data
213
+ .csp_ratio * 100
214
+ : null;
223
215
  let csp_description =
224
216
  "A system is made up of the equipment and a duct system that delivers air from the equipment into your home. The ideal " +
225
217
  "System Performance Score is 100%. A lower score reveals unseen problems in your system that increase utility bills and reduce " +
226
218
  "your comfort. A System Performance Score of 80% or better is excellent compared to most installed systems.";
227
219
 
228
- form.getTextField("HEPEfficiency").setText(cep_ratio);
229
- if (cep_ratio < 80) form.getButton("HEPLow").setImage(iconRangeRed);
230
- else if (cep_ratio >= 80 && cep_ratio <= 100)
231
- form.getButton("HEPNormal").setImage(iconRangeGreen);
232
- else if (cep_ratio > 100) form.getButton("HEPHigh").setImage(iconRangeRed);
233
- form.getTextField("HEPDescription").setText(cep_description);
220
+ if (cep_ratio) {
221
+ form
222
+ .getTextField("HEPEfficiency")
223
+ .setText(cep_ratio.toFixed(0).toString() + "%");
224
+ if (cep_ratio < 80) form.getButton("HEPLow").setImage(iconRangeRed);
225
+ else if (cep_ratio >= 80 && cep_ratio <= 100)
226
+ form.getButton("HEPNormal").setImage(iconRangeGreen);
227
+ else if (cep_ratio > 100)
228
+ form.getButton("HEPHigh").setImage(iconRangeRed);
229
+ form.getTextField("HEPDescription").setText(cep_description);
230
+ } else {
231
+ form.getTextField("HEPEfficiency").setText("--");
232
+ }
234
233
 
235
- form.getTextField("HSPEfficiency").setText(csp_ratio);
236
- if (csp_ratio < 70) form.getButton("HSPLow").setImage(iconRangeRed);
237
- else if (csp_ratio >= 70 && csp_ratio <= 100)
238
- form.getButton("HSPNormal").setImage(iconRangeGreen);
239
- else if (csp_ratio > 100) form.getButton("HSPHigh").setImage(iconRangeRed);
240
- form.getTextField("HSPDescription").setText(csp_description);
234
+ if (csp_ratio) {
235
+ form
236
+ .getTextField("HSPEfficiency")
237
+ .setText(csp_ratio.toFixed(0).toString() + "%");
238
+ if (csp_ratio < 70) form.getButton("HSPLow").setImage(iconRangeRed);
239
+ else if (csp_ratio >= 70 && csp_ratio <= 100)
240
+ form.getButton("HSPNormal").setImage(iconRangeGreen);
241
+ else if (csp_ratio > 100)
242
+ form.getButton("HSPHigh").setImage(iconRangeRed);
243
+ form.getTextField("HSPDescription").setText(csp_description);
244
+ } else {
245
+ form.getTextField("HSPEfficiency").setText("--");
246
+ }
241
247
 
242
248
  //These are all from the duct screening... fan tables OR TEC
243
249
  let duct_test =
@@ -388,6 +394,31 @@ export async function getReport(payload, _test) {
388
394
  }
389
395
  }
390
396
 
397
+ let tesp_factors = getTESPPointsUsed(test.ductScreeningSystemType);
398
+
399
+ if (test["ductScreeningPressureDrop" + tesp_factors.entering]) {
400
+ form
401
+ .getTextField("TESPEntering")
402
+ .setText(
403
+ (+test["ductScreeningPressureDrop" + tesp_factors.entering])
404
+ .toFixed(2)
405
+ .toString() + " inH2O"
406
+ );
407
+ } else {
408
+ form.getTextField("TESPEntering").setText("--");
409
+ }
410
+ if (test["ductScreeningPressureDrop" + tesp_factors.entering]) {
411
+ form
412
+ .getTextField("TESPExiting")
413
+ .setText(
414
+ (+test["ductScreeningPressureDrop" + tesp_factors.exiting])
415
+ .toFixed(2)
416
+ .toString() + " inH2O"
417
+ );
418
+ } else {
419
+ form.getTextField("TESPExiting").setText("--");
420
+ }
421
+
391
422
  if (test["ductScreeningPressureDrop" + filter_pressure_drop])
392
423
  form
393
424
  .getTextField("AirFilterDrop")
@@ -458,13 +489,6 @@ export async function getReport(payload, _test) {
458
489
  .toFixed(2)
459
490
  .toString() + " inH2O"
460
491
  );
461
- form
462
- .getTextField("TESPExiting")
463
- .setText(
464
- (+test["ductScreeningPressureDrop" + supply_pressure + "Target"])
465
- .toFixed(2)
466
- .toString() + " inH2O"
467
- );
468
492
  } else {
469
493
  form.getTextField("SupplyBudget").setText("--");
470
494
  form.getTextField("TESPExiting").setText("--");
@@ -508,13 +532,6 @@ export async function getReport(payload, _test) {
508
532
  .toFixed(2)
509
533
  .toString() + " inH2O"
510
534
  );
511
- form
512
- .getTextField("TESPEntering")
513
- .setText(
514
- (+test["ductScreeningPressureDrop" + return_pressure_drop])
515
- .toFixed(2)
516
- .toString() + " inH2O"
517
- );
518
535
  } else {
519
536
  form.getTextField("ReturnPressure").setText("--");
520
537
  form.getTextField("TESPEntering").setText("--");
@@ -1060,6 +1077,22 @@ export async function getReport(payload, _test) {
1060
1077
  }
1061
1078
  }
1062
1079
 
1080
+ function getTESPPointsUsed(type) {
1081
+ if (type === "Package Draw Through") {
1082
+ return { entering: "2", exiting: "4" };
1083
+ } else if (type === "Package Blow Through") {
1084
+ return { entering: "2", exiting: "4" };
1085
+ } else if (type === "AHU Draw Through") {
1086
+ return { entering: "1", exiting: "4" };
1087
+ } else if (type === "AHU Blow Through") {
1088
+ return { entering: "1", exiting: "4" };
1089
+ } else if (type === "Split/Furnace") {
1090
+ return { entering: "2", exiting: "3" };
1091
+ }
1092
+
1093
+ return { entering: "", exiting: "" }; // fallback if system type is unrecognized
1094
+ }
1095
+
1063
1096
  function getTextFields(payload) {
1064
1097
  return {
1065
1098
  cName: