fix(report): attach sensor-check strip to the waveform panel; move "0.0"

Match Blastware's layout, measured off the reference PDF: the sensor-check
strip shares a border with the main waveform panel (no gap between them), and
the per-lane "0.0" baseline labels sit to the RIGHT of the strip. Previously
the strip floated with a gap and the "0.0" label overprinted the strip's left
edge. Purely layout — the traces and decode are unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YDXjZCr4RqT2U3QvMDhgzf
This commit is contained in:
2026-09-15 05:48:31 +00:00
co-authored by Claude Opus 4.8
parent 2c5c20cfd7
commit 2a747f6893
+15 -6
View File
@@ -856,9 +856,12 @@ def _draw_waveform_subplot(fig, gridspec_cell, rd: ReportData) -> None:
order = ["MicL", "Long", "Vert", "Tran"] order = ["MicL", "Long", "Vert", "Tran"]
has_sc = bool(rd.sensor_check_waveforms) has_sc = bool(rd.sensor_check_waveforms)
if has_sc: if has_sc:
# main lanes + a narrow sensor-check strip column on the right # main lanes + a narrow sensor-check strip column, flush against the
inner = gridspec_cell.subgridspec(4, 2, width_ratios=[1.0, 0.15], # main panel (BW shares the border — no gap), with the "0.0" baseline
wspace=0.04, hspace=0.0) # labels moved to the right of the strip. Proportions match BW's
# Event Report (main ~0.75 / strip ~0.10 of the panel width).
inner = gridspec_cell.subgridspec(4, 2, width_ratios=[1.0, 0.13],
wspace=0.0, hspace=0.0)
else: else:
inner = gridspec_cell.subgridspec(4, 1, hspace=0.0) inner = gridspec_cell.subgridspec(4, 1, hspace=0.0)
sr = rd.sample_rate_sps or 1024 sr = rd.sample_rate_sps or 1024
@@ -902,9 +905,12 @@ def _draw_waveform_subplot(fig, gridspec_cell, rd: ReportData) -> None:
# Channel label on the LEFT (matches BW) # Channel label on the LEFT (matches BW)
ax.set_ylabel(ch, fontsize=8, rotation=0, ha="right", va="center", ax.set_ylabel(ch, fontsize=8, rotation=0, ha="right", va="center",
color=_channel_axis_color(ch), weight="bold", labelpad=14) color=_channel_axis_color(ch), weight="bold", labelpad=14)
# "0.0" on the RIGHT (BW convention) # "0.0" baseline label on the RIGHT (BW convention). With the sensor-
ax.text(1.005, 0.5, "0.0", transform=ax.transAxes, # check strip attached, it goes to the right of the STRIP (drawn below);
fontsize=7, color="#555", va="center", ha="left") # otherwise just outside the main lane.
if not has_sc:
ax.text(1.005, 0.5, "0.0", transform=ax.transAxes,
fontsize=7, color="#555", va="center", ha="left")
ax.grid(True, linestyle="--", linewidth=0.3, color="#bbb", alpha=0.6) ax.grid(True, linestyle="--", linewidth=0.3, color="#bbb", alpha=0.6)
# Vertical dashed trigger line at t=0 # Vertical dashed trigger line at t=0
@@ -944,6 +950,9 @@ def _draw_waveform_subplot(fig, gridspec_cell, rd: ReportData) -> None:
scx.set_xticks([]); scx.set_yticks([]) scx.set_xticks([]); scx.set_yticks([])
for _s in scx.spines.values(): for _s in scx.spines.values():
_s.set_linewidth(0.4); _s.set_color("#999") _s.set_linewidth(0.4); _s.set_color("#999")
# "0.0" baseline label to the RIGHT of the strip (BW convention)
scx.text(1.10, 0.5, "0.0", transform=scx.transAxes,
fontsize=7, color="#555", va="center", ha="left")
# Trigger triangle marker ▼ above the top channel at t=0 # Trigger triangle marker ▼ above the top channel at t=0
top_ax = main_axes[0] # MicL top_ax = main_axes[0] # MicL