feat: 完善机巢任务安全控制与状态诊断

同步新版飞控与 WebSocket 回执合同,完善独立指令等待、暂停继续和返航状态;增加真机诊断并优化倒计时与素材库展示。
This commit is contained in:
2026-11-04 17:34:28 +08:00
parent 1c766ff12f
commit e3979e9e32
44 changed files with 4575 additions and 581 deletions
@@ -28,6 +28,9 @@ final class DroneDockStartShootViewModelTests: XCTestCase {
["ui": ["phase": "shooting"]],
["ui": ["phase": "unknown"]],
["ui": NSNull()],
["flight_control": NSNull()],
["flight_control": DroneDockShootingTaskTestData.flightControl(state: "unknown", droneInDock: nil, isAirborne: nil)],
["flight_control": DroneDockShootingTaskTestData.flightControl(batch: 999)],
["task": ["id": 501, "status": 20, "wayline_status": 91]]
]
for change in changes {
@@ -319,6 +322,8 @@ private final class StartTaskWriteService: DroneDockStartShooting {
private enum StartTaskData {
static func ready(changes: [String: Any] = [:]) throws -> DroneDockShootingResponse {
try DroneDockShootingTaskTestData.response(changes: [
"execution_batch": 100, "state_version": 1, "snapshot_kind": "full",
"flight_control": DroneDockShootingTaskTestData.flightControl(resumePhase: "arrived_pending_start", pauseReason: "arrival_wait"),
"order_flight_task": ["id": 501, "order_number": "TEST-TASK-PAGE-001", "scenic_id": 128, "status": 20],
"task": ["id": 501, "status": 20],
"execute_gate": ["can_execute": true, "primary_action": "start_shoot", "primary_action_label": "开始拍摄"],
@@ -327,7 +332,7 @@ private enum StartTaskData {
}
static func shooting() throws -> DroneDockShootingResponse {
try ready(changes: ["ui": ["phase": "shooting", "title": "模拟无人机正在拍摄中", "message": "本地模拟,未下发设备指令"],
try ready(changes: ["state_version": 2, "flight_control": DroneDockShootingTaskTestData.flightControl(), "ui": ["phase": "shooting", "title": "模拟无人机正在拍摄中", "message": "本地模拟,未下发设备指令"],
"execute_gate": ["can_execute": false, "primary_action": "shooting"]])
}