@measurequick/measurequick-report-generator 1.5.207 → 1.5.215
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
|
@@ -15,6 +15,7 @@ import * as vitalsHeatpumpHeatingReport from "./vitals-heatpump-heating-report.j
|
|
|
15
15
|
import * as nciReport from "./nci-report.js";
|
|
16
16
|
import * as energyStarCertificate from "./energy-star-certificate.js";
|
|
17
17
|
import * as accaCertificate from "./acca-certificate.js";
|
|
18
|
+
import * as notesSummaryPage from "./notes-summary-page.js";
|
|
18
19
|
import * as util from "../util.js";
|
|
19
20
|
|
|
20
21
|
let docs = [];
|
|
@@ -487,6 +488,13 @@ export async function getReport(payload) {
|
|
|
487
488
|
errors.push(`System Info: ${error}`);
|
|
488
489
|
}
|
|
489
490
|
|
|
491
|
+
/******** AI SUMMARY / NOTES (1+ PAGES) *********/
|
|
492
|
+
try {
|
|
493
|
+
await notesSummaryPage.addNotesSummaryPages(coreDoc, payload);
|
|
494
|
+
} catch (error) {
|
|
495
|
+
errors.push(`AI Summary: ${error}`);
|
|
496
|
+
}
|
|
497
|
+
|
|
490
498
|
return errors.length > 0
|
|
491
499
|
? { status: 400, data: errors.join("\n") }
|
|
492
500
|
: { status: 200, data: await coreDoc.saveAsBase64({ dataUri: true }) };
|
|
@@ -10,7 +10,7 @@ let embeddedIconsTestOut = {};
|
|
|
10
10
|
function isNCIProject(payload) {
|
|
11
11
|
if (payload && payload.project && payload.project.specialProjectType) {
|
|
12
12
|
const type = payload.project.specialProjectType;
|
|
13
|
-
return type ===
|
|
13
|
+
return type === "CoolMaxx" || type === "HeatMaxx";
|
|
14
14
|
}
|
|
15
15
|
return false;
|
|
16
16
|
}
|
|
@@ -203,8 +203,12 @@ export async function getReport(payload) {
|
|
|
203
203
|
// For NCI projects (CoolMaxx/HeatMaxx), draw NCI logo in place of profile picture (15% larger)
|
|
204
204
|
let isNCI = isNCIProject(payload) && base64.nciLogo;
|
|
205
205
|
if (isNCI) {
|
|
206
|
-
const nciLogoImagePg1 = await pdfDocPg1.embedPng(
|
|
207
|
-
|
|
206
|
+
const nciLogoImagePg1 = await pdfDocPg1.embedPng(
|
|
207
|
+
util._base64ToArrayBuffer(base64.nciLogo)
|
|
208
|
+
);
|
|
209
|
+
const nciLogoImagePg2 = await pdfDocPg2.embedPng(
|
|
210
|
+
util._base64ToArrayBuffer(base64.nciLogo)
|
|
211
|
+
);
|
|
208
212
|
const pagesPg1 = pdfDocPg1.getPages();
|
|
209
213
|
const pagesPg2 = pdfDocPg2.getPages();
|
|
210
214
|
const firstPagePg1 = pagesPg1[0];
|
|
@@ -218,11 +222,13 @@ export async function getReport(payload) {
|
|
|
218
222
|
const rectPg2 = widgetsPg2[0].getRectangle();
|
|
219
223
|
// Draw NCI logo at the profile picture position, 15% larger
|
|
220
224
|
const logoWidth1 = rectPg1.width * 1.15;
|
|
221
|
-
const logoHeight1 =
|
|
225
|
+
const logoHeight1 =
|
|
226
|
+
logoWidth1 * (nciLogoImagePg1.height / nciLogoImagePg1.width);
|
|
222
227
|
const x1 = rectPg1.x + (rectPg1.width - logoWidth1) / 2;
|
|
223
228
|
const y1 = rectPg1.y + (rectPg1.height - logoHeight1) / 2;
|
|
224
229
|
const logoWidth2 = rectPg2.width * 1.15;
|
|
225
|
-
const logoHeight2 =
|
|
230
|
+
const logoHeight2 =
|
|
231
|
+
logoWidth2 * (nciLogoImagePg2.height / nciLogoImagePg2.width);
|
|
226
232
|
const x2 = rectPg2.x + (rectPg2.width - logoWidth2) / 2;
|
|
227
233
|
const y2 = rectPg2.y + (rectPg2.height - logoHeight2) / 2;
|
|
228
234
|
firstPagePg1.drawImage(nciLogoImagePg1, {
|
|
@@ -283,7 +289,8 @@ export async function getReport(payload) {
|
|
|
283
289
|
let test = payload.tests[t].testInfo;
|
|
284
290
|
// Add source property to test object for tool icon lookup
|
|
285
291
|
// Source is stored in testInfo.source, not at the test root level
|
|
286
|
-
test.source =
|
|
292
|
+
test.source =
|
|
293
|
+
payload.tests[t].testInfo.source || payload.tests[t].source || {};
|
|
287
294
|
form.getTextField("Header").setText(`${sectionLabel}Measurement Details`);
|
|
288
295
|
|
|
289
296
|
if (payload.meta.cName)
|
|
@@ -500,9 +507,12 @@ export async function getReport(payload) {
|
|
|
500
507
|
|
|
501
508
|
// Use derated value if available for gas_input_rated
|
|
502
509
|
// Also check for empty string - middleman passes "" when it expects lookup from test.data
|
|
503
|
-
let val =
|
|
504
|
-
|
|
505
|
-
|
|
510
|
+
let val =
|
|
511
|
+
measurement.value !== null &&
|
|
512
|
+
measurement.value !== undefined &&
|
|
513
|
+
measurement.value !== ""
|
|
514
|
+
? measurement.value
|
|
515
|
+
: +test.data[measurement.ref];
|
|
506
516
|
if (
|
|
507
517
|
measurement.ref == "gas_input_rated" &&
|
|
508
518
|
payload.equipment.gas_input_derated
|
|
@@ -518,7 +528,10 @@ export async function getReport(payload) {
|
|
|
518
528
|
|
|
519
529
|
// For CO measurements: if value is null/undefined, show "--"; if valid, show as integer (no decimals)
|
|
520
530
|
if (isCOMeasurement) {
|
|
521
|
-
if (
|
|
531
|
+
if (
|
|
532
|
+
measurement.value === null ||
|
|
533
|
+
measurement.value === undefined
|
|
534
|
+
) {
|
|
522
535
|
val = "--";
|
|
523
536
|
} else {
|
|
524
537
|
val = Math.round(Number(val)).toString();
|
|
@@ -5,6 +5,20 @@ import * as systemInfoPage from "./system-info-page.js";
|
|
|
5
5
|
import * as util from "../util.js";
|
|
6
6
|
import * as notesSummaryPage from "./notes-summary-page.js";
|
|
7
7
|
|
|
8
|
+
// Helper to safely set text field (ignores if field doesn't exist)
|
|
9
|
+
function safeSetText(form, name, value) {
|
|
10
|
+
try {
|
|
11
|
+
form.getTextField(name).setText(value != null ? String(value) : "");
|
|
12
|
+
} catch (e) {}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Helper to safely set image on button (ignores if field doesn't exist)
|
|
16
|
+
function safeSetImage(form, name, image) {
|
|
17
|
+
try {
|
|
18
|
+
form.getButton(name).setImage(image);
|
|
19
|
+
} catch (e) {}
|
|
20
|
+
}
|
|
21
|
+
|
|
8
22
|
// Check if project is CoolMaxx or HeatMaxx (NCI branded)
|
|
9
23
|
function isNCIProject(payload) {
|
|
10
24
|
if (payload && payload.project && payload.project.specialProjectType) {
|
|
@@ -230,6 +244,19 @@ export async function getReport(payload, _test) {
|
|
|
230
244
|
.setText(date.toLocaleTimeString("en-US"));
|
|
231
245
|
}
|
|
232
246
|
|
|
247
|
+
// Build equipment info and set "Information Text" field with shortened description
|
|
248
|
+
const equipment = payload.equipment || {};
|
|
249
|
+
let equipmentLines = [];
|
|
250
|
+
if (equipment.condenser_make) equipmentLines.push("Make: " + equipment.condenser_make);
|
|
251
|
+
if (equipment.condenser_model) equipmentLines.push("Model: " + equipment.condenser_model);
|
|
252
|
+
if (equipment.condenser_serial) equipmentLines.push("Serial: " + equipment.condenser_serial);
|
|
253
|
+
|
|
254
|
+
let infoText = "What Are Your System Vitals?\nYour system vitals show the overall health of your HVAC system. These vitals account for both the refrigerant and air delivery of the system.";
|
|
255
|
+
if (equipmentLines.length > 0) {
|
|
256
|
+
infoText = equipmentLines.join("\n") + "\n\n" + infoText;
|
|
257
|
+
}
|
|
258
|
+
safeSetText(form, "Information Text", infoText);
|
|
259
|
+
|
|
233
260
|
let systemScorePercentage = t.data.vitals_score
|
|
234
261
|
? +t.data.vitals_score.toFixed(0)
|
|
235
262
|
: 0;
|
|
@@ -294,6 +321,42 @@ export async function getReport(payload, _test) {
|
|
|
294
321
|
.getTextField("YourSystemScorePage2")
|
|
295
322
|
.setText(`${systemScorePercentage} ${systemScoreGrade}`);
|
|
296
323
|
|
|
324
|
+
// Display system age (condenser year installed)
|
|
325
|
+
const currentYear = new Date().getUTCFullYear();
|
|
326
|
+
const rawYear = payload.equipment && payload.equipment.year_installed;
|
|
327
|
+
const installYear = rawYear !== undefined && rawYear !== null ? Number(rawYear) : NaN;
|
|
328
|
+
const hasValidYear = Number.isFinite(installYear) && installYear > 1900 && installYear <= currentYear;
|
|
329
|
+
|
|
330
|
+
if (hasValidYear) {
|
|
331
|
+
const age = currentYear - installYear;
|
|
332
|
+
let specialCasePlacement = "1";
|
|
333
|
+
let specialCaseIcon = iconRangeGreen;
|
|
334
|
+
|
|
335
|
+
if (age < 2) specialCasePlacement = "1";
|
|
336
|
+
else if (age < 5) specialCasePlacement = "2";
|
|
337
|
+
else if (age < 8) specialCasePlacement = "3";
|
|
338
|
+
else if (age < 15) {
|
|
339
|
+
specialCasePlacement = "4";
|
|
340
|
+
specialCaseIcon = iconRangeRed;
|
|
341
|
+
} else if (age < 20) {
|
|
342
|
+
specialCasePlacement = "5";
|
|
343
|
+
specialCaseIcon = iconRangeRed;
|
|
344
|
+
} else if (age < 25) {
|
|
345
|
+
specialCasePlacement = "6";
|
|
346
|
+
specialCaseIcon = iconRangeRed;
|
|
347
|
+
} else {
|
|
348
|
+
specialCasePlacement = "7";
|
|
349
|
+
specialCaseIcon = iconRangeRed;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// Set age marker and text if fields exist
|
|
353
|
+
safeSetImage(form, `ImageAge${specialCasePlacement}`, specialCaseIcon);
|
|
354
|
+
safeSetText(form, "Age", age.toString());
|
|
355
|
+
} else {
|
|
356
|
+
// Age unknown - set to "--" if field exists
|
|
357
|
+
safeSetText(form, "Age", "--");
|
|
358
|
+
}
|
|
359
|
+
|
|
297
360
|
// print targets and range icons
|
|
298
361
|
const measureLabels = [
|
|
299
362
|
"Superheat",
|
|
@@ -4,6 +4,20 @@ import * as pdf from "../base-64/mq-vitals-heatpump-heating.js";
|
|
|
4
4
|
import * as util from "../util.js";
|
|
5
5
|
import * as notesSummaryPage from "./notes-summary-page.js";
|
|
6
6
|
|
|
7
|
+
// Helper to safely set text field (ignores if field doesn't exist)
|
|
8
|
+
function safeSetText(form, name, value) {
|
|
9
|
+
try {
|
|
10
|
+
form.getTextField(name).setText(value != null ? String(value) : "");
|
|
11
|
+
} catch (e) {}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Helper to safely set image on button (ignores if field doesn't exist)
|
|
15
|
+
function safeSetImage(form, name, image) {
|
|
16
|
+
try {
|
|
17
|
+
form.getButton(name).setImage(image);
|
|
18
|
+
} catch (e) {}
|
|
19
|
+
}
|
|
20
|
+
|
|
7
21
|
// Check if project is CoolMaxx or HeatMaxx (NCI branded)
|
|
8
22
|
function isNCIProject(payload) {
|
|
9
23
|
if (payload && payload.project && payload.project.specialProjectType) {
|
|
@@ -170,6 +184,19 @@ export async function getReport(payload, _test) {
|
|
|
170
184
|
form.getTextField("TimeOfServiceUpper").setText(date.toLocaleTimeString("en-US"));
|
|
171
185
|
}
|
|
172
186
|
|
|
187
|
+
// Build equipment info and set "Information Text" field with shortened description
|
|
188
|
+
const equipment = payload.equipment || {};
|
|
189
|
+
let equipmentLines = [];
|
|
190
|
+
if (equipment.condenser_make) equipmentLines.push("Make: " + equipment.condenser_make);
|
|
191
|
+
if (equipment.condenser_model) equipmentLines.push("Model: " + equipment.condenser_model);
|
|
192
|
+
if (equipment.condenser_serial) equipmentLines.push("Serial: " + equipment.condenser_serial);
|
|
193
|
+
|
|
194
|
+
let infoText = "What Are Your System Vitals?\nYour system vitals show the overall health of your HVAC system. These vitals account for both the refrigerant and air delivery of the system.";
|
|
195
|
+
if (equipmentLines.length > 0) {
|
|
196
|
+
infoText = equipmentLines.join("\n") + "\n\n" + infoText;
|
|
197
|
+
}
|
|
198
|
+
safeSetText(form, "Information Text", infoText);
|
|
199
|
+
|
|
173
200
|
// System score
|
|
174
201
|
let systemScorePercentage = t.data.vitals_score ? +t.data.vitals_score.toFixed(0) : 0;
|
|
175
202
|
let systemScoreGrade = util.getGradeFromScore(systemScorePercentage);
|
|
@@ -223,6 +250,42 @@ export async function getReport(payload, _test) {
|
|
|
223
250
|
|
|
224
251
|
form.getTextField("YourSystemScorePage2").setText(`${systemScorePercentage} ${systemScoreGrade}`);
|
|
225
252
|
|
|
253
|
+
// Display system age (condenser year installed - heat pump outdoor unit)
|
|
254
|
+
const currentYear = new Date().getUTCFullYear();
|
|
255
|
+
const rawYear = payload.equipment && payload.equipment.year_installed;
|
|
256
|
+
const installYear = rawYear !== undefined && rawYear !== null ? Number(rawYear) : NaN;
|
|
257
|
+
const hasValidYear = Number.isFinite(installYear) && installYear > 1900 && installYear <= currentYear;
|
|
258
|
+
|
|
259
|
+
if (hasValidYear) {
|
|
260
|
+
const age = currentYear - installYear;
|
|
261
|
+
let specialCasePlacement = "1";
|
|
262
|
+
let specialCaseIcon = iconRangeGreen;
|
|
263
|
+
|
|
264
|
+
if (age < 2) specialCasePlacement = "1";
|
|
265
|
+
else if (age < 5) specialCasePlacement = "2";
|
|
266
|
+
else if (age < 8) specialCasePlacement = "3";
|
|
267
|
+
else if (age < 15) {
|
|
268
|
+
specialCasePlacement = "4";
|
|
269
|
+
specialCaseIcon = iconRangeRed;
|
|
270
|
+
} else if (age < 20) {
|
|
271
|
+
specialCasePlacement = "5";
|
|
272
|
+
specialCaseIcon = iconRangeRed;
|
|
273
|
+
} else if (age < 25) {
|
|
274
|
+
specialCasePlacement = "6";
|
|
275
|
+
specialCaseIcon = iconRangeRed;
|
|
276
|
+
} else {
|
|
277
|
+
specialCasePlacement = "7";
|
|
278
|
+
specialCaseIcon = iconRangeRed;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// Set age marker and text if fields exist
|
|
282
|
+
safeSetImage(form, `ImageAge${specialCasePlacement}`, specialCaseIcon);
|
|
283
|
+
safeSetText(form, "Age", age.toString());
|
|
284
|
+
} else {
|
|
285
|
+
// Age unknown - set to "--" if field exists
|
|
286
|
+
safeSetText(form, "Age", "--");
|
|
287
|
+
}
|
|
288
|
+
|
|
226
289
|
// Print targets and range icons for heat pump heating
|
|
227
290
|
// Heat pump heating target zones - some are in data, some in targets
|
|
228
291
|
const measureLabels = ["Superheat", "Subcooling", "Condenser", "TempSplit", "Tesp", "FilterFace"];
|
package/util.js
CHANGED
|
@@ -218,6 +218,7 @@ export function getToolIcon(test, ref, embeddedIcons) {
|
|
|
218
218
|
toolIcon = embeddedIcons.iconBluflame;
|
|
219
219
|
break;
|
|
220
220
|
case "iDVM510":
|
|
221
|
+
case "iDVM-510":
|
|
221
222
|
toolIcon = embeddedIcons.iconRedfish510;
|
|
222
223
|
break;
|
|
223
224
|
case "iDVM550":
|
|
@@ -250,7 +251,7 @@ export function getToolIcon(test, ref, embeddedIcons) {
|
|
|
250
251
|
break;
|
|
251
252
|
}
|
|
252
253
|
}
|
|
253
|
-
if (sourceValue == "iDVM510" && ref.includes("amperage"))
|
|
254
|
+
if ((sourceValue == "iDVM510" || sourceValue == "iDVM-510") && ref.includes("amperage"))
|
|
254
255
|
toolIcon = embeddedIcons.iconRedfish510333;
|
|
255
256
|
return toolIcon;
|
|
256
257
|
}
|
|
@@ -293,99 +294,121 @@ export function getElectricalData(test, suffix, embeddedIcons) {
|
|
|
293
294
|
if (phase === "Single") {
|
|
294
295
|
if (
|
|
295
296
|
(voltage == "115" || voltage == "120") &&
|
|
296
|
-
test.data[`voltage_l1`] &&
|
|
297
|
-
test.data[`amperage_l1`]
|
|
297
|
+
test.data[`voltage_l1${suffix}`] &&
|
|
298
|
+
test.data[`amperage_l1${suffix}`]
|
|
298
299
|
) {
|
|
299
|
-
vDisplay = (+test.data[`voltage_l1`]).toFixed(1);
|
|
300
|
-
aDisplay = (+test.data[`amperage_l1`]).toFixed(1);
|
|
300
|
+
vDisplay = (+test.data[`voltage_l1${suffix}`]).toFixed(1);
|
|
301
|
+
aDisplay = (+test.data[`amperage_l1${suffix}`]).toFixed(1);
|
|
301
302
|
} else if (
|
|
302
303
|
(voltage == "115" || voltage == "120") &&
|
|
303
|
-
test.data[`
|
|
304
|
-
test.data[`
|
|
304
|
+
test.data[`voltage_l1${suffix}_ph_to_gnd`] &&
|
|
305
|
+
test.data[`amperage_l1${suffix}_ph_to_gnd`]
|
|
305
306
|
) {
|
|
306
|
-
vDisplay = (+test.data[`
|
|
307
|
-
aDisplay = (+test.data[`
|
|
308
|
-
src =
|
|
307
|
+
vDisplay = (+test.data[`voltage_l1${suffix}_ph_to_gnd`]).toFixed(1);
|
|
308
|
+
aDisplay = (+test.data[`amperage_l1${suffix}_ph_to_gnd`]).toFixed(1);
|
|
309
|
+
src = `_l1${suffix}_ph_to_gnd`;
|
|
309
310
|
} else if (
|
|
310
311
|
(voltage == "208" ||
|
|
311
312
|
voltage == "230" ||
|
|
312
313
|
voltage == "240" ||
|
|
313
314
|
voltage == "460" ||
|
|
314
315
|
voltage == "480") &&
|
|
315
|
-
test.data[`voltage_l1`] &&
|
|
316
|
-
test.data[`amperage_l1`]
|
|
316
|
+
test.data[`voltage_l1${suffix}`] &&
|
|
317
|
+
test.data[`amperage_l1${suffix}`]
|
|
317
318
|
) {
|
|
318
|
-
vDisplay = (+test.data[`voltage_l1`]).toFixed(1);
|
|
319
|
-
aDisplay = (+test.data[`amperage_l1`]).toFixed(1);
|
|
319
|
+
vDisplay = (+test.data[`voltage_l1${suffix}`]).toFixed(1);
|
|
320
|
+
aDisplay = (+test.data[`amperage_l1${suffix}`]).toFixed(1);
|
|
320
321
|
} else if (
|
|
321
322
|
(voltage == "208" ||
|
|
322
323
|
voltage == "230" ||
|
|
323
324
|
voltage == "240" ||
|
|
324
325
|
voltage == "460" ||
|
|
325
326
|
voltage == "480") &&
|
|
326
|
-
test.data[`
|
|
327
|
-
test.data[`
|
|
328
|
-
test.data[`
|
|
329
|
-
test.data[`
|
|
327
|
+
test.data[`voltage_l1${suffix}_ph_to_gnd`] &&
|
|
328
|
+
test.data[`voltage_l2${suffix}_ph_to_gnd`] &&
|
|
329
|
+
test.data[`amperage_l1${suffix}_ph_to_gnd`] &&
|
|
330
|
+
test.data[`amperage_l2${suffix}_ph_to_gnd`]
|
|
330
331
|
) {
|
|
331
332
|
vDisplay =
|
|
332
|
-
(+test.data[`
|
|
333
|
+
(+test.data[`voltage_l1${suffix}_ph_to_gnd`]).toFixed(1) +
|
|
333
334
|
" / " +
|
|
334
|
-
(+test.data[`
|
|
335
|
+
(+test.data[`voltage_l2${suffix}_ph_to_gnd`]).toFixed(1);
|
|
335
336
|
aDisplay =
|
|
336
|
-
(+test.data[`
|
|
337
|
+
(+test.data[`amperage_l1${suffix}_ph_to_gnd`]).toFixed(1) +
|
|
337
338
|
" / " +
|
|
338
|
-
(+test.data[`
|
|
339
|
-
src =
|
|
339
|
+
(+test.data[`amperage_l2${suffix}_ph_to_gnd`]).toFixed(1);
|
|
340
|
+
src = `_l1${suffix}_ph_to_gnd`;
|
|
340
341
|
}
|
|
341
342
|
} else if (
|
|
342
343
|
phase === "Three" &&
|
|
343
|
-
test.data[`voltage_l1`] &&
|
|
344
|
-
test.data
|
|
345
|
-
test.data[`voltage_l3`] &&
|
|
346
|
-
test.data[`amperage_l1`] &&
|
|
347
|
-
test.data
|
|
348
|
-
test.data[`amperage_l3`]
|
|
344
|
+
test.data[`voltage_l1${suffix}`] &&
|
|
345
|
+
test.data[`voltage_l2${suffix}`] &&
|
|
346
|
+
test.data[`voltage_l3${suffix}`] &&
|
|
347
|
+
test.data[`amperage_l1${suffix}`] &&
|
|
348
|
+
test.data[`amperage_l2${suffix}`] &&
|
|
349
|
+
test.data[`amperage_l3${suffix}`]
|
|
349
350
|
) {
|
|
350
351
|
vDisplay =
|
|
351
|
-
(+test.data[`voltage_l1`]).toFixed(1) +
|
|
352
|
+
(+test.data[`voltage_l1${suffix}`]).toFixed(1) +
|
|
352
353
|
" / " +
|
|
353
|
-
(+test.data[`voltage_l2`]).toFixed(1) +
|
|
354
|
+
(+test.data[`voltage_l2${suffix}`]).toFixed(1) +
|
|
354
355
|
" / " +
|
|
355
|
-
(+test.data[`voltage_l3`]).toFixed(1);
|
|
356
|
+
(+test.data[`voltage_l3${suffix}`]).toFixed(1);
|
|
356
357
|
aDisplay =
|
|
357
|
-
(+test.data[`amperage_l1`]).toFixed(1) +
|
|
358
|
+
(+test.data[`amperage_l1${suffix}`]).toFixed(1) +
|
|
358
359
|
" / " +
|
|
359
|
-
(+test.data[`amperage_l2`]).toFixed(1) +
|
|
360
|
+
(+test.data[`amperage_l2${suffix}`]).toFixed(1) +
|
|
360
361
|
" / " +
|
|
361
|
-
(+test.data[`amperage_l3`]).toFixed(1);
|
|
362
|
+
(+test.data[`amperage_l3${suffix}`]).toFixed(1);
|
|
362
363
|
}
|
|
363
364
|
} else if (test.electrical_capture_type === "Power") {
|
|
364
365
|
vDisplay = (+test.data[`voltage_l1`]).toFixed(1);
|
|
365
366
|
aDisplay = (+test.data[`amperage_l1`]).toFixed(1);
|
|
366
367
|
}
|
|
368
|
+
// Build the source key with suffix for AHU support
|
|
369
|
+
// Note: for ph_to_gnd cases, src already includes the suffix, so don't add it again
|
|
370
|
+
const suffixAlreadyInSrc = src.includes(suffix) && suffix !== "";
|
|
371
|
+
const vSourceKey = suffixAlreadyInSrc ? "voltage" + src : "voltage" + src + suffix;
|
|
372
|
+
const aSourceKey = suffixAlreadyInSrc ? "amperage" + src : "amperage" + src + suffix;
|
|
373
|
+
|
|
374
|
+
// Build fallback source keys for multimeter sources (used when L1/L2/L3 sources aren't set)
|
|
375
|
+
// For condenser (suffix=""), check voltage_multimeter_condenser then voltage_multimeter
|
|
376
|
+
// For AHU (suffix="_ahu"), check voltage_multimeter_ahu then voltage_multimeter
|
|
377
|
+
const vMultimeterKey = suffix === "_ahu" ? "voltage_multimeter_ahu" : "voltage_multimeter_condenser";
|
|
378
|
+
const aMultimeterKey = suffix === "_ahu" ? "amperage_multimeter_ahu" : "amperage_multimeter_condenser";
|
|
379
|
+
|
|
380
|
+
// Get voltage source with fallback chain
|
|
381
|
+
let vSource = test.source[vSourceKey];
|
|
382
|
+
if (!vSource) vSource = test.source[vMultimeterKey];
|
|
383
|
+
if (!vSource) vSource = test.source["voltage_multimeter"];
|
|
384
|
+
|
|
385
|
+
// Get amperage source with fallback chain
|
|
386
|
+
let aSource = test.source[aSourceKey];
|
|
387
|
+
if (!aSource) aSource = test.source[aMultimeterKey];
|
|
388
|
+
if (!aSource) aSource = test.source["amperage_multimeter"];
|
|
389
|
+
|
|
367
390
|
if (vDisplay) {
|
|
368
|
-
if (
|
|
391
|
+
if (vSource == "ComfortGuard")
|
|
369
392
|
vIcon = embeddedIcons.iconSensi;
|
|
370
|
-
else if (
|
|
393
|
+
else if (vSource == "iDVM550" || vSource == "iDVM-550")
|
|
371
394
|
vIcon = embeddedIcons.iconRedfish550;
|
|
372
|
-
else if (
|
|
395
|
+
else if (vSource == "VOLT-100")
|
|
373
396
|
vIcon = embeddedIcons.iconVolt100;
|
|
374
|
-
else if (
|
|
397
|
+
else if (vSource == "iDVM510" || vSource == "iDVM-510")
|
|
375
398
|
vIcon = embeddedIcons.iconRedfish510;
|
|
376
|
-
else if (
|
|
399
|
+
else if (vSource == "Fieldpiece")
|
|
377
400
|
vIcon = embeddedIcons.iconFieldpiece;
|
|
378
401
|
}
|
|
379
402
|
if (aDisplay) {
|
|
380
|
-
if (
|
|
403
|
+
if (aSource == "ComfortGuard")
|
|
381
404
|
aIcon = embeddedIcons.iconSensi;
|
|
382
|
-
else if (
|
|
405
|
+
else if (aSource == "iDVM550" || aSource == "iDVM-550")
|
|
383
406
|
aIcon = embeddedIcons.iconRedfish550;
|
|
384
|
-
else if (
|
|
407
|
+
else if (aSource == "VOLT-100")
|
|
385
408
|
aIcon = embeddedIcons.iconVolt100;
|
|
386
|
-
else if (
|
|
409
|
+
else if (aSource == "iDVM510" || aSource == "iDVM-510")
|
|
387
410
|
aIcon = embeddedIcons.iconRedfish510;
|
|
388
|
-
else if (
|
|
411
|
+
else if (aSource == "Fieldpiece")
|
|
389
412
|
aIcon = embeddedIcons.iconFieldpiece;
|
|
390
413
|
}
|
|
391
414
|
return {
|