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 dfee1e8..b1e47dc 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 @@ -256,8 +256,11 @@ fun PlacementGuideView(appState: AppState) { ) { Text("Echo Waveforms", fontSize = 13.sp, fontWeight = FontWeight.Bold, color = MlPrimary) for (chData in lastChannelData.filter { it.buffer.isNotEmpty() }) { - val chAnalysis = analyzer.analyzeChannel(chData.buffer, chData.channel) val detected = if (chData.channel < channelDetected.size) channelDetected[chData.channel] else false + val showWalls = if (detected) { + val chAnalysis = analyzer.analyzeChannel(chData.buffer, chData.channel) + chAnalysis.result + } else null Column(verticalArrangement = Arrangement.spacedBy(2.dp)) { Row(verticalAlignment = Alignment.CenterVertically) { Box( @@ -266,11 +269,10 @@ fun PlacementGuideView(appState: AppState) { ) Spacer(modifier = Modifier.width(4.dp)) Text("CH${chData.channel}", fontSize = 11.sp, fontWeight = FontWeight.Bold) - if (chAnalysis.result != null) { - val r = chAnalysis.result + if (showWalls != null) { Spacer(modifier = Modifier.width(6.dp)) Text( - "${"%.0f".format(r.antDepthMm)}–${"%.0f".format(r.postDepthMm)}mm", + "${"%.0f".format(showWalls.antDepthMm)}–${"%.0f".format(showWalls.postDepthMm)}mm", fontSize = 9.sp, color = Color.Cyan ) } @@ -279,8 +281,8 @@ fun PlacementGuideView(appState: AppState) { buffer = chData.buffer, peakIndex = chData.peakIndex.toInt(), analyzer = analyzer, - antIndex = chAnalysis.result?.ant, - postIndex = chAnalysis.result?.post, + antIndex = showWalls?.ant, + postIndex = showWalls?.post, modifier = Modifier.fillMaxWidth().height(80.dp) ) } @@ -307,7 +309,7 @@ fun PlacementGuideView(appState: AppState) { val urineLens = MutableList(6) { 0 } val allWalls: MutableList?> = MutableList(6) { null } - val MIN_URINE_LEN_PLACEMENT = 10 // Placement에서는 최소 10칸 이상이어야 유효 + val MIN_URINE_LEN_PLACEMENT = 12 for (ch in channels) { if (ch.buffer.isNotEmpty() && ch.channel < 6) {