@measurequick/measurequick-report-generator 1.5.203 → 1.5.205

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.
@@ -20,7 +20,8 @@
20
20
  "Bash(done)",
21
21
  "Bash(cd /Users/bobby/mQ/packages/mq-hvac/src/pages/acr-modal-subpage/combustion grep -c \"margin-bottom: 0px\" acr-modal-subpage-combustion.html grep -c \"''''mQ''''\" acr-modal-subpage-combustion.html)",
22
22
  "Bash(grep:*)",
23
- "Bash(git checkout:*)"
23
+ "Bash(git checkout:*)",
24
+ "mcp__ide__getDiagnostics"
24
25
  ]
25
26
  }
26
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measurequick/measurequick-report-generator",
3
- "version": "1.5.203",
3
+ "version": "1.5.205",
4
4
  "description": "Generates PDF documents for various measureQuick applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -499,7 +499,8 @@ export async function getReport(payload) {
499
499
  .setText(`${displayLabel} ${units}`);
500
500
 
501
501
  // Use derated value if available for gas_input_rated
502
- let val = measurement.value !== null && measurement.value !== undefined
502
+ // Also check for empty string - middleman passes "" when it expects lookup from test.data
503
+ let val = measurement.value !== null && measurement.value !== undefined && measurement.value !== ""
503
504
  ? measurement.value
504
505
  : +test.data[measurement.ref];
505
506
  if (
@@ -509,20 +510,24 @@ export async function getReport(payload) {
509
510
  val = payload.equipment.gas_input_derated;
510
511
  }
511
512
 
512
- // Special handling for CO measurements - allow 0 as valid value
513
+ // Special handling for CO measurements - allow 0 as valid value, no decimals
513
514
  const isCOMeasurement =
514
515
  measurement.label == "Ambient CO" ||
515
516
  measurement.label == "Return CO" ||
516
517
  measurement.label == "Supply CO";
517
518
 
518
- if (!val && !isCOMeasurement) val = "--";
519
- else if (measurement.fixTo && typeof val == "number")
519
+ // For CO measurements: if value is null/undefined, show "--"; if valid, show as integer (no decimals)
520
+ if (isCOMeasurement) {
521
+ if (measurement.value === null || measurement.value === undefined) {
522
+ val = "--";
523
+ } else {
524
+ val = Math.round(Number(val)).toString();
525
+ }
526
+ } else if (!val) {
527
+ val = "--";
528
+ } else if (measurement.fixTo && typeof val == "number") {
520
529
  val = val.toFixed(measurement.fixTo);
521
- if (
522
- isCOMeasurement &&
523
- (measurement.value === null || measurement.value === undefined)
524
- )
525
- val = "0.0";
530
+ }
526
531
  if (typeof val == "number" || !isNaN(val))
527
532
  val = val.toLocaleString("en-US");
528
533
  if (measurement.fixTo && typeof val == "number")
@@ -320,8 +320,11 @@ export async function getReport(payload, _test) {
320
320
  let high = +t.targets[`${targetKeys[i]}_ideal_high`];
321
321
  low = mid - low;
322
322
  high = mid + high;
323
- if (targetKeys[i] == "pressure_static_total_external") high = mid * 1.4;
324
- else if (targetKeys[i] == "velocity_face_filter1") high = 500;
323
+ // For TESP, use 40%-140% of target (low = mid * 0.4, high = mid * 1.4)
324
+ if (targetKeys[i] == "pressure_static_total_external") {
325
+ low = mid * 0.4;
326
+ high = mid * 1.4;
327
+ } else if (targetKeys[i] == "velocity_face_filter1") high = 500;
325
328
  let val = t.data[targetKeys[i]];
326
329
  if (actual < low && targetKeys[i] != "velocity_face_filter1")
327
330
  iconPlacement = "Low";
@@ -332,10 +335,8 @@ export async function getReport(payload, _test) {
332
335
  .getButton(`Image${measureLabels[i]}${iconPlacement}_af_image`)
333
336
  .setImage(icon);
334
337
  let targetZone = "";
335
- if (
336
- targetKeys[i] == "pressure_static_total_external" ||
337
- targetKeys[i] == "velocity_face_filter1"
338
- )
338
+ // Filter face velocity only shows upper bound
339
+ if (targetKeys[i] == "velocity_face_filter1")
339
340
  targetZone = `(< ${high.toFixed(1)})`;
340
341
  else if (!isNaN(low) && low != "NaN" && !isNaN(high) && high != "NaN")
341
342
  targetZone = `(${low.toFixed(1)} - ${high.toFixed(1)})`;
@@ -362,8 +362,11 @@ export async function getReport(payload, _test) {
362
362
  let high = +test.testInfo.targets[`${targetKeys[i]}_ideal_high`];
363
363
  low = mid - low;
364
364
  high = mid + high;
365
- if (targetKeys[i] == "pressure_static_total_external") high = mid * 1.4;
366
- else if (targetKeys[i] == "velocity_face_filter1") high = 500;
365
+ // For TESP, use 40%-140% of target (low = mid * 0.4, high = mid * 1.4)
366
+ if (targetKeys[i] == "pressure_static_total_external") {
367
+ low = mid * 0.4;
368
+ high = mid * 1.4;
369
+ } else if (targetKeys[i] == "velocity_face_filter1") high = 500;
367
370
  let val = test.testInfo.data[targetKeys[i]];
368
371
  if (targetKeys[i] === "pressure_manifold") {
369
372
  val = test.testInfo.data["pressure_manifold_after"]
@@ -377,10 +380,8 @@ export async function getReport(payload, _test) {
377
380
  if (icon)
378
381
  safeSetImage(form, `Image${measureLabels[i]}${iconPlacement}`, icon);
379
382
  let targetZone = "";
380
- if (
381
- targetKeys[i] == "pressure_static_total_external" ||
382
- targetKeys[i] == "velocity_face_filter1"
383
- )
383
+ // Filter face velocity only shows upper bound
384
+ if (targetKeys[i] == "velocity_face_filter1")
384
385
  targetZone = `(< ${high.toFixed(1)})`;
385
386
  else if (!isNaN(low) && low != "NaN" && !isNaN(high) && high != "NaN")
386
387
  targetZone = `(${low.toFixed(1)} - ${high.toFixed(1)})`;
@@ -401,8 +401,11 @@ export async function getReport(payload, _test) {
401
401
  let high = +test.testInfo.targets[`${targetKeys[i]}_ideal_high`];
402
402
  low = mid - low;
403
403
  high = mid + high;
404
- if (targetKeys[i] == "pressure_static_total_external") high = mid * 1.4;
405
- else if (targetKeys[i] == "velocity_face_filter1") high = 500;
404
+ // For TESP, use 40%-140% of target (low = mid * 0.4, high = mid * 1.4)
405
+ if (targetKeys[i] == "pressure_static_total_external") {
406
+ low = mid * 0.4;
407
+ high = mid * 1.4;
408
+ } else if (targetKeys[i] == "velocity_face_filter1") high = 500;
406
409
 
407
410
  let val = test.testInfo.data[targetKeys[i]];
408
411
  if (targetKeys[i] === "pressure_manifold") {
@@ -418,10 +421,8 @@ export async function getReport(payload, _test) {
418
421
  if (icon)
419
422
  safeSetImage(form, `Image${measureLabels[i]}${iconPlacement}`, icon);
420
423
  let targetZone = "";
421
- if (
422
- targetKeys[i] == "pressure_static_total_external" ||
423
- targetKeys[i] == "velocity_face_filter1"
424
- )
424
+ // Filter face velocity only shows upper bound
425
+ if (targetKeys[i] == "velocity_face_filter1")
425
426
  targetZone = `(< ${high.toFixed(1)})`;
426
427
  else if (!isNaN(low) && low != "NaN" && !isNaN(high) && high != "NaN")
427
428
  targetZone = `(${low.toFixed(1)} - ${high.toFixed(1)})`;