PM updates, still need Battery to show up on periph screen and calibration/recalib stuff to work, but it should tomorrow
This commit is contained in:
@@ -145,6 +145,35 @@ class _PeripheralScreenState extends State<PeripheralScreen> {
|
||||
));
|
||||
});
|
||||
|
||||
// Server emits this when the device reports its own calibration state.
|
||||
// When calibrated=false, reset all calibration UI state so the
|
||||
// pre-calibration screen is shown and the user can tap Calibrate.
|
||||
socket?.on("calib_status_changed", (data) {
|
||||
if (data is Map<String, dynamic>) {
|
||||
if (data['periphID'] == widget.peripheralId) {
|
||||
if (!mounted) return;
|
||||
if (data['calibrated'] == false) {
|
||||
setState(() {
|
||||
calibrated = false;
|
||||
calibrating = false;
|
||||
calibrationStage = 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
socket?.on("device_pos_report", (data) {
|
||||
if (data is Map<String, dynamic>) {
|
||||
if (data['periphID'] == widget.peripheralId) {
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_blindPosition = (data['pos'] as int).toDouble();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
socket?.on("calib", (periphData) {
|
||||
if (periphData is Map<String, dynamic>) {
|
||||
if (periphData['periphID'] == widget.peripheralId) {
|
||||
|
||||
Reference in New Issue
Block a user