mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
Output SPICE node names in the "Nxxx" format
join all nodes connected to GND together
This commit is contained in:
@@ -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++)
|
||||
|
||||
Reference in New Issue
Block a user