- center 채널 3개 미만이면 BV 계산 스킵 (신뢰도 부족 방지)
- 1~2채널: "측정 부족 (N/4채널) — 센서 위치를 조절해주세요"
- 0채널: "방광이 감지되지 않았습니다. 센서 접촉을 확인해주세요."
- BleDebugLogger에 BV_SKIP/BV_FAIL 기록
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- 수동 1회 → 자동 반복 스캔 (Start/Stop 토글)
- 3초마다 maa 전송 → Score 실시간 갱신
- 사용자가 센서 움직이면서 점수 변화를 즉시 확인 가능
- "Scanning every 3s — move sensor and watch the score" 안내 문구
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- BleManager: 배터리 폴링 30초→5초 (펌웨어 15초 타임아웃 방지, iOS 동일)
- BleManager: 자동 reconnect with 백오프 (3s→5s→10s, 최대 5회)
- scheduleAutoReconnect() + attemptAutoReconnect()
- GATT 에러 시에도 백오프 재시도
- 수동 disconnect 시 자동 reconnect 취소
- PiezoMonitoringView: 끊김 시 즉시 파란 배너(RECONNECTING)
- 성공 시 배너 자동 숨김 + 배터리 폴링 재시작
- 5회 실패 시 빨간 배너 + 수동 Reconnect 버튼
- 측정 중 끊김 → isMeasuring 리셋 + 자동측정 중지
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CRITICAL: In multi-channel mode, "ree:" packets between channels
were silently dropped instead of saving the current channel data.
This caused channel data loss when channels are separated by "ree:".
Fixed: Added missing isMultiChannel + ree: branch that calls
saveCurrentChannel() — matching Swift behavior exactly.
Found via line-by-line Swift vs Kotlin verification.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GreenZoneConstants.kt — all 16 constants (thresholds, physical)
UrinAI.kt — urine gatekeeper (binary threshold detection)
PiezoEchoAnalyzer.kt — low-echo detection with prominence-based wall selection
PiezoBVEstimator.kt — Frustum BV estimation with device presets
1:1 port from Swift, same logic, same constants.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace hardcoded Korean UI strings in Piezo, CatheterizeSheet,
VoidingDiary, and UrineCameraScreen with stringResource() calls.
Add values/strings.xml (English) and values-ko/strings.xml (Korean).
System language setting now controls app language.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
A. Reminder: ReminderService (AlarmManager chain), ReminderSettingsView,
bell icon in Piezo top bar, reschedule on catheterization
B. Consent: ConsentView (3 mandatory items), onboarding→consent→registration flow,
persistent consent storage, sex field in User + Registration Step 2
C. Diary: 24hUV, NUV, NPI, max capacity, day/night frequency metrics card
D. Design: DesignTokens.kt, 48dp touch targets, DonutChart semantics, pressScale modifier
E. Quality: BuildConfig.DEBUG log wrapping, DateFormatter caching, background I/O for diary store
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Camera was hidden behind PiezoMonitoringView because it was rendered
as a child composable. Now uses AppScreen.URINE_CAMERA for full
Crossfade navigation — camera gets its own screen transition.
Flow: Catheterize → 카메라 → AppScreen.URINE_CAMERA → measure → back to PIEZO_MONITORING
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace ModalBottomSheet-based flow with AlertDialog:
- Catheterize → AlertDialog with 3 buttons (수기/음성/카메라)
- 수기: AlertDialog with number TextField + save
- 음성: AlertDialog with auto-start SpeechRecognizer + auto-save
- 카메라: showUrineCamera directly
VoidingDiaryView: sort date groups descending (newest first)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CatheterizeSheet:
- Replace OutlinedButton with filled Button for tab selection
- Selected tab: filled color, unselected: 10% opacity background
- Tabs now reliably switch between 수기/음성/카메라
- Camera tab directly calls onCameraRequested + onDismiss
PiezoMonitoringView:
- Fix camera launch: use pendingCamera + LaunchedEffect
to ensure ModalBottomSheet fully closes before camera opens
- Prevents state race condition between sheet dismiss and camera show
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
VoidingDiaryView:
- Date-grouped record list (grouped by day)
- Shows volume/awake/sleep with icons and colors
- Method badge (수기/음성/카메라)
- Delete with confirmation dialog
- Total record count footer
Navigation changes:
- Piezo screen: ArrowBack → Home icon (집 아이콘)
- Piezo screen: 배뇨일지 icon (Description) added next to home
- NIRS screen: ArrowBack → Home icon
- AppScreen.VOIDING_DIARY route added to Crossfade navigation
- VoidingDiaryView navigates back to HOME
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
UrineCameraScreen:
- YOLO real-time cup detection with green border indicator
- Auto-capture: 2s continuous detection (≥90%) triggers shutter
- Manual shutter button fallback
- V2 SimpleMeasureService analysis (OCR + 3-zone gradient)
- Auto-analyze after capture
- Result display with volume (ml)
- Save to local VoidingRecordStore + toast confirmation
- Retake option on failure
- Brightness guide text
PiezoMonitoringView:
- Camera tab in CatheterizeSheet now opens UrineCameraScreen
- Full-screen overlay for camera (doesn't leave Piezo screen)
- Auto bladder reset on successful measurement
Complete Catheterize flow:
Catheterize → [수기/음성/카메라] → 입력 → "등록되었습니다" → 레벨 리셋
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Catheterize button now opens a voiding record sheet with 3 input modes:
- Manual: number TextField (1-1000ml)
- Voice: SpeechRecognizer + VolumeParser (Korean/English)
- Camera: placeholder for YOLO cup measurement (TODO)
On save: "배뇨일지에 등록되었습니다" toast, bladder level resets to 0
New modules (from Uridiary):
- measure/: SimpleMeasureService, YoloDetector, CCPosition, VoidingRecord
- speech/: SpeechRecognizerManager, VolumeParser, HfVolumeExtractor
- assets/urinecup_best.onnx: YOLO model for cup detection
VoidingRecordStore: local SharedPreferences+JSON storage for voiding records
Dependencies added: ONNX Runtime, ML Kit OCR, CameraX, OkHttp
Permissions added: CAMERA, RECORD_AUDIO, INTERNET
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Force light theme only, block Samsung Force Dark Mode via forceDarkAllowed=false,
and add explicit text colors to prevent invisible text on light backgrounds.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reduce padding, icon sizes, and chart dimensions on narrow screens.
Hide title text and battery % in compact mode to prevent top bar
overflow. Scale donut chart 240→180dp and SpO2 text 56→40sp.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add "Demo Mode" button in device scan screen that bypasses BLE
connection and calibration. NIRS monitoring generates simulated
random data at 4Hz. Both monitoring views show DEMO badge in top bar.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Y-axis shows data range with 5 tick labels, X-axis shows elapsed time
in seconds, horizontal grid lines for readability.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Clear mcj callback immediately on stop to prevent stale responses from
triggering new polling chains. Delay battery polling resume by 500ms to
avoid command collision with in-flight mcj response. Add sendNirsPowerOff
for future use.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix BLE API deprecation warnings with API 33+ version checks
- Move isServiceReady to onDescriptorWrite for reliable CCCD setup
- Fix battery polling: immediate query on connect, pause during NIRS streaming
- Add mcj retry mechanism for NIRS streaming reliability
- Add debug logging to BLE, NIRS parsing, and processing pipeline
- Add catheter count feature to Piezo monitoring (persistent count, add dialog, auto-decrement on catheterize)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Port of MedilightV2 iOS app to Android with Kotlin + Jetpack Compose.
Includes BLE connectivity, NIRS/Piezo sensor modes, Rive animations,
interactive measurement history charts, and foldable device support.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>