@measurequick/measurequick-report-generator 1.5.192 → 1.5.194
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/package.json
CHANGED
|
@@ -108,7 +108,7 @@ export async function getReport(payload, options = {}) {
|
|
|
108
108
|
// Combine content
|
|
109
109
|
let fullContent = "";
|
|
110
110
|
if (aiSummary) {
|
|
111
|
-
fullContent += "
|
|
111
|
+
fullContent += "SUMMARY\n\n" + aiSummary + "\n\n";
|
|
112
112
|
}
|
|
113
113
|
if (notes) {
|
|
114
114
|
fullContent += "NOTES\n\n" + notes;
|
|
@@ -166,7 +166,7 @@ export async function getReport(payload, options = {}) {
|
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
// Check if this is a title line
|
|
169
|
-
const isTitle = line === "
|
|
169
|
+
const isTitle = line === "SUMMARY" || line === "NOTES";
|
|
170
170
|
|
|
171
171
|
if (isTitle) {
|
|
172
172
|
// Add some spacing before title
|
|
@@ -230,19 +230,34 @@ export async function getReport(payload, _test) {
|
|
|
230
230
|
form.getTextField("YourSystemScorePage2").setText(`${systemScorePercentage} ${systemScoreGrade}`);
|
|
231
231
|
|
|
232
232
|
// Print targets and range icons (using appropriate values for heat pump heating)
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
|
|
233
|
+
// Only show range icons for measurements that exist
|
|
234
|
+
// Map field names to textFields values and check if they exist
|
|
235
|
+
const measureChecks = [
|
|
236
|
+
{ label: "Superheat", value: textFields.tempRise }, // Temperature Rise
|
|
237
|
+
{ label: "Subcooling", value: textFields.llt }, // Liquid Line Temp
|
|
238
|
+
{ label: "Condenser", value: textFields.cop }, // COP/Efficiency
|
|
239
|
+
{ label: "TempSplit", value: textFields.oat }, // Outdoor Air Temp
|
|
240
|
+
{ label: "Tesp", value: textFields.tesp }, // Total External Static Pressure
|
|
241
|
+
{ label: "FilterFace", value: textFields.airflow } // Airflow
|
|
242
|
+
];
|
|
243
|
+
|
|
244
|
+
for (let i = 0; i < measureChecks.length; i++) {
|
|
245
|
+
const { label, value } = measureChecks[i];
|
|
246
|
+
// Only show range indicator if value exists (is not "--")
|
|
247
|
+
if (value && value !== "--") {
|
|
248
|
+
// For heat pump heating, we don't have typical target ranges yet
|
|
249
|
+
// Show green icon as placeholder for valid measurements
|
|
250
|
+
let icon = iconRangeGreen;
|
|
251
|
+
let iconPlacement = "Mid";
|
|
252
|
+
try {
|
|
253
|
+
form.getButton(`Image${label}${iconPlacement}_af_image`).setImage(icon);
|
|
254
|
+
} catch (e) {
|
|
255
|
+
// Field may not exist
|
|
256
|
+
}
|
|
242
257
|
}
|
|
243
258
|
// Clear target zone text for heat pump heating (different targets apply)
|
|
244
259
|
try {
|
|
245
|
-
form.getTextField(`${
|
|
260
|
+
form.getTextField(`${label}Target`).setText("");
|
|
246
261
|
} catch (e) {
|
|
247
262
|
// Field may not exist
|
|
248
263
|
}
|
|
@@ -299,7 +314,8 @@ function getTextFields(payload, test) {
|
|
|
299
314
|
cop: test.data.cop !== undefined ? (+test.data.cop).toFixed(2) : "--",
|
|
300
315
|
oat: test.data.temperature_outdoor_dry_bulb !== undefined ? (+test.data.temperature_outdoor_dry_bulb).toFixed(1) : "--",
|
|
301
316
|
tesp: test.data.pressure_static_total_external !== undefined ? (+test.data.pressure_static_total_external).toFixed(2) : "--",
|
|
302
|
-
airflow: test.data.airflow !== undefined ? (+test.data.airflow).toFixed(0) :
|
|
317
|
+
airflow: test.data.airflow !== undefined ? (+test.data.airflow).toFixed(0) :
|
|
318
|
+
(test.data.airflow_estimated !== undefined ? (+test.data.airflow_estimated).toFixed(0) : "--"),
|
|
303
319
|
// Heat pump heating scoring factors (points earned, not losses)
|
|
304
320
|
ptsFilter: test.data.hp_heating_pts_filter !== undefined ? (+test.data.hp_heating_pts_filter).toFixed(0) : "--",
|
|
305
321
|
ptsA: test.data.hp_heating_pts_a !== undefined ? (+test.data.hp_heating_pts_a).toFixed(0) : "--",
|
package/util.js
CHANGED
|
@@ -1061,10 +1061,31 @@ export function shouldShowAiSummary(payload) {
|
|
|
1061
1061
|
}
|
|
1062
1062
|
|
|
1063
1063
|
export function getAiSummary(payload) {
|
|
1064
|
-
// Check multiple possible sources for AI summary
|
|
1064
|
+
// Check multiple possible sources for AI summary (both snake_case and camelCase)
|
|
1065
1065
|
if (payload.ai_summary) return payload.ai_summary;
|
|
1066
|
+
if (payload.aiSummary) return payload.aiSummary;
|
|
1066
1067
|
if (payload.project && payload.project.ai_summary) return payload.project.ai_summary;
|
|
1068
|
+
if (payload.project && payload.project.aiSummary) return payload.project.aiSummary;
|
|
1067
1069
|
if (payload.project && payload.project.mq_ai_summary) return payload.project.mq_ai_summary;
|
|
1070
|
+
if (payload.project && payload.project.mqAiSummary) return payload.project.mqAiSummary;
|
|
1071
|
+
// Check in tests array
|
|
1072
|
+
if (payload.tests && payload.tests[0]) {
|
|
1073
|
+
if (payload.tests[0].testInfo && payload.tests[0].testInfo.aiSummary) {
|
|
1074
|
+
return payload.tests[0].testInfo.aiSummary;
|
|
1075
|
+
}
|
|
1076
|
+
if (payload.tests[0].testInfo && payload.tests[0].testInfo.ai_summary) {
|
|
1077
|
+
return payload.tests[0].testInfo.ai_summary;
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
// Check aiSummaries array on project
|
|
1081
|
+
if (payload.project && payload.project.aiSummaries && payload.project.aiSummaries.length > 0) {
|
|
1082
|
+
// Return the most recent summary - extract text if it's an object
|
|
1083
|
+
const summary = payload.project.aiSummaries[payload.project.aiSummaries.length - 1];
|
|
1084
|
+
if (typeof summary === 'string') return summary;
|
|
1085
|
+
if (summary && summary.text) return summary.text;
|
|
1086
|
+
if (summary && summary.summary) return summary.summary;
|
|
1087
|
+
if (summary && summary.content) return summary.content;
|
|
1088
|
+
}
|
|
1068
1089
|
return null;
|
|
1069
1090
|
}
|
|
1070
1091
|
|
|
@@ -1072,8 +1093,13 @@ export function getAiNotes(payload) {
|
|
|
1072
1093
|
// Check multiple possible sources for notes
|
|
1073
1094
|
if (payload.notes) return payload.notes;
|
|
1074
1095
|
if (payload.project && payload.project.notes) return payload.project.notes;
|
|
1096
|
+
// Check in tests array
|
|
1075
1097
|
if (payload.tests && payload.tests[0] && payload.tests[0].testInfo && payload.tests[0].testInfo.notes) {
|
|
1076
1098
|
return payload.tests[0].testInfo.notes;
|
|
1077
1099
|
}
|
|
1100
|
+
// Check testInfo directly on payload (for single test payloads)
|
|
1101
|
+
if (payload.testInfo && payload.testInfo.notes) {
|
|
1102
|
+
return payload.testInfo.notes;
|
|
1103
|
+
}
|
|
1078
1104
|
return null;
|
|
1079
1105
|
}
|