mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-13 10:42:09 +10:00
heat sink resistor
This commit is contained in:
+38
-2
@@ -40,6 +40,8 @@ import org.diylc.components.AbstractLeadedComponent;
|
||||
import org.diylc.components.transform.SimpleComponentTransformer;
|
||||
import org.diylc.core.CreationMethod;
|
||||
import org.diylc.core.IDIYComponent;
|
||||
import org.diylc.core.IDatasheetSupport;
|
||||
import org.diylc.core.annotations.AiNote;
|
||||
import org.diylc.core.annotations.ComponentDescriptor;
|
||||
import org.diylc.core.annotations.EditableProperty;
|
||||
import org.diylc.core.annotations.PositiveMeasureValidator;
|
||||
@@ -54,11 +56,14 @@ import org.diylc.core.Project;
|
||||
import org.diylc.core.Theme;
|
||||
import org.diylc.utils.Constants;
|
||||
|
||||
@AiNote("A datasheet model is an Arcol HS part such as HS25 or HS100 and sets 'Power Rating' and the whole housing - body size, lips, mounting holes, lead length and diameter - but never the resistance; set 'Value' separately")
|
||||
@ComponentDescriptor(name = "Heat Sink Resistor", author = "Branislav Stojkovic", category = "Passive",
|
||||
creationMethod = CreationMethod.SINGLE_CLICK, instanceNamePrefix = "R",
|
||||
description = "Power resistor with heatsink; similar to Arcol HS series",
|
||||
zOrder = IDIYComponent.COMPONENT, transformer = SimpleComponentTransformer.class, enableCache = true)
|
||||
public class HeatSinkResistor extends AbstractLeadedComponent<Resistance> implements IGerberComponentSimple {
|
||||
zOrder = IDIYComponent.COMPONENT, transformer = SimpleComponentTransformer.class, enableCache = true,
|
||||
enableDatasheet = true, datasheetCreationStepCount = 2, datasheetModelColumn = 1)
|
||||
public class HeatSinkResistor extends AbstractLeadedComponent<Resistance>
|
||||
implements IGerberComponentSimple, IDatasheetSupport {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -107,6 +112,37 @@ public class HeatSinkResistor extends AbstractLeadedComponent<Resistance> implem
|
||||
leadLength = DEFAULT_LEAD_LENGTH;
|
||||
}
|
||||
|
||||
public HeatSinkResistor(String[] model) {
|
||||
this();
|
||||
|
||||
applyModel(model);
|
||||
}
|
||||
|
||||
// columns: series, part, power, body length, total width, lead length, lip width, mounting holes,
|
||||
// hole spacing, hole diameter, lead diameter; the resistance is not part of a row because the
|
||||
// housing depends only on the part
|
||||
@Override
|
||||
public void applyModel(String[] model) {
|
||||
setPower(Power.parseCapacitance(model[2]));
|
||||
setLength(Size.parseSize(model[3]));
|
||||
setWidth(Size.parseSize(model[4]));
|
||||
setLeadLength(Size.parseSize(model[5]));
|
||||
setLipSize(Size.parseSize(model[6]));
|
||||
setMountingHoles(parseMountingHoles(model[7]));
|
||||
setHorizontalHoleSpacing(Size.parseSize(model[8]));
|
||||
setMountingHoleDiameter(Size.parseSize(model[9]));
|
||||
setTerminalLeadDiameter(Size.parseSize(model[10]));
|
||||
}
|
||||
|
||||
private static MountingHoleCount parseMountingHoles(String label) {
|
||||
for (MountingHoleCount value : MountingHoleCount.values()) {
|
||||
if (value.toString().equalsIgnoreCase(label)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown mounting holes: " + label);
|
||||
}
|
||||
|
||||
private MountingHoleCount holeCount() {
|
||||
return mountingHoles == null ? MountingHoleCount.TWO_DIAGONAL : mountingHoles;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
Arcol HS,HS10,10 W,15.9 mm,16.5 mm,7.05 mm,4.1 mm,2 diagonal,11.3 mm,2.4 mm,2.0 mm
|
||||
Arcol HS,HS15,15 W,19.9 mm,21.0 mm,8.3 mm,5.1 mm,2 diagonal,14.3 mm,2.4 mm,2.0 mm
|
||||
Arcol HS,HS25,25 W,27.3 mm,28.0 mm,11.85 mm,8.2 mm,2 diagonal,18.3 mm,3.2 mm,2.0 mm
|
||||
Arcol HS,HS50,50 W,49.1 mm,29.7 mm,11.7 mm,8.3 mm,2 diagonal,39.7 mm,3.2 mm,2.0 mm
|
||||
Arcol HS,HS75,75 W,48.7 mm,47.5 mm,11.65 mm,10.5 mm,4 holes,29.0 mm,4.4 mm,3.2 mm
|
||||
Arcol HS,HS100,100 W,65.2 mm,47.5 mm,11.4 mm,10.5 mm,4 holes,35.0 mm,4.4 mm,3.2 mm
|
||||
Arcol HS,HS150,150 W,97.7 mm,47.5 mm,11.65 mm,10.5 mm,6 holes,29.0 mm,4.4 mm,3.2 mm
|
||||
Arcol HS,HS200,200 W,89.7 mm,72.5 mm,28.0 mm,15.3 mm,6 holes,35.0 mm,5.1 mm,6.0 mm
|
||||
Arcol HS,HS250,250 W,109.7 mm,72.5 mm,28.65 mm,15.3 mm,6 holes,44.5 mm,5.1 mm,6.0 mm
|
||||
Arcol HS,HS300,300 W,127.7 mm,72.5 mm,28.35 mm,13.5 mm,6 holes,52.0 mm,6.6 mm,6.0 mm
|
||||
Reference in New Issue
Block a user