generated from hulk/gd32f4xx_template_cmake_vscode
Tools: PID debug toolchain from V0.1.x bring-up
test_run.py: judged closed-loop test over COM5 (fixed sequence, J1~J4
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Segment climb-rate analysis from test_events.log (2C buckets)."""
|
||||
import re
|
||||
|
||||
rows = []
|
||||
for ln in open("test_events.log", encoding="utf-8", errors="replace"):
|
||||
m = re.match(r"^([\d.]+) . ([\d.]+) \[B5", ln)
|
||||
if m:
|
||||
rows.append((float(m.group(1)), float(m.group(2))))
|
||||
|
||||
if not rows:
|
||||
print("no frames")
|
||||
raise SystemExit
|
||||
|
||||
t0 = rows[0][0]
|
||||
print(f"{len(rows)} frames, span {rows[-1][0]-t0:.0f}s")
|
||||
|
||||
segs = {}
|
||||
for t, v in rows:
|
||||
segs.setdefault(int(v // 2) * 2, []).append((t, v))
|
||||
for k in sorted(segs):
|
||||
seg = segs[k]
|
||||
dt = seg[-1][0] - seg[0][0]
|
||||
dv = seg[-1][1] - seg[0][1]
|
||||
rate = dv / dt if dt > 0 else 0
|
||||
print(f" [{k:3d}-{k+2:3d}C] {dt:6.1f}s rate={rate:+.3f} C/s ({seg[0][1]:.1f}->{seg[-1][1]:.1f})")
|
||||
Reference in New Issue
Block a user