fix: 修复 BUG-007 PinList→PinMAP 上方引脚并入标题行,恢复独立2行
This commit is contained in:
@@ -103,27 +103,28 @@ def calculate_layout(
|
|||||||
|
|
||||||
top_pins = entries[idx: idx + top_count]
|
top_pins = entries[idx: idx + top_count]
|
||||||
|
|
||||||
# ── 计算单元格坐标(v1.5.5:上边 Name 在 row 0,完全独立)──
|
# ── 计算单元格坐标(BUG-007 修复:上边 Name 在 row 2,标题独占 row 0)──
|
||||||
#
|
#
|
||||||
# 网格坐标体系(0-based):
|
# 网格坐标体系(0-based):
|
||||||
# 从网格边界往中心走,第一圈全是 Number,第二圈全是 Name
|
# 第 0 行完全由标题(A1 合并单元格,不包含引脚数据)独占
|
||||||
# 上边 Name 在 Number 上方 row 0,不与左/右边共享行
|
# 第 1 行是上边引脚序号,第 2 行是上边引脚 PinName
|
||||||
|
# 从第 3 行开始是左/下/右边引脚
|
||||||
#
|
#
|
||||||
# 左边: Number (r, 0) r ∈ [2, rows+1] Name (r, 1)
|
# 左边: Number (r, 0) r ∈ [3, rows+2] Name (r, 1)
|
||||||
# 下边: Number (rows+3, c) c ∈ [1, cols] Name (rows+2, c)
|
# 下边: Number (rows+4, c) c ∈ [1, cols] Name (rows+3, c)
|
||||||
# 右边: Number (r, cols+1) r ∈ [rows+1, 2] Name (r, cols) 逆序
|
# 右边: Number (r, cols+1) r ∈ [rows+2, 3] Name (r, cols) 逆序
|
||||||
# 上边: Number (1, c) c ∈ [cols, 1] Name (0, c) 逆序
|
# 上边: Number (1, c) c ∈ [cols, 1] Name (2, c) 逆序
|
||||||
#
|
#
|
||||||
# Pin1: Number (2,0) = A3, Name (2,1) = B3 — 左上角
|
# Pin1: Number (3,0) = A4, Name (3,1) = B4 — 左上角
|
||||||
|
|
||||||
# 左边:从上到下 (rows 个)
|
# 左边:从上到下 (rows 个)
|
||||||
left_cells = [(r, 0) for r in range(2, rows + 2)]
|
left_cells = [(r, 0) for r in range(3, rows + 3)]
|
||||||
|
|
||||||
# 下边:从左到右 (cols 个),Number 在最底行 rows+3
|
# 下边:从左到右 (cols 个),Number 在最底行 rows+4
|
||||||
bottom_cells = [(rows + 3, c) for c in range(1, cols + 1)]
|
bottom_cells = [(rows + 4, c) for c in range(1, cols + 1)]
|
||||||
|
|
||||||
# 右边:从下到上 (rows 个),Number 在 cols+1 列(右扩一列)
|
# 右边:从下到上 (rows 个),Number 在 cols+1 列(右扩一列)
|
||||||
right_cells = [(r, cols + 1) for r in range(rows + 1, 1, -1)]
|
right_cells = [(r, cols + 1) for r in range(rows + 2, 2, -1)]
|
||||||
|
|
||||||
# 上边:从右到左 (cols 个)
|
# 上边:从右到左 (cols 个)
|
||||||
top_cells = [(1, c) for c in range(cols, 0, -1)]
|
top_cells = [(1, c) for c in range(cols, 0, -1)]
|
||||||
@@ -173,8 +174,8 @@ def get_name_cell(num_cell: tuple[int, int], edge_name: str,
|
|||||||
return (r, c - 1) # Name 在 Number 左侧 (col cols)
|
return (r, c - 1) # Name 在 Number 左侧 (col cols)
|
||||||
elif edge_name == "top":
|
elif edge_name == "top":
|
||||||
# Top Number 在 (1, c), c ∈ [cols..1]
|
# Top Number 在 (1, c), c ∈ [cols..1]
|
||||||
# Name 在 Number 上方 (0, c),即 Excel 第 1 行
|
# Name 在 Number 下方 (2, c)
|
||||||
# 不再需要角点例外——整个上边 Name 在独立一行
|
# row 0 完全由标题行(A1 合并单元格)独占
|
||||||
return (0, c) # Name 在 Number 上方
|
return (2, c) # Name 在 Number 下方(row 2)
|
||||||
else:
|
else:
|
||||||
raise LayoutError(f"未知的边名称: {edge_name}")
|
raise LayoutError(f"未知的边名称: {edge_name}")
|
||||||
|
|||||||
@@ -16,35 +16,36 @@ from pinlist_generator import generate_pinlist
|
|||||||
from utils import rc_to_cell_ref
|
from utils import rc_to_cell_ref
|
||||||
|
|
||||||
|
|
||||||
# ── 4x4 example (v1.5.5 layout) ───────────────────────────────
|
# ── 4x4 example (BUG-007 fixed layout) ─────────────────────────
|
||||||
# Layout: rows=4, cols=4, 16 pins
|
# Layout: rows=4, cols=4, 16 pins
|
||||||
# Top: Name row 0 (B1..E1), Number row 1 (B2..E2)
|
# Title: A1 "QFP-44" (row 0 only)
|
||||||
# Left: Number A3..A6 (rows 2..5), Name B3..B6 (rows 2..5)
|
# Top: Number row 1 (B2..E2), Name row 2 (B3..E3)
|
||||||
# Bottom: Name B7..E7 (row 6), Number B8..E8 (row 7)
|
# Left: Number A4..A7 (rows 3..6), Name B4..B7 (rows 3..6)
|
||||||
# Right: Number F6..F3 (rows 5..2), Name E6..E3 (rows 5..2)
|
# Bottom: Name B8..E8 (row 7), Number B9..E9 (row 8)
|
||||||
# A1: "QFP-44" = package info
|
# Right: Number F7..F4 (rows 6..3), Name E7..E4 (rows 6..3)
|
||||||
|
# A1: "QFP-44" = package info (title, merged, row 0 only)
|
||||||
#
|
#
|
||||||
# Pin1: Number A3=(2,0), Name B3=(2,1)
|
# Pin1: Number A4=(3,0), Name B4=(3,1)
|
||||||
|
|
||||||
cells_4x4 = {
|
cells_4x4 = {
|
||||||
(0, 0): "QFP-44",
|
(0, 0): "QFP-44",
|
||||||
# top edge Names (row 0, cols 1..4)
|
|
||||||
(0, 1): "Pin16", (0, 2): "Pin15", (0, 3): "Pin14", (0, 4): "Pin13",
|
|
||||||
# top edge Numbers (row 1, cols 1..4)
|
# top edge Numbers (row 1, cols 1..4)
|
||||||
(1, 1): "16", (1, 2): "15", (1, 3): "14", (1, 4): "13",
|
(1, 1): "16", (1, 2): "15", (1, 3): "14", (1, 4): "13",
|
||||||
# left edge (rows 2..5, cols 0..1)
|
# top edge Names (row 2, cols 1..4)
|
||||||
(2, 0): "1", (2, 1): "Pin1",
|
(2, 1): "Pin16", (2, 2): "Pin15", (2, 3): "Pin14", (2, 4): "Pin13",
|
||||||
(3, 0): "2", (3, 1): "Pin2",
|
# left edge (rows 3..6, cols 0..1)
|
||||||
(4, 0): "3", (4, 1): "Pin3",
|
(3, 0): "1", (3, 1): "Pin1",
|
||||||
(5, 0): "4", (5, 1): "Pin4",
|
(4, 0): "2", (4, 1): "Pin2",
|
||||||
# bottom edge (rows 6..7, cols 1..4)
|
(5, 0): "3", (5, 1): "Pin3",
|
||||||
(6, 1): "Pin5", (6, 2): "Pin6", (6, 3): "Pin7", (6, 4): "Pin8",
|
(6, 0): "4", (6, 1): "Pin4",
|
||||||
(7, 1): "5", (7, 2): "6", (7, 3): "7", (7, 4): "8",
|
# bottom edge (rows 7..8, cols 1..4)
|
||||||
# right edge (rows 5..2, cols 4..5)
|
(7, 1): "Pin5", (7, 2): "Pin6", (7, 3): "Pin7", (7, 4): "Pin8",
|
||||||
(5, 4): "Pin9", (5, 5): "9",
|
(8, 1): "5", (8, 2): "6", (8, 3): "7", (8, 4): "8",
|
||||||
(4, 4): "Pin10", (4, 5): "10",
|
# right edge (rows 6..3, cols 4..5)
|
||||||
(3, 4): "Pin11", (3, 5): "11",
|
(6, 4): "Pin9", (6, 5): "9",
|
||||||
(2, 4): "Pin12", (2, 5): "12",
|
(5, 4): "Pin10", (5, 5): "10",
|
||||||
|
(4, 4): "Pin11", (4, 5): "11",
|
||||||
|
(3, 4): "Pin12", (3, 5): "12",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -111,7 +112,7 @@ def test_missing_names_warning():
|
|||||||
|
|
||||||
def test_duplicate_numbers():
|
def test_duplicate_numbers():
|
||||||
cells = dict(cells_4x4)
|
cells = dict(cells_4x4)
|
||||||
cells[(3, 0)] = "1" # duplicate pin 1 (original at (2,0))
|
cells[(4, 0)] = "1" # duplicate pin 1 (original at (3,0))
|
||||||
pm = parse_pinmap(cells)
|
pm = parse_pinmap(cells)
|
||||||
vr = validate_pinmap(pm)
|
vr = validate_pinmap(pm)
|
||||||
assert not vr.is_valid
|
assert not vr.is_valid
|
||||||
@@ -121,7 +122,7 @@ def test_duplicate_numbers():
|
|||||||
|
|
||||||
def test_gap_in_numbers():
|
def test_gap_in_numbers():
|
||||||
cells = dict(cells_4x4)
|
cells = dict(cells_4x4)
|
||||||
cells[(7, 2)] = "10" # skip pin 6 (was "6" at (7,2))
|
cells[(8, 2)] = "10" # skip pin 6 (was "6" at (8,2))
|
||||||
pm = parse_pinmap(cells)
|
pm = parse_pinmap(cells)
|
||||||
vr = validate_pinmap(pm)
|
vr = validate_pinmap(pm)
|
||||||
assert not vr.is_valid
|
assert not vr.is_valid
|
||||||
@@ -176,26 +177,26 @@ def test_rectangular_parse():
|
|||||||
|
|
||||||
def test_12pin_square():
|
def test_12pin_square():
|
||||||
"""A 3×3 square: 12 pins (3 pins per edge).
|
"""A 3×3 square: 12 pins (3 pins per edge).
|
||||||
Using v1.5.5 layout: top names at row 0, top numbers at row 1.
|
Using BUG-007 fixed layout: top numbers at row 1, top names at row 2.
|
||||||
left: 1,2,3 bottom: 4,5,6 right: 7,8,9 top: 12,11,10
|
left: 1,2,3 bottom: 4,5,6 right: 7,8,9 top: 12,11,10
|
||||||
"""
|
"""
|
||||||
cells = {
|
cells = {
|
||||||
(0, 0): "QFP-12",
|
(0, 0): "QFP-12",
|
||||||
# top Names (row 0, cols 1..3)
|
|
||||||
(0, 1): "RST", (0, 2): "VSS", (0, 3): "VDD",
|
|
||||||
# top Numbers (row 1, cols 1..3)
|
# top Numbers (row 1, cols 1..3)
|
||||||
(1, 1): "12", (1, 2): "11", (1, 3): "10",
|
(1, 1): "12", (1, 2): "11", (1, 3): "10",
|
||||||
|
# top Names (row 2, cols 1..3)
|
||||||
|
(2, 1): "RST", (2, 2): "VSS", (2, 3): "VDD",
|
||||||
# left (col 0) — names at col 1
|
# left (col 0) — names at col 1
|
||||||
(2, 0): "1", (2, 1): "VCC",
|
(3, 0): "1", (3, 1): "VCC",
|
||||||
(3, 0): "2", (3, 1): "GND",
|
(4, 0): "2", (4, 1): "GND",
|
||||||
(4, 0): "3", (4, 1): "IN1",
|
(5, 0): "3", (5, 1): "IN1",
|
||||||
# bottom Names (row 5), Numbers (row 6)
|
# bottom Names (row 6), Numbers (row 7)
|
||||||
(5, 1): "IN2", (5, 2): "OUT1", (5, 3): "OUT2",
|
(6, 1): "IN2", (6, 2): "OUT1", (6, 3): "OUT2",
|
||||||
(6, 1): "4", (6, 2): "5", (6, 3): "6",
|
(7, 1): "4", (7, 2): "5", (7, 3): "6",
|
||||||
# right (col 4 Number, col 3 Name) — bottom to top: 7, 8, 9
|
# right (col 4 Number, col 3 Name) — bottom to top: 7, 8, 9
|
||||||
(4, 3): "CTL1", (4, 4): "7",
|
(5, 3): "CTL1", (5, 4): "7",
|
||||||
(3, 3): "CTL2", (3, 4): "8",
|
(4, 3): "CTL2", (4, 4): "8",
|
||||||
(2, 3): "NC1", (2, 4): "9",
|
(3, 3): "NC1", (3, 4): "9",
|
||||||
}
|
}
|
||||||
pm = parse_pinmap(cells)
|
pm = parse_pinmap(cells)
|
||||||
assert len(pm.pins) == 12, f"expected 12, got {len(pm.pins)}"
|
assert len(pm.pins) == 12, f"expected 12, got {len(pm.pins)}"
|
||||||
@@ -260,40 +261,40 @@ def test_f012_pinname_position():
|
|||||||
output_path=None,
|
output_path=None,
|
||||||
)
|
)
|
||||||
|
|
||||||
# ── 3. 检查单元格位置 (v1.5.5) ─────────────────────────────
|
# ── 3. 检查单元格位置 (BUG-007 fixed) ─────────────────────
|
||||||
# 5×5: rows=5, cols=5, 20 pins
|
# 5×5: rows=5, cols=5, 20 pins
|
||||||
# 上边: Name (0, 1..5), Number (1, 5..1)
|
# 上边: Number (1, 5..1), Name (2, 1..5)
|
||||||
# 左边: Number (2..6, 0), Name (2..6, 1)
|
# 左边: Number (3..7, 0), Name (3..7, 1)
|
||||||
# 下边: Name (7, 1..5), Number (8, 1..5)
|
# 下边: Name (8, 1..5), Number (9, 1..5)
|
||||||
# 右边: Number (6..2, 6), Name (6..2, 5)
|
# 右边: Number (7..3, 6), Name (7..3, 5)
|
||||||
|
|
||||||
# ── 3a. 验证上边 Name 位置 (0, 1..cols) ─────────────────
|
# ── 3a. 验证上边 Name 位置 (2, 1..cols) ─────────────────
|
||||||
for c in range(1, cols + 1):
|
for c in range(1, cols + 1):
|
||||||
num_ref = rc_to_cell_ref(1, c) # Number at row 1
|
num_ref = rc_to_cell_ref(1, c) # Number at row 1
|
||||||
name_ref = rc_to_cell_ref(0, c) # Name at row 0
|
name_ref = rc_to_cell_ref(2, c) # Name at row 2
|
||||||
assert num_ref in data, f"上边 Number {num_ref} 缺失"
|
assert num_ref in data, f"上边 Number {num_ref} 缺失"
|
||||||
assert name_ref in data, (
|
assert name_ref in data, (
|
||||||
f"上边 Name 应在 {name_ref} (row 0), 但未找到。Number 在 {num_ref}"
|
f"上边 Name 应在 {name_ref} (row 2), 但未找到。Number 在 {num_ref}"
|
||||||
)
|
)
|
||||||
|
|
||||||
# ── 3b. 验证下边 Name 位置 (rows+2=7, 1..cols) ──────────
|
# ── 3b. 验证下边 Name 位置 (rows+3=8, 1..cols) ──────────
|
||||||
for c in range(1, cols + 1):
|
for c in range(1, cols + 1):
|
||||||
num_ref = rc_to_cell_ref(rows + 3, c) # Number at row 8
|
num_ref = rc_to_cell_ref(rows + 4, c) # Number at row 9
|
||||||
name_ref = rc_to_cell_ref(rows + 2, c) # Name at row 7
|
name_ref = rc_to_cell_ref(rows + 3, c) # Name at row 8
|
||||||
assert num_ref in data, f"下边 Number {num_ref} 缺失"
|
assert num_ref in data, f"下边 Number {num_ref} 缺失"
|
||||||
assert name_ref in data, (
|
assert name_ref in data, (
|
||||||
f"下边 Name 应在 {name_ref} (rows+2), 但未找到。Number 在 {num_ref}"
|
f"下边 Name 应在 {name_ref} (rows+3), 但未找到。Number 在 {num_ref}"
|
||||||
)
|
)
|
||||||
|
|
||||||
# ── 3c. 验证左边 Name 位置 (2..6, 1) ───────────────────
|
# ── 3c. 验证左边 Name 位置 (3..7, 1) ───────────────────
|
||||||
for r in range(2, rows + 2):
|
for r in range(3, rows + 3):
|
||||||
num_ref = rc_to_cell_ref(r, 0)
|
num_ref = rc_to_cell_ref(r, 0)
|
||||||
name_ref = rc_to_cell_ref(r, 1)
|
name_ref = rc_to_cell_ref(r, 1)
|
||||||
assert num_ref in data, f"左边 Number {num_ref} 缺失"
|
assert num_ref in data, f"左边 Number {num_ref} 缺失"
|
||||||
assert name_ref in data, f"左边 Name {name_ref} 缺失"
|
assert name_ref in data, f"左边 Name {name_ref} 缺失"
|
||||||
|
|
||||||
# ── 3d. 验证右边 Name 位置 (6..2, 5) ────────────────────
|
# ── 3d. 验证右边 Name 位置 (7..3, 5) ────────────────────
|
||||||
for r in range(rows + 1, 1, -1):
|
for r in range(rows + 2, 2, -1):
|
||||||
num_ref = rc_to_cell_ref(r, cols + 1)
|
num_ref = rc_to_cell_ref(r, cols + 1)
|
||||||
name_ref = rc_to_cell_ref(r, cols)
|
name_ref = rc_to_cell_ref(r, cols)
|
||||||
assert num_ref in data, f"右边 Number {num_ref} 缺失"
|
assert num_ref in data, f"右边 Number {num_ref} 缺失"
|
||||||
@@ -709,6 +710,7 @@ def test_f016_qfn60_list_to_map():
|
|||||||
- A1 = "QFN60"
|
- A1 = "QFN60"
|
||||||
- 所有 60 个引脚都有 Name 和 Number 单元格
|
- 所有 60 个引脚都有 Name 和 Number 单元格
|
||||||
- 四边布局正确(left/bottom/right/top 各 15 个)
|
- 四边布局正确(left/bottom/right/top 各 15 个)
|
||||||
|
- 标题行独立(A1 独占 row 0,不混入引脚数据)
|
||||||
"""
|
"""
|
||||||
data = generate_pinmap(
|
data = generate_pinmap(
|
||||||
entries=QFN60_PINLIST_ENTRIES,
|
entries=QFN60_PINLIST_ENTRIES,
|
||||||
@@ -730,9 +732,17 @@ def test_f016_qfn60_list_to_map():
|
|||||||
f"A1 应为 {QFN60_PACKAGE_INFO},实际: {data.get('A1')}"
|
f"A1 应为 {QFN60_PACKAGE_INFO},实际: {data.get('A1')}"
|
||||||
)
|
)
|
||||||
|
|
||||||
# ── 验证所有 60 个引脚都有 Name 和 Number ───────────
|
# ── 验证标题行独立(BUG-007)─────────────────────────
|
||||||
|
# A1 是唯一在 row 0 的单元格,无引脚数据混入
|
||||||
from utils import cell_ref_to_rc
|
from utils import cell_ref_to_rc
|
||||||
|
for ref, val in data.items():
|
||||||
|
r, c = cell_ref_to_rc(ref)
|
||||||
|
if r == 0:
|
||||||
|
assert ref == "A1", (
|
||||||
|
f"row 0 应只有 A1 标题,但发现 {ref}={val}"
|
||||||
|
)
|
||||||
|
|
||||||
|
# ── 验证所有 60 个引脚都有 Name 和 Number ───────────
|
||||||
name_cells = {}
|
name_cells = {}
|
||||||
num_cells = {}
|
num_cells = {}
|
||||||
for ref, val in data.items():
|
for ref, val in data.items():
|
||||||
@@ -767,58 +777,60 @@ def test_f016_qfn60_list_to_map():
|
|||||||
f"Number 单元格应覆盖 1..60\n缺失: {sorted(set(range(1,61)) - all_numbers)}"
|
f"Number 单元格应覆盖 1..60\n缺失: {sorted(set(range(1,61)) - all_numbers)}"
|
||||||
)
|
)
|
||||||
|
|
||||||
# ── 验证四边布局 ───────────────────────────────────
|
# ── 验证四边布局(BUG-007 fixed layout)──────────────
|
||||||
# v1.5.5 Layout A:
|
# BUG-007 修复布局:
|
||||||
# Top: Name (0, 1..15), Number (1, 15..1)
|
# Title: A1 (row 0 only)
|
||||||
# Left: Number (2..16, 0), Name (2..16, 1)
|
# Top Numbers: (1, 1..15)
|
||||||
# Bottom: Name (17, 1..15), Number (18, 1..15)
|
# Top Names: (2, 1..15)
|
||||||
# Right: Number (16..2, 16), Name (16..2, 15)
|
# Left: Number (3..17, 0), Name (3..17, 1)
|
||||||
|
# Bottom: Name (18, 1..15), Number (19, 1..15)
|
||||||
# Top Names 在 row 0
|
# Right: Number (17..3, 16), Name (17..3, 15)
|
||||||
for c in range(1, QFN60_COLS + 1):
|
|
||||||
ref = rc_to_cell_ref(0, c)
|
|
||||||
assert ref in data, f"Top Name {ref} 缺失"
|
|
||||||
assert data[ref].startswith("Pin"), f"Top Name {ref} = {data[ref]}"
|
|
||||||
|
|
||||||
# Top Numbers 在 row 1
|
# Top Numbers 在 row 1
|
||||||
for c in range(1, QFN60_COLS + 1):
|
for c in range(1, QFN60_COLS + 1):
|
||||||
ref = rc_to_cell_ref(1, c)
|
ref = rc_to_cell_ref(1, c)
|
||||||
assert ref in data, f"Top Number {ref} 缺失"
|
assert ref in data, f"Top Number {ref} 缺失"
|
||||||
|
|
||||||
# Left Numbers 在 col 0, rows 2..16
|
# Top Names 在 row 2
|
||||||
for r in range(2, QFN60_ROWS + 2):
|
for c in range(1, QFN60_COLS + 1):
|
||||||
|
ref = rc_to_cell_ref(2, c)
|
||||||
|
assert ref in data, f"Top Name {ref} 缺失"
|
||||||
|
assert data[ref].startswith("Pin"), f"Top Name {ref} = {data[ref]}"
|
||||||
|
|
||||||
|
# Left Numbers 在 col 0, rows 3..17
|
||||||
|
for r in range(3, QFN60_ROWS + 3):
|
||||||
ref = rc_to_cell_ref(r, 0)
|
ref = rc_to_cell_ref(r, 0)
|
||||||
assert ref in data, f"Left Number {ref} 缺失"
|
assert ref in data, f"Left Number {ref} 缺失"
|
||||||
|
|
||||||
# Left Names 在 col 1, rows 2..16
|
# Left Names 在 col 1, rows 3..17
|
||||||
for r in range(2, QFN60_ROWS + 2):
|
for r in range(3, QFN60_ROWS + 3):
|
||||||
ref = rc_to_cell_ref(r, 1)
|
ref = rc_to_cell_ref(r, 1)
|
||||||
assert ref in data, f"Left Name {ref} 缺失"
|
assert ref in data, f"Left Name {ref} 缺失"
|
||||||
assert data[ref].startswith("Pin"), f"Left Name {ref} = {data[ref]}"
|
assert data[ref].startswith("Pin"), f"Left Name {ref} = {data[ref]}"
|
||||||
|
|
||||||
# Bottom Names 在 row 17
|
# Bottom Names 在 row 18
|
||||||
for c in range(1, QFN60_COLS + 1):
|
for c in range(1, QFN60_COLS + 1):
|
||||||
ref = rc_to_cell_ref(QFN60_ROWS + 2, c)
|
ref = rc_to_cell_ref(QFN60_ROWS + 3, c)
|
||||||
assert ref in data, f"Bottom Name {ref} 缺失"
|
assert ref in data, f"Bottom Name {ref} 缺失"
|
||||||
assert data[ref].startswith("Pin"), f"Bottom Name {ref} = {data[ref]}"
|
assert data[ref].startswith("Pin"), f"Bottom Name {ref} = {data[ref]}"
|
||||||
|
|
||||||
# Bottom Numbers 在 row 18
|
# Bottom Numbers 在 row 19
|
||||||
for c in range(1, QFN60_COLS + 1):
|
for c in range(1, QFN60_COLS + 1):
|
||||||
ref = rc_to_cell_ref(QFN60_ROWS + 3, c)
|
ref = rc_to_cell_ref(QFN60_ROWS + 4, c)
|
||||||
assert ref in data, f"Bottom Number {ref} 缺失"
|
assert ref in data, f"Bottom Number {ref} 缺失"
|
||||||
|
|
||||||
# Right Numbers 在 col 16, rows 16..2
|
# Right Numbers 在 col 16, rows 17..3
|
||||||
for r in range(QFN60_ROWS + 1, 1, -1):
|
for r in range(QFN60_ROWS + 2, 2, -1):
|
||||||
ref = rc_to_cell_ref(r, QFN60_COLS + 1)
|
ref = rc_to_cell_ref(r, QFN60_COLS + 1)
|
||||||
assert ref in data, f"Right Number {ref} 缺失"
|
assert ref in data, f"Right Number {ref} 缺失"
|
||||||
|
|
||||||
# Right Names 在 col 15, rows 16..2
|
# Right Names 在 col 15, rows 17..3
|
||||||
for r in range(QFN60_ROWS + 1, 1, -1):
|
for r in range(QFN60_ROWS + 2, 2, -1):
|
||||||
ref = rc_to_cell_ref(r, QFN60_COLS)
|
ref = rc_to_cell_ref(r, QFN60_COLS)
|
||||||
assert ref in data, f"Right Name {ref} 缺失"
|
assert ref in data, f"Right Name {ref} 缺失"
|
||||||
assert data[ref].startswith("Pin"), f"Right Name {ref} = {data[ref]}"
|
assert data[ref].startswith("Pin"), f"Right Name {ref} = {data[ref]}"
|
||||||
|
|
||||||
print(f"✓ test_f016_qfn60_list_to_map passed (60 pins, Layout A)")
|
print(f"✓ test_f016_qfn60_list_to_map passed (60 pins, BUG-007 layout)")
|
||||||
|
|
||||||
|
|
||||||
def test_f017_roundtrip():
|
def test_f017_roundtrip():
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
### TC-MAP-002: 长方形PinMAP转换
|
### TC-MAP-002: 长方形PinMAP转换
|
||||||
- **结果**: ✅ 通过
|
- **结果**: ✅ 通过
|
||||||
- **详情**: 封装=LQFP100, Pin数=8, 序号递增
|
- **详情**: 封装=LQFP100, Pin数=11, 序号递增
|
||||||
|
|
||||||
### TC-MAP-003: 序号不连续检测
|
### TC-MAP-003: 序号不连续检测
|
||||||
- **结果**: ✅ 通过
|
- **结果**: ✅ 通过
|
||||||
|
|||||||
@@ -8,3 +8,4 @@
|
|||||||
| BUG-004 | 中 | 不支持循环处理流程 | 转换完成后继续操作 | 循环等待下一个文件,输入 Q 返回主菜单 | 处理完直接退出 | 已修复 | F008 |
|
| BUG-004 | 中 | 不支持循环处理流程 | 转换完成后继续操作 | 循环等待下一个文件,输入 Q 返回主菜单 | 处理完直接退出 | 已修复 | F008 |
|
||||||
| BUG-005 | 高 | 模板文件名/路径错误 | PinList↔PinMAP 转换时读取模板 | PinMAP 模板为 PinMAP-Template.xlsx,PinList 模板为 PinList-Template.xlsx | v1.5.4 只改文件名未改搜索路径,模板在 Code/src/Template/ 下但代码在根目录找 | 已修复 | v1.5.5 |
|
| BUG-005 | 高 | 模板文件名/路径错误 | PinList↔PinMAP 转换时读取模板 | PinMAP 模板为 PinMAP-Template.xlsx,PinList 模板为 PinList-Template.xlsx | v1.5.4 只改文件名未改搜索路径,模板在 Code/src/Template/ 下但代码在根目录找 | 已修复 | v1.5.5 |
|
||||||
| BUG-006 | 高 | PinList→PinMAP 上边 Name 与左边 Name 同行(数据无误但肉眼混淆) | 12×12 PinMap:PinList→PinMAP 转换后查看输出 | 每条边的 Name 和 Number 在独立行/列区域,肉眼可辨 | v1.5.4 上边 Name 在 row 2,与左边 Name(row 2)同行,3 条边数据混在同一行 | 已修复 | v1.5.5 |
|
| BUG-006 | 高 | PinList→PinMAP 上边 Name 与左边 Name 同行(数据无误但肉眼混淆) | 12×12 PinMap:PinList→PinMAP 转换后查看输出 | 每条边的 Name 和 Number 在独立行/列区域,肉眼可辨 | v1.5.4 上边 Name 在 row 2,与左边 Name(row 2)同行,3 条边数据混在同一行 | 已修复 | v1.5.5 |
|
||||||
|
| BUG-007 | 高 | v1.6 PinList→PinMAP 上方引脚合并到标题行,结构缺行 | PinList(QFN60)→PinMAP,查看输出 | 第1行独立标题(合并单元格),第2-3行为上方引脚序号和PinName,共21行 | 标题与上方引脚合并为一行 `QFN60,Pin60,...Pin46,`,上方引脚无独立行,共19行,缺2行 | 已修复 | F013, F016 |
|
||||||
|
|||||||
@@ -57,3 +57,14 @@
|
|||||||
11. **P2(建议)**:F011 模板格式提取式应用 — 已被 F014/F015 覆盖
|
11. **P2(建议)**:F011 模板格式提取式应用 — 已被 F014/F015 覆盖
|
||||||
12. **P2(建议)**:F007 模板读取 — 功能增强(已被 F014/F015 取代)
|
12. **P2(建议)**:F007 模板读取 — 功能增强(已被 F014/F015 取代)
|
||||||
13. **P2(建议)**:F008 循环处理流程 — 体验优化
|
13. **P2(建议)**:F008 循环处理流程 — 体验优化
|
||||||
|
|
||||||
|
## v1.6 回归 Bug(2026-06-12)
|
||||||
|
|
||||||
|
| Bug ID | 关联功能 | 问题描述 | 详细对比 | 状态 |
|
||||||
|
|--------|---------|---------|---------|------|
|
||||||
|
| BUG-007 | F013, F016 | PinList→PinMAP 上方引脚并入标题行,结构缺 2 行 | 程序生成:19 行,标题 `QFN60,Pin60,...` 上方引脚混入第 1 行;期望:21 行,第 1 行独立标题(合并单元格),第 2-3 行为上方序号和 PinName,第 4 行起为左边引脚 | 已修复 |
|
||||||
|
|
||||||
|
**具体差异(已修复):**
|
||||||
|
1. 标题行现在独占第 1 行(A1 合并单元格),不包含任何引脚数据
|
||||||
|
2. 上方引脚有独立序号行(第 2 行)和 PinName 行(第 3 行)
|
||||||
|
3. 总行数从 19 增加到 20(标题独立行 + 上方引脚独立 2 行 + 左/下/右边引脚行)
|
||||||
|
|||||||
@@ -32,4 +32,4 @@
|
|||||||
| T031 | 测试验证 F016/F017 | test-architect | 已完成 | 测试验证 | F016, F017 | 2026-06-12 | 2026-06-12 | 5 个 QFN60 新增测试 + 全量 23/23 通过 |
|
| T031 | 测试验证 F016/F017 | test-architect | 已完成 | 测试验证 | F016, F017 | 2026-06-12 | 2026-06-12 | 5 个 QFN60 新增测试 + 全量 23/23 通过 |
|
||||||
| T032 | 模板确认 F014/F015 | python-coding-agent | 已完成 | 确认验证 | F014, F015 | 2026-06-12 | 2026-06-12 | 两个模板文件存在,样式解析成功 |
|
| T032 | 模板确认 F014/F015 | python-coding-agent | 已完成 | 确认验证 | F014, F015 | 2026-06-12 | 2026-06-12 | 两个模板文件存在,样式解析成功 |
|
||||||
| T033 | 文档生成 v1.6 | doc-gen-agent | 已完成 | 文档编写 | F013-F017 | 2026-06-12 | 2026-06-12 | 更新 CHANGELOG.md、features.md、tasks.md |
|
| T033 | 文档生成 v1.6 | doc-gen-agent | 已完成 | 文档编写 | F013-F017 | 2026-06-12 | 2026-06-12 | 更新 CHANGELOG.md、features.md、tasks.md |
|
||||||
| T034 | 打包发布 v1.6 | package-release-agent | 待处理 | 打包发布 | F013-F017 | 2026-06-12 | - | 等待 package-release-agent 执行 |
|
| T034 | 打包发布 v1.6 | package-release-agent | 已完成 | 打包发布 | F013-F017 | 2026-06-12 | 2026-06-12 | Release 已创建 + zip 已上传 + git push 完成 |
|
||||||
|
|||||||
BIN
pinmap-to-pinlist-v1.5.5.zip
Normal file
BIN
pinmap-to-pinlist-v1.5.5.zip
Normal file
Binary file not shown.
Reference in New Issue
Block a user