Pick the simulator's stage map from a drop-down, and make the QLC+ show optional.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Opus 5.5 committed 2026-10-22 14:05:42 +13:00
1 parent df05c8ca49
commit a295fefac0
8 files changed
+154 -20

No files matched your search

+12 -7
View File
@@ -6,6 +6,10 @@ Art-Net. Open the printed URL and point QLC+ Art-Net output at this machine.
python -m simulator
python -m simulator --stage stage/map.json --show shows/templeoftechno.qxw
python -m simulator --demo
The show is optional: it only fills addresses the stage map leaves out, and
shows the QLC+ Art-Net output it sends to. The page can switch to any other
stage map in the same folder.
"""
from __future__ import annotations
@@ -114,24 +118,25 @@ def _parse_host_port(value: str, default_port: int) -> tuple[str, int]:
def main() -> None:
parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument("--stage", type=Path, default=ROOT / "stage" / "map.json")
parser.add_argument("--show", type=Path, default=ROOT / "shows" / "templeoftechno.qxw")
parser.add_argument("--no-show", action="store_true", help="Use addresses stored in the stage file only")
parser.add_argument("--show", type=Path, help="QLC+ workspace to fill addresses the stage map leaves out")
parser.add_argument("--no-show", action="store_true", help="Ignore --show (kept for older commands)")
parser.add_argument("--http", default="0.0.0.0:8765", help="Web view host:port")
parser.add_argument("--artnet", default="0.0.0.0:6454", help="Art-Net listen host:port")
parser.add_argument("--demo", action="store_true", help="Play a local look when you want to see the rig without QLC+")
args = parser.parse_args()
stage = load_stage(args.stage)
if not args.no_show:
if not args.show.is_file():
raise SystemExit(f"Show not found: {args.show}")
apply_show(stage, args.show)
show = None if args.no_show else args.show
if show is not None:
if not show.is_file():
raise SystemExit(f"Show not found: {show}")
apply_show(stage, show)
http_host, http_port = _parse_host_port(args.http, 8765)
artnet_host, artnet_port = _parse_host_port(args.artnet, 6454)
node = ArtNetNode(artnet_host, artnet_port)
node.start()
server = make_server(Simulator(stage, node), http_host, http_port)
server = make_server(Simulator(stage, node, show), http_host, http_port)
print("Stage simulator", flush=True)
print(f" stage: {args.stage}", flush=True)