@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 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",
@@ -112,60 +112,74 @@ export const outdoorMeasurements = {
112
112
  };
113
113
 
114
114
  export const performanceData = {
115
- "headerLabel": "Performance Data",
115
+ "headerLabel": "Performance Calculations",
116
+ "subHeaderLabel1": "Capacity Calculations",
116
117
  "capacityNominal": {
117
- "label": "Test Label"
118
+ "label": "Nominal",
119
+ "units": ["Tons", "Btu/h"],
120
+ "secondaryValue": ""
118
121
  },
119
122
  "capacityNormalized": {
120
- "label": "Test Label"
123
+ "label": "Normalized",
124
+ "units": ["Tons", "Btu/h"],
125
+ "secondaryValue": ""
121
126
  },
122
127
  "capacityActual": {
123
- "label": "Test Label"
128
+ "label": "Actual",
129
+ "units": ["Tons", "Btu/h"]
124
130
  },
125
131
  "capacityActualNormalized": {
126
- "label": "Test Label"
132
+ "label": "TestLabel"
127
133
  },
128
134
  "capacitySensible": {
129
- "label": "Test Label"
135
+ "label": "Sensible",
136
+ "units": ["Tons", "Btu/h"]
130
137
  },
131
138
  "capacitySensibleNormalized": {
132
- "label": "Test Label"
139
+ "label": "TestLabel"
133
140
  },
134
141
  "capacityLatent": {
135
- "label": "Test Label"
142
+ "label": "Latent",
143
+ "units": ["Tons", "Btu/h"]
136
144
  },
137
145
  "capacityLatentNormalized": {
138
- "label": "Test Label"
146
+ "label": "TestLabel"
139
147
  },
140
148
  "sensibleHeatRatio": {
141
- "label": "Test Label"
149
+ "label": "Sensible Heat Ratio"
142
150
  },
151
+ "columnBreak": "",
152
+ "subHeaderLabel2": "Air-side Performance",
143
153
  "temperatureSplitTarget": {
144
- "label": "Test Label"
154
+ "label": "Temp Split Target",
155
+ "units": "°F"
145
156
  },
146
157
  "temperatureSplit": {
147
- "label": "Test Label"
158
+ "label": "Temp Split",
159
+ "units": "°F"
148
160
  },
149
161
  "dehumidification": {
150
- "label": "Test Label"
162
+ "label": "Dehumidification"
151
163
  },
152
164
  "dehumidificationAlternate": {
153
- "label": "Test Label"
165
+ "label": ""
154
166
  },
167
+ "rowBreak": "",
168
+ "subHeaderLabel3": "Energy Efficiency",
155
169
  "fanEfficacy": {
156
- "label": "Test Label"
170
+ "label": "Fan Efficacy"
157
171
  },
158
172
  "totalPower": {
159
- "label": "Test Label"
173
+ "label": "Total Power"
160
174
  },
161
175
  "eer": {
162
- "label": "Test Label"
176
+ "label": "EER"
163
177
  },
164
178
  "seerApproximate": {
165
- "label": "Test Label"
179
+ "label": "Approx. SEER"
166
180
  },
167
181
  "sensibleEfficiency": {
168
- "label": "Test 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": 1,
242
- "y": 1,
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": 6.5,
257
- "y": 1,
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.455);
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
- doc.setFontStyle("bold");
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") continue;
98
- dataPoint = dataPoints[key];
99
- val = reportData.values[key];
100
- units = Array.isArray(dataPoint.units) ? `${dataPoint.units[0]} / ${dataPoint.units[1]}` : dataPoint.units;
101
- text = dataPoint.hasOwnProperty("secondaryValue") ? `${val} / ${reportData.values[dataPoint.secondaryValue]}` : val;
102
- doc.text(`${dataPoint.label} (${units}):`, xLeft, y);
103
- doc.text(val, alignRight(val, xRight, 8), y);
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);
106
- y += s;
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measurequick/measurequick-report-generator",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "Generates PDF documents for various MeasureQuick applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {