@measurequick/measurequick-report-generator 1.0.19 → 1.0.21
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 +4 -0
- package/index.js +8 -3
- package/package.json +1 -1
package/assets/templates.js
CHANGED
|
@@ -7,6 +7,7 @@ export const docOptions = {
|
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export const indoorMeasurements = {
|
|
10
|
+
"headerLabel": "Indoor Measurements",
|
|
10
11
|
"returnTemperature": {
|
|
11
12
|
"label": "Return Temp",
|
|
12
13
|
"units": "°F"
|
|
@@ -55,6 +56,7 @@ export const indoorMeasurements = {
|
|
|
55
56
|
};
|
|
56
57
|
|
|
57
58
|
export const outdoorMeasurements = {
|
|
59
|
+
"headerLabel": "Outdoor Measurements",
|
|
58
60
|
"lowSidePressure": {
|
|
59
61
|
"label": "Low Pressure",
|
|
60
62
|
"units": ["PSIG", "°F"],
|
|
@@ -110,6 +112,7 @@ export const outdoorMeasurements = {
|
|
|
110
112
|
};
|
|
111
113
|
|
|
112
114
|
export const performanceData = {
|
|
115
|
+
"headerLabel": "Performance Data",
|
|
113
116
|
"capacityNominal": {
|
|
114
117
|
"label": "Test Label"
|
|
115
118
|
},
|
|
@@ -167,6 +170,7 @@ export const performanceData = {
|
|
|
167
170
|
};
|
|
168
171
|
|
|
169
172
|
export const systemInfo = {
|
|
173
|
+
"headerLabel": "System & Weather Info",
|
|
170
174
|
"systemType": {
|
|
171
175
|
"label": "System Type"
|
|
172
176
|
},
|
package/index.js
CHANGED
|
@@ -76,7 +76,7 @@ function printHeaderData(reportName, techName, profilePicture, companyLogo) {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
function printBodyData(geolocationMap) {
|
|
79
|
-
doc.setTextColor(0,0,0);
|
|
79
|
+
doc.setTextColor(0, 0, 0);
|
|
80
80
|
printMap(geolocationMap);
|
|
81
81
|
printSingleBodySection(templates.outdoorMeasurements, .25, 2.317, 1.55);
|
|
82
82
|
printSingleBodySection(templates.indoorMeasurements, 3.042, 5.109, 1.55);
|
|
@@ -90,15 +90,19 @@ function printSingleBodySection(dataPoints, xLeft, xRight, y) {
|
|
|
90
90
|
var val;
|
|
91
91
|
var units;
|
|
92
92
|
var text;
|
|
93
|
+
doc.setFontStyle("bold");
|
|
94
|
+
doc.text(dataPoints.headerLabel, xLeft, y - .22);
|
|
95
|
+
doc.setFontStyle("normal");
|
|
93
96
|
for (let key in dataPoints) {
|
|
97
|
+
if (key == "headerLabel") continue;
|
|
94
98
|
dataPoint = dataPoints[key];
|
|
95
99
|
val = reportData.values[key];
|
|
96
100
|
units = Array.isArray(dataPoint.units) ? `${dataPoint.units[0]} / ${dataPoint.units[1]}` : dataPoint.units;
|
|
97
101
|
text = dataPoint.hasOwnProperty("secondaryValue") ? `${val} / ${reportData.values[dataPoint.secondaryValue]}` : val;
|
|
98
102
|
doc.text(`${dataPoint.label} (${units}):`, xLeft, y);
|
|
99
103
|
doc.text(val, alignRight(val, xRight, 8), y);
|
|
100
|
-
doc.addImage(graphics[reportData.rangeIcons[key]], "JPEG", xRight, y - .15, .
|
|
101
|
-
doc.addImage(graphics[reportData.toolIcons[key]], "JPEG", xRight+.2, y - .15, .
|
|
104
|
+
doc.addImage(graphics[reportData.rangeIcons[key]], "JPEG", xRight + .05, y - .15, .16, .16);
|
|
105
|
+
doc.addImage(graphics[reportData.toolIcons[key]], "JPEG", xRight+.2, y - .15, .16, .16);
|
|
102
106
|
y += s;
|
|
103
107
|
}
|
|
104
108
|
}
|
|
@@ -132,6 +136,7 @@ function printFooterData(techName, profilePicture, companyLogo) {
|
|
|
132
136
|
}
|
|
133
137
|
|
|
134
138
|
function printPhotos(photoArray) {
|
|
139
|
+
doc.addPage();
|
|
135
140
|
for (let photo in photoArray) {
|
|
136
141
|
|
|
137
142
|
}
|