fix: 분석 백그라운드 Thread, 그래프 빈칸 표시, CSV 세션별 분리

성능:
- 측정 콜백 분석(TGC/Otsu/BV)을 백그라운드 Thread로 이동
- UI 업데이트만 handler.post로 메인 스레드 복귀
- 메인 스레드 블로킹으로 인한 BLE 패킷 드롭 방지
- 분석 소요시간 로그 출력 (Analysis took Xms)
- Toast도 handler.post로 감싸서 Thread-safe

Placement:
- 6채널 그래프: 데이터 없는 채널도 "No data" 빈 칸 표시 (항상 6칸)

CSV:
- 일별 파일 → 세션별 파일 (YYYY-MM-DD_HHmmss.csv)
- BLE 연결 시 자동 newSession()

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-30 10:04:03 +09:00
parent 297d67b4d7
commit 1a42fe6a07
4 changed files with 82 additions and 66 deletions
@@ -789,6 +789,7 @@ class BleManager private constructor(private val context: Context) {
if (status == BluetoothGatt.GATT_SUCCESS) {
if (txCharacteristic != null && rxCharacteristic != null) {
isServiceReady.value = true
com.example.medilightv2android.services.AdcCsvLogger.newSession()
startBatteryPolling()
startWatchdog()
sendDeviceInfoQuery()