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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user