USB 摄像头适配iPadOS17+

This commit is contained in:
2026-10-22 12:53:24 +08:00
parent 582242e9aa
commit 58a23ef218
18 changed files with 288 additions and 140 deletions

View File

@@ -44,6 +44,8 @@ class RunningStatusEntity extends Equatable {
// === 主机实时话题(device/{sn}/host/realTime/message)扩展字段(新增,纯附加) ===
final double totalWorkDistance; // host 累计作业里程(供"巡检里程"展示)
final double linearSpeed; // host 实时线速度 m/s(前进为正,后退为负)
final double angularSpeed; // host 实时角速度 rad/s(左转为正,右转为负)
final bool hostDataReceived; // 是否已收到 host 实时数据(未收到时 UI 显示"未知")
const RunningStatusEntity({
@@ -72,6 +74,8 @@ class RunningStatusEntity extends Equatable {
this.workingArea = '0',
this.obstacleFlag = '0',
this.totalWorkDistance = 0.0,
this.linearSpeed = 0.0,
this.angularSpeed = 0.0,
this.hostDataReceived = false,
});
@@ -173,6 +177,8 @@ class RunningStatusEntity extends Equatable {
String? workingArea,
String? obstacleFlag,
double? totalWorkDistance,
double? linearSpeed,
double? angularSpeed,
bool? hostDataReceived,
}) {
return RunningStatusEntity(
@@ -201,6 +207,8 @@ class RunningStatusEntity extends Equatable {
workingArea: workingArea ?? this.workingArea,
obstacleFlag: obstacleFlag ?? this.obstacleFlag,
totalWorkDistance: totalWorkDistance ?? this.totalWorkDistance,
linearSpeed: linearSpeed ?? this.linearSpeed,
angularSpeed: angularSpeed ?? this.angularSpeed,
hostDataReceived: hostDataReceived ?? this.hostDataReceived,
);
}
@@ -232,6 +240,8 @@ class RunningStatusEntity extends Equatable {
workingArea,
obstacleFlag,
totalWorkDistance,
linearSpeed,
angularSpeed,
hostDataReceived,
];

View File

@@ -327,6 +327,9 @@ class DeviceStatusBloc extends Bloc<DeviceStatusEvent, DeviceStatusState> {
workingArea: host.totalWorkArea.toString(),
// 🔥 供全功能模式(pv_control)展示:累计作业里程 + host 已推数据标记
totalWorkDistance: host.totalWorkDistance,
// 🔥 车体实测线速度/角速度(后端新增 linear_speed / angular_speed)
linearSpeed: host.linearSpeed,
angularSpeed: host.angularSpeed,
hostDataReceived: true,
);
@@ -334,7 +337,7 @@ class DeviceStatusBloc extends Bloc<DeviceStatusEvent, DeviceStatusState> {
_cachedGps ??= GPSEntity(_cachedStatus!.latitude, _cachedStatus!.longitude);
debugPrint(
'${LogTime.now()} 🛰️ [MQTT-主机实时] 已合并 → 电量=${host.batteryPercentage}% 电压=${host.batteryVoltage}V 控制模式=${host.controlMode}',
'${LogTime.now()} 🛰️ [MQTT-主机实时] 已合并 → 电量=${host.batteryPercentage}% 电压=${host.batteryVoltage}V 控制模式=${host.controlMode} 线速度=${host.linearSpeed}m/s 角速度=${host.angularSpeed}rad/s',
);
// 500ms 节流:与 location/车辆实时 发射链路一致