Output SPICE node names in the "Nxxx" format

join all nodes connected to GND together
This commit is contained in:
Branislav Stojkovic
2019-03-13 19:23:35 +01:00
parent 92a2bb9809
commit 4de3b6d97c
9 changed files with 46 additions and 7 deletions
Binary file not shown.
@@ -139,6 +139,11 @@ public class GroundSymbol extends AbstractComponent<Void> {
@Override
public String getControlPointNodeName(int index) {
return getName();
}
@Override
public String getCommonPointName(int pointIndex) {
return "GND";
}
@Override
@@ -113,7 +113,7 @@ public class SpiceAnalyzer extends NetlistAnalyzer implements INetlistAnalyzer {
// output to spice
for (int i = 0; i < c.getControlPointCount(); i++) {
sb.append(fill(Integer.toString(nodeIndices[i]), 5));
sb.append(fill(formatSpiceNode(nodeIndices[i]), 5));
sb.append(" ");
}
@@ -130,6 +130,10 @@ public class SpiceAnalyzer extends NetlistAnalyzer implements INetlistAnalyzer {
return new Summary(netlist, sb.toString());
}
private static String formatSpiceNode(int i) {
return String.format("N%03d" , i);
}
private String fill(String source, int desiredLength) {
String res = source;
for (int i = 0; i < desiredLength - source.length(); i++)