@measurequick/measurequick-report-generator 1.5.223 → 1.5.225
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
|
@@ -1634,6 +1634,15 @@ export async function getReport(payload) {
|
|
|
1634
1634
|
testo_size,
|
|
1635
1635
|
testo_size
|
|
1636
1636
|
);
|
|
1637
|
+
} else if (testObj.source["voltage" + src] == "UEi HAC" || testObj.source["voltage" + src] == "UEi DL599") {
|
|
1638
|
+
doc.addImage(
|
|
1639
|
+
base64.iconUei,
|
|
1640
|
+
"PNG",
|
|
1641
|
+
pos_right + testo_offset_x,
|
|
1642
|
+
pos_vert - testo_offset_y,
|
|
1643
|
+
testo_size,
|
|
1644
|
+
testo_size
|
|
1645
|
+
);
|
|
1637
1646
|
}
|
|
1638
1647
|
pos_vert += spacing;
|
|
1639
1648
|
}
|
|
@@ -1688,6 +1697,15 @@ export async function getReport(payload) {
|
|
|
1688
1697
|
testo_size,
|
|
1689
1698
|
testo_size
|
|
1690
1699
|
);
|
|
1700
|
+
} else if (testObj.source["amperage" + src] == "UEi HAC" || testObj.source["amperage" + src] == "UEi DL599") {
|
|
1701
|
+
doc.addImage(
|
|
1702
|
+
base64.iconUei,
|
|
1703
|
+
"PNG",
|
|
1704
|
+
pos_right + testo_offset_x,
|
|
1705
|
+
pos_vert - testo_offset_y,
|
|
1706
|
+
testo_size,
|
|
1707
|
+
testo_size
|
|
1708
|
+
);
|
|
1691
1709
|
}
|
|
1692
1710
|
pos_vert += spacing;
|
|
1693
1711
|
}
|
|
@@ -2661,6 +2679,15 @@ export async function getReport(payload) {
|
|
|
2661
2679
|
testo_size,
|
|
2662
2680
|
testo_size
|
|
2663
2681
|
);
|
|
2682
|
+
} else if (testObj.source.power_ahu == "UEi HAC" || testObj.source.power_ahu == "UEi DL599") {
|
|
2683
|
+
doc.addImage(
|
|
2684
|
+
base64.iconUei,
|
|
2685
|
+
"PNG",
|
|
2686
|
+
pos_right + testo_offset_x,
|
|
2687
|
+
pos_vert - testo_offset_y,
|
|
2688
|
+
testo_size,
|
|
2689
|
+
testo_size
|
|
2690
|
+
);
|
|
2664
2691
|
} else if (
|
|
2665
2692
|
testObj.electrical_capture_type_ahu !== "Power" &&
|
|
2666
2693
|
testObj.data.power_ahu
|
|
@@ -256,18 +256,67 @@ export async function getReport(payload, _test) {
|
|
|
256
256
|
var coAmbRaw = toNum(data && data.co_ambient);
|
|
257
257
|
var coRetRaw = toNum(data && data.co_return);
|
|
258
258
|
var coSupRaw = toNum(data && data.co_supply);
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
);
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
259
|
+
|
|
260
|
+
// CO level helper function
|
|
261
|
+
// Normal: 0-8 ppm, Elevated: 9-35 ppm, Dangerous: 36-69 ppm, Emergency: 70+ ppm
|
|
262
|
+
function getCOLevel(ppm) {
|
|
263
|
+
if (!isFinite(ppm) || ppm <= 8) return "Normal";
|
|
264
|
+
if (ppm >= 9 && ppm <= 35) return "Elevated";
|
|
265
|
+
if (ppm >= 36 && ppm <= 69) return "Dangerous";
|
|
266
|
+
return "Emergency";
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
var reasons = [];
|
|
270
|
+
if (isFinite(coAmbRaw) && coAmbRaw > 8) reasons.push({ type: "Ambient", value: coAmbRaw, level: getCOLevel(coAmbRaw) });
|
|
271
|
+
if (isFinite(coRetRaw) && coRetRaw > 8) reasons.push({ type: "Return", value: coRetRaw, level: getCOLevel(coRetRaw) });
|
|
272
|
+
if (isFinite(coSupRaw) && coSupRaw > 8) reasons.push({ type: "Supply", value: coSupRaw, level: getCOLevel(coSupRaw) });
|
|
273
|
+
var coHigh = reasons.length > 0;
|
|
274
|
+
|
|
275
|
+
if (coHigh) {
|
|
276
|
+
// Find the highest severity level and the ambient CO reading
|
|
277
|
+
var highestLevel = "Elevated";
|
|
278
|
+
var ambientReading = null;
|
|
279
|
+
for (var r = 0; r < reasons.length; r++) {
|
|
280
|
+
if (reasons[r].type === "Ambient") ambientReading = reasons[r];
|
|
281
|
+
if (reasons[r].level === "Emergency") highestLevel = "Emergency";
|
|
282
|
+
else if (reasons[r].level === "Dangerous" && highestLevel !== "Emergency") highestLevel = "Dangerous";
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// Build warning message focused on ambient CO
|
|
286
|
+
var warningMsg, warningMsg2;
|
|
287
|
+
if (ambientReading) {
|
|
288
|
+
warningMsg = "WARNING: " + ambientReading.level + " Ambient CO " + Math.round(ambientReading.value) + " ppm\nVentilate the area and investigate source.";
|
|
289
|
+
warningMsg2 = "WARNING: " + ambientReading.level + " Ambient CO " + Math.round(ambientReading.value) + " ppm. Ventilate the area and investigate source.";
|
|
290
|
+
} else {
|
|
291
|
+
// Fallback if no ambient reading (use first reading)
|
|
292
|
+
var firstReading = reasons[0];
|
|
293
|
+
warningMsg = "WARNING: " + firstReading.level + " " + firstReading.type + " CO " + Math.round(firstReading.value) + " ppm\nVentilate the area and investigate source.";
|
|
294
|
+
warningMsg2 = "WARNING: " + firstReading.level + " " + firstReading.type + " CO " + Math.round(firstReading.value) + " ppm. Ventilate the area and investigate source.";
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// Set text with color based on severity level
|
|
298
|
+
// Orange for Elevated, Red for Dangerous, Dark Red for Emergency
|
|
299
|
+
var warningColor;
|
|
300
|
+
if (highestLevel === "Emergency") {
|
|
301
|
+
warningColor = rgb(0.72, 0.11, 0.11); // Dark red (#b71c1c)
|
|
302
|
+
} else if (highestLevel === "Dangerous") {
|
|
303
|
+
warningColor = rgb(0.96, 0.26, 0.21); // Red (#f44336)
|
|
304
|
+
} else {
|
|
305
|
+
warningColor = rgb(1, 0.6, 0); // Orange (#ff9800)
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
try {
|
|
309
|
+
var tf1 = form.getTextField("COWarning");
|
|
310
|
+
tf1.setText(warningMsg);
|
|
311
|
+
tf1.setTextColor(warningColor);
|
|
312
|
+
} catch (e) {}
|
|
313
|
+
try {
|
|
314
|
+
var tf2 = form.getTextField("COWarning2");
|
|
315
|
+
tf2.setText(warningMsg2);
|
|
316
|
+
tf2.setTextColor(warningColor);
|
|
317
|
+
} catch (e) {}
|
|
270
318
|
} else {
|
|
319
|
+
// clear warnings if not applicable
|
|
271
320
|
safeSetText(form, "COWarning", "");
|
|
272
321
|
safeSetText(form, "COWarning2", "");
|
|
273
322
|
}
|
package/util.js
CHANGED
|
@@ -403,6 +403,8 @@ export function getElectricalData(test, suffix, embeddedIcons) {
|
|
|
403
403
|
vIcon = embeddedIcons.iconRedfish510;
|
|
404
404
|
else if (vSource == "Fieldpiece")
|
|
405
405
|
vIcon = embeddedIcons.iconFieldpiece;
|
|
406
|
+
else if (vSource == "UEi HAC" || vSource == "UEi DL599")
|
|
407
|
+
vIcon = embeddedIcons.iconUei;
|
|
406
408
|
}
|
|
407
409
|
if (aDisplay) {
|
|
408
410
|
if (aSource == "ComfortGuard")
|
|
@@ -415,6 +417,8 @@ export function getElectricalData(test, suffix, embeddedIcons) {
|
|
|
415
417
|
aIcon = embeddedIcons.iconRedfish510;
|
|
416
418
|
else if (aSource == "Fieldpiece")
|
|
417
419
|
aIcon = embeddedIcons.iconFieldpiece;
|
|
420
|
+
else if (aSource == "UEi HAC" || aSource == "UEi DL599")
|
|
421
|
+
aIcon = embeddedIcons.iconUei;
|
|
418
422
|
}
|
|
419
423
|
return {
|
|
420
424
|
voltage: vDisplay,
|