@measurequick/measurequick-report-generator 1.0.28 → 1.0.30
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/assets/templates.js +63 -0
- package/index.js +13 -9
- package/package.json +1 -1
package/assets/templates.js
CHANGED
|
@@ -229,6 +229,69 @@ export const systemInfo = {
|
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
231
|
|
|
232
|
+
export const footerData = {
|
|
233
|
+
"headerLabel": "Customer",
|
|
234
|
+
"customerFirstName": {
|
|
235
|
+
"label": ""
|
|
236
|
+
},
|
|
237
|
+
"customerLastName": {
|
|
238
|
+
"label": ""
|
|
239
|
+
},
|
|
240
|
+
"customerAddressLine1": {
|
|
241
|
+
"label": ""
|
|
242
|
+
},
|
|
243
|
+
"customerAddressLine2": {
|
|
244
|
+
"label": ""
|
|
245
|
+
},
|
|
246
|
+
"customerCity": {
|
|
247
|
+
"label": ""
|
|
248
|
+
},
|
|
249
|
+
"customerState": {
|
|
250
|
+
"label": ""
|
|
251
|
+
},
|
|
252
|
+
"customerZip": {
|
|
253
|
+
"label": ""
|
|
254
|
+
},
|
|
255
|
+
"customerEmail": {
|
|
256
|
+
"label": ""
|
|
257
|
+
},
|
|
258
|
+
"customerPhone": {
|
|
259
|
+
"label": ""
|
|
260
|
+
},
|
|
261
|
+
"columnBreak": {
|
|
262
|
+
"label": ""
|
|
263
|
+
},
|
|
264
|
+
"headerLabel": "Customer",
|
|
265
|
+
"systemNumber": {
|
|
266
|
+
"label": ""
|
|
267
|
+
},
|
|
268
|
+
"systenName": {
|
|
269
|
+
"label": ""
|
|
270
|
+
},
|
|
271
|
+
"systemId": {
|
|
272
|
+
"label": "ID"
|
|
273
|
+
},
|
|
274
|
+
"systemLat": {
|
|
275
|
+
"label": ""
|
|
276
|
+
},
|
|
277
|
+
"systemLng": {
|
|
278
|
+
"label": ""
|
|
279
|
+
},
|
|
280
|
+
"subHeaderLabel": "Condenser",
|
|
281
|
+
"systemType": {
|
|
282
|
+
"label": ""
|
|
283
|
+
},
|
|
284
|
+
"systemMake": {
|
|
285
|
+
"label": ""
|
|
286
|
+
},
|
|
287
|
+
"systemModel": {
|
|
288
|
+
"label": ""
|
|
289
|
+
},
|
|
290
|
+
"systemSerial": {
|
|
291
|
+
"label": ""
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
|
|
232
295
|
export const profilePictureCoordinates = {
|
|
233
296
|
"header": {
|
|
234
297
|
"x": 7.5,
|
package/index.js
CHANGED
|
@@ -78,13 +78,14 @@ function printHeaderData(reportName, techName, profilePicture, companyLogo) {
|
|
|
78
78
|
function printBodyData(geolocationMap) {
|
|
79
79
|
doc.setTextColor(0, 0, 0);
|
|
80
80
|
printMap(geolocationMap);
|
|
81
|
-
printSingleBodySection(templates.outdoorMeasurements, .25, 2.317, 1.
|
|
82
|
-
printSingleBodySection(templates.indoorMeasurements, 3.042, 5.109, 1.
|
|
83
|
-
printSingleBodySection(templates.systemInfo, 5.834, 7.9, 1.
|
|
84
|
-
printSingleBodySection(templates.performanceData, .25, 2, 4.
|
|
81
|
+
printSingleBodySection(templates.outdoorMeasurements, .25, 2.317, 1.33);
|
|
82
|
+
printSingleBodySection(templates.indoorMeasurements, 3.042, 5.109, 1.33);
|
|
83
|
+
printSingleBodySection(templates.systemInfo, 5.834, 7.9, 1.33);
|
|
84
|
+
printSingleBodySection(templates.performanceData, .25, 2, 4.435);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
function printSingleBodySection(dataPoints, xLeft, xRight, y) {
|
|
88
|
+
var yTop = y;
|
|
88
89
|
var s = .2;
|
|
89
90
|
var dataPoint;
|
|
90
91
|
var val;
|
|
@@ -94,18 +95,21 @@ function printSingleBodySection(dataPoints, xLeft, xRight, y) {
|
|
|
94
95
|
for (let key in dataPoints) {
|
|
95
96
|
if (key == "headerLabel") {
|
|
96
97
|
doc.setFontStyle("bold");
|
|
97
|
-
doc.text(dataPoints.headerLabel, xLeft, y
|
|
98
|
+
doc.text(dataPoints.headerLabel, xLeft, y);
|
|
98
99
|
doc.setFontStyle("normal");
|
|
100
|
+
y += .22;
|
|
99
101
|
} else if (key.includes("subHeaderLabel")) {
|
|
100
102
|
doc.setFontStyle("bold");
|
|
101
|
-
doc.text(dataPoints[`subHeaderLabel${i}`], xLeft, y
|
|
103
|
+
doc.text(dataPoints[`subHeaderLabel${i}`], xLeft, y);
|
|
102
104
|
doc.setFontStyle("normal");
|
|
105
|
+
y += .22;
|
|
103
106
|
i++;
|
|
104
107
|
} else if (key == "columnBreak") {
|
|
105
108
|
xLeft += 2;
|
|
106
109
|
xRight += 2;
|
|
110
|
+
y = yTop;
|
|
107
111
|
} else if (key == "rowBreak") {
|
|
108
|
-
y += .
|
|
112
|
+
y += .3;
|
|
109
113
|
} else {
|
|
110
114
|
dataPoint = dataPoints[key];
|
|
111
115
|
val = reportData.values[key];
|
|
@@ -113,8 +117,8 @@ function printSingleBodySection(dataPoints, xLeft, xRight, y) {
|
|
|
113
117
|
text = dataPoint.hasOwnProperty("secondaryValue") ? `${val} / ${reportData.values[dataPoint.secondaryValue]}` : val;
|
|
114
118
|
doc.text(`${dataPoint.label} (${units}):`, xLeft, y);
|
|
115
119
|
doc.text(text, alignRight(text, xRight, 8), y);
|
|
116
|
-
doc.addImage(graphics[reportData.rangeIcons[key]], "JPEG", xRight + .05, y - .
|
|
117
|
-
doc.addImage(graphics[reportData.toolIcons[key]], "JPEG", xRight+.
|
|
120
|
+
doc.addImage(graphics[reportData.rangeIcons[key]], "JPEG", xRight + .05, y - .12, .16, .16);
|
|
121
|
+
doc.addImage(graphics[reportData.toolIcons[key]], "JPEG", xRight+.25, y - .12, .16, .16);
|
|
118
122
|
y += s;
|
|
119
123
|
}
|
|
120
124
|
}
|