feat: add demo mode for testing without BLE device

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>
This commit is contained in:
2026-03-25 10:16:59 +09:00
parent 99c58382b4
commit 9feaae1939
4 changed files with 89 additions and 10 deletions
@@ -22,6 +22,7 @@ class AppState(private val context: Context) {
var sensorMode by mutableStateOf(SensorMode.PIEZO)
var bladderLevel by mutableStateOf(BladderLevel())
var isDeviceConnected by mutableStateOf(false)
var isDemoMode by mutableStateOf(false)
var piezoSettings by mutableStateOf(PiezoSettings())
var catheterCount = mutableIntStateOf(0)
@@ -66,11 +67,22 @@ class AppState(private val context: Context) {
fun goHome() {
NirsManager.instance.stopStreaming()
NirsManager.instance.reset()
bleManager.disconnect()
if (!isDemoMode) bleManager.disconnect()
isDeviceConnected = false
isDemoMode = false
currentScreen = AppScreen.HOME
}
fun enterDemoMode() {
isDemoMode = true
isDeviceConnected = true
currentScreen = if (sensorMode == SensorMode.NIRS) {
AppScreen.VIVAMYO_MONITORING
} else {
AppScreen.PIEZO_MONITORING
}
}
fun startFromHome() {
currentScreen = AppScreen.SENSOR_SELECT
}