hack trimmer to show terminals in the correct order

This commit is contained in:
Bane Stojkovic
2025-05-19 22:54:23 +02:00
parent 144f6e1c9f
commit 4fb17d343d
2 changed files with 26 additions and 12 deletions
@@ -376,12 +376,35 @@ public class TrimmerPotentiometer extends AbstractPotentiometer {
return body;
}
// in all methods that deal with point index we need to flip the indices to treat 2 as 0 and 0 and 2
// this is because controlPoints in TrimmerPotentiometer are made in the opposite order than
// PotentiometerPanel and opposite of how the actual pins are ordered on a trimmer
@Override
public Point2D getControlPoint(int index) {
return super.getControlPoint(2 - index);
}
@Override
public void setControlPoint(Point2D point, int index) {
super.setControlPoint(point, index);
super.setControlPoint(point, 2 - index);
body = null;
}
@Override
public String getInternalLinkName(int index1, int index2) {
if (index1 < index2)
return getInternalLinkName(index2, index1);
index1 = 2 - index1;
index2 = 2 - index2;
if (index2 - index1 == 1)
return (index1 + 1) + "-" + (index2 + 1);
return null;
}
@Override
public void setOrientation(Orientation orientation) {
super.setOrientation(orientation);
@@ -565,17 +588,6 @@ public class TrimmerPotentiometer extends AbstractPotentiometer {
return false;
}
@Override
public String getInternalLinkName(int index1, int index2) {
if (index1 > index2)
return getInternalLinkName(index2, index1);
if (index2 - index1 == 1)
return (index1 + 1) + "-" + (index2 + 1);
return null;
}
public enum TrimmerType {
FLAT_SMALL("Horizontal Small 1"),
FLAT_SMALL2("Horizontal Small 2"),
@@ -387,8 +387,10 @@ public class GuitarDiagramAnalyzer extends AbstractNetlistAnalyzer implements IN
Map<IDIYComponent<?>, Set<IDIYComponent<?>>> volPotTrebleBleedMap,
Map<IDIYComponent<?>, List<IDIYComponent<?>>> volPotPickupMap,
Map<IDIYComponent<?>, List<IDIYComponent<?>>> volPotPickupReverseMap) {
TreeLeaf leaf1 = new TreeLeaf(pot, 0, 1);
TreeLeaf leaf2 = new TreeLeaf(pot, 1, 2);
Tree tree1 = tree.locate(leaf1, false);
Tree tree2 = tree.locate(leaf2, false);