@measurequick/measurequick-report-generator 1.0.21 → 1.0.23
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/request.js +19 -1
- package/assets/templates.js +37 -23
- package/index.js +28 -15
- package/package.json +1 -1
package/assets/request.js
CHANGED
|
@@ -5,7 +5,25 @@ export const body = {
|
|
|
5
5
|
"reportTheme": "dark",
|
|
6
6
|
"techName": "David Zucco",
|
|
7
7
|
"profilePicturePlacement": "header",
|
|
8
|
-
"companyLogoPlacement": "header"
|
|
8
|
+
"companyLogoPlacement": "header",
|
|
9
|
+
"customerFirstName": "David",
|
|
10
|
+
"customerLastName": "Zucco",
|
|
11
|
+
"customerAddressLine1": "1234 Test Street",
|
|
12
|
+
"customerAddressLine2": "Apt. 5",
|
|
13
|
+
"customerCity": "Columbus",
|
|
14
|
+
"customerState": "OH",
|
|
15
|
+
"customerZip": "44147",
|
|
16
|
+
"customerEmail": "test@email.com",
|
|
17
|
+
"customerPhone": "(123)-456-7899",
|
|
18
|
+
"systemNumber": "1234325657456",
|
|
19
|
+
"systenName": "Test System",
|
|
20
|
+
"systemId": "Test ID",
|
|
21
|
+
"systemLat": "43.436363",
|
|
22
|
+
"systemLng": "77.56436",
|
|
23
|
+
"systemType": "Split",
|
|
24
|
+
"systemMake": "Goodman",
|
|
25
|
+
"systemModel": "Model 3",
|
|
26
|
+
"systemSerial": "4958w9sgjdigjs9fadn"
|
|
9
27
|
},
|
|
10
28
|
"units": {
|
|
11
29
|
"temperature": "F",
|
package/assets/templates.js
CHANGED
|
@@ -112,60 +112,74 @@ export const outdoorMeasurements = {
|
|
|
112
112
|
};
|
|
113
113
|
|
|
114
114
|
export const performanceData = {
|
|
115
|
-
"headerLabel": "Performance
|
|
115
|
+
"headerLabel": "Performance Calculations",
|
|
116
|
+
"subHeaderLabel1": "Capacity Calculations",
|
|
116
117
|
"capacityNominal": {
|
|
117
|
-
"label": "
|
|
118
|
+
"label": "Nominal",
|
|
119
|
+
"units": ["Tons", "Btu/h"],
|
|
120
|
+
"secondaryValue": ""
|
|
118
121
|
},
|
|
119
122
|
"capacityNormalized": {
|
|
120
|
-
"label": "
|
|
123
|
+
"label": "Normalized",
|
|
124
|
+
"units": ["Tons", "Btu/h"],
|
|
125
|
+
"secondaryValue": ""
|
|
121
126
|
},
|
|
122
127
|
"capacityActual": {
|
|
123
|
-
"label": "
|
|
128
|
+
"label": "Actual",
|
|
129
|
+
"units": ["Tons", "Btu/h"]
|
|
124
130
|
},
|
|
125
131
|
"capacityActualNormalized": {
|
|
126
|
-
"label": "
|
|
132
|
+
"label": "TestLabel"
|
|
127
133
|
},
|
|
128
134
|
"capacitySensible": {
|
|
129
|
-
"label": "
|
|
135
|
+
"label": "Sensible",
|
|
136
|
+
"units": ["Tons", "Btu/h"]
|
|
130
137
|
},
|
|
131
138
|
"capacitySensibleNormalized": {
|
|
132
|
-
"label": "
|
|
139
|
+
"label": "TestLabel"
|
|
133
140
|
},
|
|
134
141
|
"capacityLatent": {
|
|
135
|
-
"label": "
|
|
142
|
+
"label": "Latent",
|
|
143
|
+
"units": ["Tons", "Btu/h"]
|
|
136
144
|
},
|
|
137
145
|
"capacityLatentNormalized": {
|
|
138
|
-
"label": "
|
|
146
|
+
"label": "TestLabel"
|
|
139
147
|
},
|
|
140
148
|
"sensibleHeatRatio": {
|
|
141
|
-
"label": "
|
|
149
|
+
"label": "Sensible Heat Ratio"
|
|
142
150
|
},
|
|
151
|
+
"columnBreak": "",
|
|
152
|
+
"subHeaderLabel2": "Air-side Performance",
|
|
143
153
|
"temperatureSplitTarget": {
|
|
144
|
-
"label": "
|
|
154
|
+
"label": "Temp Split Target",
|
|
155
|
+
"units": "°F"
|
|
145
156
|
},
|
|
146
157
|
"temperatureSplit": {
|
|
147
|
-
"label": "
|
|
158
|
+
"label": "Temp Split",
|
|
159
|
+
"units": "°F"
|
|
148
160
|
},
|
|
149
161
|
"dehumidification": {
|
|
150
|
-
"label": "
|
|
162
|
+
"label": "Dehumidification"
|
|
151
163
|
},
|
|
152
164
|
"dehumidificationAlternate": {
|
|
153
|
-
"label": "
|
|
165
|
+
"label": ""
|
|
154
166
|
},
|
|
167
|
+
"rowBreak": "",
|
|
168
|
+
"subHeaderLabel3": "Energy Efficiency",
|
|
155
169
|
"fanEfficacy": {
|
|
156
|
-
"label": "
|
|
170
|
+
"label": "Fan Efficacy"
|
|
157
171
|
},
|
|
158
172
|
"totalPower": {
|
|
159
|
-
"label": "
|
|
173
|
+
"label": "Total Power"
|
|
160
174
|
},
|
|
161
175
|
"eer": {
|
|
162
|
-
"label": "
|
|
176
|
+
"label": "EER"
|
|
163
177
|
},
|
|
164
178
|
"seerApproximate": {
|
|
165
|
-
"label": "
|
|
179
|
+
"label": "Approx. SEER"
|
|
166
180
|
},
|
|
167
181
|
"sensibleEfficiency": {
|
|
168
|
-
"label": "
|
|
182
|
+
"label": "Sensible Efficiency"
|
|
169
183
|
}
|
|
170
184
|
};
|
|
171
185
|
|
|
@@ -238,8 +252,8 @@ export const footerData = [
|
|
|
238
252
|
|
|
239
253
|
export const profilePictureCoordinates = {
|
|
240
254
|
"header": {
|
|
241
|
-
"x":
|
|
242
|
-
"y":
|
|
255
|
+
"x": 7.5,
|
|
256
|
+
"y": 7.75,
|
|
243
257
|
"w": 1,
|
|
244
258
|
"h": 1
|
|
245
259
|
},
|
|
@@ -253,8 +267,8 @@ export const profilePictureCoordinates = {
|
|
|
253
267
|
|
|
254
268
|
export const companyLogoCoordinates = {
|
|
255
269
|
"header": {
|
|
256
|
-
"x":
|
|
257
|
-
"y":
|
|
270
|
+
"x": 7.5,
|
|
271
|
+
"y": 0,
|
|
258
272
|
"w": 1,
|
|
259
273
|
"h": 1
|
|
260
274
|
},
|
package/index.js
CHANGED
|
@@ -81,7 +81,7 @@ function printBodyData(geolocationMap) {
|
|
|
81
81
|
printSingleBodySection(templates.outdoorMeasurements, .25, 2.317, 1.55);
|
|
82
82
|
printSingleBodySection(templates.indoorMeasurements, 3.042, 5.109, 1.55);
|
|
83
83
|
printSingleBodySection(templates.systemInfo, 5.834, 7.9, 1.55);
|
|
84
|
-
printSingleBodySection(templates.performanceData, .25, 2, 4.
|
|
84
|
+
printSingleBodySection(templates.performanceData, .25, 2, 4.655);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
function printSingleBodySection(dataPoints, xLeft, xRight, y) {
|
|
@@ -90,20 +90,33 @@ function printSingleBodySection(dataPoints, xLeft, xRight, y) {
|
|
|
90
90
|
var val;
|
|
91
91
|
var units;
|
|
92
92
|
var text;
|
|
93
|
-
|
|
94
|
-
doc.text(dataPoints.headerLabel, xLeft, y - .22);
|
|
95
|
-
doc.setFontStyle("normal");
|
|
93
|
+
var i = 1;
|
|
96
94
|
for (let key in dataPoints) {
|
|
97
|
-
if (key == "headerLabel")
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
95
|
+
if (key == "headerLabel") {
|
|
96
|
+
doc.setFontStyle("bold");
|
|
97
|
+
doc.text(dataPoints.headerLabel, xLeft, y - .22);
|
|
98
|
+
doc.setFontStyle("normal");
|
|
99
|
+
} else if (key.includes("subHeaderLabel")) {
|
|
100
|
+
doc.setFontStyle("bold");
|
|
101
|
+
doc.text(dataPoints[`subHeaderLabel${i}`], xLeft, y - .22);
|
|
102
|
+
doc.setFontStyle("normal");
|
|
103
|
+
i++;
|
|
104
|
+
} else if (key == "columnBreak") {
|
|
105
|
+
xLeft += 2;
|
|
106
|
+
xRight += 2;
|
|
107
|
+
} else if (key == "rowBreak") {
|
|
108
|
+
y += .2;
|
|
109
|
+
} else {
|
|
110
|
+
dataPoint = dataPoints[key];
|
|
111
|
+
val = reportData.values[key];
|
|
112
|
+
units = Array.isArray(dataPoint.units) ? `${dataPoint.units[0]} / ${dataPoint.units[1]}` : dataPoint.units;
|
|
113
|
+
text = dataPoint.hasOwnProperty("secondaryValue") ? `${val} / ${reportData.values[dataPoint.secondaryValue]}` : val;
|
|
114
|
+
doc.text(`${dataPoint.label} (${units}):`, xLeft, y);
|
|
115
|
+
doc.text(text, alignRight(text, xRight, 8), y);
|
|
116
|
+
doc.addImage(graphics[reportData.rangeIcons[key]], "JPEG", xRight + .05, y - .1, .16, .16);
|
|
117
|
+
doc.addImage(graphics[reportData.toolIcons[key]], "JPEG", xRight+.3, y - .1, .16, .16);
|
|
118
|
+
y += s;
|
|
119
|
+
}
|
|
107
120
|
}
|
|
108
121
|
}
|
|
109
122
|
|
|
@@ -114,7 +127,7 @@ function printMap(geolocationMap) {
|
|
|
114
127
|
function printProfilePicture(picturePlacement, techName, profilePicture) {
|
|
115
128
|
var coords = templates.profilePictureCoordinates[picturePlacement];
|
|
116
129
|
doc.addImage(profilePicture, "JPEG", coords.x, coords.y, coords.w, coords.h);
|
|
117
|
-
doc.text(techName, coords.x, coords.y + 1, coords.w, coords.h);
|
|
130
|
+
doc.text(alignRight(techName, 8.4, 8), coords.x, coords.y + 1.2, coords.w, coords.h);
|
|
118
131
|
}
|
|
119
132
|
|
|
120
133
|
function printCompanyLogo(logoPlacement, companyLogo) {
|