Show wire gauge in the bom and project explorer

This commit is contained in:
Bane Stojkovic
2022-12-14 22:15:40 +01:00
parent d5d0ec56cf
commit 7a186d0d49
10 changed files with 47 additions and 47 deletions
@@ -4245,7 +4245,11 @@
<org.diylc.appframework.update.Change> <org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType> <changeType>NEW_FEATURE</changeType>
<description>Show component values in the project explorer</description> <description>Show component values in the project explorer</description>
</org.diylc.appframework.update.Change> </org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType>
<description>Double click in the project explorer to edit selected component</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change> <org.diylc.appframework.update.Change>
<changeType>NEW_FEATURE</changeType> <changeType>NEW_FEATURE</changeType>
<description>Title Block added as one of factory building blocks</description> <description>Title Block added as one of factory building blocks</description>
@@ -4264,7 +4268,11 @@
</org.diylc.appframework.update.Change> </org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change> <org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType> <changeType>IMPROVEMENT</changeType>
<description>Show jack type in the BOM</description> <description>Show jack type in the BOM and project explorer</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType>
<description>Show wire gauge in the BOM and project explorer</description>
</org.diylc.appframework.update.Change> </org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change> <org.diylc.appframework.update.Change>
<changeType>IMPROVEMENT</changeType> <changeType>IMPROVEMENT</changeType>
Binary file not shown.
@@ -27,7 +27,7 @@ public enum AWG {
@Override @Override
public String toString() { public String toString() {
return "#" + name().replace("_", "") + " (" + String.format("%1$,.2f", diameterIn() * 25.4) + "mm / " + String.format("%1$,.5f", diameterIn()) + "in)"; return "#" + name().replace("_", "") + " / " + String.format("%1$,.2f", diameterIn() * 25.4) + "mm";
} }
public double diameterIn() { public double diameterIn() {
@@ -41,7 +41,7 @@ import org.diylc.utils.Constants;
instanceNamePrefix = "W", description = "Flexible wire with two control points", zOrder = IDIYComponent.WIRING, instanceNamePrefix = "W", description = "Flexible wire with two control points", zOrder = IDIYComponent.WIRING,
flexibleZOrder = true, bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false, flexibleZOrder = true, bomPolicy = BomPolicy.NEVER_SHOW, autoEdit = false,
transformer = SimpleComponentTransformer.class, enableCache = false) transformer = SimpleComponentTransformer.class, enableCache = false)
public class HookupWire extends AbstractCurvedComponent<Void> implements IContinuity { public class HookupWire extends AbstractCurvedComponent<AWG> implements IContinuity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@@ -117,22 +117,14 @@ public class HookupWire extends AbstractCurvedComponent<Void> implements IContin
} }
@EditableProperty(name = "AWG") @EditableProperty(name = "AWG")
public AWG getGauge() { public AWG getValue() {
return gauge; return gauge;
} }
public void setGauge(AWG gauge) { public void setValue(AWG gauge) {
this.gauge = gauge; this.gauge = gauge;
} }
@Override
public Void getValue() {
return null;
}
@Override
public void setValue(Void value) {}
@EditableProperty(name = "Stripe") @EditableProperty(name = "Stripe")
public boolean getStriped() { public boolean getStriped() {
return striped; return striped;
@@ -80,7 +80,7 @@ public class FlexibleLeadsEditor implements IProjectEditor {
// create leads // create leads
HookupWire w1 = new HookupWire(); HookupWire w1 = new HookupWire();
getInstantiationManager().fillWithDefaultProperties(w1, null); getInstantiationManager().fillWithDefaultProperties(w1, null);
w1.setGauge(AWG._26); w1.setValue(AWG._26);
w1.setLeadColor(leaded.getLeadColor()); w1.setLeadColor(leaded.getLeadColor());
// w1.setPointCount(PointCount.THREE); // w1.setPointCount(PointCount.THREE);
w1.setControlPoint(p1, 0); w1.setControlPoint(p1, 0);
@@ -93,7 +93,7 @@ public class FlexibleLeadsEditor implements IProjectEditor {
HookupWire w2 = new HookupWire(); HookupWire w2 = new HookupWire();
getInstantiationManager().fillWithDefaultProperties(w2, null); getInstantiationManager().fillWithDefaultProperties(w2, null);
w2.setGauge(AWG._26); w2.setValue(AWG._26);
w2.setLeadColor(leaded.getLeadColor()); w2.setLeadColor(leaded.getLeadColor());
// w2.setPointCount(PointCount.THREE); // w2.setPointCount(PointCount.THREE);
w2.setControlPoint(p2, 0); w2.setControlPoint(p2, 0);
@@ -134,9 +134,9 @@ public class FlexibleLeadsEditor implements IProjectEditor {
getInstantiationManager().fillWithDefaultProperties(w, null); getInstantiationManager().fillWithDefaultProperties(w, null);
// make the leads thicker for TO220 and TO126 // make the leads thicker for TO220 and TO126
if (c instanceof TransistorTO220 || c instanceof TransistorTO126) if (c instanceof TransistorTO220 || c instanceof TransistorTO126)
w.setGauge(AWG._24); w.setValue(AWG._24);
else else
w.setGauge(AWG._26); w.setValue(AWG._26);
w.setLeadColor(AbstractTransistorPackage.METAL_COLOR); w.setLeadColor(AbstractTransistorPackage.METAL_COLOR);
w.setPointCount(PointCount.THREE); w.setPointCount(PointCount.THREE);
w.setControlPoint(p0, 0); w.setControlPoint(p0, 0);
@@ -244,7 +244,7 @@ public class FlexibleLeadsEditor implements IProjectEditor {
tx = AffineTransform.getRotateInstance(c.getOrientation().toRadians(), p0.getX(), p0.getY()); tx = AffineTransform.getRotateInstance(c.getOrientation().toRadians(), p0.getX(), p0.getY());
HookupWire w = new HookupWire(); HookupWire w = new HookupWire();
w.setGauge(AWG._24); w.setValue(AWG._24);
getInstantiationManager().fillWithDefaultProperties(w, null); getInstantiationManager().fillWithDefaultProperties(w, null);
for (int j = 0; j < w.getControlPointCount(); j++) { for (int j = 0; j < w.getControlPointCount(); j++) {
Point2D p = new Point2D.Double((int)(p0.getX() + dx * j), (int)(p0.getY() + dy * j)); Point2D p = new Point2D.Double((int)(p0.getX() + dx * j), (int)(p0.getY() + dy * j));
@@ -439,29 +439,29 @@ public class V2FileParser implements IOldFileParser {
} }
num = num * 2 + 8; num = num * 2 + 8;
if (num == 8) if (num == 8)
hw.setGauge(AWG._8); hw.setValue(AWG._8);
else if (num == 10) else if (num == 10)
hw.setGauge(AWG._10); hw.setValue(AWG._10);
else if (num == 12) else if (num == 12)
hw.setGauge(AWG._12); hw.setValue(AWG._12);
else if (num == 14) else if (num == 14)
hw.setGauge(AWG._14); hw.setValue(AWG._14);
else if (num == 16) else if (num == 16)
hw.setGauge(AWG._16); hw.setValue(AWG._16);
else if (num == 18) else if (num == 18)
hw.setGauge(AWG._18); hw.setValue(AWG._18);
else if (num == 20) else if (num == 20)
hw.setGauge(AWG._20); hw.setValue(AWG._20);
else if (num == 22) else if (num == 22)
hw.setGauge(AWG._22); hw.setValue(AWG._22);
else if (num == 24) else if (num == 24)
hw.setGauge(AWG._24); hw.setValue(AWG._24);
else if (num == 26) else if (num == 26)
hw.setGauge(AWG._26); hw.setValue(AWG._26);
else if (num == 28) else if (num == 28)
hw.setGauge(AWG._28); hw.setValue(AWG._28);
else if (num == 30) else if (num == 30)
hw.setGauge(AWG._30); hw.setValue(AWG._30);
hw.setLeadColor(cl); hw.setLeadColor(cl);
hw.setControlPoint(tacke.get(0), 0); hw.setControlPoint(tacke.get(0), 0);
hw.setControlPoint(tacke.get(1), 1); hw.setControlPoint(tacke.get(1), 1);
+1 -1
View File
@@ -14,5 +14,5 @@
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.diylc.DIYLCStarter"/> <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.diylc.DIYLCStarter"/>
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="diylc-swing"/> <stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="diylc-swing"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="diylc-swing"/> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="diylc-swing"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms512m -Xmx2048m -javaagent:lib/jar-loader.jar -Dorg.diylc.storeDict=true -Dorg.diylc.enableTests=true -Dorg.diylc.scriptRun=true -Ddorg.diylc.debugContinuityAreas=true -Ddorg.diylc.debugComponentAreas=true -Ddorg.diylc.WriteStaticVariants=true -Dorg.diylc.WriteStaticBlocks=true &#13;&#10;--add-opens java.base/java.util=ALL-UNNAMED&#13;&#10;--add-opens java.base/java.lang=ALL-UNNAMED&#13;&#10;--add-opens java.base/java.text=ALL-UNNAMED&#13;&#10;--add-opens java.desktop/java.awt=ALL-UNNAMED&#13;&#10;--add-opens java.desktop/java.awt.font=ALL-UNNAMED&#13;&#10;--add-opens java.desktop/java.awt.geom=ALL-UNNAMED"/> <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms512m -Xmx2048m -javaagent:lib/jar-loader.jar -Dorg.diylc.storeDict=true -Dorg.diylc.enableTests=true -Dorg.diylc.scriptRun=true -Ddorg.diylc.debugContinuityAreas=true -Ddorg.diylc.debugComponentAreas=true -Ddorg.diylc.WriteStaticVariants=true -Ddorg.diylc.WriteStaticBlocks=true &#13;&#10;--add-opens java.base/java.util=ALL-UNNAMED&#13;&#10;--add-opens java.base/java.lang=ALL-UNNAMED&#13;&#10;--add-opens java.base/java.text=ALL-UNNAMED&#13;&#10;--add-opens java.desktop/java.awt=ALL-UNNAMED&#13;&#10;--add-opens java.desktop/java.awt.font=ALL-UNNAMED&#13;&#10;--add-opens java.desktop/java.awt.geom=ALL-UNNAMED"/>
</launchConfiguration> </launchConfiguration>
+15 -15
View File
@@ -1,18 +1,18 @@
#10 (2.59mm / 0.10190in) #10 / 2.59mm
#12 (2.05mm / 0.08081in) #12 / 2.05mm
#14 (1.63mm / 0.06409in) #14 / 1.63mm
#16 (1.29mm / 0.05082in) #16 / 1.29mm
#18 (1.02mm / 0.04030in) #18 / 1.02mm
#20 (0.81mm / 0.03196in) #20 / 0.81mm
#22 (0.64mm / 0.02535in) #22 / 0.64mm
#24 (0.51mm / 0.02010in) #24 / 0.51mm
#26 (0.40mm / 0.01594in) #26 / 0.40mm
#28 (0.32mm / 0.01264in) #28 / 0.32mm
#30 (0.25mm / 0.01003in) #30 / 0.25mm
#32 (0.20mm / 0.00795in) #32 / 0.20mm
#34 (0.16mm / 0.00631in) #34 / 0.16mm
#36 (0.13mm / 0.00500in) #36 / 0.13mm
#8 (3.26mm / 0.12849in) #8 / 3.26mm
1 throws / 2 positions 1 throws / 2 positions
10 throws / 10 positions 10 throws / 10 positions
11 throws / 11 positions 11 throws / 11 positions
Binary file not shown.
Binary file not shown.