More test run data
This commit is contained in:
BIN
scripts/__pycache__/serial_direct_response_sweep.cpython-312.pyc
Normal file
BIN
scripts/__pycache__/serial_direct_response_sweep.cpython-312.pyc
Normal file
Binary file not shown.
@@ -159,6 +159,11 @@ def parse_args() -> argparse.Namespace:
|
||||
parser.add_argument("--log", help="append sweep log to this file")
|
||||
parser.add_argument("--dry-run", action="store_true")
|
||||
parser.add_argument("--stop-on-anomaly", action="store_true")
|
||||
parser.add_argument(
|
||||
"--pause-on-anomaly",
|
||||
action="store_true",
|
||||
help="after logging an anomaly, wait for Enter so the RCP can be power-cycled before continuing",
|
||||
)
|
||||
parser.add_argument("--verbose-heartbeat", action="store_true")
|
||||
parser.add_argument("--cycles", type=int, default=1)
|
||||
parser.add_argument("--cycle-pause", type=float, default=0.0)
|
||||
@@ -171,6 +176,18 @@ def parse_args() -> argparse.Namespace:
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def pause_after_anomaly(ser: serial.Serial, emit, label: str) -> bool:
|
||||
answer = input(
|
||||
f"{label}: anomaly logged. Power-cycle RCP, wait for heartbeat, "
|
||||
"then press Enter to continue (q then Enter to stop): "
|
||||
).strip()
|
||||
if answer.lower() in {"q", "quit", "stop"}:
|
||||
emit("Stopped after anomaly pause.")
|
||||
return False
|
||||
ser.reset_input_buffer()
|
||||
return True
|
||||
|
||||
|
||||
def main() -> int:
|
||||
args = parse_args()
|
||||
if args.cycles < 1:
|
||||
@@ -253,6 +270,13 @@ def main() -> int:
|
||||
emit("Stopping after anomaly.")
|
||||
should_stop = True
|
||||
break
|
||||
if args.pause_on_anomaly and not pause_after_anomaly(
|
||||
ser,
|
||||
emit,
|
||||
f"cmd=0x{command:02X}",
|
||||
):
|
||||
should_stop = True
|
||||
break
|
||||
elif args.verbose_heartbeat:
|
||||
emit(f"{stamp} {note}")
|
||||
|
||||
@@ -269,6 +293,12 @@ def main() -> int:
|
||||
if args.stop_on_anomaly:
|
||||
emit("Stopping after anomaly.")
|
||||
break
|
||||
if args.pause_on_anomaly and not pause_after_anomaly(
|
||||
ser,
|
||||
emit,
|
||||
f"cycle {cycle} pause",
|
||||
):
|
||||
break
|
||||
|
||||
final_rx = read_window(ser, args.after)
|
||||
final_anomaly, final_note = classify_rx(final_rx)
|
||||
|
||||
Reference in New Issue
Block a user