mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
Detect when a file is created with a newer version of DIYLC and show a
warning Force correct prefix for transistors in spice
This commit is contained in:
Binary file not shown.
+8
-1
@@ -89,7 +89,14 @@ public abstract class AbstractTransistorPackage extends AbstractTransparentCompo
|
||||
|
||||
@Override
|
||||
public String getComment() {
|
||||
return getPinout() == null ? null : (getPinout().toString() + " pinout");
|
||||
return getPinout() == null ? "Pinout not configured, validate this line" : (getPinout().toString() + " pinout");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPrefix() {
|
||||
if (getPinout() == null)
|
||||
return null;
|
||||
return getPinout().name().substring(0, 1);
|
||||
}
|
||||
|
||||
@EditableProperty
|
||||
|
||||
@@ -31,4 +31,6 @@ public interface ISpiceMapper {
|
||||
int mapToSpiceNode(int pontIndex);
|
||||
|
||||
String getComment();
|
||||
|
||||
String getPrefix();
|
||||
}
|
||||
|
||||
@@ -80,8 +80,16 @@ public class SpiceAnalyzer extends NetlistAnalyzer implements INetlistAnalyzer {
|
||||
maxLen = c.getName().length();
|
||||
}
|
||||
|
||||
for (IDIYComponent<?> c : allComponents) {
|
||||
sb.append(fill(c.getName(), (int) (Math.ceil(maxLen / 5.0) * 5)));
|
||||
for (IDIYComponent<?> c : allComponents) {
|
||||
// change the prefix to match spice convention if needed
|
||||
String name = c.getName();
|
||||
String prefix = null;
|
||||
if (c instanceof ISpiceMapper)
|
||||
prefix = ((ISpiceMapper)c).getPrefix();
|
||||
if (prefix != null && !name.toLowerCase().startsWith(prefix.toLowerCase()))
|
||||
name = prefix + name;
|
||||
|
||||
sb.append(fill(name, (int) (Math.ceil(maxLen / 5.0) * 5)));
|
||||
sb.append(" ");
|
||||
int[] nodeIndices = new int[c.getControlPointCount()];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user