mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-28 12:56:32 -08:00
Keep SetStatus separate for debug
This commit is contained in:
1 parent
e4014679e0
commit
01362ca2de
2 files changed
+12
-5
No files matched your search
@@ -109,7 +109,8 @@ class HIDDeviceInfoBehaviour : HIDReceiverBehaviour {
|
||||
}
|
||||
receiver.context.dispatch(HIDReceiverActions.TrackerRegistered(packet.hidId, tracker.context.state.value.id))
|
||||
// HID does not have a rest calibration signal
|
||||
tracker.context.dispatch(TrackerActions.Update { copy(sensorType = packet.imuType, completedRestCalibration = true, magStatus = packet.magStatus, status = TrackerStatus.OK) })
|
||||
tracker.context.dispatch(TrackerActions.Update { copy(sensorType = packet.imuType, completedRestCalibration = true, magStatus = packet.magStatus) })
|
||||
tracker.context.dispatch(TrackerActions.SetStatus(TrackerStatus.OK))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,15 +334,21 @@ class SensorInfoBehaviour : UDPConnectionBehaviour {
|
||||
|
||||
val existingTracker = receiver.getTracker(event.data.sensorId)
|
||||
if (existingTracker != null) {
|
||||
existingTracker.context.dispatch(
|
||||
TrackerActions.Update { copy(sensorType = event.data.imuType, completedRestCalibration = event.data.hasCompletedRestCalibration, status = event.data.status) },
|
||||
existingTracker.context.dispatchAll(
|
||||
listOf(
|
||||
TrackerActions.Update { copy(sensorType = event.data.imuType, completedRestCalibration = event.data.hasCompletedRestCalibration) },
|
||||
TrackerActions.SetStatus(event.data.status),
|
||||
),
|
||||
)
|
||||
return@onPacket
|
||||
}
|
||||
|
||||
val (tracker, isNew) = assignTracker(receiver, device, event)
|
||||
tracker.context.dispatch(
|
||||
TrackerActions.Update { copy(sensorType = event.data.imuType, completedRestCalibration = event.data.hasCompletedRestCalibration, status = event.data.status) },
|
||||
tracker.context.dispatchAll(
|
||||
listOf(
|
||||
TrackerActions.Update { copy(sensorType = event.data.imuType, completedRestCalibration = event.data.hasCompletedRestCalibration) },
|
||||
TrackerActions.SetStatus(event.data.status),
|
||||
),
|
||||
)
|
||||
if (isNew && tracker.context.state.value.magStatus == MagnetometerStatus.NOT_SUPPORTED) {
|
||||
tracker.context.dispatch(
|
||||
|
||||
Reference in new issue
Block a user