完善机巢任务实时同步并开放双构建真实操作

订阅明确无缓存时使用新发起的有效 HTTP 全量响应衔接首包,保留任务、批次和版本校验。
移除 Debug/Release 的设备指令、图传和 RTC 构建拦截,保留后端权限、身份、防重复提交及结果未知保护。
更新开发约定并补充隔离传输、飞控状态和页面回归测试。

验证:iPhone 真机 500 项相关测试通过;iOS Release 无签名编译通过。
This commit is contained in:
2026-11-05 10:59:26 +08:00
parent 477bf611e6
commit 34ee60b8b2
46 changed files with 914 additions and 461 deletions
@@ -49,10 +49,10 @@ final class DroneDockLiveViewModel {
self.allowsDevicePlayback = allowsDevicePlayback
self.now = now
self.currentContext = currentContext
state = service == nil ? .restricted : .idle
state = service == nil ? .unavailable("当前页面未配置图传服务") : .idle
}
/// 仅有明确注入服务且身份有效时允许发起请求;正式禁飞入口始终为 false。
/// 有明确注入服务且身份有效时允许发起请求。
var canLoad: Bool { service != nil && !isLoading && !identityInvalidated && context.canLoad && taskID > 0 }
/// 仅返回明确注入且已经过本地文件检查的模拟视频,不使用后端未定义字段。
@@ -64,7 +64,6 @@ final class DroneDockLiveViewModel {
/// 图传区域主文案,不把接口受理视为设备连接成功。
var title: String {
switch state {
case .restricted: return "当前调试已停用实时图传"
case .idle: return "实时图传"
case .loading: return "正在获取图传信息"
case .unavailable: return "图传暂不可用"
@@ -78,7 +77,6 @@ final class DroneDockLiveViewModel {
/// 缺失协议时说明真实限制,不给示例视频贴上实时来源。
var message: String {
switch state {
case .restricted: return "禁飞调试期间不启动设备图传"
case .idle: return allowsDevicePlayback ? "正在准备连接图传" : "按当前任务获取图传信息"
case .loading: return "请稍候"
case .unavailable(let reason), .failed(let reason): return reason
@@ -93,7 +91,6 @@ final class DroneDockLiveViewModel {
guard service != nil else { return nil }
if isLoading { return allowsDevicePlayback ? nil : "正在加载…" }
switch state {
case .restricted: return nil
case .idle: return nil
case .loading: return allowsDevicePlayback ? nil : "正在加载…"
case .failed, .unavailable: return "重试"
@@ -194,7 +191,7 @@ final class DroneDockLiveViewModel {
isLoading = false
response = nil
clearPlayback()
state = service == nil ? .restricted : .idle
state = service == nil ? .unavailable("当前页面未配置图传服务") : .idle
}
/// 只接受当前播放器会话的事件;首帧之前不显示已连接,旧回调不能恢复画面。