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:
+20
-6
@@ -212,8 +212,8 @@ def test_tables_split_by_role(app):
|
||||
assert dlg.pdn_sup_table.item(0, 1).text() == "src"
|
||||
assert dlg.pdn_load_table.item(0, 1).text() == "snk"
|
||||
# supplies carry R_out + V_oc columns, loads only I draw
|
||||
assert dlg.pdn_sup_table.columnCount() == 8
|
||||
assert dlg.pdn_load_table.columnCount() == 7
|
||||
assert dlg.pdn_sup_table.columnCount() == 9
|
||||
assert dlg.pdn_load_table.columnCount() == 8
|
||||
|
||||
|
||||
def test_table_titles_name_the_marker_layers(app):
|
||||
@@ -292,10 +292,12 @@ def test_cell_flags(app):
|
||||
for col in (1, 2, last - 1):
|
||||
assert t.item(0, col).flags() & Qt.ItemIsEnabled
|
||||
assert not (t.item(0, col).flags() & Qt.ItemIsEditable)
|
||||
# the Active column is a checkbox, not an editable cell
|
||||
assert t.item(0, 0).flags() & Qt.ItemIsUserCheckable
|
||||
assert not (t.item(0, 0).flags() & Qt.ItemIsEditable)
|
||||
# Active and Bonded are checkboxes, not editable cells
|
||||
for col in (0, last - 3):
|
||||
assert t.item(0, col).flags() & Qt.ItemIsUserCheckable
|
||||
assert not (t.item(0, col).flags() & Qt.ItemIsEditable)
|
||||
assert t.item(0, 0).checkState() == Qt.Checked
|
||||
assert t.item(0, last - 3).checkState() == Qt.Unchecked
|
||||
# the Layer column holds a combo, not a text item
|
||||
assert t.cellWidget(0, last - 2) is not None
|
||||
|
||||
@@ -449,16 +451,28 @@ def test_comment_column_roundtrip(app):
|
||||
assert sel.pdn_rows[1].comment == "worst case"
|
||||
|
||||
|
||||
def test_bonded_flag_survives_the_table_roundtrip(app):
|
||||
def test_bonded_checkbox_seeds_and_toggles(app):
|
||||
setup = PdnSetup(rows=[
|
||||
PdnTerminalRow(name="src", role="supply", resolved="r"),
|
||||
PdnTerminalRow(name="pkg", role="load", resolved="2× rects",
|
||||
bonded=True)], source="markers")
|
||||
dlg = _dlg(app, pdn=setup, classic_reason="x")
|
||||
_fill_pdn(dlg)
|
||||
# seeds: the grouped load checked, the single supply not
|
||||
bcol_s = dlg.pdn_sup_table.columnCount() - 4
|
||||
bcol_l = dlg.pdn_load_table.columnCount() - 4
|
||||
assert dlg.pdn_sup_table.item(0, bcol_s).checkState() == Qt.Unchecked
|
||||
assert dlg.pdn_load_table.item(0, bcol_l).checkState() == Qt.Checked
|
||||
sel = dlg._build_selection()
|
||||
assert sel.pdn_rows[0].bonded is False
|
||||
assert sel.pdn_rows[1].bonded is True
|
||||
# editable both ways: unbond the group (area share), bond the
|
||||
# single supply (equipotential lug contact)
|
||||
dlg.pdn_load_table.item(0, bcol_l).setCheckState(Qt.Unchecked)
|
||||
dlg.pdn_sup_table.item(0, bcol_s).setCheckState(Qt.Checked)
|
||||
sel = dlg._build_selection()
|
||||
assert sel.pdn_rows[0].bonded is True
|
||||
assert sel.pdn_rows[1].bonded is False
|
||||
|
||||
|
||||
def test_pdn_values_reach_the_selection(app):
|
||||
|
||||
Reference in New Issue
Block a user