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:
@@ -297,5 +297,9 @@ public abstract class AbstractComponent<T> implements IDIYComponent<T> {
|
||||
public String[] getSectionNames(int pointIndex) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getCommonPointName(int pointIndex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,11 +131,17 @@ public interface IDIYComponent<T> extends Serializable {
|
||||
String getInternalLinkName(int index1, int index2);
|
||||
|
||||
/**
|
||||
* @param pointIndex name of the internal section containing the specified point, or null if the component does not have internal sections.
|
||||
* One point can be shared between multiple sections, in which case, the result may contain more than one element.
|
||||
* @return
|
||||
* @param pointIndex
|
||||
* @return name of the internal section containing the specified point, or null if the component does not have internal sections.
|
||||
* One point can be shared between multiple sections, in which case, the result may contain more than one element.
|
||||
*/
|
||||
String[] getSectionNames(int pointIndex);
|
||||
String[] getSectionNames(int pointIndex);
|
||||
|
||||
/**
|
||||
* @param pointIndex
|
||||
* @return name of the common point that joins all the other points with the same name together, e.g. GND
|
||||
*/
|
||||
String getCommonPointName(int pointIndex);
|
||||
|
||||
/**
|
||||
* Draws the component onto the {@link Graphics2D}.
|
||||
|
||||
@@ -2824,10 +2824,14 @@ public class Presenter implements IPlugInPort {
|
||||
Point2D point1 = node1.getComponent().getControlPoint(node1.getPointIndex());
|
||||
Point2D point2 = node2.getComponent().getControlPoint(node2.getPointIndex());
|
||||
|
||||
String commonPoint1 = node1.getComponent().getCommonPointName(node1.getPointIndex());
|
||||
String commonPoint2 = node2.getComponent().getCommonPointName(node2.getPointIndex());
|
||||
|
||||
// try both directions
|
||||
if (point1.distance(point2) < t ||
|
||||
checkGraphConnection(point1, point2, connections, continuityAreas, new boolean[connections.size()]) ||
|
||||
checkGraphConnection(point2, point1, connections, continuityAreas, new boolean[connections.size()])) {
|
||||
checkGraphConnection(point2, point1, connections, continuityAreas, new boolean[connections.size()]) ||
|
||||
(commonPoint1 != null && commonPoint1.equalsIgnoreCase(commonPoint2))) {
|
||||
boolean added = false;
|
||||
// add to an existing vertex if possible
|
||||
for (Group g : netlist.getGroups())
|
||||
|
||||
Reference in New Issue
Block a user