fix: Placement 그래프를 선택된 Method 결과로 통일
- 그래프 벽 표시: analyzer.analyzeChannel(B 고정) → lastWallResults(선택 Method) - lastWallResults state 추가: 콜백에서 allWalls 저장 → 그래프에서 참조 - Method C 선택 시에도 V41Detector의 ant/post가 그래프에 정확히 표시 - dot 색상 + 그래프 벽 + depth mm 모두 동일 Method 결과 사용 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+13
-2
@@ -68,6 +68,7 @@ fun PlacementGuideView(appState: AppState) {
|
||||
var scanCount by remember { mutableIntStateOf(0) }
|
||||
var isLocked by remember { mutableStateOf(false) }
|
||||
var lastChannelData by remember { mutableStateOf<List<PiezoChannelData>>(emptyList()) }
|
||||
var lastWallResults by remember { mutableStateOf<List<Pair<Int, Int>?>>(List(6) { null }) }
|
||||
var debounceCount by remember { mutableIntStateOf(0) }
|
||||
var lastGuidePhase by remember { mutableStateOf(PlacementPhase.VERTICAL) }
|
||||
var lastHintChangeMs by remember { mutableStateOf(0L) }
|
||||
@@ -374,11 +375,20 @@ fun PlacementGuideView(appState: AppState) {
|
||||
verticalArrangement = Arrangement.spacedBy(6.dp)
|
||||
) {
|
||||
Text("Echo Waveforms", fontSize = 13.sp, fontWeight = FontWeight.Bold, color = MlPrimary)
|
||||
val graphMethod = com.example.medilightv2android.managers.GreenZoneConstants.detectionMethod
|
||||
val graphAnalyzerA = com.example.medilightv2android.managers.PiezoEchoAnalyzerA.shared
|
||||
for (ch in 0 until 6) {
|
||||
val chData = lastChannelData.find { it.channel == ch }
|
||||
val detected = if (ch < channelDetected.size) channelDetected[ch] else false
|
||||
val showWalls = if (chData != null && chData.buffer.isNotEmpty()) {
|
||||
analyzer.analyzeChannel(chData.buffer, ch).result
|
||||
// 그래프 벽 표시: lastWallResults에서 가져옴 (선택된 Method 결과와 동일)
|
||||
val wallPair = if (ch < lastWallResults.size) lastWallResults[ch] else null
|
||||
val showWalls = if (wallPair != null) {
|
||||
com.example.medilightv2android.managers.LowEchoResult(
|
||||
ant = wallPair.first, post = wallPair.second,
|
||||
lowStart = wallPair.first, lowEnd = wallPair.second,
|
||||
lowMean = 0.0, urineLen = wallPair.second - wallPair.first,
|
||||
score = 0.0, innerPeaks = emptyList()
|
||||
)
|
||||
} else null
|
||||
Column(verticalArrangement = Arrangement.spacedBy(2.dp)) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
@@ -499,6 +509,7 @@ fun PlacementGuideView(appState: AppState) {
|
||||
channelUrineLen[i] = urineLens[i]
|
||||
}
|
||||
lastChannelData = channels
|
||||
lastWallResults = allWalls.toList()
|
||||
|
||||
// Detachment check (미부착 감지)
|
||||
val buffers = channels.sortedBy { it.channel }.map { it.buffer }
|
||||
|
||||
Reference in New Issue
Block a user