Add Art-Net BCC145 controller with web UI and MediaPipe pointing.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
6dde628e00
commit
a0e205d463
19 files changed
+3334
No files matched your search
@@ -0,0 +1,44 @@
|
||||
"""Live Art-Net smoke test against dmx-gateway.local.
|
||||
|
||||
Sets DMX 88 (dimmer) and 90 (red) on BCC145 #1 — stop QLC+ output first.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import time
|
||||
|
||||
from stupidArtnet import StupidArtnet
|
||||
|
||||
from artnet_refresh import ArtNetRefresh
|
||||
|
||||
TARGET = os.environ.get("ARTNET_IP", "dmx-gateway.local")
|
||||
UNIVERSE = int(os.environ.get("ARTNET_UNIVERSE", "0"))
|
||||
HOLD_S = float(os.environ.get("ARTNET_TEST_HOLD", "3"))
|
||||
|
||||
|
||||
def test_set_channels_88_and_90_to_255():
|
||||
artnet = StupidArtnet(
|
||||
target_ip=TARGET,
|
||||
universe=UNIVERSE,
|
||||
packet_size=512,
|
||||
fps=40,
|
||||
)
|
||||
refresh = ArtNetRefresh(artnet)
|
||||
|
||||
def set_red(a: StupidArtnet) -> None:
|
||||
a.set_single_value(88, 255) # dimmer
|
||||
a.set_single_value(89, 0) # strobe off
|
||||
a.set_single_value(90, 255) # red
|
||||
|
||||
refresh.update(set_red)
|
||||
assert artnet.buffer[87] == 255
|
||||
assert artnet.buffer[88] == 0
|
||||
assert artnet.buffer[89] == 255
|
||||
|
||||
refresh.start()
|
||||
try:
|
||||
time.sleep(HOLD_S)
|
||||
finally:
|
||||
refresh.stop(blackout=True)
|
||||
artnet.close()
|
||||
@@ -0,0 +1,24 @@
|
||||
"""Stage layout / pointing unit tests (no camera)."""
|
||||
|
||||
from stage_layout import load_cans, pick_can
|
||||
|
||||
|
||||
def test_load_eight_cans():
|
||||
cans = load_cans()
|
||||
assert len(cans) == 8
|
||||
assert [c.label for c in cans] == [f"#{i}" for i in range(1, 9)]
|
||||
|
||||
|
||||
def test_pick_upper_left_is_wall_can():
|
||||
cans = load_cans()
|
||||
hit = pick_can((0.35, 0.55), (0.18, 0.32), cans)
|
||||
assert hit is not None
|
||||
assert hit.label in {"#1", "#2"}
|
||||
|
||||
|
||||
def test_pick_bottom_row():
|
||||
cans = load_cans()
|
||||
left = pick_can((0.40, 0.70), (0.28, 0.78), cans)
|
||||
right = pick_can((0.60, 0.70), (0.72, 0.78), cans)
|
||||
assert left is not None and left.index <= 3
|
||||
assert right is not None and right.index >= 4
|
||||
Reference in new issue
Block a user