@dssp/supervision 1.0.22 → 1.0.24
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
1
|
+
import { __decorate, __metadata, __rest } from "tslib";
|
|
2
2
|
/**
|
|
3
3
|
* 검측 관리 상세 - AI 자동 검측 (동영상 세트 + 측정 모델 2종)
|
|
4
4
|
*
|
|
@@ -33,9 +33,11 @@ const pictoMemberImg = new URL('../../assets/ai-measurement/picto-member-corner.
|
|
|
33
33
|
/* 세트 폴더 필수 파일 (LidarInspector 앱이 촬영 1회당 생성) */
|
|
34
34
|
const SET_FILES = ['video.mov', 'poses.jsonl', 'meta.json'];
|
|
35
35
|
/* 촬영 앱 실행 링크 — iPad에서 이 화면을 열었을 때 앱이 바로 촬영 화면으로 뜬다.
|
|
36
|
-
server 파라미터로 업로드 주소까지 넘겨서 앱 설정을 따로 안 만져도 되게 한다.
|
|
36
|
+
server 파라미터로 업로드 주소까지 넘겨서 앱 설정을 따로 안 만져도 되게 한다.
|
|
37
|
+
return 파라미터를 주면 앱이 업로드를 마친 뒤 이 화면으로 돌아온다(?set_id=... 가 붙어서 온다). */
|
|
37
38
|
function appCaptureLink(tech) {
|
|
38
|
-
return `gamri://${tech}?server=${encodeURIComponent(MEASURE_BASE_URL)}
|
|
39
|
+
return (`gamri://${tech}?server=${encodeURIComponent(MEASURE_BASE_URL)}` +
|
|
40
|
+
`&return=${encodeURIComponent(location.href)}`);
|
|
39
41
|
}
|
|
40
42
|
/* 한 번의 /inspect 에 보낼 검사항목 수. 엔진이 8개까지만 병렬 처리하고, 그 앞단
|
|
41
43
|
Cloudflare 가 100초에서 끊기 때문에(524) 항목이 많으면 나눠 보내야 한다. */
|
|
@@ -841,10 +843,25 @@ let BuildingInspectionAiMeasurement = class BuildingInspectionAiMeasurement exte
|
|
|
841
843
|
headers: { Authorization: ENGINE_AUTH },
|
|
842
844
|
body: form
|
|
843
845
|
});
|
|
844
|
-
|
|
846
|
+
// 러너/프록시가 에러를 낼 때는 JSON 이 아닐 수 있다(502 HTML 등) — 본문을 그대로 보여준다
|
|
847
|
+
const text = await response.text();
|
|
848
|
+
let raw;
|
|
849
|
+
try {
|
|
850
|
+
raw = JSON.parse(text);
|
|
851
|
+
}
|
|
852
|
+
catch (_a) {
|
|
853
|
+
throw new Error(`AI 엔진 응답 오류 (HTTP ${response.status}) ${text.slice(0, 200)}`);
|
|
854
|
+
}
|
|
845
855
|
const data = (raw === null || raw === void 0 ? void 0 : raw.result) || {};
|
|
846
856
|
if ((data === null || data === void 0 ? void 0 : data.status) !== 'success') {
|
|
847
|
-
|
|
857
|
+
// raw.detail: 러너가 요청을 거부한 사유(예: 파일/필드 크기 초과)
|
|
858
|
+
// raw.stderr: 모듈이 죽은 경우의 파이썬 트레이스백 — 원인이 여기 있다
|
|
859
|
+
const stderr = ((raw === null || raw === void 0 ? void 0 : raw.stderr) || '').trim().split('\n').slice(-3).join(' ');
|
|
860
|
+
throw new Error((data === null || data === void 0 ? void 0 : data.error) ||
|
|
861
|
+
(raw === null || raw === void 0 ? void 0 : raw.error) ||
|
|
862
|
+
(raw === null || raw === void 0 ? void 0 : raw.detail) ||
|
|
863
|
+
stderr ||
|
|
864
|
+
`AI 엔진 호출에 실패했습니다. (HTTP ${response.status})`);
|
|
848
865
|
}
|
|
849
866
|
return data.result;
|
|
850
867
|
}
|
|
@@ -1462,14 +1479,19 @@ let BuildingInspectionAiMeasurement = class BuildingInspectionAiMeasurement exte
|
|
|
1462
1479
|
try {
|
|
1463
1480
|
this.loading = true;
|
|
1464
1481
|
this.loadingText = '판정 확정 중...';
|
|
1465
|
-
//
|
|
1482
|
+
// 측정값·판정 근거는 그대로 전달한다 — 품질 게이트/hold 승격은 엔진이 처리한다.
|
|
1483
|
+
// 다만 근거 이미지(base64)는 빼고 보낸다: 엔진은 이 값을 판정에 쓰지 않고 그대로
|
|
1484
|
+
// 되돌려줄 뿐인데(engine.apply_measurement), 러너의 multipart 단일 필드 한도가
|
|
1485
|
+
// 1MB 라서 실어 보내면 400 "Part exceeded maximum size of 1024KB" 가 난다.
|
|
1486
|
+
// 화면 표시·첨부에 쓰는 값이므로 판정 결과에 다시 붙여 준다.
|
|
1487
|
+
const _b = this.measureResult, { image_data, image, map_png, overlay_b64, result_image } = _b, slimResult = __rest(_b, ["image_data", "image", "map_png", "overlay_b64", "result_image"]);
|
|
1466
1488
|
const result = await this._callEngine({
|
|
1467
1489
|
action: 'apply-measurement',
|
|
1468
1490
|
item: { item_id: item.item_id, text: item.text, category: item.category },
|
|
1469
1491
|
model_id: ((_a = item.measure) === null || _a === void 0 ? void 0 : _a.model_id) || this.measureResult.model_id,
|
|
1470
|
-
result:
|
|
1492
|
+
result: slimResult
|
|
1471
1493
|
});
|
|
1472
|
-
const judged = Object.assign(Object.assign({}, item), result.item);
|
|
1494
|
+
const judged = Object.assign(Object.assign(Object.assign({}, item), result.item), (image_data ? { image_data } : {}));
|
|
1473
1495
|
this._mergeItems([judged]);
|
|
1474
1496
|
// 확정 즉시 체크리스트에 기록한다. 「검사 등록」까지 미루면 그 사이에 화면을 벗어나거나
|
|
1475
1497
|
// 재판정이 일어났을 때 측정 판정만 유실된다 (VLM 항목은 inspect 결과에 남아 있어 티가 안 남).
|