fix(wafer): derive family sensor counts from YAML layouts, bound frame decode to layout

This commit is contained in:
jack
2026-07-13 11:52:56 -07:00
parent c76cddc5fd
commit 92ff6fbd14
5 changed files with 48 additions and 31 deletions
+9 -4
View File
@@ -1,9 +1,14 @@
"""Single source of truth for the wafer sensor-count partition."""
from __future__ import annotations
from pygui.backend.wafer.wafer_layouts import load_layout_for_wafer_id
def sensor_count_for(family_code: str) -> int:
"""Return the number of valid sensor readings for a wafer family code.
"""Real sensor count for a wafer family code, from its YAML layout.
Returns 80 for the "X" family. Returns 244 for every other family
code."""
return 80 if family_code == "X" else 244
0 for an unknown/empty family code."""
try:
return len(load_layout_for_wafer_id(family_code))
except KeyError:
return 0
+1 -11
View File
@@ -20,17 +20,7 @@ log = logging.getLogger(__name__)
def csv_column_count(family_code: str) -> int:
"""Return the number of columns to display for a family code."""
mapping = {
"A": 48,
"E": 48,
"P": 48,
"B": 29,
"C": 29,
"D": 29,
"F": 22,
"X": 80,
}
return mapping.get(family_code, 0)
return sensor_count_for(family_code)
def _hex_to_binary(hex_str: str) -> list[int]: