From 275009b315deff458e64b96bfd19369690cfe94d Mon Sep 17 00:00:00 2001 From: bancika Date: Thu, 26 Mar 2020 00:32:14 +0100 Subject: [PATCH] netlist - skip control points that are not representing nodes --- .../src/org/diylc/netlist/SpiceAnalyzer.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/diylc/diylc-library/src/org/diylc/netlist/SpiceAnalyzer.java b/diylc/diylc-library/src/org/diylc/netlist/SpiceAnalyzer.java index dfff70c4..256e5466 100644 --- a/diylc/diylc-library/src/org/diylc/netlist/SpiceAnalyzer.java +++ b/diylc/diylc-library/src/org/diylc/netlist/SpiceAnalyzer.java @@ -82,10 +82,14 @@ public class SpiceAnalyzer extends NetlistAnalyzer implements INetlistAnalyzer { sb.append(fill(name, (int) (Math.ceil(maxLen / 5.0) * 5))); sb.append(" "); - int[] nodeIndices = new int[c.getControlPointCount()]; + List nodeIndices = new ArrayList(); // find node indices for each control point for (int i = 0; i < c.getControlPointCount(); i++) { + // skip non-sticky points + if (c.getControlPointNodeName(i) == null) + continue; + int pointIndex = i; int nodeIndex = find(new Node(c, pointIndex), groups); @@ -99,12 +103,12 @@ public class SpiceAnalyzer extends NetlistAnalyzer implements INetlistAnalyzer { if (c instanceof ISpiceMapper) pointIndex = ((ISpiceMapper)c).mapToSpiceNode(pointIndex); - nodeIndices[pointIndex] = nodeIndex; + nodeIndices.add(nodeIndex); } // output to spice - for (int i = 0; i < c.getControlPointCount(); i++) { - sb.append(fill(formatSpiceNode(nodeIndices[i]), 5)); + for (Integer nodeIndex : nodeIndices) { + sb.append(fill(formatSpiceNode(nodeIndex), 5)); sb.append(" "); }