fix(bv): auto scan IMU 회귀 복구 — sendChannelsOnly (maa) → sendMtb

증상:
도넛차트 페이지에서 auto scan 실행 시 posture chip 이 갱신 안 됨.
Line 843 주석 "Auto Scan 자체는 mtb 응답에 IMU 가 들어있어 자동으로
posture 갱신됨" + line 845 조건 `if (!isAutoMeasuring)` 로 auto 중
mim 폴링 skip — 즉 코드는 mtb 를 쓴다는 전제로 짜여 있음.

그러나 실제 measure() 는 `bleManager.sendChannelsOnly()` (=maa) 를
호출. maa 응답은 6ch piezo 만 (rim 없음) → imuCollector 는 채워지지
않음 → posture 완전 실종. 명백한 회귀.

수정:
sendChannelsOnly (maa) → sendMtb (mtb). mtb 응답 = reb×6 + raa + rim
이라 piezoCollector + imuCollector 둘 다 자동 처리. 기존 mim polling
skip 로직 그대로 유효 (auto 중에는 mtb 로 IMU 옴).

동일 로직: PlacementGuideView / ClinicalLiveView 는 이미 sendMtb 사용.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-07-07 16:48:05 +09:00
parent bece7ea285
commit 0ab273e750
@@ -643,7 +643,11 @@ fun PiezoMonitoringView(appState: AppState) {
}
bleManager.piezoCollector.onLog = { msg -> Log.d("PiezoCollector", msg) }
if (!bleManager.sendChannelsOnly()) {
// 2026-07-07 fix: sendChannelsOnly (maa, 6ch only) → sendMtb (6ch + IMU).
// Auto scan 중 IMU 완전 실종 (line 843 주석 "mtb 응답에 IMU" 는 정확하지만
// 실제 코드는 maa 였음 → 회귀 버그). mtb 는 응답에 rim: (IMU 15 sample) 포함,
// imuCollector.onComplete 로 posture 자동 갱신.
if (!bleManager.sendMtb()) {
// Throttle됨 — isMeasuring 리셋 (deadlock 방지)
isMeasuring = false
try { measureDoneSignal.value.complete(Unit) } catch (_: Exception) {}
@@ -657,7 +661,7 @@ fun PiezoMonitoringView(appState: AppState) {
measureRetryCount++
Log.w("PiezoMonitor", "Timeout — auto-retry $measureRetryCount/$maxMeasureRetries")
bleManager.piezoCollector.reset()
bleManager.sendChannelsOnly()
bleManager.sendMtb()
// Second timeout for retry
handler.postDelayed({
if (!isMeasuring) return@postDelayed