From 5224d524be51a41827bb8f73f7a048ce0cc44d0a Mon Sep 17 00:00:00 2001 From: grantpitel Date: Sat, 13 Jun 2026 10:39:30 -0400 Subject: [PATCH 1/2] feat(wire): add winding label + pin/connection editor to Wire Configuration Adds BasicLabelPinSelector.vue to edit a winding's name and its connections (pin name, terminal type and lead length) in the Wire Configuration panel. Connections are MAS metadata, so edits don't invalidate the wound geometry. The pin field is a dropdown when the bobbin declares pins, otherwise a free-text input; lead length is entered in mm and stored in metres, and the connection count is clamped to 2x numberParallels. Renaming a winding propagates to the construction references so name-matched derived views stay consistent. --- .../Wire/BasicLabelPinSelector.vue | 532 ++++++++++++++++++ .../Wire/BasicWireSelector.vue | 9 + 2 files changed, 541 insertions(+) create mode 100644 src/components/MagneticBuilder/Wire/BasicLabelPinSelector.vue diff --git a/src/components/MagneticBuilder/Wire/BasicLabelPinSelector.vue b/src/components/MagneticBuilder/Wire/BasicLabelPinSelector.vue new file mode 100644 index 0000000..f59c355 --- /dev/null +++ b/src/components/MagneticBuilder/Wire/BasicLabelPinSelector.vue @@ -0,0 +1,532 @@ + + + + + + + diff --git a/src/components/MagneticBuilder/Wire/BasicWireSelector.vue b/src/components/MagneticBuilder/Wire/BasicWireSelector.vue index c8ab8d8..5fe573a 100644 --- a/src/components/MagneticBuilder/Wire/BasicWireSelector.vue +++ b/src/components/MagneticBuilder/Wire/BasicWireSelector.vue @@ -4,6 +4,7 @@ import Dimension from '/WebSharedComponents/DataInput/Dimension.vue' import BasicWireSubmenu from './BasicWireSubmenu.vue' import WireInfo from './WireInfo.vue' import BasicTurnsSelector from './BasicTurnsSelector.vue' +import BasicLabelPinSelector from './BasicLabelPinSelector.vue' import Wire2DVisualizer from '/WebSharedComponents/Common/Wire2DVisualizer.vue' import WindingSelector from '../Common/WindingSelector.vue' import { deepCopy } from '/WebSharedComponents/assets/js/utils.js' @@ -574,6 +575,14 @@ export default { />
+
+ +
Date: Sun, 14 Jun 2026 22:49:12 -0400 Subject: [PATCH 2/2] feat(wire): add Blind winding-to-winding connection type to pin editor Extends the Wire Configuration pin/connection editor (BasicLabelPinSelector) with a blind (internal winding-to-winding) connection: - add "Blind" to the connection Type dropdown - when a row's type is Blind, render the Name field as an + combobox: free text to mint a node id, plus a dropdown of blind node ids already used on any winding (pick one to join this winding to it) - disable the Length input on blind rows (an internal joint has no lead length) Two windings sharing the same Blind pinName are joined. "Blind" is a local string value (not yet in the generated MAS.ts ConnectionType enum) and round-trips to MAS verbatim. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../Wire/BasicLabelPinSelector.vue | 57 +++++++++++++++++-- 1 file changed, 52 insertions(+), 5 deletions(-) diff --git a/src/components/MagneticBuilder/Wire/BasicLabelPinSelector.vue b/src/components/MagneticBuilder/Wire/BasicLabelPinSelector.vue index f59c355..c35cd5c 100644 --- a/src/components/MagneticBuilder/Wire/BasicLabelPinSelector.vue +++ b/src/components/MagneticBuilder/Wire/BasicLabelPinSelector.vue @@ -31,9 +31,13 @@ export default { }, data() { return { + // 'Blind' is our local winding-to-winding marker; it is not (yet) in + // the generated MAS.ts ConnectionType enum, and round-trips to MAS as + // the verbatim string. Two windings sharing a blind pinName are joined. + blindType: 'Blind', // ConnectionType is a string enum ("Pin", "Screw", "SMT", "Flying Lead"); // store the value verbatim so it round-trips to MAS unchanged. - connectionTypeOptions: Object.values(ConnectionType), + connectionTypeOptions: [...Object.values(ConnectionType), 'Blind'], } }, computed: { @@ -85,6 +89,27 @@ export default { } return opts; }, + // Distinct blind-node ids already used on ANY winding, offered as combobox + // suggestions so picking one joins this winding to that internal node. + blindNodeOptions() { + const coil = this.masStore.mas.magnetic.coil; + const windings = (coil && Array.isArray(coil.functionalDescription)) + ? coil.functionalDescription : []; + const ids = new Set(); + windings.forEach((w) => { + (w.connections || []).forEach((c) => { + if (c && c.type === this.blindType + && c.pinName != null && String(c.pinName).trim() !== '') { + ids.add(String(c.pinName)); + } + }); + }); + return Array.from(ids).sort(); + }, + // Per-winding id so multiple mounted selectors never share a . + datalistId() { + return 'blind-nodes-' + this.windingIndex; + }, // Match the themed look of the other Wire Configuration inputs. fieldStyle() { return combinedStyle([ @@ -204,6 +229,11 @@ export default { return; } winding.connections[index][key] = value; + // A blind (internal) joint has no lead-to-terminal length; drop any + // stale value so the editor and the MAS export agree. + if (key === 'type' && value === this.blindType) { + delete winding.connections[index].length; + } }, // length is stored in metres (MAS); the field edits millimetres. Round to // kill the float noise from the m<->mm scaling (e.g. 0.0123 m -> 12.3 mm). @@ -317,14 +347,31 @@ export default {
+ + + +
+