Release 1.4.1: a Bonded checkbox in the terminal tables
tests / ubuntu-latest · py3.11 (push) Successful in 54s
tests / ubuntu-latest · py3.13 (push) Successful in 58s
tests / archlinux:latest (push) Successful in 41s
tests / debian:12 (push) Successful in 1m10s
tests / fedora:latest (push) Successful in 42m6s
tests / ubuntu:24.04 (push) Successful in 1m15s
tests / NixOS (FHS wrapper from docs/NIXOS.md) (push) Skipped
Build PCM package / build (push) Successful in 11s
tests / ubuntu-latest · py3.11 (push) Successful in 54s
tests / ubuntu-latest · py3.13 (push) Successful in 58s
tests / archlinux:latest (push) Successful in 41s
tests / debian:12 (push) Successful in 1m10s
tests / fedora:latest (push) Successful in 42m6s
tests / ubuntu:24.04 (push) Successful in 1m15s
tests / NixOS (FHS wrapper from docs/NIXOS.md) (push) Skipped
Build PCM package / build (push) Successful in 11s
The config's per-terminal bonded key becomes editable in the dialog (previously file-only, shown as a text suffix): checked, the terminal's contacts short into one internally joined lug - the total value stays prescribed, the per-contact split is a solve outcome. Same-name rectangle groups seed it checked as before; unchecking one falls back to the per-cell area share, and checking a single-contact terminal gives it an equipotential-lug contact instead of uniform injection. Save config... writes the flag back (removed when unchecked - false is the schema default). With this, every non-structural terminal option (active, values, v_oc, contact layer, bonded, comment) is table-editable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+25
-11
@@ -122,10 +122,13 @@ class PdnTerminalRow:
|
||||
i_draw_a: float | None = None # loads; None = not entered yet
|
||||
r_out_ohm: float | None = None # supplies; None = not entered yet
|
||||
v_oc: float | None = None # supplies; None = v_nominal
|
||||
bonded: bool = False # multi-contact lug: the TOTAL value
|
||||
# applies, the per-contact split is a
|
||||
# solve outcome (display/data only -
|
||||
# not editable in the table)
|
||||
bonded: bool = False # checkbox: short the contacts into
|
||||
# one lug - the TOTAL value applies,
|
||||
# the per-contact split is a solve
|
||||
# outcome. Seeded True for same-name
|
||||
# rectangle groups and from the
|
||||
# config's "bonded" key; a single
|
||||
# contact checked = equipotential lug
|
||||
contact: str = "all" # terminal-level layer scope: "auto"
|
||||
# (per contact part - config-backed
|
||||
# rows only), "all", or a layer name
|
||||
@@ -304,8 +307,10 @@ class _Dialog(QDialog):
|
||||
# the role/layer mapping lives in the table titles now
|
||||
hints.append("name from a text item inside the "
|
||||
"rectangle; empty V_oc = V nominal")
|
||||
hints.append("Layer = the copper the terminal contacts; "
|
||||
"values take SI suffixes (50m = 0.05)")
|
||||
hints.append("Bonded = contacts joined into one lug (the "
|
||||
"per-contact split is solved); Layer = the "
|
||||
"copper the terminal contacts; values take SI "
|
||||
"suffixes (50m = 0.05)")
|
||||
hint = QLabel(" — ".join(hints))
|
||||
hint.setWordWrap(True)
|
||||
hint.setStyleSheet("color: gray; font-size: 10px;")
|
||||
@@ -532,10 +537,11 @@ class _Dialog(QDialog):
|
||||
for role, cols in (
|
||||
("supply",
|
||||
["Active", "Name", "Component", "R_out [Ω]",
|
||||
"V_oc [V]", "Layer", "Contact parts", "Comment"]),
|
||||
"V_oc [V]", "Bonded", "Layer", "Contact parts",
|
||||
"Comment"]),
|
||||
("load",
|
||||
["Active", "Name", "Component", "I draw [A]", "Layer",
|
||||
"Contact parts", "Comment"])):
|
||||
["Active", "Name", "Component", "I draw [A]",
|
||||
"Bonded", "Layer", "Contact parts", "Comment"])):
|
||||
n = sum(1 for r in pdn.rows if r.role == role)
|
||||
panel = QWidget()
|
||||
pv = QVBoxLayout(panel)
|
||||
@@ -562,7 +568,8 @@ class _Dialog(QDialog):
|
||||
self._pdn_map.append((t, i))
|
||||
values = ([row.r_out_ohm, row.v_oc] if row.role == "supply"
|
||||
else [row.i_draw_a])
|
||||
last = t.columnCount() - 1 # ... | Layer | parts | Comment
|
||||
# tail columns: ... | Bonded | Layer | parts | Comment
|
||||
last = t.columnCount() - 1
|
||||
cells = [(1, row.name, False), (2, row.component, False)]
|
||||
for col, value in enumerate(values, start=3):
|
||||
cells.append((col, "" if value is None else f"{value:g}",
|
||||
@@ -579,6 +586,11 @@ class _Dialog(QDialog):
|
||||
box.setFlags(Qt.ItemIsEnabled | Qt.ItemIsUserCheckable)
|
||||
box.setCheckState(Qt.Checked if row.active else Qt.Unchecked)
|
||||
t.setItem(i, 0, box)
|
||||
bond = QTableWidgetItem("")
|
||||
bond.setFlags(Qt.ItemIsEnabled | Qt.ItemIsUserCheckable)
|
||||
bond.setCheckState(Qt.Checked if row.bonded
|
||||
else Qt.Unchecked)
|
||||
t.setItem(i, last - 3, bond)
|
||||
combo = QComboBox()
|
||||
idx = len(self._pdn_layer_combos)
|
||||
self._pdn_layer_combos.append(combo)
|
||||
@@ -695,12 +707,14 @@ class _Dialog(QDialog):
|
||||
new = PdnTerminalRow(name=row.name, role=row.role,
|
||||
resolved=row.resolved,
|
||||
component=row.component,
|
||||
bonded=row.bonded,
|
||||
from_config=row.from_config)
|
||||
box = t.item(r, 0)
|
||||
checked = (box is None
|
||||
or box.checkState() == Qt.Checked)
|
||||
new.active = checked and not self._row_hidden(i)
|
||||
bond = t.item(r, t.columnCount() - 4)
|
||||
new.bonded = (bond is not None
|
||||
and bond.checkState() == Qt.Checked)
|
||||
new.comment = cell(t.columnCount() - 1)
|
||||
combo = self._pdn_layer_combos[i]
|
||||
new.contact = (combo.currentData() if combo.count()
|
||||
|
||||
Reference in New Issue
Block a user