@measurequick/measurequick-report-generator 1.0.62 → 1.0.63

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.
@@ -129,10 +129,11 @@ function printBodySection(currentSnapshot, measurementSection, xLeft, xRight, y)
129
129
  let valueBeforeEditing = dataPoint;
130
130
  let templateRef = templates[measurementSection][key];
131
131
  if (templateRef) {
132
- if (templateRef.hasOwnProperty("units"))
132
+ labelText = templateRef.label;
133
+ if (templateRef.hasOwnProperty("units")) {
133
134
  units = Array.isArray(templateRef.units) ? `(${templateRef.units[0]} / ${templateRef.units[1]})` : `(${templateRef.units})`;
134
- else units = "";
135
- labelText = `${templateRef.label} ${units}:`;
135
+ labelText += ` ${units}:`;
136
+ } else labelText += ':';
136
137
  if (templateRef.hasOwnProperty("roundTo")) {
137
138
  dataPoint *= 1;
138
139
  dataPoint = dataPoint.toFixed(templateRef.roundTo);
@@ -146,8 +147,18 @@ function printBodySection(currentSnapshot, measurementSection, xLeft, xRight, y)
146
147
  valueText = `${dataPoint} / ${secondaryDataPoint}`;
147
148
  } else valueText = `${dataPoint}`;
148
149
  if (templateRef.label) doc.text(labelText, xLeft, y);
149
- //if (isNaN(valueText) || !valueText) valueText = "--";
150
- doc.text(valueText, alignRight(valueText, xRight, 8), y);
150
+ if (!valueText) valueText = "--";
151
+ let fs = 8;
152
+ if (key == "capacityActualNormalized" || key == "capacitySensibleNormalized" || key == "capacityLatentNormalized") {
153
+ doc.setFontSize(6);
154
+ fs = 6;
155
+ y -= .05;
156
+ }
157
+ doc.text(valueText, alignRight(valueText, xRight, fs), y);
158
+ if (key == "capacityActualNormalized" || key == "capacitySensibleNormalized" || key == "capacityLatentNormalized") {
159
+ doc.setFontSize(8);
160
+ y += .05;
161
+ }
151
162
  if (printRangeIcons) {
152
163
  let rangeIconRef = getRangeIcon(key, valueBeforeEditing, currentSnapshot);
153
164
  if (rangeIconRef) doc.addImage(graphics[rangeIconRef], "JPEG", xRight + .05, y - .12, .16, .16);
@@ -256,7 +267,7 @@ function printSystemDiagnostics() {
256
267
  else if (score > 1 && score < 10) diagnosticIcon = graphics.iconFlagRed;
257
268
  else if (score >= 10 && score < 15) diagnosticIcon = graphics.iconFlagYellow;
258
269
  else if (score >= 15) diagnosticIcon = graphics.iconFlagBlack;
259
- if (diagnosticIcon) doc.addImage(diagnosticIcon, "PNG", 7.9, y, .18, .18);
270
+ if (diagnosticIcon) doc.addImage(diagnosticIcon, "PNG", 7.8, y + .1, .18, .18);
260
271
  y += .2;
261
272
  doc.text(diagnostics[key].title, 4.4375, y);
262
273
  doc.text(`${diagnostics[key].score}`, 7.5, y);
@@ -445,6 +456,11 @@ function resizeAndPrintStaticImages() {
445
456
  profileImage = profileSettings.base64ProfilePhotoSquare;
446
457
  if (profileImage)
447
458
  doc.addImage(profileImage, "PNG", x_profile, y_profile, size_profile, size_profile);
459
+ if (profileSettings.techName) {
460
+ doc.setTextColor(0, 0, 0);
461
+ doc.text(profileSettings.techName, x_profile, y_profile + size_profile);
462
+ doc.setTextColor(255, 255, 255);
463
+ }
448
464
  }
449
465
  }
450
466
 
@@ -475,7 +491,7 @@ function setColor(measure) {
475
491
  function getRangeIcon(key, actualValue, currentSnapshot) {
476
492
  // Special Case
477
493
  let rangeIconRef = null;
478
- if (key == 'benchmarked') {
494
+ if (key == 'systemBenchmarked') {
479
495
  if (actualValue == 'Yes') rangeIconRef = "iconThumbprintGreen";
480
496
  else if (actualValue == 'Yes, under duress') rangeIconRef = "iconCautionTriangleYellow";
481
497
  else rangeIconRef = "iconThumbprintRed";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measurequick/measurequick-report-generator",
3
- "version": "1.0.62",
3
+ "version": "1.0.63",
4
4
  "description": "Generates PDF documents for various MeasureQuick applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -284,11 +284,9 @@ export const indoorMeasurements = {
284
284
  },
285
285
  "airHandlerVoltage": {
286
286
  "label": "AHU Voltage",
287
- "roundTo": 1
288
287
  },
289
288
  "airHandlerAmperage": {
290
289
  "label": "AHU Amperage",
291
- "roundTo": 1
292
290
  },
293
291
  "power_factor_ahu": {
294
292
  "label": "AHU Power Factor",