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;
|
||||
}
|
||||
|
||||
@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
|
||||
* even.
|
||||
|
||||
+7
-1
@@ -107,7 +107,8 @@ public interface IDIYComponent<T> extends Serializable {
|
||||
* @param project
|
||||
* @param drawingObserver
|
||||
*/
|
||||
void draw(Graphics2D g2d, ComponentState componentState, boolean outlineMode, Project project,
|
||||
void draw(Graphics2D g2d, ComponentState componentState,
|
||||
boolean outlineMode, Project project,
|
||||
IDrawingObserver drawingObserver);
|
||||
|
||||
/**
|
||||
@@ -127,6 +128,11 @@ public interface IDIYComponent<T> extends Serializable {
|
||||
*/
|
||||
IDIYComponent<T> clone() throws CloneNotSupportedException;
|
||||
|
||||
/**
|
||||
* @return full value for BOM.
|
||||
*/
|
||||
String getValueForDisplay();
|
||||
|
||||
/**
|
||||
* Checks if two components are equal.
|
||||
*
|
||||
|
||||
+1
-2
@@ -15,12 +15,11 @@ public class PCBLayerFiler implements IComponentFiler {
|
||||
this.layer = layer;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public boolean testComponent(IDIYComponent<?> component) {
|
||||
Class<?> clazz = component.getClass();
|
||||
try {
|
||||
Method m = clazz.getMethod("getLayer", null);
|
||||
Method m = clazz.getMethod("getLayer");
|
||||
PCBLayer l = (PCBLayer) m.invoke(component);
|
||||
return layer == l;
|
||||
} catch (Exception e) {
|
||||
|
||||
+1
-2
@@ -64,8 +64,7 @@ public class BomMaker {
|
||||
if (type.getBomPolicy() == BomPolicy.NEVER_SHOW)
|
||||
continue;
|
||||
String name = component.getName();
|
||||
String value = component.getValue() == null ? null : component
|
||||
.getValue().toString();
|
||||
String value = component.getValueForDisplay();
|
||||
if ((name != null) && (value != null)) {
|
||||
String key = type.getName() + "|" + value;
|
||||
if (entryMap.containsKey(key)) {
|
||||
|
||||
Reference in New Issue
Block a user