feat(drone-dock): 完善真实联调、状态轮询与准备页反馈
开放 Release 真实操作并保留 Debug 拦截;恢复前台 shooting 串行轮询;统一打印机巢请求与完整原值响应;优化长点位名称、未拍摄文案、报备失败及已结束任务提示,移除成功回执 UI。补充相关测试、离线策略检查和联调说明。
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
/// 基于既有订单飞行任务发送单次安全指令;禁飞期间仅向本地模拟页面注入。
|
||||
/// 基于既有订单飞行任务发送单次安全指令;Release 注入真实页面,Debug 仅向本地模拟页面注入。
|
||||
protocol DroneDockCommandSending: Sendable {
|
||||
/// 提交任务 ID 和白名单指令,不创建任务、不选机,也不自动重试。
|
||||
@MainActor
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
/// 朱工任务图传参数服务;请求可能启动设备图传,禁飞期间只允许隔离模拟注入。
|
||||
/// 朱工任务图传参数服务;请求可能启动设备图传,Release 可手动开启,Debug 只允许隔离模拟注入。
|
||||
protocol DroneDockLiveServing: Sendable {
|
||||
/// 读取同一订单飞行任务的图传回执,不创建任务或更换飞机。
|
||||
@MainActor
|
||||
|
||||
@@ -27,7 +27,7 @@ final class DroneDockShootAPI: DroneDockShootServing, DroneDockResummonServing {
|
||||
try await send(taskID: taskID, restart: false)
|
||||
}
|
||||
|
||||
/// 复用同一订单飞行任务请求重启;当前仅由隔离模拟入口注入,真实传输仍受禁飞保护。
|
||||
/// 复用同一订单飞行任务请求重启;Release 真实入口及隔离模拟入口按策略注入。
|
||||
func resummon(taskID: Int) async throws -> DroneDockShootResponse {
|
||||
try await send(taskID: taskID, restart: true)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ protocol DroneDockStartShooting: Sendable {
|
||||
func startShooting(taskID: Int) async throws -> DroneDockStartShootResponse
|
||||
}
|
||||
|
||||
/// start-shoot 合同适配;禁飞期间真实传输仍由统一客户端阻断,仅用 Mock 验证。
|
||||
/// start-shoot 合同适配;Debug 真实传输由统一客户端阻断,Release 按用户授权开放。
|
||||
@MainActor
|
||||
final class DroneDockStartShootAPI: DroneDockStartShooting {
|
||||
private let client: APIClient
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
import Foundation
|
||||
|
||||
/// 准备页的业务失败提示;区分创建与召唤,不把通用业务错误码当作未报备。
|
||||
struct DroneDockPreparationFailure: Equatable, Sendable {
|
||||
/// 失败发生的提交步骤。
|
||||
enum Stage: Sendable { case creation, summon }
|
||||
/// 面向工作人员的标题。
|
||||
let title: String
|
||||
/// 原因及下一步操作,不包含接口 JSON。
|
||||
let message: String
|
||||
/// 后端文字明确指出报备问题时,额外弹出提醒。
|
||||
let requiresFiling: Bool
|
||||
|
||||
/// 未获得专用错误码前,仅匹配明确报备/备案失败的文字,其他原因保持后端原意。
|
||||
init(message: String, stage: Stage, outcomeUnknown: Bool) {
|
||||
requiresFiling = !outcomeUnknown && Self.isFilingFailure(message)
|
||||
if outcomeUnknown {
|
||||
title = stage == .creation ? "任务创建结果待核对" : "召唤结果待核对"
|
||||
self.message = message
|
||||
} else if requiresFiling {
|
||||
title = "请先完成飞行报备"
|
||||
self.message = message + "\n请联系相关负责人核实并完成飞行报备,确认生效后再重试。"
|
||||
} else if stage == .summon && Self.requiresTaskReview(message) {
|
||||
title = "任务已结束"
|
||||
self.message = "当前任务已结束,无法直接召唤。请先查看拍摄任务状态;如需重新召唤,在任务页确认后操作。"
|
||||
} else {
|
||||
title = stage == .creation ? "任务创建失败" : "召唤失败"
|
||||
self.message = message
|
||||
}
|
||||
}
|
||||
|
||||
/// 仅识别实际返回的明确终止提示;不会据此自动发送 restart=true。
|
||||
static func requiresTaskReview(_ message: String) -> Bool {
|
||||
message.contains("任务已结束") && message.contains("无法召唤")
|
||||
}
|
||||
|
||||
private static func isFilingFailure(_ message: String) -> Bool {
|
||||
["未报备", "未完成报备", "报备未", "报备失败", "报备过期", "报备已过期",
|
||||
"报备失效", "报备已失效", "无有效报备", "没有报备", "无报备", "请先报备", "需要报备",
|
||||
"未备案", "未完成备案", "备案未", "备案失败", "备案已过期", "请先备案"]
|
||||
.contains(where: message.contains)
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ struct DroneDockShootingPlaneStatus: Decodable, Equatable, Sendable {
|
||||
let scenicID: Int?
|
||||
/// 后端景区连接状态。
|
||||
let connected: Bool?
|
||||
/// 保留后端建议间隔;当前任务页不据此安排定时请求。
|
||||
/// 后端建议轮询间隔,任务页校验并限制频率后使用。
|
||||
let pollHintMS: Int?
|
||||
|
||||
/// 设备快照字段映射,其余字段仍保留在完整 dataJSON 中。
|
||||
|
||||
@@ -92,14 +92,33 @@ struct DroneDockOSSFilmTransport: DroneDockFilmTransporting {
|
||||
let sdkConfiguration = Configuration.default().withRegion(configuration.region).withCredentialsProvider(credentials)
|
||||
sdkConfiguration.withEndpoint(configuration.endpoint)
|
||||
let client = Client(sdkConfiguration)
|
||||
_ = try await client.putObject(PutObjectRequest(
|
||||
bucket: configuration.bucket, key: objectKey, contentType: contentType, body: .file(fileURL),
|
||||
progress: ProgressClosure { _, transferred, expected in
|
||||
guard expected > 0 else { return }
|
||||
let value = Int(min(100, max(0, Double(transferred) / Double(expected) * 100)))
|
||||
Task { @MainActor in onProgress(value) }
|
||||
}
|
||||
))
|
||||
let trace = DroneDockFileTransferTrace(operation: "file_upload", method: "PUT",
|
||||
remoteURL: URL(string: configuration.endpoint))
|
||||
let fileSize = (try? fileURL.resourceValues(forKeys: [.fileSizeKey]).fileSize) ?? 0
|
||||
DroneDockDiagnostics.write(trace.message("request.started", fields: [
|
||||
"bucket": configuration.bucket, "object_key": objectKey,
|
||||
"bytes": fileSize, "content_type": contentType, "body": "<binary omitted>"
|
||||
]))
|
||||
do {
|
||||
let result = try await client.putObject(PutObjectRequest(
|
||||
bucket: configuration.bucket, key: objectKey, contentType: contentType, body: .file(fileURL),
|
||||
progress: ProgressClosure { _, transferred, expected in
|
||||
guard expected > 0 else { return }
|
||||
let value = Int(min(100, max(0, Double(transferred) / Double(expected) * 100)))
|
||||
Task { @MainActor in onProgress(value) }
|
||||
}
|
||||
))
|
||||
DroneDockDiagnostics.write(trace.message("response.received", fields: [
|
||||
"http_status": result.statusCode, "oss_request_id": result.requestId,
|
||||
"response_headers": result.headers ?? [:],
|
||||
"body": DroneDockDiagnostics.payload(result.callbackResult)
|
||||
]))
|
||||
} catch {
|
||||
let cancelled = error is CancellationError || (error as? URLError)?.code == .cancelled
|
||||
DroneDockDiagnostics.write(trace.message(cancelled ? "request.cancelled" : "request.failed",
|
||||
fields: DroneDockDiagnostics.errorFields(error)))
|
||||
throw error
|
||||
}
|
||||
try Task.checkCancellation()
|
||||
#else
|
||||
throw OSSUploadError.sdkUnavailable
|
||||
|
||||
@@ -123,8 +123,10 @@ final class DroneDockLiveViewModel {
|
||||
rtcConfiguration = try DroneDockVolcLiveConfiguration.parse(value, now: now())
|
||||
playbackSessionID = UUID()
|
||||
state = .connecting
|
||||
DroneDockDiagnostics.event("live.parameters_valid", taskID: taskID, fields: ["provider": "volc", "playback_session": playbackSessionID?.uuidString ?? ""])
|
||||
} catch {
|
||||
state = .unavailable(error.localizedDescription)
|
||||
DroneDockDiagnostics.event("live.parameters_rejected", taskID: taskID, fields: ["reason": error.localizedDescription])
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -155,6 +157,7 @@ final class DroneDockLiveViewModel {
|
||||
/// 离页、后台或取消时作废旧请求并清除本地播放来源,不向设备发送停止指令。
|
||||
@MainActor
|
||||
func invalidate() {
|
||||
if playbackSessionID != nil { DroneDockDiagnostics.event("live.stopped", taskID: taskID) }
|
||||
generation &+= 1
|
||||
isLoading = false
|
||||
response = nil
|
||||
@@ -173,6 +176,8 @@ final class DroneDockLiveViewModel {
|
||||
state = .failed("账号或景区已变化,请返回工作台重新进入")
|
||||
return
|
||||
}
|
||||
DroneDockDiagnostics.event("live.playback_event", taskID: taskID,
|
||||
fields: ["playback_session": sessionID.uuidString, "result": String(describing: event)])
|
||||
switch event {
|
||||
case .firstFrame: state = .playing
|
||||
case .failed(let message):
|
||||
|
||||
@@ -38,6 +38,20 @@ final class DroneDockPreparationViewModel {
|
||||
private(set) var shootErrorMessage: String?
|
||||
/// 召唤写请求结果不明确时禁止重发,等待后续核对任务状态。
|
||||
private(set) var summonOutcomeUnknown = false
|
||||
/// 后端明确说明原任务已结束时,转为查看原任务,禁止继续重复首次召唤。
|
||||
private(set) var summonRequiresTaskReview = false
|
||||
|
||||
/// 创建失败的用户提示;成功回执仅供业务与日志使用,不在页面输出。
|
||||
var creationFailure: DroneDockPreparationFailure? {
|
||||
guard createdTask == nil, let message = taskCreationErrorMessage else { return nil }
|
||||
return DroneDockPreparationFailure(message: message, stage: .creation, outcomeUnknown: taskCreationOutcomeUnknown)
|
||||
}
|
||||
|
||||
/// 召唤失败与创建失败分开表达,保留已经创建的任务。
|
||||
var summonFailure: DroneDockPreparationFailure? {
|
||||
guard let message = shootErrorMessage else { return nil }
|
||||
return DroneDockPreparationFailure(message: message, stage: .summon, outcomeUnknown: summonOutcomeUnknown)
|
||||
}
|
||||
|
||||
private let service: any DroneDockPreparationServing
|
||||
private let planeStatusService: any DroneDockPlaneStatusServing
|
||||
@@ -96,18 +110,18 @@ final class DroneDockPreparationViewModel {
|
||||
var isTaskSelectionLocked: Bool {
|
||||
isCreatingTask || isSummoning || isPerformingPrimaryAction || hasCreatedTask || taskCreationOutcomeUnknown
|
||||
}
|
||||
/// 仅展示真实返回的 data JSON,不拼造业务包裹或召唤结果。
|
||||
/// 为诊断保留实际 data JSON,正式准备页不展示此内容。
|
||||
var creationDataJSON: String? { createdTask?.dataJSON }
|
||||
/// 仅保留 shoot 实际返回的 data;缺失时不拼造成功 JSON。
|
||||
var shootDataJSON: String? { shootResponse?.dataJSON }
|
||||
/// 创建回执携带的最新订单摘要优先于创建前购买摘要。
|
||||
var latestOrderSummary: DroneDockHomeOrder? { createdTask?.order ?? projectInfo?.order }
|
||||
|
||||
/// 召唤已明确受理后只允许查看原任务,导航与再次提交召唤分开判断。
|
||||
/// 已受理或后端明确要求核对已结束的任务时允许查看,导航不重复提交召唤。
|
||||
var canOpenShootingTask: Bool {
|
||||
context.canLoad && !creationContextInvalidated && !isLoading && !isCreatingTask
|
||||
&& !isSummoning && !isPerformingPrimaryAction && !taskCreationOutcomeUnknown
|
||||
&& !summonOutcomeUnknown && hasSubmittedSummon && shootResponse != nil
|
||||
&& !summonOutcomeUnknown && ((hasSubmittedSummon && shootResponse != nil) || summonRequiresTaskReview)
|
||||
&& (createdTask?.taskID ?? 0) > 0
|
||||
}
|
||||
|
||||
@@ -115,7 +129,7 @@ final class DroneDockPreparationViewModel {
|
||||
var isPrimaryActionEnabled: Bool {
|
||||
guard allowsTaskSubmission, context.canLoad, !creationContextInvalidated, !isLoading, !isCreatingTask,
|
||||
!isSummoning, !isPerformingPrimaryAction, !taskCreationOutcomeUnknown,
|
||||
!hasSubmittedSummon, !summonOutcomeUnknown else { return false }
|
||||
!hasSubmittedSummon, !summonOutcomeUnknown, !summonRequiresTaskReview else { return false }
|
||||
if let createdTask { return createdTask.taskID > 0 }
|
||||
return canCreateTask
|
||||
}
|
||||
@@ -166,6 +180,7 @@ final class DroneDockPreparationViewModel {
|
||||
let response = try await shootService.shoot(taskID: taskID)
|
||||
guard acceptsSummon(requestGeneration, taskID: taskID) else { return }
|
||||
shootResponse = response
|
||||
DroneDockDiagnostics.event("summon.receipt_accepted", taskID: taskID)
|
||||
hasSubmittedSummon = true
|
||||
summonOutcomeUnknown = false
|
||||
} catch {
|
||||
@@ -177,6 +192,7 @@ final class DroneDockPreparationViewModel {
|
||||
shootErrorMessage = DeviceCommandDebugPolicy.blockedMessage
|
||||
} else if case APIError.serverCode = error {
|
||||
shootErrorMessage = error.localizedDescription
|
||||
summonRequiresTaskReview = DroneDockPreparationFailure.requiresTaskReview(error.localizedDescription)
|
||||
} else {
|
||||
markSummonUnknown(reason: error.localizedDescription)
|
||||
}
|
||||
@@ -195,6 +211,7 @@ final class DroneDockPreparationViewModel {
|
||||
if creationContextInvalidated {
|
||||
shootResponse = nil
|
||||
shootErrorMessage = nil
|
||||
summonRequiresTaskReview = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,6 +264,7 @@ final class DroneDockPreparationViewModel {
|
||||
throw APIError.decodeFailed("创建回执与当前订单或项目不一致,请核对任务")
|
||||
}
|
||||
createdTask = response
|
||||
DroneDockDiagnostics.event("create.receipt_accepted", taskID: response.taskID)
|
||||
hasCreatedTask = true
|
||||
taskCreationOutcomeUnknown = false
|
||||
} catch {
|
||||
@@ -430,7 +448,7 @@ final class DroneDockPreparationViewModel {
|
||||
var primaryButtonTitle: String {
|
||||
if isCreatingTask { return "正在创建任务…" }
|
||||
if isSummoning { return "正在召唤无人机…" }
|
||||
if hasSubmittedSummon { return "查看拍摄任务" }
|
||||
if hasSubmittedSummon || summonRequiresTaskReview { return "查看拍摄任务" }
|
||||
if !allowsTaskSubmission { return "仅限模拟调试" }
|
||||
if summonOutcomeUnknown { return "召唤结果待核对" }
|
||||
if hasCreatedTask { return shootErrorMessage == nil ? "确认并召唤" : "重试召唤" }
|
||||
@@ -445,13 +463,13 @@ final class DroneDockPreparationViewModel {
|
||||
if isSummoning { return "任务已创建,正在提交召唤请求" }
|
||||
if creationContextInvalidated, let errorMessage { return errorMessage }
|
||||
if !allowsTaskSubmission && !hasSubmittedSummon { return DeviceCommandDebugPolicy.blockedMessage }
|
||||
if let createdTask {
|
||||
if hasSubmittedSummon { return "任务 \(createdTask.taskID) 的召唤请求已提交,请等待任务状态更新" }
|
||||
if let shootErrorMessage { return shootErrorMessage }
|
||||
if createdTask != nil {
|
||||
if hasSubmittedSummon { return "召唤请求已提交,请等待任务状态更新" }
|
||||
if let summonFailure { return summonFailure.message }
|
||||
if summonOutcomeUnknown { return "召唤结果待核对,请勿重复提交" }
|
||||
return "任务 \(createdTask.taskID) 已创建,等待召唤"
|
||||
return "任务已创建,等待召唤"
|
||||
}
|
||||
if let taskCreationErrorMessage { return taskCreationErrorMessage }
|
||||
if let creationFailure { return creationFailure.message }
|
||||
if taskCreationOutcomeUnknown { return "创建结果待核对,请勿重复提交" }
|
||||
if isLoading { return "正在获取拍摄准备信息" }
|
||||
if let errorMessage { return errorMessage }
|
||||
@@ -555,11 +573,13 @@ final class DroneDockPreparationViewModel {
|
||||
}
|
||||
|
||||
private func markSummonUnknown(reason: String? = nil) {
|
||||
DroneDockDiagnostics.event("summon.outcome_unknown", taskID: createdTask?.taskID)
|
||||
summonOutcomeUnknown = true
|
||||
shootErrorMessage = (reason.map { "\($0)。" } ?? "") + "召唤结果待核对,请先核对任务状态,勿重复提交"
|
||||
}
|
||||
|
||||
private func markTaskCreationUnknown(reason: String? = nil) {
|
||||
DroneDockDiagnostics.event("taskcreation.outcome_unknown", taskID: createdTask?.taskID)
|
||||
taskCreationOutcomeUnknown = true
|
||||
taskCreationErrorMessage = (reason.map { "\($0)。" } ?? "") + "创建结果待核对,请先查看订单任务,勿重复提交"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
/// 拍摄任务状态及可选控制流程,始终复用同一任务;禁飞调试仅为本地模拟注入操作服务。
|
||||
/// 拍摄任务状态及可选控制流程,始终复用同一任务;Release 真实入口与隔离模拟入口按策略注入操作服务。
|
||||
final class DroneDockShootingTaskViewModel {
|
||||
/// 页面绑定的账号、景区和门店身份。
|
||||
let context: DroneDockHomeContext
|
||||
@@ -62,7 +62,7 @@ final class DroneDockShootingTaskViewModel {
|
||||
// 回查仍提供的已受理指令分别保留防重锁,避免另一条指令受理覆盖旧锁。
|
||||
private var pendingAcceptedCommands: Set<DroneDockSafetyCommand> = []
|
||||
|
||||
/// 默认只读;仅显式注入模拟操作服务时开放对应动作,当前正式入口不注入。
|
||||
/// 默认只读;仅显式注入操作服务时开放对应动作,Release 入口按授权注入。
|
||||
init(context: DroneDockHomeContext, taskID: Int, order: DroneDockHomeOrder,
|
||||
service: any DroneDockShootingServing,
|
||||
startService: (any DroneDockStartShooting)? = nil,
|
||||
@@ -85,6 +85,18 @@ final class DroneDockShootingTaskViewModel {
|
||||
await refreshSnapshot(allowWhileStarting: false)
|
||||
}
|
||||
|
||||
/// 后端建议间隔限制为 2~30 秒;缺失或无效时默认 5 秒,从上次请求结束后计时。
|
||||
var pollIntervalNanoseconds: UInt64 {
|
||||
let hint = response?.planeStatus?.pollHintMS ?? 5_000
|
||||
return UInt64(min(max(hint > 0 ? hint : 5_000, 2_000), 30_000)) * 1_000_000
|
||||
}
|
||||
|
||||
/// 身份失效或缺少任务信息时停止安排下一次读取。
|
||||
var canContinuePolling: Bool {
|
||||
!identityInvalidated && context.canLoad && taskID > 0
|
||||
&& DroneDockHomeMetric.usableText(order.orderNumber) != nil
|
||||
}
|
||||
|
||||
@MainActor
|
||||
private func refreshSnapshot(allowWhileStarting: Bool, allowWhileCommand: Bool = false,
|
||||
allowWhileResummoning: Bool = false) async {
|
||||
@@ -114,6 +126,12 @@ final class DroneDockShootingTaskViewModel {
|
||||
throw APIError.decodeFailed("拍摄任务返回的任务、订单或景区与当前页面不一致,请重新读取")
|
||||
}
|
||||
response = value
|
||||
DroneDockDiagnostics.event("shooting.snapshot_applied", taskID: taskID, fields: [
|
||||
"phase": presentation.phase.rawValue,
|
||||
"plane_id": value.currentPlane?.id as Any? ?? NSNull(),
|
||||
"can_execute": value.executeGate?.canExecute as Any? ?? NSNull(),
|
||||
"primary_action": value.executeGate?.primaryAction as Any? ?? NSNull()
|
||||
])
|
||||
if awaitingResummonSnapshot, [.navigating, .ready, .shooting, .paused, .returning, .completed].contains(resolvedDisplayPhase().0) {
|
||||
awaitingResummonSnapshot = false
|
||||
}
|
||||
@@ -121,6 +139,9 @@ final class DroneDockShootingTaskViewModel {
|
||||
} catch {
|
||||
guard accepts(requestGeneration) else { return }
|
||||
errorMessage = error is CancellationError ? nil : error.localizedDescription
|
||||
DroneDockDiagnostics.event("shooting.refresh_failed", taskID: taskID, fields: [
|
||||
"retained_snapshot": response != nil, "error": DroneDockDiagnostics.errorFields(error)
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +170,7 @@ final class DroneDockShootingTaskViewModel {
|
||||
}
|
||||
}
|
||||
|
||||
/// 只在有效读取明确到达、锁定飞机并允许 start_shoot 后开放;默认真实页面保持禁用。
|
||||
/// 只在有效读取明确到达、锁定飞机并允许 start_shoot 后开放;Debug 真实页面保持禁用。
|
||||
var canStartShooting: Bool {
|
||||
startService != nil && context.canLoad && taskID > 0 && !identityInvalidated
|
||||
&& !isLoading && !isStartingShooting && !isSendingCommand && !isResummoning && errorMessage == nil
|
||||
@@ -161,7 +182,7 @@ final class DroneDockShootingTaskViewModel {
|
||||
&& (response?.currentPlane?.id ?? 0) > 0
|
||||
}
|
||||
|
||||
/// 提交一次开拍并单次读取同任务;失败保留原快照,不轮询、不重建、不自动重发。
|
||||
/// 提交一次开拍并单次读取同任务;失败保留原快照,不重建、不自动重发控制请求。
|
||||
@MainActor
|
||||
func startShooting(onStateChange: @escaping @MainActor () -> Void = {}) async {
|
||||
guard canStartShooting, let startService else { return }
|
||||
@@ -200,6 +221,7 @@ final class DroneDockShootingTaskViewModel {
|
||||
throw APIError.decodeFailed("开始拍摄回执与当前任务或飞机不一致,请先核对任务状态")
|
||||
}
|
||||
startResponse = value
|
||||
DroneDockDiagnostics.event("start.receipt_accepted", taskID: taskID)
|
||||
hasSubmittedStart = true
|
||||
startOutcomeUnknown = false
|
||||
onStateChange()
|
||||
@@ -287,6 +309,7 @@ final class DroneDockShootingTaskViewModel {
|
||||
throw APIError.decodeFailed("安全指令回执与当前任务或指令不一致,请先核对任务状态")
|
||||
}
|
||||
commandResponse = value
|
||||
DroneDockDiagnostics.event("command.receipt_accepted", taskID: taskID)
|
||||
pendingAcceptedCommands.insert(command)
|
||||
commandOutcomeUnknown = false
|
||||
onStateChange()
|
||||
@@ -363,6 +386,7 @@ final class DroneDockShootingTaskViewModel {
|
||||
throw APIError.decodeFailed("重新召唤回执与当前任务或订单不一致,请先核对任务状态")
|
||||
}
|
||||
resummonResponse = value
|
||||
DroneDockDiagnostics.event("resummon.receipt_accepted", taskID: taskID)
|
||||
hasSubmittedResummon = true
|
||||
resummonOutcomeUnknown = false
|
||||
awaitingResummonSnapshot = true
|
||||
@@ -557,6 +581,7 @@ final class DroneDockShootingTaskViewModel {
|
||||
}
|
||||
|
||||
private func markResummonUnknown(reason: String? = nil) {
|
||||
DroneDockDiagnostics.event("resummon.outcome_unknown", taskID: taskID)
|
||||
resummonOutcomeUnknown = true
|
||||
resummonErrorMessage = (reason.map { "\($0)。" } ?? "") + "重新召唤结果待核对,请刷新任务状态,勿重复提交"
|
||||
}
|
||||
@@ -575,11 +600,13 @@ final class DroneDockShootingTaskViewModel {
|
||||
}
|
||||
|
||||
private func markCommandUnknown(reason: String? = nil) {
|
||||
DroneDockDiagnostics.event("command.outcome_unknown", taskID: taskID)
|
||||
commandOutcomeUnknown = true
|
||||
commandErrorMessage = (reason.map { "\($0)。" } ?? "") + "安全指令结果待核对,请刷新任务状态,勿重复提交"
|
||||
}
|
||||
|
||||
private func markStartUnknown(reason: String? = nil) {
|
||||
DroneDockDiagnostics.event("start.outcome_unknown", taskID: taskID)
|
||||
startOutcomeUnknown = true
|
||||
startErrorMessage = (reason.map { "\($0)。" } ?? "") + "开始拍摄结果待核对,请刷新任务状态,勿重复提交"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user