@measurequick/measurequick-report-generator 1.5.200 → 1.5.202
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,7 +1,6 @@
|
|
|
1
1
|
import { PDFDocument } from "pdf-lib";
|
|
2
2
|
import * as base64 from "../base-64/icons.js";
|
|
3
3
|
import * as pdf from "../base-64/mq-vitals-heatpump-heating.js";
|
|
4
|
-
import * as systemInfoPage from "./system-info-page.js";
|
|
5
4
|
import * as util from "../util.js";
|
|
6
5
|
import * as notesSummaryPage from "./notes-summary-page.js";
|
|
7
6
|
|
|
@@ -236,9 +235,18 @@ export async function getReport(payload, _test) {
|
|
|
236
235
|
let mid, low, high;
|
|
237
236
|
|
|
238
237
|
if (label === "Superheat") {
|
|
239
|
-
// Temperature Rise -
|
|
238
|
+
// Temperature Rise - uses temperature_split targets for HP heating
|
|
240
239
|
value = textFields.tempRise;
|
|
241
|
-
|
|
240
|
+
if (t.targets && t.targets.temperature_split !== undefined) {
|
|
241
|
+
mid = parseFloat(t.targets.temperature_split);
|
|
242
|
+
const idealLow = t.targets.temperature_split_ideal_low !== undefined ? parseFloat(t.targets.temperature_split_ideal_low) : 5;
|
|
243
|
+
const idealHigh = t.targets.temperature_split_ideal_high !== undefined ? parseFloat(t.targets.temperature_split_ideal_high) : 5;
|
|
244
|
+
low = mid - idealLow;
|
|
245
|
+
high = mid + idealHigh;
|
|
246
|
+
if (!isNaN(low) && !isNaN(high)) {
|
|
247
|
+
targetZone = `(${low.toFixed(1)} - ${high.toFixed(1)})`;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
242
250
|
} else if (label === "Subcooling") {
|
|
243
251
|
// Approach - LLT minus entering dry bulb
|
|
244
252
|
value = textFields.approach;
|
|
@@ -279,8 +287,19 @@ export async function getReport(payload, _test) {
|
|
|
279
287
|
}
|
|
280
288
|
}
|
|
281
289
|
} else if (label === "FilterFace") {
|
|
282
|
-
// Airflow -
|
|
290
|
+
// Airflow - use airflow target if available
|
|
283
291
|
value = textFields.airflow;
|
|
292
|
+
// Check for airflow target (airflow_estimated or airflow)
|
|
293
|
+
const airflowTarget = t.targets && (t.targets.airflow_estimated || t.targets.airflow);
|
|
294
|
+
if (airflowTarget !== undefined) {
|
|
295
|
+
mid = parseFloat(airflowTarget);
|
|
296
|
+
// Airflow ideal range is typically ±10%
|
|
297
|
+
low = mid * 0.9;
|
|
298
|
+
high = mid * 1.1;
|
|
299
|
+
if (!isNaN(low) && !isNaN(high)) {
|
|
300
|
+
targetZone = `(${low.toFixed(0)} - ${high.toFixed(0)})`;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
284
303
|
}
|
|
285
304
|
|
|
286
305
|
// Determine range indicator position if we have target values
|
|
@@ -325,18 +344,6 @@ export async function getReport(payload, _test) {
|
|
|
325
344
|
// Skip pass/fail subsystem review for heat pump heating
|
|
326
345
|
form.getTextField("SSR1").setText("Heat Pump Heating Mode");
|
|
327
346
|
|
|
328
|
-
// Add system info page
|
|
329
|
-
if (payload.meta.report_type != "FullReport") {
|
|
330
|
-
let systemInfoPageBase64 = await systemInfoPage.getReport(payload);
|
|
331
|
-
const systemInfoPageDoc = systemInfoPageBase64
|
|
332
|
-
? await PDFDocument.load(util._base64ToArrayBuffer(systemInfoPageBase64.data))
|
|
333
|
-
: false;
|
|
334
|
-
const [_systemInfoPageDoc] = systemInfoPageDoc
|
|
335
|
-
? await pdfDoc.copyPages(systemInfoPageDoc, [0])
|
|
336
|
-
: false;
|
|
337
|
-
if (_systemInfoPageDoc) pdfDoc.insertPage(pdfDoc.getPages().length, _systemInfoPageDoc);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
347
|
// flatten form fields before adding AI summary pages
|
|
341
348
|
form.flatten();
|
|
342
349
|
|