feat(posture): Poll Interval 슬라이더 + default 10s → 3s
증상: 자세 갱신이 10초마다라 너무 느림. 빠르게 테스트하고 싶음.
수정:
1) GreenZoneConstants.posturePollIntervalMs (default 3000ms) 신규
- polling loop 의 delay(10000) → delay(GreenZoneConstants.posturePollIntervalMs)
- 슬라이더 변경 즉시 다음 iteration 부터 적용
2) PiezoMonitoring dev settings: Poll Interval 슬라이더 추가
- 위치: Lying Duration 슬라이더 바로 아래
- 범위: 1초 ~ 15초 (연속)
- 표시: "X.X초"
- 변경 시 GreenZoneConstants 에 즉시 반영
default 변경: 10초 → 3초.
- mtb 한 cycle ≈ 400ms, 3초 polling = device 활동 ≈ 13% (가벼움)
- 1초까지 줄여도 캐싱/throttle 충돌 거의 없음 (canSendMaa 500ms gate)
BLE 부담 vs 응답성 trade-off:
| interval | 1시간 device 사용 | 자세 변화 최대 지연 |
| 1초 | ~24분 (40%) | ~1초 |
| 3초 | ~8분 (13%) | ~3초 |
| 5초 | ~5분 (8%) | ~5초 |
| 10초 | ~2.5분 (4%) | ~10초 |
낙상 예방엔 1-3초가 적정. 평상시 사용엔 5-10초.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -31,6 +31,9 @@ object GreenZoneConstants {
|
||||
/** Posture pitch 임계값 (deg). |pitch| > 이 값 → LYING, ≤ 이 값 → NON_LYING. dev 모드에서 조정 가능. */
|
||||
@Volatile var pitchLyingThreshold: Float = 25f
|
||||
|
||||
/** Posture polling 간격 (ms). PiezoMonitoring 에서 mtb 보내는 주기. dev 모드에서 조정 가능. */
|
||||
@Volatile var posturePollIntervalMs: Long = 3000L
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// 신호 범위
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
Reference in New Issue
Block a user