fix: Auto Stop 최종 trimmedMean 반영 + Placement 채널소실 멘트
- Auto Stop 시 윈도우 전체 trimmed mean 계산 후 표시 - LATERAL/GREEN 중 center 채널 소실 → "Start over from above the pubic bone" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+11
@@ -379,6 +379,17 @@ fun PiezoMonitoringView(appState: AppState) {
|
|||||||
fun stopAutoMeasure() {
|
fun stopAutoMeasure() {
|
||||||
isAutoMeasuring = false
|
isAutoMeasuring = false
|
||||||
autoTickCount = 0
|
autoTickCount = 0
|
||||||
|
// 종료 시 최종 trimmed mean 반영
|
||||||
|
if (autoVolumeWindow.size >= 3) {
|
||||||
|
val finalVol = trimmedMean(autoVolumeWindow.toList())
|
||||||
|
lastVolumeMl = finalVol
|
||||||
|
maxVolumeMl = maxOf(maxVolumeMl, finalVol)
|
||||||
|
val maxVol = appState.piezoSettings.maxVolume.toDouble()
|
||||||
|
val pct = if (maxVol > 0) (finalVol / maxVol).coerceAtMost(1.0) else 0.0
|
||||||
|
val level = (pct * BladderLevel.MAX_LEVEL).toInt().coerceIn(1, BladderLevel.MAX_LEVEL)
|
||||||
|
appState.bladderLevel = appState.bladderLevel.copy(currentLevel = level)
|
||||||
|
Log.d("PiezoMonitor", "AUTO STOP finalTrimmedMean=${"%.1f".format(finalVol)}ml from ${autoVolumeWindow.size} samples")
|
||||||
|
}
|
||||||
autoVolumeWindow.clear()
|
autoVolumeWindow.clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1286,9 +1286,9 @@ private fun computePlacementGuide(
|
|||||||
val ch4det = detected.getOrElse(4) { false }
|
val ch4det = detected.getOrElse(4) { false }
|
||||||
val ch5det = detected.getOrElse(5) { false }
|
val ch5det = detected.getOrElse(5) { false }
|
||||||
|
|
||||||
// 상하 유지 확인 — gradient 재계산
|
// 상하 유지 확인 — 좌우 이동 중 center 채널 소실
|
||||||
if (centerDetected < 2) {
|
if (centerDetected < 2) {
|
||||||
return PlacementGuideResult("Readjust vertically", "arrow.up", 20,
|
return PlacementGuideResult("Start over from above the pubic bone", "arrow.up", 10,
|
||||||
phase = PlacementPhase.LATERAL, nextPhase = PlacementPhase.VERTICAL)
|
phase = PlacementPhase.LATERAL, nextPhase = PlacementPhase.VERTICAL)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1375,7 +1375,7 @@ private fun computePlacementGuide(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (depths.size < 2) {
|
if (depths.size < 2) {
|
||||||
return PlacementGuideResult("Readjust position", "exclamationmark.triangle", 30,
|
return PlacementGuideResult("Start over from above the pubic bone", "arrow.up", 10,
|
||||||
phase = PlacementPhase.GREEN, nextPhase = PlacementPhase.VERTICAL)
|
phase = PlacementPhase.GREEN, nextPhase = PlacementPhase.VERTICAL)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user