@measurequick/measurequick-report-generator 1.5.196 → 1.5.197

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.196",
3
+ "version": "1.5.197",
4
4
  "description": "Generates PDF documents for various measureQuick applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -193,7 +193,7 @@ export async function getReport(payload, _test) {
193
193
 
194
194
  // Heat pump heating measurements (using existing form fields with different data)
195
195
  form.getTextField("Superheat").setText(`${textFields.tempRise} °${payload.units.temperature}`);
196
- form.getTextField("Subcooling").setText(`${textFields.llt} °${payload.units.temperature}`);
196
+ form.getTextField("Subcooling").setText(`${textFields.approach} °${payload.units.temperature}`);
197
197
  form.getTextField("CondenserApproach").setText(`${textFields.cop}`);
198
198
  form.getTextField("TemperatureSplit").setText(`${textFields.oat} °${payload.units.temperature}`);
199
199
  form.getTextField("TotalExternalStaticPressure").setText(`${textFields.tesp} inH2O`);
@@ -234,7 +234,7 @@ export async function getReport(payload, _test) {
234
234
  // Map field names to textFields values and check if they exist
235
235
  const measureChecks = [
236
236
  { label: "Superheat", value: textFields.tempRise }, // Temperature Rise
237
- { label: "Subcooling", value: textFields.llt }, // Liquid Line Temp
237
+ { label: "Subcooling", value: textFields.approach, ref: "temperature_difference_condenser" }, // Approach
238
238
  { label: "Condenser", value: textFields.cop }, // COP/Efficiency
239
239
  { label: "TempSplit", value: textFields.oat }, // Outdoor Air Temp
240
240
  { label: "Tesp", value: textFields.tesp }, // Total External Static Pressure
@@ -242,13 +242,30 @@ export async function getReport(payload, _test) {
242
242
  ];
243
243
 
244
244
  for (let i = 0; i < measureChecks.length; i++) {
245
- const { label, value } = measureChecks[i];
245
+ const { label, value, ref } = measureChecks[i];
246
246
  // Only show range indicator if value exists (is not "--")
247
247
  if (value && value !== "--") {
248
- // For heat pump heating, we don't have typical target ranges yet
249
- // Show green icon as placeholder for valid measurements
250
248
  let icon = iconRangeGreen;
251
249
  let iconPlacement = "Mid";
250
+
251
+ // Check if we have target zone data for this measurement
252
+ if (ref && t.targets && t.targets[ref] !== undefined) {
253
+ const target = parseFloat(t.targets[ref]);
254
+ const idealLow = t.targets[`${ref}_ideal_low`] ? parseFloat(t.targets[`${ref}_ideal_low`]) : 0;
255
+ const idealHigh = t.targets[`${ref}_ideal_high`] ? parseFloat(t.targets[`${ref}_ideal_high`]) : 0;
256
+ const actual = parseFloat(value);
257
+ const low = target - idealLow;
258
+ const high = target + idealHigh;
259
+
260
+ if (actual < low) {
261
+ icon = iconRangeRed;
262
+ iconPlacement = "Low";
263
+ } else if (actual > high) {
264
+ icon = iconRangeRed;
265
+ iconPlacement = "High";
266
+ }
267
+ }
268
+
252
269
  try {
253
270
  form.getButton(`Image${label}${iconPlacement}_af_image`).setImage(icon);
254
271
  } catch (e) {
@@ -310,7 +327,7 @@ function getTextFields(payload, test) {
310
327
  zip: payload.site.location.zip ? ` ${payload.site.location.zip}` : "",
311
328
  // Heat pump heating specific fields
312
329
  tempRise: tempRise,
313
- llt: test.data.temperature_liquid_line !== undefined ? (+test.data.temperature_liquid_line).toFixed(1) : "--",
330
+ approach: test.data.temperature_difference_condenser !== undefined ? (+test.data.temperature_difference_condenser).toFixed(1) : "--",
314
331
  cop: test.data.cop !== undefined ? (+test.data.cop).toFixed(2) : "--",
315
332
  oat: test.data.temperature_outdoor_dry_bulb !== undefined ? (+test.data.temperature_outdoor_dry_bulb).toFixed(1) : "--",
316
333
  tesp: test.data.pressure_static_total_external !== undefined ? (+test.data.pressure_static_total_external).toFixed(2) : "--",