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:
BIN
debug_annotated_20260416_094607.png
Normal file
BIN
debug_annotated_20260416_094607.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 256 KiB |
BIN
debug_dot_roi_20260416_094607.png
Normal file
BIN
debug_dot_roi_20260416_094607.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
BIN
debug_full_20260416_094607.png
Normal file
BIN
debug_full_20260416_094607.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 258 KiB |
@@ -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)")
|
||||||
|
|||||||
Reference in New Issue
Block a user