From ce7753744adcd0bc491941a76710bf9c789c97a4 Mon Sep 17 00:00:00 2001 From: Martin Morrell <45169654+mm-rnd@users.noreply.github.com> Date: Sun, 21 Dec 2025 20:58:20 +0000 Subject: [PATCH] Lever 2502N import switch (#981) * Add 4P3T AxLabs Lever Switch variant * Add 2502N Lever Switch * Bridge is now pos1 and neck pos5 as expected Re-worked acording to the diagram here: https://guitarpartscenter.eu/en_US/p/ALPHA-SW-2502N-5-Way-Lever-Switch-ADWH/23036 --- .../diylc/components/guitar/LeverSwitch.java | 62 +++++++++++++++++-- .../org/diylc/netlist/LeverSwitchTests.java | 29 +++++++++ knowledge/component_types.sql | 2 +- 3 files changed, 88 insertions(+), 5 deletions(-) diff --git a/diylc/diylc-library/src/main/java/org/diylc/components/guitar/LeverSwitch.java b/diylc/diylc-library/src/main/java/org/diylc/components/guitar/LeverSwitch.java index 597db8c8..d2ccff57 100644 --- a/diylc/diylc-library/src/main/java/org/diylc/components/guitar/LeverSwitch.java +++ b/diylc/diylc-library/src/main/java/org/diylc/components/guitar/LeverSwitch.java @@ -151,8 +151,13 @@ public class LeverSwitch extends AbstractAngledComponent= 6 ? terminalSpacing : 0)); } break; + case _4P3T: + controlPoints = new Point2D[16]; + for (int i = 0; i < controlPoints.length / 2; i++) { + controlPoints[i] = new Point2D.Double(x, y + i * terminalSpacing + (i >= 4 ? terminalSpacing : 0)); + controlPoints[i + 8] = new Point2D.Double(x + waferSpacing, y + i * terminalSpacing + (i >= 4 ? terminalSpacing : 0)); + } + break; } // Rotate if needed @@ -464,6 +484,12 @@ public class LeverSwitch extends AbstractAngledComponent> DP3T_5pos_2502N_CONNECTIONS = Arrays.asList( + Arrays.asList( + new int[] { 0, 3 } + ), // position 1 + Arrays.asList( + new int[] { 0, 3 }, + new int[] { 1, 3 }, + new int[] { 4, 7 }, + new int[] { 5, 7 } + ), // position 2 + Arrays.asList( + new int[] { 0, 3 }, + new int[] { 2, 3 }, + new int[] { 6, 7 } + ), // position 3 + Arrays.asList( + new int[] { 1, 3 }, + new int[] { 2, 3 }, + new int[] { 5, 7 } + ), // position 4 + Arrays.asList( + new int[] { 2, 3 }, + new int[] { 6, 7 } + ) // position 5 + ); + @DynamicEditableProperty(source = LeverSwitchPositionPropertyValueSource.class) @EditableProperty(name = "Selected Position") @Override @@ -576,7 +628,9 @@ public class LeverSwitch extends AbstractAngledComponent