mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
fix mavenized
This commit is contained in:
Vendored
BIN
Binary file not shown.
@@ -24,16 +24,13 @@ import java.util.HashSet;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.diylc.core.IDIYComponent;
|
import org.diylc.core.IDIYComponent;
|
||||||
|
|
||||||
public abstract class AbstractNetlistAnalyzer {
|
public abstract class AbstractNetlistAnalyzer {
|
||||||
|
|
||||||
public AbstractNetlistAnalyzer() {
|
public AbstractNetlistAnalyzer() {}
|
||||||
}
|
|
||||||
|
|
||||||
public List<Summary> summarize(List<Netlist> netlists, Node preferredOutput)
|
public List<Summary> summarize(List<Netlist> netlists, Node preferredOutput) throws TreeException {
|
||||||
throws TreeException {
|
|
||||||
Map<String, Summary> summaries = new HashMap<String, Summary>();
|
Map<String, Summary> summaries = new HashMap<String, Summary>();
|
||||||
for (Netlist n : netlists) {
|
for (Netlist n : netlists) {
|
||||||
Summary s = summarize(n, preferredOutput);
|
Summary s = summarize(n, preferredOutput);
|
||||||
@@ -52,20 +49,31 @@ public abstract class AbstractNetlistAnalyzer {
|
|||||||
|
|
||||||
public Tree constructTreeBetween(Netlist netlist, Node nodeA, Node nodeB) {
|
public Tree constructTreeBetween(Netlist netlist, Node nodeA, Node nodeB) {
|
||||||
Tree tree = new Tree(TreeConnectionType.Parallel);
|
Tree tree = new Tree(TreeConnectionType.Parallel);
|
||||||
connectNodes(netlist, nodeA, nodeB, tree.getChildren(), new Tree(TreeConnectionType.Series),
|
connectNodes(netlist, nodeA, nodeB, tree.getChildren(), new Tree(TreeConnectionType.Series), new HashSet<Node>());
|
||||||
new HashSet<Node>());
|
|
||||||
|
|
||||||
return tree;
|
return tree;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void connectNodes(Netlist netlist, Node nodeA, Node nodeB, List<Tree> concurrentPaths,
|
// protected Tree removeRedundantElements(Tree tree) {
|
||||||
Tree currentPath, Set<Node> visited) {
|
// List<Tree> children = tree.getChildren()
|
||||||
|
// .stream()
|
||||||
|
// .map(t -> removeRedundantElements(t))
|
||||||
|
// .collect(Collectors.toList());
|
||||||
|
// if (children.size() == 1) {
|
||||||
|
// Tree first = children.get(0);
|
||||||
|
// return first;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
protected void connectNodes(Netlist netlist, Node nodeA, Node nodeB, List<Tree> concurrentPaths, Tree currentPath,
|
||||||
|
Set<Node> visited) {
|
||||||
if (nodeA == nodeB) {
|
if (nodeA == nodeB) {
|
||||||
concurrentPaths.add(currentPath);
|
concurrentPaths.add(currentPath);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Group groupA = findGroup(netlist, nodeA);
|
Group groupA = findGroup(netlist, nodeA);
|
||||||
|
|
||||||
if (groupA == null)
|
if (groupA == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -74,147 +82,138 @@ public abstract class AbstractNetlistAnalyzer {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<Node> pathVisited = new HashSet<>(visited);
|
visited.addAll(groupA.getNodes());
|
||||||
pathVisited.add(nodeA);
|
|
||||||
|
List<Tree> newConcurrentPaths = new ArrayList<Tree>();
|
||||||
|
|
||||||
// First collect all immediate next nodes and their paths
|
|
||||||
Map<Node, List<Tree>> nextNodes = new HashMap<>();
|
|
||||||
for (Node n : groupA.getNodes()) {
|
for (Node n : groupA.getNodes()) {
|
||||||
if (pathVisited.contains(n))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
IDIYComponent<?> c = n.getComponent();
|
IDIYComponent<?> c = n.getComponent();
|
||||||
for (int i = 0; i < c.getControlPointCount(); i++) {
|
for (int i = 0; i < c.getControlPointCount(); i++) {
|
||||||
int targetPoint = i;
|
if (i != n.getPointIndex() && c.getInternalLinkName(i, n.getPointIndex()) != null) {
|
||||||
int sourcePoint = n.getPointIndex();
|
TreeLeaf l = new TreeLeaf(c, i, n.getPointIndex());
|
||||||
|
Node newNodeA = new Node(c, i, n.getZIndex());
|
||||||
if (targetPoint == sourcePoint)
|
if (!visited.contains(newNodeA)) {
|
||||||
continue;
|
// visited.add(n);
|
||||||
|
Tree newCurrentPath = null;
|
||||||
if (c.getInternalLinkName(targetPoint, sourcePoint) != null) {
|
|
||||||
Node newNodeA = new Node(c, targetPoint, n.getZIndex());
|
|
||||||
if (pathVisited.contains(newNodeA))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Tree newPath = (Tree) currentPath.clone();
|
newCurrentPath = (Tree) currentPath.clone();
|
||||||
TreeLeaf leaf = new TreeLeaf(c, targetPoint, sourcePoint);
|
|
||||||
Tree newItem = new Tree(leaf);
|
|
||||||
|
|
||||||
if (!newPath.getChildren().contains(newItem)) {
|
|
||||||
newPath.getChildren().add(newItem);
|
|
||||||
nextNodes.computeIfAbsent(newNodeA, k -> new ArrayList<>()).add(newPath);
|
|
||||||
}
|
|
||||||
} catch (CloneNotSupportedException e) {
|
} catch (CloneNotSupportedException e) {
|
||||||
// Skip this path if clone fails
|
}
|
||||||
|
Tree newItem = new Tree(l);
|
||||||
|
if (!newCurrentPath.getChildren().contains(newItem))
|
||||||
|
newCurrentPath.getChildren().add(newItem);
|
||||||
|
// if (!currentPath.contains(l))
|
||||||
|
// newCurrentPath.add(l);
|
||||||
|
Set<Node> newVisited = new HashSet<Node>(visited);
|
||||||
|
connectNodes(netlist, newNodeA, nodeB, newConcurrentPaths, newCurrentPath, newVisited);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now explore each next node
|
if (newConcurrentPaths.size() == 0)
|
||||||
List<Tree> allPaths = new ArrayList<>();
|
|
||||||
for (Map.Entry<Node, List<Tree>> entry : nextNodes.entrySet()) {
|
|
||||||
for (Tree path : entry.getValue()) {
|
|
||||||
List<Tree> branchPaths = new ArrayList<>();
|
|
||||||
connectNodes(netlist, entry.getKey(), nodeB, branchPaths, path, pathVisited);
|
|
||||||
allPaths.addAll(branchPaths);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (allPaths.isEmpty())
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (allPaths.size() > 1) {
|
if (newConcurrentPaths.size() == 1) {
|
||||||
// Find common prefix among all paths
|
if (newConcurrentPaths.get(0).getConnectionType() == TreeConnectionType.Series) {
|
||||||
List<Tree> commonPrefix = findCommonElements(allPaths, true, false);
|
currentPath.getChildren().clear();
|
||||||
|
currentPath.getChildren().addAll(newConcurrentPaths.get(0).getChildren());
|
||||||
// Create a new tree for the merged result
|
|
||||||
Tree mergedTree = new Tree(TreeConnectionType.Series);
|
|
||||||
|
|
||||||
// Add common prefix elements
|
|
||||||
for (Tree prefixElement : commonPrefix) {
|
|
||||||
mergedTree.getChildren().add(prefixElement);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Extract unique parts
|
|
||||||
List<Tree> uniqueParts = new ArrayList<>();
|
|
||||||
for (Tree path : allPaths) {
|
|
||||||
Tree uniquePart = extractUniquePart(path, commonPrefix.size(), 0);
|
|
||||||
if (uniquePart != null) {
|
|
||||||
if (uniquePart.getChildren().size() == 1) {
|
|
||||||
uniqueParts.add(uniquePart.getChildren().get(0));
|
|
||||||
} else {
|
} else {
|
||||||
uniqueParts.add(uniquePart);
|
currentPath.getChildren().add(newConcurrentPaths.get(0));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
concurrentPaths.add(currentPath);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create parallel section for unique parts
|
mergePaths(newConcurrentPaths, false);
|
||||||
if (!uniqueParts.isEmpty()) {
|
concurrentPaths.addAll(newConcurrentPaths);
|
||||||
Tree parallelSection = new Tree(TreeConnectionType.Parallel);
|
|
||||||
parallelSection.getChildren().addAll(uniqueParts);
|
|
||||||
|
|
||||||
// Add parallel section to series container
|
|
||||||
Tree parallelContainer = new Tree(TreeConnectionType.Series);
|
|
||||||
parallelContainer.getChildren().add(parallelSection);
|
|
||||||
mergedTree.getChildren().add(parallelContainer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
concurrentPaths.add(mergedTree);
|
protected void mergePaths(List<Tree> paths, boolean backward) {
|
||||||
} else {
|
Map<Tree, Integer> uniques = new HashMap<Tree, Integer>();
|
||||||
concurrentPaths.add(allPaths.get(0));
|
for (Tree t : paths) {
|
||||||
}
|
if (t.getConnectionType() != TreeConnectionType.Series)
|
||||||
|
continue;
|
||||||
|
Tree key = t.getChildren().get(backward ? t.getChildren().size() - 1 : 0);
|
||||||
|
Integer count = uniques.get(key);
|
||||||
|
uniques.put(key, count == null ? 1 : count + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Tree> findCommonElements(List<Tree> paths, boolean fromStart, boolean backward) {
|
List<Tree> unmerged = new ArrayList<Tree>(paths);
|
||||||
if (paths.isEmpty())
|
|
||||||
return new ArrayList<>();
|
|
||||||
|
|
||||||
List<Tree> common = new ArrayList<>();
|
for (Map.Entry<Tree, Integer> e : uniques.entrySet()) {
|
||||||
Tree template = paths.get(0);
|
if (e.getValue() > 1) {
|
||||||
int maxLength = template.getChildren().size();
|
List<Tree> pathsToMerge = new ArrayList<Tree>();
|
||||||
|
for (Tree t : paths) {
|
||||||
|
Tree key = t.getChildren().get(backward ? t.getChildren().size() - 1 : 0);
|
||||||
|
if (key.equals(e.getKey()))
|
||||||
|
pathsToMerge.add(t);
|
||||||
|
}
|
||||||
|
unmerged.removeAll(pathsToMerge);
|
||||||
|
|
||||||
for (int i = 0; i < maxLength; i++) {
|
Tree jointStart = new Tree(new ArrayList<Tree>(), TreeConnectionType.Series);
|
||||||
int index = fromStart ?
|
Tree jointFinish = new Tree(new ArrayList<Tree>(), TreeConnectionType.Series);
|
||||||
(backward ? template.getChildren().size() - i - 1 : i) :
|
|
||||||
(backward ? i : template.getChildren().size() - i - 1);
|
|
||||||
|
|
||||||
if (index < 0 || index >= template.getChildren().size())
|
Tree unique = e.getKey();
|
||||||
break;
|
|
||||||
|
|
||||||
Tree element = template.getChildren().get(index);
|
for (int i = 0; i < pathsToMerge.get(0).getChildren().size(); i++) {
|
||||||
boolean isCommon = true;
|
boolean canMerge = true;
|
||||||
|
unique = pathsToMerge.get(0).getChildren().get(backward ? pathsToMerge.get(0).getChildren().size() - i - 1 : i);
|
||||||
for (int j = 1; j < paths.size(); j++) {
|
for (Tree t : pathsToMerge) {
|
||||||
Tree current = paths.get(j);
|
if (t.getChildren().size() <= i || !t.getChildren().get(backward ? t.getChildren().size() - i - 1 : i).equals(unique)) {
|
||||||
if (current.getChildren().size() <= i || index >= current.getChildren()
|
canMerge = false;
|
||||||
.size() || !current.getChildren().get(index).equals(element)) {
|
|
||||||
isCommon = false;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (canMerge)
|
||||||
|
(backward ? jointFinish : jointStart).getChildren().add(unique);
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (isCommon) {
|
for (int i = 0; i < pathsToMerge.get(0).getChildren().size(); i++) {
|
||||||
common.add(element);
|
boolean canMerge = true;
|
||||||
} else {
|
unique = pathsToMerge.get(0).getChildren().get(backward ? i : pathsToMerge.get(0).getChildren().size() - i - 1);
|
||||||
|
for (Tree t : pathsToMerge) {
|
||||||
|
if (t.getChildren().size() <= i || !t.getChildren().get(backward ? 0 : t.getChildren().size() - 1).equals(unique)) {
|
||||||
|
canMerge = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (canMerge)
|
||||||
return common;
|
(backward ? jointStart : jointFinish).getChildren().add(unique);
|
||||||
|
else
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Tree extractUniquePart(Tree path, int prefixSize, int suffixSize) {
|
if (!jointStart.getChildren().isEmpty() || !jointFinish.getChildren().isEmpty()) {
|
||||||
if (path.getChildren().size() <= prefixSize + suffixSize)
|
Tree mergedTree = new Tree(new ArrayList<Tree>(), TreeConnectionType.Series);
|
||||||
return null;
|
Tree parallelSection = new Tree(new ArrayList<Tree>(pathsToMerge), TreeConnectionType.Parallel);
|
||||||
|
if (!jointStart.getChildren().isEmpty()) {
|
||||||
Tree uniquePart = new Tree(TreeConnectionType.Series);
|
mergedTree.getChildren().add(jointStart);
|
||||||
for (int i = prefixSize; i < path.getChildren().size() - suffixSize; i++) {
|
for (Tree t : parallelSection.getChildren()) {
|
||||||
uniquePart.getChildren().add(path.getChildren().get(i));
|
t.trimChildrenLeft(jointStart.getChildren().size());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mergedTree.getChildren().add(parallelSection);
|
||||||
|
if (!jointFinish.getChildren().isEmpty()) {
|
||||||
|
mergedTree.getChildren().add(jointFinish);
|
||||||
|
for (Tree t : parallelSection.getChildren()) {
|
||||||
|
t.trimChildrenRight(jointFinish.getChildren().size());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
paths.removeAll(pathsToMerge);
|
||||||
|
paths.add(mergedTree);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return uniquePart.getChildren().isEmpty() ? null : uniquePart;
|
// try in the opposite direction for paths we haven't merged
|
||||||
|
if (!backward && !unmerged.isEmpty()) {
|
||||||
|
paths.removeAll(unmerged);
|
||||||
|
mergePaths(unmerged, true);
|
||||||
|
paths.addAll(unmerged);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Group findGroup(Netlist netlist, Node node) {
|
protected Group findGroup(Netlist netlist, Node node) {
|
||||||
@@ -228,9 +227,8 @@ public abstract class AbstractNetlistAnalyzer {
|
|||||||
List<Node> res = new ArrayList<Node>();
|
List<Node> res = new ArrayList<Node>();
|
||||||
for (Group g : netlist.getGroups()) {
|
for (Group g : netlist.getGroups()) {
|
||||||
for (Node n : g.getNodes()) {
|
for (Node n : g.getNodes()) {
|
||||||
if (typeNames.contains(n.getComponent().getClass()
|
if (typeNames.contains(n.getComponent().getClass().getCanonicalName())
|
||||||
.getCanonicalName()) && (nodeName == null || n.getDisplayName()
|
&& (nodeName == null || n.getDisplayName().equalsIgnoreCase(nodeName))) {
|
||||||
.equalsIgnoreCase(nodeName))) {
|
|
||||||
res.add(n);
|
res.add(n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -238,6 +236,10 @@ public abstract class AbstractNetlistAnalyzer {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected String extractName(IDIYComponent<?> c) {
|
||||||
|
return c.getName() + " " + (c.getValueForDisplay() == null ? "" : c.getValueForDisplay());
|
||||||
|
}
|
||||||
|
|
||||||
public static List<Set<IDIYComponent<?>>> extractComponentGroups(List<Netlist> netlists) {
|
public static List<Set<IDIYComponent<?>>> extractComponentGroups(List<Netlist> netlists) {
|
||||||
List<Set<IDIYComponent<?>>> res = new ArrayList<Set<IDIYComponent<?>>>();
|
List<Set<IDIYComponent<?>>> res = new ArrayList<Set<IDIYComponent<?>>>();
|
||||||
for (Netlist n : netlists) {
|
for (Netlist n : netlists) {
|
||||||
|
|||||||
+49
-9
@@ -21,6 +21,8 @@ package org.diylc.netlist;
|
|||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import org.diylc.components.passive.AxialFilmCapacitor;
|
||||||
|
import org.diylc.components.passive.Resistor;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import org.diylc.components.electromechanical.OpenJack1_4;
|
import org.diylc.components.electromechanical.OpenJack1_4;
|
||||||
@@ -28,13 +30,8 @@ import org.diylc.components.guitar.HumbuckerPickup;
|
|||||||
import org.diylc.components.guitar.SingleCoilPickup;
|
import org.diylc.components.guitar.SingleCoilPickup;
|
||||||
import org.diylc.components.passive.PotentiometerPanel;
|
import org.diylc.components.passive.PotentiometerPanel;
|
||||||
import org.diylc.components.passive.RadialCeramicDiskCapacitor;
|
import org.diylc.components.passive.RadialCeramicDiskCapacitor;
|
||||||
import org.diylc.netlist.Group;
|
|
||||||
import org.diylc.netlist.GuitarDiagramAnalyzer;
|
|
||||||
import org.diylc.netlist.Netlist;
|
|
||||||
import org.diylc.netlist.Tree;
|
|
||||||
import org.diylc.netlist.TreeException;
|
|
||||||
|
|
||||||
public class GuitarAbstractNetlistAnalyzerTests {
|
public class GuitarDiagramAnalyzerTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testOneSinglePickup() throws TreeException {
|
public void testOneSinglePickup() throws TreeException {
|
||||||
@@ -67,6 +64,49 @@ public class GuitarAbstractNetlistAnalyzerTests {
|
|||||||
assertEquals("((Volume.1-2 + Pickup.North<-) || Volume.2-3)", s);
|
assertEquals("((Volume.1-2 + Pickup.North<-) || Volume.2-3)", s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testOneSinglePickupVolPotTrebleBleedSeries() throws TreeException {
|
||||||
|
OpenJack1_4 jack = new OpenJack1_4();
|
||||||
|
SingleCoilPickup pickup = new SingleCoilPickup();
|
||||||
|
pickup.setName("Pickup");
|
||||||
|
PotentiometerPanel vol = new PotentiometerPanel();
|
||||||
|
vol.setName("Volume");
|
||||||
|
AxialFilmCapacitor cap = new AxialFilmCapacitor();
|
||||||
|
cap.setName("Cbleed");
|
||||||
|
Resistor resistor = new Resistor();
|
||||||
|
resistor.setName("Rbleed");
|
||||||
|
Netlist netlist = new Netlist(Arrays.asList(jack, pickup, vol));
|
||||||
|
Group hotGroup = new Group().connect(pickup, 1).connect(vol, 0).connect(resistor, 1);
|
||||||
|
Group tipGroup = new Group().connect(jack, 0).connect(vol, 1).connect(cap, 1);
|
||||||
|
Group sleeveGroup = new Group().connect(jack, 1).connect(pickup, 2).connect(vol, 2);
|
||||||
|
Group trebleBleedGroup = new Group().connect(cap, 0).connect(resistor, 0);
|
||||||
|
netlist.add(tipGroup).add(tipGroup).add(sleeveGroup).add(hotGroup).add(trebleBleedGroup);
|
||||||
|
Tree tree = new GuitarDiagramAnalyzer().constructTree(netlist);
|
||||||
|
String s = tree.toString();
|
||||||
|
assertEquals("((((Cbleed + Rbleed) || Volume.1-2) + Pickup.North<-) || Volume.2-3)", s);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testOneSinglePickupVolPotTrebleBleedParallel() throws TreeException {
|
||||||
|
OpenJack1_4 jack = new OpenJack1_4();
|
||||||
|
SingleCoilPickup pickup = new SingleCoilPickup();
|
||||||
|
pickup.setName("Pickup");
|
||||||
|
PotentiometerPanel vol = new PotentiometerPanel();
|
||||||
|
vol.setName("Volume");
|
||||||
|
AxialFilmCapacitor cap = new AxialFilmCapacitor();
|
||||||
|
cap.setName("Cbleed");
|
||||||
|
Resistor resistor = new Resistor();
|
||||||
|
resistor.setName("Rbleed");
|
||||||
|
Netlist netlist = new Netlist(Arrays.asList(jack, pickup, vol));
|
||||||
|
Group hotGroup = new Group().connect(pickup, 1).connect(vol, 0).connect(resistor, 1).connect(cap, 1);
|
||||||
|
Group tipGroup = new Group().connect(jack, 0).connect(vol, 1).connect(resistor, 0).connect(cap, 0);
|
||||||
|
Group sleeveGroup = new Group().connect(jack, 1).connect(pickup, 2).connect(vol, 2);
|
||||||
|
netlist.add(tipGroup).add(tipGroup).add(sleeveGroup).add(hotGroup);
|
||||||
|
Tree tree = new GuitarDiagramAnalyzer().constructTree(netlist);
|
||||||
|
String s = tree.toString();
|
||||||
|
assertEquals("(((Cbleed || Rbleed || Volume.1-2) + Pickup.North<-) || Volume.2-3)", s);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testOneSinglePickupVolTonePot() throws TreeException {
|
public void testOneSinglePickupVolTonePot() throws TreeException {
|
||||||
OpenJack1_4 jack = new OpenJack1_4();
|
OpenJack1_4 jack = new OpenJack1_4();
|
||||||
@@ -87,7 +127,7 @@ public class GuitarAbstractNetlistAnalyzerTests {
|
|||||||
netlist.add(tipGroup).add(tipGroup).add(sleeveGroup).add(hotGroup).add(toneGroup);
|
netlist.add(tipGroup).add(tipGroup).add(sleeveGroup).add(hotGroup).add(toneGroup);
|
||||||
Tree tree = new GuitarDiagramAnalyzer().constructTree(netlist);
|
Tree tree = new GuitarDiagramAnalyzer().constructTree(netlist);
|
||||||
String s = tree.toString();
|
String s = tree.toString();
|
||||||
assertEquals("((Volume.1-2 + (Tone.2-3 + Cap) || Pickup.North<-) || Volume.2-3)", s);
|
assertEquals("((Volume.1-2 + ((Tone.2-3 + Cap) || Pickup.North<-)) || Volume.2-3)", s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -121,7 +161,7 @@ public class GuitarAbstractNetlistAnalyzerTests {
|
|||||||
Tree tree = new GuitarDiagramAnalyzer().constructTree(netlist);
|
Tree tree = new GuitarDiagramAnalyzer().constructTree(netlist);
|
||||||
String s = tree.toString();
|
String s = tree.toString();
|
||||||
assertEquals(
|
assertEquals(
|
||||||
"((Volume.1-2 + (Tone1.2-3 + Cap1) || (Tone2.2-3 + Cap2) || Pickup1.North<- || Pickup2.North<-) || Volume.2-3)",
|
"((Volume.1-2 + ((Tone1.2-3 + Cap1) || (Tone2.2-3 + Cap2) || Pickup1.North<- || Pickup2.North<-)) || Volume.2-3)",
|
||||||
s);
|
s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -285,7 +325,7 @@ public class GuitarAbstractNetlistAnalyzerTests {
|
|||||||
Tree tree = new GuitarDiagramAnalyzer().constructTree(netlist);
|
Tree tree = new GuitarDiagramAnalyzer().constructTree(netlist);
|
||||||
String s = tree.toString();
|
String s = tree.toString();
|
||||||
assertEquals(
|
assertEquals(
|
||||||
"((Volume.1-2 + (Pickup1.North<- + Pickup1.South<-) || (Pickup2.North<- + Pickup2.South<-) || (Tone1.2-3 + Cap1) || (Tone2.2-3 + Cap2)) || Volume.2-3)",
|
"((Volume.1-2 + ((Pickup1.North<- + Pickup1.South<-) || (Pickup2.North<- + Pickup2.South<-) || (Tone1.2-3 + Cap1) || (Tone2.2-3 + Cap2))) || Volume.2-3)",
|
||||||
s);
|
s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,20 +20,24 @@
|
|||||||
10 throws / 10 positions
|
10 throws / 10 positions
|
||||||
11 throws / 11 positions
|
11 throws / 11 positions
|
||||||
12 throws / 12 positions
|
12 throws / 12 positions
|
||||||
|
135 degrees clockwise
|
||||||
180 degrees clockwise
|
180 degrees clockwise
|
||||||
1P12T
|
1P12T
|
||||||
2 throws / 2 positions
|
2 throws / 2 positions
|
||||||
2 throws / 3 positions / OFF even positions
|
2 throws / 3 positions / OFF even positions
|
||||||
|
225 degrees clockwise
|
||||||
270 degrees clockwise
|
270 degrees clockwise
|
||||||
2P5T
|
2P5T
|
||||||
2P6T
|
2P6T
|
||||||
3 throws / 3 positions
|
3 throws / 3 positions
|
||||||
3 throws / 5 positions / SHORT even positions
|
3 throws / 5 positions / SHORT even positions
|
||||||
|
315 degrees clockwise
|
||||||
3P4T
|
3P4T
|
||||||
3PDT
|
3PDT
|
||||||
3PDT (On/Off/On)
|
3PDT (On/Off/On)
|
||||||
4 band
|
4 band
|
||||||
4 throws / 4 positions
|
4 throws / 4 positions
|
||||||
|
45 degrees clockwise
|
||||||
4P3T
|
4P3T
|
||||||
4P5T
|
4P5T
|
||||||
4P5T (Super/Mega)
|
4P5T (Super/Mega)
|
||||||
@@ -598,6 +602,7 @@ Vertical Inline
|
|||||||
Vertical Offset 1
|
Vertical Offset 1
|
||||||
Vertical Offset 2
|
Vertical Offset 2
|
||||||
View
|
View
|
||||||
|
Virtual Multimeter
|
||||||
Visible
|
Visible
|
||||||
Voltage
|
Voltage
|
||||||
Wafer
|
Wafer
|
||||||
|
|||||||
Reference in New Issue
Block a user