mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
Show voltage and power ratings in BOM where applicable
This commit is contained in:
+5
@@ -64,6 +64,11 @@ public abstract class AbstractComponent<T> implements IDIYComponent<T> {
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getValueForDisplay() {
|
||||||
|
return getValue() == null ? "" : getValue().toString();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the closest odd number, i.e. x when x is odd, or x + 1 when x is
|
* Returns the closest odd number, i.e. x when x is odd, or x + 1 when x is
|
||||||
* even.
|
* even.
|
||||||
|
|||||||
+7
-1
@@ -107,7 +107,8 @@ public interface IDIYComponent<T> extends Serializable {
|
|||||||
* @param project
|
* @param project
|
||||||
* @param drawingObserver
|
* @param drawingObserver
|
||||||
*/
|
*/
|
||||||
void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode, Project project,
|
void draw(Graphics2D g2d, ComponentState componentState,
|
||||||
|
boolean outlineMode, Project project,
|
||||||
IDrawingObserver drawingObserver);
|
IDrawingObserver drawingObserver);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -127,6 +128,11 @@ public interface IDIYComponent<T> extends Serializable {
|
|||||||
*/
|
*/
|
||||||
IDIYComponent<T> clone() throws CloneNotSupportedException;
|
IDIYComponent<T> clone() throws CloneNotSupportedException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return full value for BOM.
|
||||||
|
*/
|
||||||
|
String getValueForDisplay();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if two components are equal.
|
* Checks if two components are equal.
|
||||||
*
|
*
|
||||||
|
|||||||
+1
-2
@@ -15,12 +15,11 @@ public class PCBLayerFiler implements IComponentFiler {
|
|||||||
this.layer = layer;
|
this.layer = layer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
@Override
|
@Override
|
||||||
public boolean testComponent(IDIYComponent<?> component) {
|
public boolean testComponent(IDIYComponent<?> component) {
|
||||||
Class<?> clazz = component.getClass();
|
Class<?> clazz = component.getClass();
|
||||||
try {
|
try {
|
||||||
Method m = clazz.getMethod("getLayer", null);
|
Method m = clazz.getMethod("getLayer");
|
||||||
PCBLayer l = (PCBLayer) m.invoke(component);
|
PCBLayer l = (PCBLayer) m.invoke(component);
|
||||||
return layer == l;
|
return layer == l;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
+1
-2
@@ -64,8 +64,7 @@ public class BomMaker {
|
|||||||
if (type.getBomPolicy() == BomPolicy.NEVER_SHOW)
|
if (type.getBomPolicy() == BomPolicy.NEVER_SHOW)
|
||||||
continue;
|
continue;
|
||||||
String name = component.getName();
|
String name = component.getName();
|
||||||
String value = component.getValue() == null ? null : component
|
String value = component.getValueForDisplay();
|
||||||
.getValue().toString();
|
|
||||||
if ((name != null) && (value != null)) {
|
if ((name != null) && (value != null)) {
|
||||||
String key = type.getName() + "|" + value;
|
String key = type.getName() + "|" + value;
|
||||||
if (entryMap.containsKey(key)) {
|
if (entryMap.containsKey(key)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user