Allow guitar wiring analyzer when some of the switching configuration do not produce output

This commit is contained in:
Bane Stojkovic
2025-02-09 16:22:34 +01:00
parent e0aa7d99ee
commit 0ca4df3161
5 changed files with 12 additions and 2 deletions
@@ -4458,6 +4458,10 @@
<changeType>IMPROVEMENT</changeType> <changeType>IMPROVEMENT</changeType>
<description>Added 1-pole DIP switch option</description> <description>Added 1-pole DIP switch option</description>
</org.diylc.appframework.update.Change> </org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType>
<description>Allow guitar wiring analyzer when some of the switching configuration do not produce output</description>
</org.diylc.appframework.update.Change>
</changes> </changes>
<url>https://github.com/bancika/diy-layout-creator/releases</url> <url>https://github.com/bancika/diy-layout-creator/releases</url>
</org.diylc.appframework.update.Version> </org.diylc.appframework.update.Version>
Binary file not shown.
@@ -109,6 +109,10 @@ public class GuitarDiagramAnalyzer extends NetlistAnalyzer implements INetlistAn
List<String> notes = new ArrayList<String>(); List<String> notes = new ArrayList<String>();
Tree tree = constructTree(netlist); Tree tree = constructTree(netlist);
if (tree == null) {
return new Summary(netlist, "No pickups are connected to the output jack");
}
Tree pickupTree = tree.filter(PICKUP_TYPES); Tree pickupTree = tree.filter(PICKUP_TYPES);
@@ -405,8 +409,10 @@ public class GuitarDiagramAnalyzer extends NetlistAnalyzer implements INetlistAn
List<Node> jackSleeveNodes = find(JACK_TYPES, "Sleeve", netlist); List<Node> jackSleeveNodes = find(JACK_TYPES, "Sleeve", netlist);
if (jackTipNodes.size() == 0 || jackSleeveNodes.size() == 0) { if (jackTipNodes.size() == 0 || jackSleeveNodes.size() == 0) {
throw new TreeException("Could not find anything connected to a jack tip terminal."); // LOG.("Could not find anything connected to a jack tip terminal.");
} else if (jackTipNodes.size() > 1 || jackSleeveNodes.size() > 1) { return null;
} else
if (jackTipNodes.size() > 1 || jackSleeveNodes.size() > 1) {
throw new TreeException("Multiple jacks found, could not proceed."); throw new TreeException("Multiple jacks found, could not proceed.");
} else { } else {
Node jackTip = jackTipNodes.get(0); Node jackTip = jackTipNodes.get(0);
Binary file not shown.
Binary file not shown.