wiki: passage confirmation scope and relay maps, crossing-line editor, desktop WS hello fix, cameras push to the dev machine

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZgP5oMncSaVmKRKk1UvN4
This commit is contained in:
2026-11-19 12:38:53 +01:00
parent b69faec547
commit d3649669ee
5 changed files with 101 additions and 5 deletions
+55 -2
View File
@@ -77,6 +77,8 @@ with the test results attached.
## Test plan — on park-lab (user, 2026-10-24: "we will test it on park-lab")
0. Verify the interlock with a meter: hold the open relay, pulse the close relay, `DOWN` must stay
dead. Then assert `UP` and `DOWN` together on the unit: open must win.
1. Confirm the operator's close input; wire a spare relay to it.
2. Close with a car on the safety loop → boom must not move / must reverse.
3. Close with the photocell beam broken by a person → same.
@@ -111,7 +113,7 @@ Two cameras mounted on **one physical lane that serves both directions** (user,
| Sub-stream (102) | 1280×720 **MJPEG**, 12.5 fps (was 640×360 H.264, keyframe every 4 s) | 1280×720 **MJPEG**, 20 fps (was 640×360 H.264, keyframe every 2.5 s) |
| Line crossing / intrusion (`ISAPI/Smart/LineDetection`, `FieldDetection`) | `notSupport` | `notSupport` |
| Motion detection | on, target `vehicle`, grid drawn | on, target `vehicle`, grid drawn |
| Alarm server (`httpHosts`) | not set (`0.0.0.0`) | not set (`0.0.0.0`) |
| Alarm server (`httpHosts`) | the dev machine `10.0.10.203:3000` (user, 2026-11-19) | the dev machine `10.0.10.203:3000` (user, 2026-11-19) |
Read from the cameras over ISAPI the same day; bench snapshot results are on [[lpr-camera]].
@@ -129,13 +131,64 @@ Read from the cameras over ISAPI the same day; bench snapshot results are on [[l
does the tracking.
- ~~Both sub-stream keyframe intervals are above the ≤ 1 s this design asks for (item 1).~~
Moot since the switch to MJPEG (2026-11-17).
- Neither camera pushes to park-lab yet, and neither is in its device registry.
- Both cameras push to the local dev machine, which runs on a copy of park-lab's database where
both are registered (bound to Dingtian relay 1, ANPR auto-open on). They push to the dev
machine, not to park-lab, so a subscriber read there raises the real boom.
- [[k200l-printer]] records `10.0.10.7` as the park-lab printer's fixed address — the exit camera
now answers there. To be resolved with the user.
- **Shared lane — not covered by the design above**, which assumes a camera sees only its own
direction. Here a car driving in passes the entry camera and then drives away through the exit
camera's view, and the reverse for a car driving out. Open in "Open questions".
## Decided with the user (2026-11-17)
- **Layout.** park-lab is **one lane, one barrier** for both directions (relay 1 registered as
`both`, both cameras bound to it). park-2 and park-buzi have **two lanes, two barriers**.
- **Every open is watched**, not only ANPR subscriber opens: a ticket printed by someone who then
drives off leaves the boom up the same way. No A→B passage inside the window ⇒ close.
- **Scope, phase 1: the close only.** The ledger part (`vehicle_passed`, `*.abandoned`, ticket
invalidation) is phase 2. The close itself is a signed event from the start.
- **Wiring.** park-lab: R1 opens, R2 closes (`DOWN`). The user believes R2 is interlocked behind
R1's NC as [[zkteco-cmp200-barrier]] prescribes; this is **not yet verified**. Relays 3 and 4 are
**not** interlocked. Until a pair is verified interlocked (a meter on `DOWN` with the open relay
held), that barrier gets no close.
- **Relay maps at the other sites (user, 2026-11-19).** **No close relay exists at either site.**
A close there needs new wiring to the operator's close input first.
| Site | R1 | R2 | R3 | R4 |
|---|---|---|---|---|
| park-2 | opens the entry barrier | opens the exit barrier | — | — |
| park-buzi | opens the entry barrier | opens the exit barrier | pulses the entry ticket button when a vehicle is in the drawn zone | — |
park-buzi is offline (the site does not run this software).
Config validation must refuse a close relay that already has a direction or an input role.
- **The line is our own Line Crossing rule (user, 2026-11-19).** The model is Hikvision's: a
segment with sides A and B and a direction, where A → B, B → A or A ↔ B is what counts as a
crossing. The fleet cameras have no such rule, so Setup draws it and the booth's tracker judges.
### Phase-1 shape (proposed)
- **Built (uncommitted).** Setup → camera → *Crossing line* draws the segment over the live
picture. You drag across the picture to draw it, drag an end to move it, and can swap A/B and
pick A → B, B → A or A ↔ B. It is stored as camera `config.crossing` (`CrossingLine` in
`packages/shared`): two normalised points and a direction, with side A on the screen-left of
p1→p2. The save validates it, and `null` clears it.
- The watch is **per barrier**, started by the **open** (any source), not by a camera push. A
barrier without a drawn line gets no watch and no close.
- The direction of the open picks the confirming line; "lane clear" must hold on **every** camera
bound to that barrier (park-lab: a car approaching from the other side holds the close).
- The close relay is named **explicitly** per barrier in the controller config (never derived from
the open relay), may have no other role, and is a separate optional driver capability. The driver
serialises open/close per barrier with open always winning — which does **not** replace the
hardware interlock (a second server on the same board, e.g. a dev machine, has its own lock).
- **Dry run first:** the verdict and a "would close now" record with the evidence frame; the real
pulse sits behind a per-barrier switch, off by default, until the bench tests pass and
[[barrier-not-a-door]] is revised.
- Frames come from the live-view hub ([[camera-live-view]]): one MJPEG session per camera, shared.
- A drawn **line alone may not be enough**: the entry view has parked vehicles in the background,
so "nothing in view" is never true there. The recordings decide whether Setup also needs a lane
area.
## Open questions
- **One lane, both directions (park-lab rig).** Every car crosses both cameras' views. Does the far