@measurequick/measurequick-report-generator 1.5.202 → 1.5.204

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.202",
3
+ "version": "1.5.204",
4
4
  "description": "Generates PDF documents for various measureQuick applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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)})`;
@@ -185,10 +185,11 @@ export async function getReport(payload, _test) {
185
185
  form.getTextField(`YourSystemScore${systemScoreColor}`).setText(`${systemScorePercentage} ${systemScoreGrade}`);
186
186
 
187
187
  // Heat pump heating measurements (using existing form fields with different data)
188
- form.getTextField("Superheat").setText(`${textFields.tempRise} °${payload.units.temperature}`);
189
- form.getTextField("Subcooling").setText(`${textFields.approach} °${payload.units.temperature}`);
188
+ // Field mapping: Superheat=Capacity, Subcooling=TempSplit, TemperatureSplit=Approach
189
+ form.getTextField("Superheat").setText(`${textFields.capacity}`);
190
+ form.getTextField("Subcooling").setText(`${textFields.tempRise} °${payload.units.temperature}`);
190
191
  form.getTextField("CondenserApproach").setText(`${textFields.cop}`);
191
- form.getTextField("TemperatureSplit").setText(`${textFields.oat} °${payload.units.temperature}`);
192
+ form.getTextField("TemperatureSplit").setText(`${textFields.approach} °${payload.units.temperature}`);
192
193
  form.getTextField("TotalExternalStaticPressure").setText(`${textFields.tesp} inH2O`);
193
194
  form.getTextField("FilterFaceVelocity").setText(`${textFields.airflow} CFM`);
194
195
 
@@ -235,7 +236,19 @@ export async function getReport(payload, _test) {
235
236
  let mid, low, high;
236
237
 
237
238
  if (label === "Superheat") {
238
- // Temperature Rise - uses temperature_split targets for HP heating
239
+ // Capacity (total) - uses capacity_total targets for HP heating
240
+ value = textFields.capacityRaw;
241
+ if (t.targets && t.targets.capacity_total !== undefined) {
242
+ mid = parseFloat(t.targets.capacity_total);
243
+ // Capacity ideal range is typically ±10%
244
+ low = mid * 0.9;
245
+ high = mid * 1.1;
246
+ if (!isNaN(low) && !isNaN(high)) {
247
+ targetZone = `(${(low/1000).toFixed(1)}k - ${(high/1000).toFixed(1)}k)`;
248
+ }
249
+ }
250
+ } else if (label === "Subcooling") {
251
+ // Temperature Split - uses temperature_split targets
239
252
  value = textFields.tempRise;
240
253
  if (t.targets && t.targets.temperature_split !== undefined) {
241
254
  mid = parseFloat(t.targets.temperature_split);
@@ -247,20 +260,6 @@ export async function getReport(payload, _test) {
247
260
  targetZone = `(${low.toFixed(1)} - ${high.toFixed(1)})`;
248
261
  }
249
262
  }
250
- } else if (label === "Subcooling") {
251
- // Approach - LLT minus entering dry bulb
252
- value = textFields.approach;
253
- // Check for approach targets in targets object
254
- if (t.targets && t.targets.approach !== undefined) {
255
- mid = parseFloat(t.targets.approach);
256
- const idealLow = t.targets.approach_ideal_low !== undefined ? parseFloat(t.targets.approach_ideal_low) : 3;
257
- const idealHigh = t.targets.approach_ideal_high !== undefined ? parseFloat(t.targets.approach_ideal_high) : 3;
258
- low = mid - idealLow;
259
- high = mid + idealHigh;
260
- if (!isNaN(low) && !isNaN(high)) {
261
- targetZone = `(${low.toFixed(1)} - ${high.toFixed(1)})`;
262
- }
263
- }
264
263
  } else if (label === "Condenser") {
265
264
  // COP - target is in data.hp_heating_cop_target
266
265
  value = textFields.cop;
@@ -274,8 +273,18 @@ export async function getReport(payload, _test) {
274
273
  }
275
274
  }
276
275
  } else if (label === "TempSplit") {
277
- // Outdoor Air Temp - no target zone, just informational
278
- value = textFields.oat;
276
+ // Approach - LLT minus entering dry bulb, uses approach targets
277
+ value = textFields.approach;
278
+ if (t.targets && t.targets.approach !== undefined) {
279
+ mid = parseFloat(t.targets.approach);
280
+ const idealLow = t.targets.approach_ideal_low !== undefined ? parseFloat(t.targets.approach_ideal_low) : 3;
281
+ const idealHigh = t.targets.approach_ideal_high !== undefined ? parseFloat(t.targets.approach_ideal_high) : 3;
282
+ low = mid - idealLow;
283
+ high = mid + idealHigh;
284
+ if (!isNaN(low) && !isNaN(high)) {
285
+ targetZone = `(${low.toFixed(1)} - ${high.toFixed(1)})`;
286
+ }
287
+ }
279
288
  } else if (label === "Tesp") {
280
289
  // Total External Static Pressure
281
290
  value = textFields.tesp;
@@ -364,6 +373,19 @@ function getTextFields(payload, test) {
364
373
  tempRise = (test.data.temperature_leaving_dry_bulb - test.data.temperature_entering_dry_bulb).toFixed(1);
365
374
  }
366
375
 
376
+ // Calculate capacity - use capacity_total from data or targets
377
+ let capacityRaw = null;
378
+ let capacity = "--";
379
+ if (test.data.capacity_total !== undefined && test.data.capacity_total !== null) {
380
+ capacityRaw = +test.data.capacity_total;
381
+ // Format capacity: show in k BTU/h (e.g., "36.2k BTU/h")
382
+ capacity = (capacityRaw / 1000).toFixed(1) + "k BTU/h";
383
+ } else if (test.targets && test.targets.capacity_total !== undefined) {
384
+ // Fall back to target if actual capacity not available
385
+ capacityRaw = +test.targets.capacity_total;
386
+ capacity = (capacityRaw / 1000).toFixed(1) + "k BTU/h";
387
+ }
388
+
367
389
  return {
368
390
  cName:
369
391
  payload.site.customer.first_name && payload.site.customer.last_name
@@ -375,6 +397,8 @@ function getTextFields(payload, test) {
375
397
  state: payload.site.location.state ? `, ${payload.site.location.state}` : "",
376
398
  zip: payload.site.location.zip ? ` ${payload.site.location.zip}` : "",
377
399
  // Heat pump heating specific fields
400
+ capacity: capacity,
401
+ capacityRaw: capacityRaw,
378
402
  tempRise: tempRise,
379
403
  approach: (test.data.temperature_liquid_line !== undefined && test.data.temperature_entering_dry_bulb !== undefined)
380
404
  ? (test.data.temperature_liquid_line - test.data.temperature_entering_dry_bulb).toFixed(1)