chore(task): archive 08-12-vehicle-incident-info
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
{"_example": "Fill with {\"file\": \"<path>\", \"reason\": \"<why>\"}. Put spec/research files only — no code paths. Run `python3 .trellis/scripts/get_context.py --mode packages` to list available specs. Delete this line once real entries are added."}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
# Design: Vehicle Incident And Information Preview
|
||||||
|
|
||||||
|
## Boundary
|
||||||
|
|
||||||
|
This is browser-only Cesium preview state. It changes neither generated OSM data nor `package/` assets.
|
||||||
|
Vehicle routes and models remain `_preview/` resources; refresh resets all vehicle event state.
|
||||||
|
|
||||||
|
## Data Model
|
||||||
|
|
||||||
|
Each object returned by `addCruiseVehicle()` gains:
|
||||||
|
|
||||||
|
```js
|
||||||
|
{
|
||||||
|
id: "vehicle-1",
|
||||||
|
modelName: "car_a01_002",
|
||||||
|
status: "normal" | "breakdown" | "accident",
|
||||||
|
incidentNote: "",
|
||||||
|
motion: { state },
|
||||||
|
markerEntity
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The current route distance remains the single motion source. The clock tick leaves it unchanged while
|
||||||
|
status is not `normal`; returning to normal resumes from that position.
|
||||||
|
|
||||||
|
## Interaction Flow
|
||||||
|
|
||||||
|
1. Vehicle Cesium Entities carry a `vehicleId` property.
|
||||||
|
2. A `ScreenSpaceEventHandler` picks a clicked entity, resolves its vehicle, synchronizes the existing
|
||||||
|
vehicle selector, and opens a positioned information card.
|
||||||
|
3. The card displays vehicle number, model family, route label/length, configured speed, state, and note.
|
||||||
|
4. Card controls set normal/breakdown/accident and persist only in the in-memory vehicle object.
|
||||||
|
5. State changes update marker visibility, the route material, card content, and Cesium render request.
|
||||||
|
|
||||||
|
## Visual Contract
|
||||||
|
|
||||||
|
- Normal: no marker; original route color; motion active.
|
||||||
|
- Breakdown: yellow wrench label above the vehicle; route retains its original color; motion frozen.
|
||||||
|
- Accident: red warning-triangle label above the vehicle; route material becomes red; motion frozen.
|
||||||
|
- Marker positions use the same vehicle `CallbackProperty`, so they move with the vehicle before an event
|
||||||
|
and remain at the incident location while stopped.
|
||||||
|
|
||||||
|
## Compatibility And Risks
|
||||||
|
|
||||||
|
- Picking must ignore routes, static models, and signal entities.
|
||||||
|
- No route must retain the existing disabled cruise controls and never show a card.
|
||||||
|
- The card must be HTML/CSS UI, not Cesium InfoBox, because the viewer deliberately disables InfoBox.
|
||||||
|
- The feature must not alter signal runtime behavior or vehicle asset URLs.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"_example": "Fill with {\"file\": \"<path>\", \"reason\": \"<why>\"}. Put spec/research files only — no code paths. Run `python3 .trellis/scripts/get_context.py --mode packages` to list available specs. Delete this line once real entries are added."}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# Implementation Plan
|
||||||
|
|
||||||
|
1. Add an initially hidden vehicle information card to `area-preview.js` and responsive card styles to
|
||||||
|
`cesium-preview.css`.
|
||||||
|
2. Extend the browser runtime vehicle records with stable identity, parsed model metadata, incident status,
|
||||||
|
note, and a marker entity.
|
||||||
|
3. Gate route-distance advancement on normal state; add status transition helper for marker, route material,
|
||||||
|
and card refresh.
|
||||||
|
4. Add Cesium click picking and card controls. Keep the existing selector synchronized for follow/route use.
|
||||||
|
5. Add focused assertions to `test-preview-assets.js` for card wiring, status behavior, and marker/route
|
||||||
|
contracts.
|
||||||
|
6. Run syntax checks, preview test, stage test, target-area preview regeneration, and `check:area`.
|
||||||
|
|
||||||
|
## Rollback
|
||||||
|
|
||||||
|
Revert only the preview HTML/CSS/runtime/test files. No package, Blender, route, or OSM product files should
|
||||||
|
need rollback.
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
# Vehicle incident and information preview
|
||||||
|
|
||||||
|
## Goal
|
||||||
|
|
||||||
|
在 Cesium 验证预览中,让使用者能够查看每辆巡航车辆的基础信息,并人为标记车辆事故/故障状态,直观看到该状态对车辆和路线展示的影响。
|
||||||
|
|
||||||
|
## Confirmed Facts
|
||||||
|
|
||||||
|
- 车辆是 `scripts/lib/cesium-preview.js` 创建的 Cesium Entity;当前已有车型、路线、巡航速度、
|
||||||
|
跟随、显隐与路线选择。
|
||||||
|
- 车辆模型和路线都属于 `_preview/` 验证资源,不是 area package 的下游资产契约。
|
||||||
|
- 当前不存在车辆业务资料、事故状态、碰撞检测或自动事件推演。
|
||||||
|
- 项目定位是资产生成与验证,不能将交通流/事故仿真作为本任务的范围。
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- 每辆预览车辆必须有稳定的显示编号、车型、当前路线、设定速度和行驶状态。
|
||||||
|
- 点击场景中的车辆后,必须弹出该车辆的信息卡,展示基础信息与当前事件状态;信息卡内完成状态与说明编辑。
|
||||||
|
- 使用者必须能将选中车辆在正常、故障和事故状态之间切换,并能提供简短事件说明。
|
||||||
|
- 故障和事故是不同状态:二者均停止巡航;故障使用黄色标记,事故使用红色标记并提示路线中断。
|
||||||
|
- 故障使用车辆顶部黄色扳手标记;事故使用红色警示三角标记,并将该车辆当前路线改为红色。
|
||||||
|
- 非正常车辆必须有可见的场景标记;恢复正常后继续按既有路线巡航。
|
||||||
|
- 事故/故障仅在当前浏览器预览会话中存在;刷新或重建预览后不保留。
|
||||||
|
|
||||||
|
## Out of Scope
|
||||||
|
|
||||||
|
- 自动碰撞检测、车辆间物理碰撞、自动事故生成。
|
||||||
|
- 信号配时、交通流、调度策略或持久化事件记录。
|
||||||
|
- 向 `package/` 加入车辆、路线或事故数据。
|
||||||
|
|
||||||
|
## Acceptance Criteria
|
||||||
|
|
||||||
|
- [ ] 用户可点击任一可见车辆,弹出其基础信息、状态和事件说明;现有车辆选择控件仍可用于路线和跟随。
|
||||||
|
- [ ] 用户可标记故障或事故,并看到车辆停止、状态文本和明显的场景标记。
|
||||||
|
- [ ] 故障显示黄色扳手;事故显示红色警示三角且当前路线变红。
|
||||||
|
- [ ] 用户可恢复正常,车辆继续其现有路线;其他车辆不受影响。
|
||||||
|
- [ ] 无可用路线时,车辆信息和事故控件按既有禁用语义处理。
|
||||||
|
- [ ] 预览资产、路线与现有信号灯 runtime 继续可加载;不新增下游 package 内容。
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"id": "vehicle-incident-info",
|
||||||
|
"name": "vehicle-incident-info",
|
||||||
|
"title": "Vehicle incident and information preview",
|
||||||
|
"description": "",
|
||||||
|
"status": "completed",
|
||||||
|
"dev_type": null,
|
||||||
|
"scope": null,
|
||||||
|
"package": null,
|
||||||
|
"priority": "P2",
|
||||||
|
"creator": "dingkang",
|
||||||
|
"assignee": "dingkang",
|
||||||
|
"createdAt": "2026-08-12",
|
||||||
|
"completedAt": "2026-08-12",
|
||||||
|
"branch": null,
|
||||||
|
"base_branch": "main",
|
||||||
|
"worktree_path": null,
|
||||||
|
"commit": null,
|
||||||
|
"pr_url": null,
|
||||||
|
"subtasks": [],
|
||||||
|
"children": [],
|
||||||
|
"parent": null,
|
||||||
|
"relatedFiles": [],
|
||||||
|
"notes": "",
|
||||||
|
"meta": {}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user