feat(debug): add --delay countdown so user can bring target to front

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-04-16 06:48:07 +00:00
parent f43f5ce93b
commit ecd1b23e11
4 changed files with 14 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 KiB

View File

@@ -63,7 +63,11 @@ def main(argv=None) -> None:
) )
# debug # debug
sub.add_parser("debug", help="Capture one frame, run detector, annotate + print result") p_debug = sub.add_parser("debug", help="Capture one frame, run detector, annotate + print result")
p_debug.add_argument(
"--delay", type=float, default=3.0, metavar="SEC",
help="Seconds to wait before capture (bring TradeStation to front first). Default 3.",
)
# report # report
p_report = sub.add_parser("report", help="Print weekly performance report") p_report = sub.add_parser("report", help="Print weekly performance report")
@@ -155,6 +159,15 @@ def _cmd_debug(args) -> None:
cfg = Config.load_current(Path("configs")) cfg = Config.load_current(Path("configs"))
capture = _build_capture(cfg) capture = _build_capture(cfg)
delay = getattr(args, "delay", 0.0)
if delay > 0:
print(f"Bring TradeStation to front. Capturing in {delay:.0f}s...", flush=True)
for i in range(int(delay), 0, -1):
print(f" {i}...", flush=True)
time.sleep(1.0)
print("CAPTURE", flush=True)
frame = capture() frame = capture()
if frame is None: if frame is None:
sys.exit("capture returned None (window not found or region invalid)") sys.exit("capture returned None (window not found or region invalid)")