@measurequick/measurequick-report-generator 1.5.229 → 1.5.232
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 +1 -1
- package/report-gen-scripts/measurement-details.js +22 -4
- package/util.js +59 -10
package/package.json
CHANGED
|
@@ -450,38 +450,56 @@ export async function getReport(payload) {
|
|
|
450
450
|
let condDisplay = util.getElectricalData(test, "", embeddedIcons);
|
|
451
451
|
let ahuDisplay = util.getElectricalData(test, "_ahu", embeddedIcons);
|
|
452
452
|
if (measurement) {
|
|
453
|
+
// Debug log for V/A icon checking
|
|
454
|
+
if (measurement.label == "Cond. Volts" || measurement.label == "Cond. Amps" ||
|
|
455
|
+
measurement.label == "AHU Volts" || measurement.label == "AHU Amps") {
|
|
456
|
+
console.log("[measurement-details] Checking label:", measurement.label);
|
|
457
|
+
console.log("[measurement-details] isGoettlInstall:", isGoettlInstall);
|
|
458
|
+
console.log("[measurement-details] condDisplay.voltageIcon:", !!condDisplay.voltageIcon);
|
|
459
|
+
console.log("[measurement-details] condDisplay.amperageIcon:", !!condDisplay.amperageIcon);
|
|
460
|
+
console.log("[measurement-details] ahuDisplay.voltageIcon:", !!ahuDisplay.voltageIcon);
|
|
461
|
+
console.log("[measurement-details] ahuDisplay.amperageIcon:", !!ahuDisplay.amperageIcon);
|
|
462
|
+
}
|
|
453
463
|
if (
|
|
454
464
|
!isGoettlInstall &&
|
|
455
465
|
measurement.label == "Cond. Volts" &&
|
|
456
466
|
condDisplay.voltageIcon
|
|
457
|
-
)
|
|
467
|
+
) {
|
|
468
|
+
console.log("[measurement-details] Setting Cond. Volts icon!");
|
|
458
469
|
form
|
|
459
470
|
.getButton(`Block${blockNum}-Row${rowNum}-Col4`)
|
|
460
471
|
.setImage(condDisplay.voltageIcon);
|
|
472
|
+
}
|
|
461
473
|
else if (
|
|
462
474
|
!isGoettlInstall &&
|
|
463
475
|
measurement.label == "Cond. Amps" &&
|
|
464
476
|
condDisplay.amperageIcon
|
|
465
|
-
)
|
|
477
|
+
) {
|
|
478
|
+
console.log("[measurement-details] Setting Cond. Amps icon!");
|
|
466
479
|
form
|
|
467
480
|
.getButton(`Block${blockNum}-Row${rowNum}-Col4`)
|
|
468
481
|
.setImage(condDisplay.amperageIcon);
|
|
482
|
+
}
|
|
469
483
|
else if (
|
|
470
484
|
!isGoettlInstall &&
|
|
471
485
|
measurement.label == "AHU Volts" &&
|
|
472
486
|
ahuDisplay.voltageIcon
|
|
473
|
-
)
|
|
487
|
+
) {
|
|
488
|
+
console.log("[measurement-details] Setting AHU Volts icon!");
|
|
474
489
|
form
|
|
475
490
|
.getButton(`Block${blockNum}-Row${rowNum}-Col4`)
|
|
476
491
|
.setImage(ahuDisplay.voltageIcon);
|
|
492
|
+
}
|
|
477
493
|
else if (
|
|
478
494
|
!isGoettlInstall &&
|
|
479
495
|
measurement.label == "AHU Amps" &&
|
|
480
496
|
ahuDisplay.amperageIcon
|
|
481
|
-
)
|
|
497
|
+
) {
|
|
498
|
+
console.log("[measurement-details] Setting AHU Amps icon!");
|
|
482
499
|
form
|
|
483
500
|
.getButton(`Block${blockNum}-Row${rowNum}-Col4`)
|
|
484
501
|
.setImage(ahuDisplay.amperageIcon);
|
|
502
|
+
}
|
|
485
503
|
|
|
486
504
|
let units = measurement.units ? `(${measurement.units})` : "";
|
|
487
505
|
let altLabel = "";
|
package/util.js
CHANGED
|
@@ -290,6 +290,16 @@ export function getRangeIcon(test, ref, embeddedIcons) {
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
export function getElectricalData(test, suffix, embeddedIcons) {
|
|
293
|
+
// Ensure test.source exists
|
|
294
|
+
if (!test.source) test.source = {};
|
|
295
|
+
if (!test.data) test.data = {};
|
|
296
|
+
|
|
297
|
+
// Debug logging to help diagnose icon issues
|
|
298
|
+
console.log("[getElectricalData] suffix:", suffix);
|
|
299
|
+
console.log("[getElectricalData] test.source:", JSON.stringify(test.source));
|
|
300
|
+
console.log("[getElectricalData] test.source.voltage_l1:", test.source.voltage_l1);
|
|
301
|
+
console.log("[getElectricalData] test.source.voltage_l1_ahu:", test.source.voltage_l1_ahu);
|
|
302
|
+
|
|
293
303
|
let voltage = test.data[`voltage_nominal${suffix}`];
|
|
294
304
|
let phase = test.data[`phase${suffix}`];
|
|
295
305
|
let src = "_l1";
|
|
@@ -386,6 +396,10 @@ export function getElectricalData(test, suffix, embeddedIcons) {
|
|
|
386
396
|
const vSourceKey = suffixAlreadyInSrc ? "voltage" + src : "voltage" + src + suffix;
|
|
387
397
|
const aSourceKey = suffixAlreadyInSrc ? "amperage" + src : "amperage" + src + suffix;
|
|
388
398
|
|
|
399
|
+
console.log("[getElectricalData] src:", src, "suffix:", suffix);
|
|
400
|
+
console.log("[getElectricalData] suffixAlreadyInSrc:", suffixAlreadyInSrc);
|
|
401
|
+
console.log("[getElectricalData] vSourceKey:", vSourceKey, "aSourceKey:", aSourceKey);
|
|
402
|
+
|
|
389
403
|
// Build fallback source keys for multimeter sources (used when L1/L2/L3 sources aren't set)
|
|
390
404
|
// For condenser (suffix=""), check voltage_multimeter_condenser then voltage_multimeter
|
|
391
405
|
// For AHU (suffix="_ahu"), check voltage_multimeter_ahu then voltage_multimeter
|
|
@@ -394,22 +408,52 @@ export function getElectricalData(test, suffix, embeddedIcons) {
|
|
|
394
408
|
|
|
395
409
|
// Get voltage source with fallback chain
|
|
396
410
|
let vSource = test.source[vSourceKey];
|
|
411
|
+
console.log("[getElectricalData] vSource from vSourceKey:", vSource);
|
|
397
412
|
// Direct fallback for HAC/DL599 - check voltage_l1 directly for condenser, voltage_l1_ahu for AHU
|
|
398
|
-
if (!vSource && suffix === "")
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
413
|
+
if (!vSource && suffix === "") {
|
|
414
|
+
vSource = test.source["voltage_l1"];
|
|
415
|
+
console.log("[getElectricalData] vSource fallback voltage_l1:", vSource);
|
|
416
|
+
}
|
|
417
|
+
if (!vSource && suffix === "_ahu") {
|
|
418
|
+
vSource = test.source["voltage_l1_ahu"];
|
|
419
|
+
console.log("[getElectricalData] vSource fallback voltage_l1_ahu:", vSource);
|
|
420
|
+
}
|
|
421
|
+
if (!vSource) {
|
|
422
|
+
vSource = test.source[vMultimeterKey];
|
|
423
|
+
console.log("[getElectricalData] vSource fallback", vMultimeterKey + ":", vSource);
|
|
424
|
+
}
|
|
425
|
+
if (!vSource) {
|
|
426
|
+
vSource = test.source["voltage_multimeter"];
|
|
427
|
+
console.log("[getElectricalData] vSource fallback voltage_multimeter:", vSource);
|
|
428
|
+
}
|
|
429
|
+
console.log("[getElectricalData] FINAL vSource:", vSource);
|
|
402
430
|
|
|
403
431
|
// Get amperage source with fallback chain
|
|
404
432
|
let aSource = test.source[aSourceKey];
|
|
433
|
+
console.log("[getElectricalData] aSource from aSourceKey:", aSource);
|
|
405
434
|
// Direct fallback for HAC/DL599 - check amperage_l1 directly for condenser, amperage_l1_ahu for AHU
|
|
406
|
-
if (!aSource && suffix === "")
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
435
|
+
if (!aSource && suffix === "") {
|
|
436
|
+
aSource = test.source["amperage_l1"];
|
|
437
|
+
console.log("[getElectricalData] aSource fallback amperage_l1:", aSource);
|
|
438
|
+
}
|
|
439
|
+
if (!aSource && suffix === "_ahu") {
|
|
440
|
+
aSource = test.source["amperage_l1_ahu"];
|
|
441
|
+
console.log("[getElectricalData] aSource fallback amperage_l1_ahu:", aSource);
|
|
442
|
+
}
|
|
443
|
+
if (!aSource) {
|
|
444
|
+
aSource = test.source[aMultimeterKey];
|
|
445
|
+
console.log("[getElectricalData] aSource fallback", aMultimeterKey + ":", aSource);
|
|
446
|
+
}
|
|
447
|
+
if (!aSource) {
|
|
448
|
+
aSource = test.source["amperage_multimeter"];
|
|
449
|
+
console.log("[getElectricalData] aSource fallback amperage_multimeter:", aSource);
|
|
450
|
+
}
|
|
451
|
+
console.log("[getElectricalData] FINAL aSource:", aSource);
|
|
410
452
|
|
|
411
453
|
// Set icons based on source - don't require vDisplay/aDisplay to be set
|
|
412
454
|
// This ensures icons show up even if the display value logic doesn't match
|
|
455
|
+
console.log("[getElectricalData] Setting icons - vSource:", vSource, "aSource:", aSource);
|
|
456
|
+
console.log("[getElectricalData] embeddedIcons.iconUei exists:", !!embeddedIcons.iconUei);
|
|
413
457
|
if (vSource == "ComfortGuard")
|
|
414
458
|
vIcon = embeddedIcons.iconSensi;
|
|
415
459
|
else if (vSource == "iDVM550" || vSource == "iDVM-550")
|
|
@@ -420,8 +464,10 @@ export function getElectricalData(test, suffix, embeddedIcons) {
|
|
|
420
464
|
vIcon = embeddedIcons.iconRedfish510;
|
|
421
465
|
else if (vSource == "Fieldpiece")
|
|
422
466
|
vIcon = embeddedIcons.iconFieldpiece;
|
|
423
|
-
else if (vSource == "UEi HAC" || vSource == "UEi DL599" || vSource == "UEi HUB")
|
|
467
|
+
else if (vSource == "UEi HAC" || vSource == "UEi DL599" || vSource == "UEi HUB") {
|
|
424
468
|
vIcon = embeddedIcons.iconUei;
|
|
469
|
+
console.log("[getElectricalData] MATCHED UEi for voltage! vIcon set:", !!vIcon);
|
|
470
|
+
}
|
|
425
471
|
|
|
426
472
|
if (aSource == "ComfortGuard")
|
|
427
473
|
aIcon = embeddedIcons.iconSensi;
|
|
@@ -433,8 +479,11 @@ export function getElectricalData(test, suffix, embeddedIcons) {
|
|
|
433
479
|
aIcon = embeddedIcons.iconRedfish510;
|
|
434
480
|
else if (aSource == "Fieldpiece")
|
|
435
481
|
aIcon = embeddedIcons.iconFieldpiece;
|
|
436
|
-
else if (aSource == "UEi HAC" || aSource == "UEi DL599" || aSource == "UEi HUB")
|
|
482
|
+
else if (aSource == "UEi HAC" || aSource == "UEi DL599" || aSource == "UEi HUB") {
|
|
437
483
|
aIcon = embeddedIcons.iconUei;
|
|
484
|
+
console.log("[getElectricalData] MATCHED UEi for amperage! aIcon set:", !!aIcon);
|
|
485
|
+
}
|
|
486
|
+
console.log("[getElectricalData] Final icons - vIcon:", !!vIcon, "aIcon:", !!aIcon);
|
|
438
487
|
return {
|
|
439
488
|
voltage: vDisplay,
|
|
440
489
|
amperage: aDisplay,
|