diode improvements

This commit is contained in:
Bane Stojkovic
2026-11-02 14:58:52 +01:00
parent 3e043a8387
commit e369ea6200
8 changed files with 566 additions and 6 deletions
+4 -2
View File
@@ -16827,7 +16827,8 @@
"namePrefix" : "D",
"description" : "Glass diode, like most small signal diodes.",
"creationMethod" : "POINT_BY_POINT",
"notes" : [ "The two control points are the holes the leads go into and the body is centred between them; 'Length' is the body length, not the hole spacing", "If the control points are closer together than 'Length' (0.2in by default) the part is drawn standing, its body over the first point, or over the second with 'Reverse (standing)'; to keep it lying on a tighter footprint, reduce 'Length'" ],
"notes" : [ "The two control points are the holes the leads go into and the body is centred between them; 'Length' is the body length, not the hole spacing", "If the control points are closer together than 'Length' (0.2in by default) the part is drawn standing, its body over the first point, or over the second with 'Reverse (standing)'; to keep it lying on a tighter footprint, reduce 'Length'", "A datasheet model is a part number such as 1N4148, BAT46 or 1N34A and sets 'Value', 'Length', 'Width' and the body colours to match its package; set 'Value' to the same part number together with the model" ],
"datasheetModels" : [ "1N4148", "1N914", "1N4448", "1N916", "1N4151", "BAV21", "1N3600", "BA221", "BAT41", "BAT42", "BAT43", "BAT46", "BAT48", "BAT85", "1N5711", "BAT86", "1N34A", "1N270", "OA90", "OA91", "OA95", "OA47", "AA119", "AA143", "1N60", "1N60P", "BYV26C", "BYV26E", "1N4728A", "1N4729A", "1N4730A", "1N4731A", "1N4732A", "1N4733A", "1N4734A", "1N4735A", "1N4736A", "1N4737A", "1N4738A", "1N4739A", "1N4740A", "1N4741A", "1N4742A", "1N4743A", "1N4744A", "1N4745A", "1N4746A", "1N4747A", "1N4748A", "1N4749A", "1N4750A", "1N4751A", "1N4752A", "1N4753A", "1N4754A", "1N4755A", "1N4756A", "1N4757A", "1N4758A", "1N4759A", "1N4760A", "1N4761A", "1N4762A", "1N4763A", "1N4764A", "1N5221B", "1N5222B", "1N5223B", "1N5224B", "1N5225B", "1N5226B", "1N5227B", "1N5228B", "1N5229B", "1N5230B", "1N5231B", "1N5232B", "1N5233B", "1N5234B", "1N5235B", "1N5236B", "1N5237B", "1N5238B", "1N5239B", "1N5240B", "1N5241B", "1N5242B", "1N5243B", "1N5244B", "1N5245B", "1N5246B", "1N5247B", "1N5248B", "1N5249B", "1N5250B", "1N5251B", "1N5252B", "1N5253B", "1N5254B", "1N5255B", "1N5256B", "1N5257B", "1N5258B", "1N5259B", "1N5260B", "1N5261B", "1N5262B", "1N5263B", "1N5264B", "1N5265B", "1N5266B", "1N5267B", "1N746A", "1N747A", "1N748A", "1N749A", "1N750A", "1N751A", "1N752A", "1N753A", "1N754A", "1N755A", "1N756A", "1N757A", "1N758A", "1N759A", "BZX55C2V4", "BZX55C2V7", "BZX55C3V0", "BZX55C3V3", "BZX55C3V6", "BZX55C3V9", "BZX55C4V3", "BZX55C4V7", "BZX55C5V1", "BZX55C5V6", "BZX55C6V2", "BZX55C6V8", "BZX55C7V5", "BZX55C8V2", "BZX55C9V1", "BZX55C10", "BZX55C11", "BZX55C12", "BZX55C13", "BZX55C15", "BZX55C16", "BZX55C18", "BZX55C20", "BZX55C22", "BZX55C24", "BZX55C27", "BZX55C30", "BZX55C33", "BZX55C36", "BZX55C39", "BZX55C43", "BZX55C47", "BZX55C51", "BZX55C56", "BZX55C62", "BZX55C68", "BZX55C75", "BZX79C2V4", "BZX79C2V7", "BZX79C3V0", "BZX79C3V3", "BZX79C3V6", "BZX79C3V9", "BZX79C4V3", "BZX79C4V7", "BZX79C5V1", "BZX79C5V6", "BZX79C6V2", "BZX79C6V8", "BZX79C7V5", "BZX79C8V2", "BZX79C9V1", "BZX79C10", "BZX79C11", "BZX79C12", "BZX79C13", "BZX79C15", "BZX79C16", "BZX79C18", "BZX79C20", "BZX79C22", "BZX79C24", "BZX79C27", "BZX79C30", "BZX79C33", "BZX79C36", "BZX79C39", "BZX79C43", "BZX79C47", "BZX79C51", "BZX79C56", "BZX79C62", "BZX79C68", "BZX79C75" ],
"properties" : [ {
"name" : "Alpha",
"type" : "Percentage",
@@ -16919,7 +16920,8 @@
"namePrefix" : "D",
"description" : "Plastic diode, like most rectifier, zener, schottky, etc.",
"creationMethod" : "POINT_BY_POINT",
"notes" : [ "The two control points are the holes the leads go into and the body is centred between them; 'Length' is the body length, not the hole spacing", "If the control points are closer together than 'Length' (0.25in by default) the part is drawn standing, its body over the first point; to keep it lying on a tighter footprint, reduce 'Length'" ],
"notes" : [ "The two control points are the holes the leads go into and the body is centred between them; 'Length' is the body length, not the hole spacing", "If the control points are closer together than 'Length' (0.25in by default) the part is drawn standing, its body over the first point; to keep it lying on a tighter footprint, reduce 'Length'", "A datasheet model is a part number such as 1N4007, 1N5819 or UF4007 and sets 'Value', 'Length', 'Width' and the body colours to match its package; set 'Value' to the same part number together with the model" ],
"datasheetModels" : [ "1N4001", "1N4002", "1N4003", "1N4004", "1N4005", "1N4006", "1N4007", "1N5391", "1N5392", "1N5393", "1N5394", "1N5395", "1N5396", "1N5397", "1N5398", "1N5399", "1N5400", "1N5401", "1N5402", "1N5404", "1N5406", "1N5407", "1N5408", "BY255", "6A10", "UF4001", "UF4002", "UF4003", "UF4004", "UF4005", "UF4006", "UF4007", "1N4933", "1N4934", "1N4935", "1N4936", "1N4937", "FR101", "FR102", "FR103", "FR104", "FR105", "FR106", "FR107", "HER101", "HER102", "HER103", "HER104", "HER105", "HER106", "HER107", "HER108", "MUR120", "MUR160", "BA157", "BA158", "BA159", "UF5400", "UF5401", "UF5402", "UF5404", "UF5406", "UF5407", "UF5408", "MUR460", "BY399", "1N5817", "1N5818", "1N5819", "SB140", "SB160", "SR160", "11DQ04", "1N5820", "1N5821", "1N5822", "SB560" ],
"properties" : [ {
"name" : "Alpha",
"type" : "Percentage",
@@ -529,6 +529,10 @@
<changeType>NEW_FEATURE</changeType>
<description>Added a datasheet to 'Tube Socket' - pick a tube by its type from the component's submenu to set its base and electrode labels at once - more than 180 preamp, power, rectifier, radio, space-charge and Soviet tubes; the AI Assistant can place these tubes by type too</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType>
<description>Added datasheets to 'Diode (plastic)' and 'Diode (glass)' - pick a part by its number from the component's submenu to draw it at its real package size and colours - more than 270 rectifiers, Schottky, signal, germanium and zener diodes; the AI Assistant can place these parts by part number too</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType>
<description>'Chassis Panel' is now 'Enclosure' and can draw an exploded view of the whole box; set 'Height' and choose which 'Sides' to unfold</description>
@@ -31,6 +31,7 @@ import org.diylc.common.IPlugInPort;
import org.diylc.components.AbstractLeadedComponent;
import org.diylc.components.transform.SimpleComponentTransformer;
import org.diylc.core.CreationMethod;
import org.diylc.core.IDatasheetSupport;
import org.diylc.core.IDIYComponent;
import org.diylc.core.Theme;
import org.diylc.core.annotations.AiNote;
@@ -43,11 +44,14 @@ import org.diylc.utils.Constants;
@AiNote("The two control points are the holes the leads go into and the body is centred between them; 'Length' is the body length, not the hole spacing")
@AiNote("If the control points are closer together than 'Length' (0.2in by default) the part is drawn standing, its body over the first point, or over the second with 'Reverse (standing)'; to keep it lying on a tighter footprint, reduce 'Length'")
@AiNote("A datasheet model is a part number such as 1N4148, BAT46 or 1N34A and sets 'Value', 'Length', 'Width' and the body colours to match its package; set 'Value' to the same part number together with the model")
@ComponentDescriptor(name = "Diode (glass)", author = "Branislav Stojkovic", category = "Semiconductors",
creationMethod = CreationMethod.POINT_BY_POINT, instanceNamePrefix = "D",
description = "Glass diode, like most small signal diodes.", zOrder = IDIYComponent.COMPONENT,
transformer = SimpleComponentTransformer.class, enableCache = true)
public class DiodeGlass extends AbstractLeadedComponent<String> implements IGerberComponentSimple {
transformer = SimpleComponentTransformer.class, enableCache = true, enableDatasheet = true,
datasheetCreationStepCount = 2, datasheetModelColumn = 1)
public class DiodeGlass extends AbstractLeadedComponent<String>
implements IGerberComponentSimple, IDatasheetSupport {
private static final long serialVersionUID = 1L;
@@ -71,6 +75,24 @@ public class DiodeGlass extends AbstractLeadedComponent<String> implements IGerb
this.borderColor = BORDER_COLOR;
}
public DiodeGlass(String[] model) {
this();
applyModel(model);
}
// columns: group, part number, package, body length, body diameter, body colour, cathode band
// colour, die colour
@Override
public void applyModel(String[] model) {
setValue(model[1]);
setLength(Size.parseSize(model[3]));
setWidth(Size.parseSize(model[4]));
setBodyColor(Color.decode(model[5]));
setMarkerColor(Color.decode(model[6]));
setInsideColor(Color.decode(model[7]));
}
@Override
protected boolean supportsStandingMode() {
return true;
@@ -31,6 +31,7 @@ import org.diylc.common.IPlugInPort;
import org.diylc.components.AbstractLeadedComponent;
import org.diylc.components.transform.SimpleComponentTransformer;
import org.diylc.core.CreationMethod;
import org.diylc.core.IDatasheetSupport;
import org.diylc.core.IDIYComponent;
import org.diylc.core.Theme;
import org.diylc.core.annotations.AiNote;
@@ -43,11 +44,14 @@ import org.diylc.utils.Constants;
@AiNote("The two control points are the holes the leads go into and the body is centred between them; 'Length' is the body length, not the hole spacing")
@AiNote("If the control points are closer together than 'Length' (0.25in by default) the part is drawn standing, its body over the first point; to keep it lying on a tighter footprint, reduce 'Length'")
@AiNote("A datasheet model is a part number such as 1N4007, 1N5819 or UF4007 and sets 'Value', 'Length', 'Width' and the body colours to match its package; set 'Value' to the same part number together with the model")
@ComponentDescriptor(name = "Diode (plastic)", author = "Branislav Stojkovic", category = "Semiconductors",
creationMethod = CreationMethod.POINT_BY_POINT, instanceNamePrefix = "D",
description = "Plastic diode, like most rectifier, zener, schottky, etc.", zOrder = IDIYComponent.COMPONENT,
transformer = SimpleComponentTransformer.class, enableCache = true)
public class DiodePlastic extends AbstractLeadedComponent<String> implements IGerberComponentSimple {
transformer = SimpleComponentTransformer.class, enableCache = true, enableDatasheet = true,
datasheetCreationStepCount = 2, datasheetModelColumn = 1)
public class DiodePlastic extends AbstractLeadedComponent<String>
implements IGerberComponentSimple, IDatasheetSupport {
private static final long serialVersionUID = 1L;
@@ -69,6 +73,23 @@ public class DiodePlastic extends AbstractLeadedComponent<String> implements IGe
this.borderColor = BORDER_COLOR;
}
public DiodePlastic(String[] model) {
this();
applyModel(model);
}
// columns: group, part number, package, body length, body diameter, body colour, cathode band
// colour
@Override
public void applyModel(String[] model) {
setValue(model[1]);
setLength(Size.parseSize(model[3]));
setWidth(Size.parseSize(model[4]));
setBodyColor(Color.decode(model[5]));
setMarkerColor(Color.decode(model[6]));
}
@Override
protected boolean supportsStandingMode() {
return true;
@@ -0,0 +1,200 @@
Signal,1N4148,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#D9652B
Signal,1N914,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#D9652B
Signal,1N4448,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#D9652B
Signal,1N916,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#D9652B
Signal,1N4151,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#D9652B
Signal,BAV21,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#D9652B
Signal,1N3600,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#D9652B
Signal,BA221,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#D9652B
Schottky,BAT41,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#D9652B
Schottky,BAT42,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#D9652B
Schottky,BAT43,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#D9652B
Schottky,BAT46,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#D9652B
Schottky,BAT48,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#D9652B
Schottky,BAT85,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#D9652B
Schottky,1N5711,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#D9652B
Schottky,BAT86,DO-34,2.6 mm,1.6 mm,#E1F0FF,#141414,#D9652B
Germanium,1N34A,DO-7,6.7 mm,2.45 mm,#E8F2F2,#141414,#5E5E5E
Germanium,1N270,DO-7,6.7 mm,2.45 mm,#E8F2F2,#141414,#5E5E5E
Germanium,OA90,DO-7,6.7 mm,2.45 mm,#E8F2F2,#141414,#5E5E5E
Germanium,OA91,DO-7,6.7 mm,2.45 mm,#E8F2F2,#141414,#5E5E5E
Germanium,OA95,DO-7,6.7 mm,2.45 mm,#E8F2F2,#141414,#5E5E5E
Germanium,OA47,DO-7,6.7 mm,2.45 mm,#E8F2F2,#141414,#5E5E5E
Germanium,AA119,DO-7,6.7 mm,2.45 mm,#E8F2F2,#141414,#5E5E5E
Germanium,AA143,DO-7,6.7 mm,2.45 mm,#E8F2F2,#141414,#5E5E5E
Germanium,1N60,DO-35,4 mm,1.8 mm,#E8F2F2,#141414,#5E5E5E
Germanium,1N60P,DO-35,4 mm,1.8 mm,#E8F2F2,#141414,#5E5E5E
Fast Rectifier,BYV26C,SOD-57,4.2 mm,3.5 mm,#202020,#B0B0B0,#202020
Fast Rectifier,BYV26E,SOD-57,4.2 mm,3.5 mm,#202020,#B0B0B0,#202020
Zener (1N47xx),1N4728A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4729A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4730A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4731A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4732A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4733A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4734A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4735A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4736A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4737A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4738A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4739A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4740A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4741A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4742A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4743A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4744A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4745A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4746A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4747A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4748A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4749A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4750A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4751A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4752A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4753A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4754A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4755A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4756A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4757A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4758A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4759A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4760A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4761A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4762A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4763A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N47xx),1N4764A,DO-41,4.3 mm,2.4 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5221B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5222B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5223B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5224B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5225B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5226B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5227B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5228B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5229B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5230B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5231B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5232B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5233B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5234B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5235B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5236B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5237B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5238B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5239B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5240B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5241B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5242B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5243B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5244B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5245B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5246B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5247B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5248B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5249B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5250B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5251B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5252B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5253B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5254B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5255B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5256B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5257B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5258B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5259B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5260B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5261B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5262B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5263B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5264B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5265B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5266B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N52xx),1N5267B,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N7xx),1N746A,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N7xx),1N747A,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N7xx),1N748A,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N7xx),1N749A,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N7xx),1N750A,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N7xx),1N751A,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N7xx),1N752A,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N7xx),1N753A,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N7xx),1N754A,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N7xx),1N755A,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N7xx),1N756A,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N7xx),1N757A,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N7xx),1N758A,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (1N7xx),1N759A,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C2V4,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C2V7,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C3V0,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C3V3,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C3V6,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C3V9,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C4V3,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C4V7,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C5V1,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C5V6,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C6V2,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C6V8,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C7V5,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C8V2,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C9V1,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C10,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C11,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C12,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C13,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C15,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C16,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C18,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C20,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C22,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C24,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C27,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C30,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C33,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C36,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C39,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C43,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C47,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C51,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C56,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C62,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C68,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX55),BZX55C75,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C2V4,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C2V7,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C3V0,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C3V3,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C3V6,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C3V9,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C4V3,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C4V7,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C5V1,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C5V6,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C6V2,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C6V8,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C7V5,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C8V2,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C9V1,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C10,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C11,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C12,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C13,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C15,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C16,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C18,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C20,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C22,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C24,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C27,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C30,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C33,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C36,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C39,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C43,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C47,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C51,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C56,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C62,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C68,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
Zener (BZX79),BZX79C75,DO-35,4 mm,1.8 mm,#E1F0FF,#141414,#E07A3A
@@ -0,0 +1,77 @@
Rectifier,1N4001,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Rectifier,1N4002,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Rectifier,1N4003,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Rectifier,1N4004,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Rectifier,1N4005,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Rectifier,1N4006,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Rectifier,1N4007,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Rectifier,1N5391,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Rectifier,1N5392,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Rectifier,1N5393,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Rectifier,1N5394,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Rectifier,1N5395,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Rectifier,1N5396,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Rectifier,1N5397,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Rectifier,1N5398,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Rectifier,1N5399,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Rectifier,1N5400,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
Rectifier,1N5401,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
Rectifier,1N5402,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
Rectifier,1N5404,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
Rectifier,1N5406,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
Rectifier,1N5407,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
Rectifier,1N5408,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
Rectifier,BY255,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
Rectifier,6A10,R-6,8.85 mm,8.85 mm,#1E1E1E,#BDBDBD
Fast Rectifier,UF4001,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,UF4002,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,UF4003,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,UF4004,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,UF4005,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,UF4006,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,UF4007,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,1N4933,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,1N4934,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,1N4935,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,1N4936,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,1N4937,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,FR101,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,FR102,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,FR103,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,FR104,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,FR105,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,FR106,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,FR107,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,HER101,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,HER102,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,HER103,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,HER104,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,HER105,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,HER106,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,HER107,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,HER108,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,MUR120,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,MUR160,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,BA157,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,BA158,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,BA159,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Fast Rectifier,UF5400,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
Fast Rectifier,UF5401,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
Fast Rectifier,UF5402,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
Fast Rectifier,UF5404,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
Fast Rectifier,UF5406,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
Fast Rectifier,UF5407,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
Fast Rectifier,UF5408,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
Fast Rectifier,MUR460,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
Fast Rectifier,BY399,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
Schottky,1N5817,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Schottky,1N5818,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Schottky,1N5819,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Schottky,SB140,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Schottky,SB160,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Schottky,SR160,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Schottky,11DQ04,DO-41,4.6 mm,2.4 mm,#1E1E1E,#BDBDBD
Schottky,1N5820,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
Schottky,1N5821,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
Schottky,1N5822,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
Schottky,SB560,DO-201AD,8.5 mm,5.1 mm,#1E1E1E,#BDBDBD
@@ -0,0 +1,105 @@
/*
DIY Layout Creator (DIYLC).
Copyright (c) 2009-2025 held jointly by the individual authors.
This file is part of DIYLC.
DIYLC is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DIYLC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DIYLC. If not, see <http://www.gnu.org/licenses/>.
*/
package org.diylc.components.semiconductors;
import java.awt.Color;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.diylc.core.measures.Size;
import org.diylc.presenter.DatasheetService;
import org.junit.Assert;
import org.junit.Test;
/** The datasheets of the plastic and glass diodes, which share their first seven columns. */
public class DiodeDatasheetTest {
@Test
public void everyPlasticRowApplies() {
for (String[] row : datasheet(DiodePlastic.class)) {
DiodePlastic diode = new DiodePlastic(row);
String context = String.join(",", row);
Assert.assertEquals(context, 7, row.length);
Assert.assertEquals(context, row[1], diode.getValue());
Assert.assertEquals(context, Size.parseSize(row[3]), diode.getLength());
Assert.assertEquals(context, Color.decode(row[6]), diode.getMarkerColor());
}
}
@Test
public void everyGlassRowApplies() {
for (String[] row : datasheet(DiodeGlass.class)) {
DiodeGlass diode = new DiodeGlass(row);
String context = String.join(",", row);
Assert.assertEquals(context, 8, row.length);
Assert.assertEquals(context, row[1], diode.getValue());
Assert.assertEquals(context, Size.parseSize(row[4]), diode.getWidth());
Assert.assertEquals(context, Color.decode(row[7]), diode.getInsideColor());
}
}
/** A part ships in one envelope, so it is listed under one component only. */
@Test
public void partNumbersAreUniqueAcrossBothFiles() {
Set<String> parts = new HashSet<String>();
for (Class<?> type : new Class<?>[] {DiodePlastic.class, DiodeGlass.class}) {
for (String[] row : datasheet(type)) {
Assert.assertTrue("repeated part " + row[1], parts.add(row[1].toUpperCase()));
}
}
}
/** Packages are standard outlines, so every part in one package is drawn the same size. */
@Test
public void onePackageHasOneSize() {
for (Class<?> type : new Class<?>[] {DiodePlastic.class, DiodeGlass.class}) {
Map<String, String> sizes = new HashMap<String, String>();
for (String[] row : datasheet(type)) {
String size = row[3] + " x " + row[4];
String first = sizes.putIfAbsent(row[2], size);
if (first != null) {
Assert.assertEquals(row[1] + " in " + row[2], first, size);
}
}
}
}
@Test
public void partIsFoundByNumberNotByGroup() {
DatasheetService service = DatasheetService.getInstance();
for (Class<?> type : new Class<?>[] {DiodePlastic.class, DiodeGlass.class}) {
String[] first = datasheet(type).get(0);
Assert.assertEquals(1, service.findSeries(type, first[1]).size());
Assert.assertTrue(service.findSeries(type, first[0]).isEmpty());
}
}
private static List<String[]> datasheet(Class<?> type) {
List<String[]> datasheet = DatasheetService.getInstance().loadDatasheet(type);
Assert.assertNotNull(type.getSimpleName(), datasheet);
Assert.assertFalse(type.getSimpleName(), datasheet.isEmpty());
return datasheet;
}
}
+129
View File
@@ -0,0 +1,129 @@
# Diode Datasheets
Applying a known diode's package and appearance from a datasheet.
## 1. Goal
Follows [DIP IC Pin Names](dip-ic-pin-names.md), [Transistor Pinouts](transistor-pinouts.md) and
[Tube Socket Datasheets](tube-socket-datasheets.md). A diode's terminals are always anode and cathode
(`A`, `K`), so unlike those components there are no pins to name. What a part number does fix is the
package - a 1N5408 is twice the size of a 1N4007 - and, for the AI, what the part is: a rectifier,
a Schottky, a signal diode, a germanium clipper or a zener. Users already type part numbers into
"Value" (in the sample corpus 1N4007 13 times, 1N4148 8, 1N5819 6), but the body keeps the default
size whatever they type. A datasheet sets the value, body size and colours in one step, from the
toolbox or from the AI, as `Resistor.datasheet` already does for resistor families.
## 2. Design decisions
| # | Decision | Choice | Rationale |
|---|---|---|---|
| D1 | Components | `DiodePlastic` and `DiodeGlass` each get a datasheet. A part goes in the file of its envelope: epoxy (DO-41, DO-15, DO-201AD) in `DiodePlastic`, glass (DO-35, DO-34, DO-7, glass DO-41) in `DiodeGlass` | The two classes are the two envelopes; the drawing differs (glass shows the die). |
| D2 | Datasheet row | Plastic: `group, part, package, length, width, body color, marker color`. Glass: the same plus `inside color`. Sizes in mm, colours as `#RRGGBB`, e.g. `Rectifier,1N4007,DO-41,4.8 mm,2.6 mm,#333333,#DDDDDD` | Every value maps to an existing property; nothing new is serialized. The package column is for readers and for a test that keeps one package one size. |
| D3 | Model identity | `enableDatasheet = true`, `datasheetCreationStepCount = 2`, `datasheetModelColumn = 1` | Toolbox groups by family, the AI names the part. |
| D4 | `applyModel` | Sets value, length, width, body colour, marker colour (and inside colour on glass). Leaves lead colour, label, display and orientation alone | The datasheet says what the part is and how big; label and display are the user's. |
| D5 | Sizes | One body length and diameter per package, the nominal (mid-range) value of the manufacturer's outline drawing, shared by every part in that package | Packages are standardized (JEDEC DO outlines); a per-part size would only add noise. A test enforces it. |
| D6 | Colours | One appearance per package and family, as the parts usually look: black epoxy with a grey band for rectifiers and Schottkys; clear glass with an orange die and a black band for silicon signal diodes and zeners; a darker die for germanium | Diodes, unlike resistors, carry no colour code; a recognisable appearance is enough. |
| D7 | Standing mode | Unchanged. A model changes "Length", and a body longer than the control-point spacing is drawn standing, as today | Existing `@AiNote`s already explain this; applying a model to a placed part can flip it to standing only if the new body is longer than the hole spacing. |
| D8 | Zeners | Listed part by part (1N4728A ... 1N4764A, the 1N52xxB and BZX55/BZX79 values DIYers use), each row naming the part; the voltage is not a column | The part number is what is printed and searched for. A zener voltage column would need a new property. |
| D9 | Equivalents | One row per part number (1N4148 and 1N914; 1N5817, 1N5818, 1N5819), as for ICs and tubes | Users and the AI look up the printed number. |
### Explicitly out of scope
- LEDs, bridge rectifiers and SMD diodes. Bridge rectifiers are a separate, smaller follow-up (shape
and pin order per W04M / DB107 / KBP / KBPC).
- The schematic diode symbols.
- A zener voltage or diode type property.
- Translating group names.
## 3. Changes
### diylc-library
- `DiodePlastic`, `DiodeGlass`: `implements IDatasheetSupport`, descriptor attributes (D3), a
`(String[] model)` constructor and `applyModel` (D4); an `@AiNote` on the datasheet model.
- `datasheets/DiodePlastic.datasheet`, `datasheets/DiodeGlass.datasheet`: rows per D2. Package
dimensions from manufacturer outline drawings; each part's package from its manufacturer data
sheet.
### Generated
- `catalog_full.json` regenerated.
## 4. Datasheet inventory
Package sizes, nominal (mid-range) body length x diameter from the outline drawings:
| Package | Size | Source | Envelope, colours |
|---|---|---|---|
| DO-41 (plastic) | 4.6 x 2.4 mm | Vishay, Diodes Inc., onsemi case 59-10, JEDEC DO-204AL | epoxy `#1E1E1E`, band `#BDBDBD` |
| DO-201AD | 8.5 x 5.1 mm | Vishay 1N5400, Diodes DS28007 | epoxy |
| R-6 (P600) | 8.85 x 8.85 mm | Diodes DS28009, Vishay P600 | epoxy |
| DO-35 | 4.0 x 1.8 mm | JEDEC DO-204AH; onsemi, Vishay, Nexperia SOD27 differ (Vishay <= 3.4 long) | glass `#E1F0FF`, band `#141414`, die `#D9652B` (zener `#E07A3A`) |
| DO-34 | 2.6 x 1.6 mm | JEDEC DO-204AG, Nexperia SOD68 | glass |
| DO-41 (glass) | 4.3 x 2.4 mm | Vishay, Nexperia SOD66, Microsemi (shorter than plastic) | glass, zener die |
| DO-7 | 6.7 x 2.45 mm | JEDEC DO-204AA only | glass, germanium chip `#5E5E5E` |
| SOD-57 | 4.2 x 3.5 mm | Vishay BYV27, NXP SOD57 (NXP ~10 % larger) | black sinterglass `#202020`, band `#B0B0B0` |
`DiodePlastic.datasheet`, 77 parts:
| Group | Package | Parts |
|---|---|---|
| Rectifier | DO-41 | 1N4001-1N4007, 1N5391-1N5399 |
| Rectifier | DO-201AD / R-6 | 1N5400-1N5408, BY255 / 6A10 |
| Fast Rectifier | DO-41 | UF4001-UF4007, 1N4933-1N4937, FR101-FR107, HER101-HER108, MUR120, MUR160, BA157-BA159 |
| Fast Rectifier | DO-201AD | UF5400-UF5408, MUR460, BY399 |
| Schottky | DO-41 / DO-201AD | 1N5817-1N5819, SB140, SB160, SR160, 11DQ04 / 1N5820-1N5822, SB560 |
`DiodeGlass.datasheet`, 200 parts:
| Group | Package | Parts |
|---|---|---|
| Signal | DO-35 | 1N4148, 1N914, 1N4448, 1N916, 1N4151, BAV21, 1N3600, BA221 |
| Schottky | DO-35 / DO-34 | BAT41, BAT42, BAT43, BAT46, BAT48, BAT85, 1N5711 / BAT86 |
| Germanium | DO-7 / DO-35 | 1N34A, 1N270, OA90, OA91, OA95, OA47, AA119, AA143 / 1N60, 1N60P |
| Fast Rectifier | SOD-57 | BYV26C, BYV26E |
| Zener (1N47xx) | DO-41 | 1N4728A-1N4764A |
| Zener (1N52xx), (1N7xx), (BZX55), (BZX79) | DO-35 | 1N5221B-1N5267B, 1N746A-1N759A, BZX55C and BZX79C 2V4-75 |
Sourcing notes:
- Part packages read from Vishay, Diodes Inc., Taiwan Semiconductor, onsemi, Nexperia, ST,
Microsemi and Central sheets. Weakest: FR10x and SR160 (second-tier makers agreeing), MUR460 and
11DQ04 (mirrors), the European germanium types (DO-7 from secondary sources; their real bodies are
"DO-7-like"), and BYV26 (package from the BYV27 sheet of the same family).
- Same number, different envelope: 1N5391-1N5399 are DO-41 at Vishay (current) and DO-15 at TSC and
the old Diodes sheet; BAT85 is DO-35 at Vishay (current) and DO-34 at Nexperia (discontinued);
1N47xxA are glass DO-41 at every maker that states an envelope, so they are glass parts here.
- 1N60 / 1N60P are sold as germanium but current Asian production is often a silicon Schottky.
- Left out: BAT54 (SMD), 1N695 (secondary sources only), Soviet D9/D18 (own glass cases, not JEDEC),
DO-15 parts (none needed once 1N539x went to DO-41).
- Popular additions not yet sourced: 1S1588, 1SS133, MA150/MA856 (Japanese pedal clippers), BZX85C
(1.3 W zeners), SF14/SF18, MBR160, SB5100, 1N4150, 1N456/1N457, BY228/BYW96 (SOD-64).
Rules for every row: a part's package is read from its manufacturer data sheet (or two independent
sources); where makers ship the same number in different envelopes (1N47xx in glass or plastic
DO-41; germanium parts in DO-7 or DO-35), the row follows the common current production and the
other is noted.
## 5. Tests
- `DiodeDatasheetTest`, over both files: every row parses and applies; parts are unique within a
file and appear in only one of the two; rows naming the same package carry the same length and
width; `findSeries` finds a part and not a group.
## 6. Verification
- `mvn -q -pl diylc-library -am test`, then the whole reactor.
- Render one part per package, lying and standing, and compare body proportions with the outline
drawings.
- Regression suite not required: no existing project changes (nothing is applied to placed parts).
## 7. Phases
1. **Plan**: this document.
2. **Code**: done - D3, D4, `DiodeDatasheetTest`, `@AiNote` on both classes. The test fails until
the datasheets exist.
3. **Library**: done - 277 parts in two datasheets, all five `DiodeDatasheetTest` cases pass, whole
reactor passes (core 227, library 513, swing 29), parts rendered per package; `catalog_full.json`
regenerated; release note in 6.10.
4. **Later**: bridge rectifiers; LEDs (3 mm / 5 mm / 10 mm bodies) if wanted.