diff --git a/app/src/main/java/com/example/medilightv2android/ui/views/monitoring/PlacementGuideView.kt b/app/src/main/java/com/example/medilightv2android/ui/views/monitoring/PlacementGuideView.kt index 3eb604f..139abad 100644 --- a/app/src/main/java/com/example/medilightv2android/ui/views/monitoring/PlacementGuideView.kt +++ b/app/src/main/java/com/example/medilightv2android/ui/views/monitoring/PlacementGuideView.kt @@ -1812,6 +1812,7 @@ private fun computePlacementGuide( val centerCh = hw.centerCh val depths = mutableListOf() + val missingCenters = mutableListOf() for (localIdx in centerCh.indices) { val ch = centerCh[localIdx] val w = if (ch < walls.size) walls[ch] else null @@ -1819,12 +1820,28 @@ private fun computePlacementGuide( val rawDepth = (offset + w.second * dps) - (offset + w.first * dps) val theta = degAll[ch] * Math.PI / 180.0 val corrected = rawDepth * kotlin.math.cos(theta) - if (corrected > 0) depths.add(corrected) + if (corrected > 0) depths.add(corrected) else missingCenters.add(ch) + } else { + missingCenters.add(ch) } } - if (depths.size < 2) { - return PlacementGuideResult("Start over from above the pubic bone", "arrow.up", 10, + // 측정 단계 BV 게이트와 정렬 (effectiveCenterWalls >= 4) — 4개 center 모두 + // 잡혀야만 GREEN 통과. 정렬 OK 직후 측정 시 ch3 missing 으로 BV SKIP 되던 케이스 차단. + if (depths.size < 4) { + val pubicMissing = 3 in missingCenters // ch3 = 치골 쪽 (bottom of sensor) + val navelMissing = 0 in missingCenters // ch0 = 배꼽 쪽 (top of sensor) + val (hint, icon) = when { + missingCenters.size >= 2 -> + Pair("Adjust position — multiple channels missing", "arrow.up") + pubicMissing -> + Pair("Slide up slightly ↑ (ch3 missing)", "arrow.up") + navelMissing -> + Pair("Slide down slightly ↓ (ch0 missing)", "arrow.down") + else -> + Pair("Adjust position slightly — center channel missing", "arrow.up") + } + return PlacementGuideResult(hint, icon, 30, phase = PlacementPhase.GREEN, nextPhase = PlacementPhase.VERTICAL) }