@measurequick/measurequick-report-generator 1.5.232 → 1.5.234
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 +4 -22
- package/util.js +18 -65
package/package.json
CHANGED
|
@@ -450,56 +450,38 @@ 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
|
-
}
|
|
463
453
|
if (
|
|
464
454
|
!isGoettlInstall &&
|
|
465
455
|
measurement.label == "Cond. Volts" &&
|
|
466
456
|
condDisplay.voltageIcon
|
|
467
|
-
)
|
|
468
|
-
console.log("[measurement-details] Setting Cond. Volts icon!");
|
|
457
|
+
)
|
|
469
458
|
form
|
|
470
459
|
.getButton(`Block${blockNum}-Row${rowNum}-Col4`)
|
|
471
460
|
.setImage(condDisplay.voltageIcon);
|
|
472
|
-
}
|
|
473
461
|
else if (
|
|
474
462
|
!isGoettlInstall &&
|
|
475
463
|
measurement.label == "Cond. Amps" &&
|
|
476
464
|
condDisplay.amperageIcon
|
|
477
|
-
)
|
|
478
|
-
console.log("[measurement-details] Setting Cond. Amps icon!");
|
|
465
|
+
)
|
|
479
466
|
form
|
|
480
467
|
.getButton(`Block${blockNum}-Row${rowNum}-Col4`)
|
|
481
468
|
.setImage(condDisplay.amperageIcon);
|
|
482
|
-
}
|
|
483
469
|
else if (
|
|
484
470
|
!isGoettlInstall &&
|
|
485
471
|
measurement.label == "AHU Volts" &&
|
|
486
472
|
ahuDisplay.voltageIcon
|
|
487
|
-
)
|
|
488
|
-
console.log("[measurement-details] Setting AHU Volts icon!");
|
|
473
|
+
)
|
|
489
474
|
form
|
|
490
475
|
.getButton(`Block${blockNum}-Row${rowNum}-Col4`)
|
|
491
476
|
.setImage(ahuDisplay.voltageIcon);
|
|
492
|
-
}
|
|
493
477
|
else if (
|
|
494
478
|
!isGoettlInstall &&
|
|
495
479
|
measurement.label == "AHU Amps" &&
|
|
496
480
|
ahuDisplay.amperageIcon
|
|
497
|
-
)
|
|
498
|
-
console.log("[measurement-details] Setting AHU Amps icon!");
|
|
481
|
+
)
|
|
499
482
|
form
|
|
500
483
|
.getButton(`Block${blockNum}-Row${rowNum}-Col4`)
|
|
501
484
|
.setImage(ahuDisplay.amperageIcon);
|
|
502
|
-
}
|
|
503
485
|
|
|
504
486
|
let units = measurement.units ? `(${measurement.units})` : "";
|
|
505
487
|
let altLabel = "";
|
package/util.js
CHANGED
|
@@ -294,18 +294,14 @@ export function getElectricalData(test, suffix, embeddedIcons) {
|
|
|
294
294
|
if (!test.source) test.source = {};
|
|
295
295
|
if (!test.data) test.data = {};
|
|
296
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
|
-
|
|
303
297
|
let voltage = test.data[`voltage_nominal${suffix}`];
|
|
304
298
|
let phase = test.data[`phase${suffix}`];
|
|
305
299
|
let src = "_l1";
|
|
306
300
|
let vDisplay, aDisplay, vIcon, aIcon;
|
|
307
301
|
|
|
308
|
-
|
|
302
|
+
// Use the correct capture type for the section (condenser vs AHU)
|
|
303
|
+
let captureType = suffix ? (test[`electrical_capture_type${suffix}`] || test.electrical_capture_type) : test.electrical_capture_type;
|
|
304
|
+
if (captureType !== "Power") {
|
|
309
305
|
if (phase === "Single") {
|
|
310
306
|
if (
|
|
311
307
|
(voltage == "115" || voltage == "120") &&
|
|
@@ -356,12 +352,8 @@ export function getElectricalData(test, suffix, embeddedIcons) {
|
|
|
356
352
|
}
|
|
357
353
|
} else if (
|
|
358
354
|
phase === "Three" &&
|
|
359
|
-
test.data[`voltage_l1${suffix}`] &&
|
|
360
|
-
test.data[`
|
|
361
|
-
test.data[`voltage_l3${suffix}`] &&
|
|
362
|
-
test.data[`amperage_l1${suffix}`] &&
|
|
363
|
-
test.data[`amperage_l2${suffix}`] &&
|
|
364
|
-
test.data[`amperage_l3${suffix}`]
|
|
355
|
+
(+test.data[`voltage_l1${suffix}`]) > 0 && (+test.data[`voltage_l2${suffix}`]) > 0 && (+test.data[`voltage_l3${suffix}`]) > 0 &&
|
|
356
|
+
test.data[`amperage_l1${suffix}`] && test.data[`amperage_l2${suffix}`] && test.data[`amperage_l3${suffix}`]
|
|
365
357
|
) {
|
|
366
358
|
vDisplay =
|
|
367
359
|
(+test.data[`voltage_l1${suffix}`]).toFixed(1) +
|
|
@@ -376,9 +368,9 @@ export function getElectricalData(test, suffix, embeddedIcons) {
|
|
|
376
368
|
" / " +
|
|
377
369
|
(+test.data[`amperage_l3${suffix}`]).toFixed(1);
|
|
378
370
|
}
|
|
379
|
-
} else if (
|
|
380
|
-
vDisplay = (+test.data[`voltage_l1`]).toFixed(1);
|
|
381
|
-
aDisplay = (+test.data[`amperage_l1`]).toFixed(1);
|
|
371
|
+
} else if (captureType === "Power") {
|
|
372
|
+
vDisplay = (+test.data[`voltage_l1${suffix}`]).toFixed(1);
|
|
373
|
+
aDisplay = (+test.data[`amperage_l1${suffix}`]).toFixed(1);
|
|
382
374
|
}
|
|
383
375
|
|
|
384
376
|
// Fallback: If vDisplay/aDisplay not set but data exists, use the data directly
|
|
@@ -396,10 +388,6 @@ export function getElectricalData(test, suffix, embeddedIcons) {
|
|
|
396
388
|
const vSourceKey = suffixAlreadyInSrc ? "voltage" + src : "voltage" + src + suffix;
|
|
397
389
|
const aSourceKey = suffixAlreadyInSrc ? "amperage" + src : "amperage" + src + suffix;
|
|
398
390
|
|
|
399
|
-
console.log("[getElectricalData] src:", src, "suffix:", suffix);
|
|
400
|
-
console.log("[getElectricalData] suffixAlreadyInSrc:", suffixAlreadyInSrc);
|
|
401
|
-
console.log("[getElectricalData] vSourceKey:", vSourceKey, "aSourceKey:", aSourceKey);
|
|
402
|
-
|
|
403
391
|
// Build fallback source keys for multimeter sources (used when L1/L2/L3 sources aren't set)
|
|
404
392
|
// For condenser (suffix=""), check voltage_multimeter_condenser then voltage_multimeter
|
|
405
393
|
// For AHU (suffix="_ahu"), check voltage_multimeter_ahu then voltage_multimeter
|
|
@@ -408,52 +396,22 @@ export function getElectricalData(test, suffix, embeddedIcons) {
|
|
|
408
396
|
|
|
409
397
|
// Get voltage source with fallback chain
|
|
410
398
|
let vSource = test.source[vSourceKey];
|
|
411
|
-
console.log("[getElectricalData] vSource from vSourceKey:", vSource);
|
|
412
399
|
// Direct fallback for HAC/DL599 - check voltage_l1 directly for condenser, voltage_l1_ahu for AHU
|
|
413
|
-
if (!vSource && suffix === "")
|
|
414
|
-
|
|
415
|
-
|
|
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);
|
|
400
|
+
if (!vSource && suffix === "") vSource = test.source["voltage_l1"];
|
|
401
|
+
if (!vSource && suffix === "_ahu") vSource = test.source["voltage_l1_ahu"];
|
|
402
|
+
if (!vSource) vSource = test.source[vMultimeterKey];
|
|
403
|
+
if (!vSource) vSource = test.source["voltage_multimeter"];
|
|
430
404
|
|
|
431
405
|
// Get amperage source with fallback chain
|
|
432
406
|
let aSource = test.source[aSourceKey];
|
|
433
|
-
console.log("[getElectricalData] aSource from aSourceKey:", aSource);
|
|
434
407
|
// Direct fallback for HAC/DL599 - check amperage_l1 directly for condenser, amperage_l1_ahu for AHU
|
|
435
|
-
if (!aSource && suffix === "")
|
|
436
|
-
|
|
437
|
-
|
|
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);
|
|
408
|
+
if (!aSource && suffix === "") aSource = test.source["amperage_l1"];
|
|
409
|
+
if (!aSource && suffix === "_ahu") aSource = test.source["amperage_l1_ahu"];
|
|
410
|
+
if (!aSource) aSource = test.source[aMultimeterKey];
|
|
411
|
+
if (!aSource) aSource = test.source["amperage_multimeter"];
|
|
452
412
|
|
|
453
413
|
// Set icons based on source - don't require vDisplay/aDisplay to be set
|
|
454
414
|
// 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);
|
|
457
415
|
if (vSource == "ComfortGuard")
|
|
458
416
|
vIcon = embeddedIcons.iconSensi;
|
|
459
417
|
else if (vSource == "iDVM550" || vSource == "iDVM-550")
|
|
@@ -464,10 +422,8 @@ export function getElectricalData(test, suffix, embeddedIcons) {
|
|
|
464
422
|
vIcon = embeddedIcons.iconRedfish510;
|
|
465
423
|
else if (vSource == "Fieldpiece")
|
|
466
424
|
vIcon = embeddedIcons.iconFieldpiece;
|
|
467
|
-
else if (vSource == "UEi HAC" || vSource == "UEi DL599" || vSource == "UEi HUB")
|
|
425
|
+
else if (vSource == "UEi HAC" || vSource == "UEi DL599" || vSource == "UEi HUB")
|
|
468
426
|
vIcon = embeddedIcons.iconUei;
|
|
469
|
-
console.log("[getElectricalData] MATCHED UEi for voltage! vIcon set:", !!vIcon);
|
|
470
|
-
}
|
|
471
427
|
|
|
472
428
|
if (aSource == "ComfortGuard")
|
|
473
429
|
aIcon = embeddedIcons.iconSensi;
|
|
@@ -479,11 +435,8 @@ export function getElectricalData(test, suffix, embeddedIcons) {
|
|
|
479
435
|
aIcon = embeddedIcons.iconRedfish510;
|
|
480
436
|
else if (aSource == "Fieldpiece")
|
|
481
437
|
aIcon = embeddedIcons.iconFieldpiece;
|
|
482
|
-
else if (aSource == "UEi HAC" || aSource == "UEi DL599" || aSource == "UEi HUB")
|
|
438
|
+
else if (aSource == "UEi HAC" || aSource == "UEi DL599" || aSource == "UEi HUB")
|
|
483
439
|
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);
|
|
487
440
|
return {
|
|
488
441
|
voltage: vDisplay,
|
|
489
442
|
amperage: aDisplay,
|