diff --git a/diylc/diylc-core/src/org/diylc/common/ComponentType.java b/diylc/diylc-core/src/org/diylc/common/ComponentType.java index 4bc1dde5..54c44b41 100644 --- a/diylc/diylc-core/src/org/diylc/common/ComponentType.java +++ b/diylc/diylc-core/src/org/diylc/common/ComponentType.java @@ -18,6 +18,7 @@ package org.diylc.common; import java.io.Serializable; +import java.util.List; import javax.swing.Icon; import org.diylc.core.CreationMethod; import org.diylc.core.IDIYComponent; @@ -52,6 +53,8 @@ public class ComponentType implements Serializable { private KeywordPolicy keywordPolicy; private String keywordTag; private boolean enableCache; + private List datasheet; + private int datasheetCreationStepCount; public ComponentType() { } @@ -59,7 +62,8 @@ public class ComponentType implements Serializable { public ComponentType(String name, String description, CreationMethod creationMethod, String category, String namePrefix, String author, Icon icon, Class> instanceClass, double zOrder, boolean flexibleZOrder, BomPolicy bomPolicy, boolean autoEdit, IComponentTransformer transformer, - KeywordPolicy keywordPolicy, String keywordTag, boolean enableCache) { + KeywordPolicy keywordPolicy, String keywordTag, boolean enableCache, List datasheet, + int datasheetCreationStepCount) { super(); this.name = name; this.description = description; @@ -77,6 +81,8 @@ public class ComponentType implements Serializable { this.keywordPolicy = keywordPolicy; this.keywordTag = keywordTag; this.enableCache = enableCache; + this.datasheet = datasheet; + this.datasheetCreationStepCount = datasheetCreationStepCount; } public String getName() { @@ -142,6 +148,14 @@ public class ComponentType implements Serializable { public boolean getEnableCache() { return enableCache; } + + public List getDatasheet() { + return datasheet; + } + + public int getDatasheetCreationStepCount() { + return datasheetCreationStepCount; + } @Override public String toString() { diff --git a/diylc/diylc-core/src/org/diylc/common/IPlugInPort.java b/diylc/diylc-core/src/org/diylc/common/IPlugInPort.java index 3f566743..62ce979a 100644 --- a/diylc/diylc-core/src/org/diylc/common/IPlugInPort.java +++ b/diylc/diylc-core/src/org/diylc/common/IPlugInPort.java @@ -308,10 +308,11 @@ public interface IPlugInPort extends ISelectionProcessor, IMouseProcessor, IKeyP * component. * * @param componentType - * @param template + * @param template optional + * @param parameters optional * @param forceInstatiate */ - void setNewComponentTypeSlot(ComponentType componentType, Template template, boolean forceInstatiate); + void setNewComponentTypeSlot(ComponentType componentType, Template template, String[] parameters, boolean forceInstatiate); /** * Locks or unlocks the specified layer. All components within +- 0.5 range will be affected by diff --git a/diylc/diylc-core/src/org/diylc/core/annotations/ComponentDescriptor.java b/diylc/diylc-core/src/org/diylc/core/annotations/ComponentDescriptor.java index c21501d4..707c9c24 100644 --- a/diylc/diylc-core/src/org/diylc/core/annotations/ComponentDescriptor.java +++ b/diylc/diylc-core/src/org/diylc/core/annotations/ComponentDescriptor.java @@ -114,5 +114,17 @@ public @interface ComponentDescriptor { /** * @return true if the component drawing should be cached */ - boolean enableCache() default false; + boolean enableCache() default false; + + /** + * @return true if component datasheet should be loaded from the corresponding file + */ + boolean enableDatasheet() default false; + + /** + * If datasheet is enabled, this property determines how many columns define a component, e.g. in how many steps we can instantiate a component + * + * @return + */ + int datasheetCreationStepCount() default 0; } diff --git a/diylc/diylc-core/src/org/diylc/core/measures/Capacitance.java b/diylc/diylc-core/src/org/diylc/core/measures/Capacitance.java index 4d2a9a15..2ad74ac6 100644 --- a/diylc/diylc-core/src/org/diylc/core/measures/Capacitance.java +++ b/diylc/diylc-core/src/org/diylc/core/measures/Capacitance.java @@ -49,5 +49,11 @@ public class Capacitance extends AbstractMeasure { } } throw new IllegalArgumentException("Could not parse capacitance: " + value); + } + + public Double getNormalizedValue() { + if (value == null || unit == null) + return null; + return value * unit.getFactor(); } } diff --git a/diylc/diylc-core/src/org/diylc/core/measures/CapacitanceUnit.java b/diylc/diylc-core/src/org/diylc/core/measures/CapacitanceUnit.java index edf70296..18447d86 100644 --- a/diylc/diylc-core/src/org/diylc/core/measures/CapacitanceUnit.java +++ b/diylc/diylc-core/src/org/diylc/core/measures/CapacitanceUnit.java @@ -23,7 +23,7 @@ package org.diylc.core.measures; public enum CapacitanceUnit implements Unit { - pF(1, "pF"), nF(1e3, "nF"), uF(1e6, "uF"), mF(1e9, "mF"), F(1e12, "F"); + pF(1e-6, "pF"), nF(1e-3, "nF"), uF(1, "uF"), mF(1e3, "mF"), F(1e6, "F"); double factor; String display; diff --git a/diylc/diylc-core/src/org/diylc/core/measures/Voltage.java b/diylc/diylc-core/src/org/diylc/core/measures/Voltage.java index 5794c96c..c9ec9889 100644 --- a/diylc/diylc-core/src/org/diylc/core/measures/Voltage.java +++ b/diylc/diylc-core/src/org/diylc/core/measures/Voltage.java @@ -49,5 +49,11 @@ public class Voltage extends AbstractMeasure { } } throw new IllegalArgumentException("Could not parse voltage: " + value); + } + + public Double getNormalizedValue() { + if (value == null || unit == null) + return null; + return value * unit.getFactor(); } } diff --git a/diylc/diylc-core/src/org/diylc/presenter/ComponentProcessor.java b/diylc/diylc-core/src/org/diylc/presenter/ComponentProcessor.java index 6c90fbc6..469d669d 100644 --- a/diylc/diylc-core/src/org/diylc/presenter/ComponentProcessor.java +++ b/diylc/diylc-core/src/org/diylc/presenter/ComponentProcessor.java @@ -96,7 +96,10 @@ public class ComponentProcessor { boolean cacheDrawing; IComponentTransformer transformer; KeywordPolicy keywordPolicy; - String keywordTag; + String keywordTag; + List datasheet = null; + int datasheetCreationStepCount = 0; + if (clazz.isAnnotationPresent(ComponentDescriptor.class)) { ComponentDescriptor annotation = clazz.getAnnotation(ComponentDescriptor.class); name = annotation.name(); @@ -112,7 +115,11 @@ public class ComponentProcessor { transformer = getComponentTransformer(annotation.transformer()); keywordPolicy = annotation.keywordPolicy(); keywordTag = annotation.keywordTag(); - cacheDrawing = annotation.enableCache(); + cacheDrawing = annotation.enableCache(); + if (annotation.enableDatasheet()) { + datasheet = DatasheetService.getInstance().loadDatasheet(clazz); + datasheetCreationStepCount = annotation.datasheetCreationStepCount(); + } } else { // default return null; } @@ -134,7 +141,8 @@ public class ComponentProcessor { } ComponentType componentType = new ComponentType(name, description, creationMethod, category, namePrefix, author, icon, clazz, zOrder, - flexibleZOrder, bomPolicy, autoEdit, transformer, keywordPolicy, keywordTag, cacheDrawing); + flexibleZOrder, bomPolicy, autoEdit, transformer, keywordPolicy, keywordTag, cacheDrawing, datasheet, + datasheetCreationStepCount); componentTypeMap.put(clazz.getName(), componentType); return componentType; } diff --git a/diylc/diylc-core/src/org/diylc/presenter/DatasheetService.java b/diylc/diylc-core/src/org/diylc/presenter/DatasheetService.java new file mode 100644 index 00000000..48ceea99 --- /dev/null +++ b/diylc/diylc-core/src/org/diylc/presenter/DatasheetService.java @@ -0,0 +1,122 @@ +/* + * + * DIY Layout Creator (DIYLC). Copyright (c) 2009-2018 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 + * . + */ +package org.diylc.presenter; + +import java.io.BufferedInputStream; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.URL; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import org.apache.log4j.Logger; + + +/*** + * Utility in charge of loading component datasheet from corresponding files. + * + * @author bancika + * + */ +public class DatasheetService { + + private static final Logger LOG = Logger.getLogger(DatasheetService.class); + + private static DatasheetService instance; + + private static Map> datasheetCache = new HashMap>(); + private static Map>> lookupCache = + new HashMap>>(); + + public static DatasheetService getInstance() { + if (instance == null) { + instance = new DatasheetService(); + } + return instance; + } + + private DatasheetService() {} + + public List loadDatasheet(Class clazz) { + return datasheetCache.computeIfAbsent(clazz.getCanonicalName(), key -> { + String fileName = clazz.getSimpleName() + ".datasheet"; + LOG.info("Loading datasheet file for " + fileName); + URL resource = clazz.getResource(fileName); + if (resource == null) { + LOG.warn("Datasheet file not found: " + fileName); + return null; + } + try (BufferedInputStream in = new BufferedInputStream(resource.openStream())) { + try (BufferedReader reader = new BufferedReader(new InputStreamReader(in))) { + + List types = + reader.lines().map(line -> line.split("\\s*,\\s*")).collect(Collectors.toList()); + + LOG.info(String.format("Loaded %d component sizes from the file", types.size())); + return types; + } + } catch (IOException e) { + LOG.error("Error loading component sizes", e); + return null; + } + }); + } + + public String[] lookup(Class clazz, double tolerance, String key, + double... approximateValues) { + int keySize = (int) (key.chars().filter(i -> i == '|').count() + 1); + + Map> classData = + lookupCache.computeIfAbsent(clazz.getCanonicalName(), k -> { + List datasheet = loadDatasheet(clazz); + if (datasheet == null) + return null; + + return datasheet.stream().collect(Collectors.groupingBy(line -> { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < keySize; i++) { + if (i > 0) { + sb.append("|"); + } + sb.append(line[i]); + } + return sb.toString(); + })); + }); + + List list = classData.get(key); + + if (list == null) { + return null; + } + + outerloop: for (String[] line : list) { + for (int i = 0; i < approximateValues.length; i++) { + String valueStr = line[keySize + i]; + double actualValue = Double.parseDouble(valueStr.split(" ")[0]); + if (Math.abs(actualValue - approximateValues[i]) / actualValue * 100 > tolerance) + continue outerloop; + } + return line; + } + + return null; + } +} diff --git a/diylc/diylc-core/src/org/diylc/presenter/InstantiationManager.java b/diylc/diylc-core/src/org/diylc/presenter/InstantiationManager.java index 3c4c95c9..50075ee2 100644 --- a/diylc/diylc-core/src/org/diylc/presenter/InstantiationManager.java +++ b/diylc/diylc-core/src/org/diylc/presenter/InstantiationManager.java @@ -22,6 +22,7 @@ package org.diylc.presenter; import java.awt.geom.Point2D; +import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Arrays; @@ -58,17 +59,18 @@ public class InstantiationManager { public static int MAX_RECENT_COMPONENTS = 16; private ComponentType componentTypeSlot; - private Template template; + private Template template; + private String[] parameters; private List> componentSlot; private Point2D firstControlPoint; private Point2D potentialControlPoint; public static final ComponentType clipboardType = new ComponentType("Clipboard contents", "Components from the clipboard", CreationMethod.SINGLE_CLICK, "Multi", "", "", null, null, 0, false, null, - false, null, KeywordPolicy.NEVER_SHOW, null, false); + false, null, KeywordPolicy.NEVER_SHOW, null, false, null, 0); public static final ComponentType blockType = new ComponentType("Building block", "Components from the building block", CreationMethod.SINGLE_CLICK, "Multi", "", "", null, null, 0, false, null, - false, null, KeywordPolicy.NEVER_SHOW, null, false); + false, null, KeywordPolicy.NEVER_SHOW, null, false, null, 0); public InstantiationManager() {} @@ -78,6 +80,10 @@ public class InstantiationManager { public Template getTemplate() { return template; + } + + public String[] getParameters() { + return parameters; } public List> getComponentSlot() { @@ -96,19 +102,21 @@ public class InstantiationManager { this.potentialControlPoint = potentialControlPoint; } - public void setComponentTypeSlot(ComponentType componentTypeSlot, Template template, Project currentProject, boolean forceInstatiate) + public void setComponentTypeSlot(ComponentType componentTypeSlot, Template template, String[] parameters, + Project currentProject, boolean forceInstatiate) throws Exception { this.componentTypeSlot = componentTypeSlot; - this.template = template; + this.template = template; + this.parameters = parameters; if (componentTypeSlot == null) { this.componentSlot = null; } else { switch (componentTypeSlot.getCreationMethod()) { case POINT_BY_POINT: - this.componentSlot = forceInstatiate ? instantiateComponent(componentTypeSlot, template, new Point2D.Double(0, 0), currentProject) : null; + this.componentSlot = forceInstatiate ? instantiateComponent(componentTypeSlot, new Point2D.Double(0, 0), currentProject) : null; break; case SINGLE_CLICK: - this.componentSlot = instantiateComponent(componentTypeSlot, template, new Point2D.Double(0, 0), currentProject); + this.componentSlot = instantiateComponent(componentTypeSlot, new Point2D.Double(0, 0), currentProject); break; } } @@ -118,7 +126,7 @@ public class InstantiationManager { public void instatiatePointByPoint(Point2D scaledPoint, Project currentProject) throws Exception { firstControlPoint = scaledPoint; - componentSlot = instantiateComponent(componentTypeSlot, template, firstControlPoint, currentProject); + componentSlot = instantiateComponent(componentTypeSlot, firstControlPoint, currentProject); // Set the other control point to the same location, we'll // move it later when mouse moves. @@ -262,12 +270,19 @@ public class InstantiationManager { } @SuppressWarnings("unchecked") - public List> instantiateComponent(ComponentType componentType, Template template, Point2D point, - Project currentProject) throws InstantiationException, IllegalAccessException { + private List> instantiateComponent(ComponentType componentType, Point2D point, + Project currentProject) throws InstantiationException, IllegalAccessException, NoSuchMethodException, + SecurityException, IllegalArgumentException, InvocationTargetException { LOG.info("Instatiating component of type: " + componentType.getInstanceClass().getName()); // Instantiate the component. - IDIYComponent component = componentType.getInstanceClass().newInstance(); + IDIYComponent component; + if (parameters == null) { + component = componentType.getInstanceClass().newInstance(); + } else { + Constructor> constructor = componentType.getInstanceClass().getConstructor(String[].class); + component = constructor.newInstance((Object)parameters); + } component.createdIn(currentProject); component.setName(createUniqueName(componentType, currentProject.getComponents())); diff --git a/diylc/diylc-core/src/org/diylc/presenter/Presenter.java b/diylc/diylc-core/src/org/diylc/presenter/Presenter.java index 802a0898..224b5876 100644 --- a/diylc/diylc-core/src/org/diylc/presenter/Presenter.java +++ b/diylc/diylc-core/src/org/diylc/presenter/Presenter.java @@ -605,6 +605,7 @@ public class Presenter implements IPlugInPort { // Keep the reference to component type for later. ComponentType componentTypeSlot = instantiationManager.getComponentTypeSlot(); Template template = instantiationManager.getTemplate(); + String[] parameters = instantiationManager.getParameters(); Project oldProject = currentProject.clone(); switch (componentTypeSlot.getCreationMethod()) { case SINGLE_CLICK: @@ -639,9 +640,9 @@ public class Presenter implements IPlugInPort { editSelection(); } if (configManager.readBoolean(IPlugInPort.CONTINUOUS_CREATION_KEY, false)) { - setNewComponentTypeSlot(componentTypeSlot, template, false); + setNewComponentTypeSlot(componentTypeSlot, template, parameters, false); } else { - setNewComponentTypeSlot(null, null, false); + setNewComponentTypeSlot(null, null, null, false); } break; case POINT_BY_POINT: @@ -663,7 +664,7 @@ public class Presenter implements IPlugInPort { } else { // On the second click, add the component to the // project. - addPendingComponentsToProject(scaledPoint, componentTypeSlot, template); + addPendingComponentsToProject(scaledPoint, componentTypeSlot, template, parameters); } break; default: @@ -718,7 +719,7 @@ public class Presenter implements IPlugInPort { } } - private void addPendingComponentsToProject(Point2D scaledPoint, ComponentType componentTypeSlot, Template template) { + private void addPendingComponentsToProject(Point2D scaledPoint, ComponentType componentTypeSlot, Template template, String[] parameters) { List> componentSlot = instantiationManager.getComponentSlot(); Point2D firstPoint = componentSlot.get(0).getControlPoint(0); // don't allow to create component with the same points @@ -742,9 +743,9 @@ public class Presenter implements IPlugInPort { editSelection(); } if (configManager.readBoolean(IPlugInPort.CONTINUOUS_CREATION_KEY, false)) { - setNewComponentTypeSlot(componentTypeSlot, template, false); + setNewComponentTypeSlot(componentTypeSlot, template, parameters, false); } else { - setNewComponentTypeSlot(null, null, false); + setNewComponentTypeSlot(null, null, null, false); } } @@ -1664,7 +1665,7 @@ public class Presenter implements IPlugInPort { // calculateSelectionDimension()); } else if (instantiationManager.getComponentSlot() != null) { preDragProject = currentProject.clone(); - addPendingComponentsToProject(scaledPoint, instantiationManager.getComponentTypeSlot(), null); + addPendingComponentsToProject(scaledPoint, instantiationManager.getComponentTypeSlot(), null, null); } else { updateSelection(selectedComponents); } @@ -2415,7 +2416,7 @@ public class Presenter implements IPlugInPort { } @Override - public void setNewComponentTypeSlot(ComponentType componentType, Template template, boolean forceInstatiate) { + public void setNewComponentTypeSlot(ComponentType componentType, Template template, String[] parameters, boolean forceInstatiate) { LOG.info(String.format("setNewComponentSlot(%s)", componentType == null ? null : componentType.getName())); // record a test step if needed @@ -2429,7 +2430,7 @@ public class Presenter implements IPlugInPort { if (componentType != null && componentType.getInstanceClass() == null) { LOG.info("Cannot set new component type slot for type " + componentType.getName()); - setNewComponentTypeSlot(null, null, false); + setNewComponentTypeSlot(null, null, null, false); return; } @@ -2452,7 +2453,7 @@ public class Presenter implements IPlugInPort { } try { - instantiationManager.setComponentTypeSlot(componentType, template, currentProject, forceInstatiate); + instantiationManager.setComponentTypeSlot(componentType, template, parameters, currentProject, forceInstatiate); if (forceInstatiate) updateSelection(instantiationManager.getComponentSlot()); diff --git a/diylc/diylc-core/src/org/diylc/test/TestPlayer.java b/diylc/diylc-core/src/org/diylc/test/TestPlayer.java index ae9aab11..beb0008e 100644 --- a/diylc/diylc-core/src/org/diylc/test/TestPlayer.java +++ b/diylc/diylc-core/src/org/diylc/test/TestPlayer.java @@ -25,7 +25,7 @@ public class TestPlayer { try { switch(step.getAction()) { case DIYTest.SET_COMPONENT_SLOT: - plugInPort.setNewComponentTypeSlot((ComponentType)step.getParams().get("componentType"), (Template)step.getParams().get("template"), (boolean)step.getParams().get("forceInstatiate")); + plugInPort.setNewComponentTypeSlot((ComponentType)step.getParams().get("componentType"), (Template)step.getParams().get("template"),(String[])step.getParams().get("parameters"), (boolean)step.getParams().get("forceInstatiate")); res.add(new StepResult(i, step.getAction(), "OK", false)); break; case DIYTest.MOUSE_MOVED: diff --git a/diylc/diylc-library/src/org/diylc/components/component_sizes_backup.csv b/diylc/diylc-library/src/org/diylc/components/component_sizes_backup.csv new file mode 100644 index 00000000..83e051c3 --- /dev/null +++ b/diylc/diylc-library/src/org/diylc/components/component_sizes_backup.csv @@ -0,0 +1,592 @@ +Mallory 150,63,0.15,16.5,6 +Mallory 150,63,0.18,16.5,6 +Mallory 150,63,0.22,16.5,6 +Mallory 150,63,0.27,16.5,6 +Mallory 150,63,0.33,16.5,6 +Mallory 150,63,0.39,16.5,6.5 +Mallory 150,63,0.47,16.5,7 +Mallory 150,63,0.56,16.5,7 +Mallory 150,63,0.68,20.5,7 +Mallory 150,63,0.82,20.5,8 +Mallory 150,63,1,20.5,8 +Mallory 150,63,1.5,20.5,9.5 +Mallory 150,63,2.2,28,9.5 +Mallory 150,63,3.3,28,11 +Mallory 150,63,4.7,28,12.5 +Mallory 150,63,6.8,33,14.5 +Mallory 150,63,10,33,15.5 +Mallory 150,100,0.068,16.5,6.0 +Mallory 150,100,0.082,16.5,6.0 +Mallory 150,100,0.100,16.5,6.0 +Mallory 150,100,0.120,16.5,6.0 +Mallory 150,100,0.150,16.5,6.0 +Mallory 150,100,0.180,16.5,6.5 +Mallory 150,100,0.220,16.5,6.5 +Mallory 150,100,0.270,16.5,6.5 +Mallory 150,100,0.330,16.5,8.0 +Mallory 150,100,0.390,16.5,8.0 +Mallory 150,100,0.470,20.5,7.0 +Mallory 150,100,0.560,20.5,8.0 +Mallory 150,100,0.680,20.5,8.5 +Mallory 150,100,0.820,20.5,9.5 +Mallory 150,100,1.000,20.5,10.0 +Mallory 150,250,0.012 ,16.5,6.0 +Mallory 150,250,0.015 ,16.5,6.0 +Mallory 150,250,0.018 ,16.5,6.0 +Mallory 150,250,0.022 ,16.5,6.0 +Mallory 150,250,0.027 ,16.5,6.0 +Mallory 150,250,0.0330,16.5,6.0 +Mallory 150,250,0.0390,16.5,6.0 +Mallory 150,250,0.0470,16.5,6.0 +Mallory 150,250,0.0560,16.5,6.0 +Mallory 150,250,0.0680,16.5,6.0 +Mallory 150,250,0.0820,16.5,6.0 +Mallory 150,250,0.1000,16.5,6.5 +Mallory 150,250,0.1200,16.5,7.0 +Mallory 150,250,0.1500,16.5,8.0 +Mallory 150,250,0.1800,16.5,8.0 +Mallory 150,250,0.2200,16.5,8.5 +Mallory 150,250,0.2700,20.5,8.0 +Mallory 150,250,0.3300,20.5,8.5 +Mallory 150,250,0.3900,20.5,9.0 +Mallory 150,250,0.4700,20.5,9.5 +Mallory 150,250,0.5600,20.5,10.0 +Mallory 150,250,0.6800,28.0,9.0 +Mallory 150,250,0.8200,28.0,9.5 +Mallory 150,250,1.0000,28.0,10.5 +Mallory 150,250,1.5000,28.0,12.5 +Mallory 150,250,2.2000,33.0,13.5 +Mallory 150,250,3.3000,33.0,15.5 +Mallory 150,250,4.7000,33.0,18.5 +Mallory 150,250,6.8000,33.0,21.5 +Mallory 150,400,0.0082,16.5,6.0 +Mallory 150,400,0.0100,16.5,6.0 +Mallory 150,400,0.0120,16.5,6.0 +Mallory 150,400,0.0150,16.5,6.0 +Mallory 150,400,0.0180,16.5,6.0 +Mallory 150,400,0.0220,16.5,6.0 +Mallory 150,400,0.0270,16.5,6.0 +Mallory 150,400,0.0330,16.5,6.0 +Mallory 150,400,0.0390,16.5,6.5 +Mallory 150,400,0.0470,16.5,7.0 +Mallory 150,400,0.0560,16.5,8.0 +Mallory 150,400,0.0680,20.5,7.0 +Mallory 150,400,0.0820,20.5,8.0 +Mallory 150,400,0.1000,20.5,8.0 +Mallory 150,400,0.1200,20.5,8.0 +Mallory 150,400,0.1500,20.5,9.0 +Mallory 150,400,0.1800,28.0,8.0 +Mallory 150,400,0.2200,28.0,8.5 +Mallory 150,400,0.2700,28.0,9.0 +Mallory 150,400,0.3300,28.0,10.0 +Mallory 150,400,0.3900,28.0,10.5 +Mallory 150,400,0.4700,33.0,11.5 +Mallory 150,400,0.5600,33.0,11.5 +Mallory 150,400,0.6800,33.0,12.5 +Mallory 150,400,0.8200,33.0,13.5 +Mallory 150,400,1.0000,33.0,14.5 +Mallory 150,400,1.5000,33.0,17.5 +Mallory 150,400,2.2000,33.0,20.5 +Mallory 150,630,0.0010,16.5,6.0 +Mallory 150,630,0.0012,16.5,6.0 +Mallory 150,630,0.0015,16.5,6.0 +Mallory 150,630,0.0018,16.5,6.0 +Mallory 150,630,0.0022,16.5,6.0 +Mallory 150,630,0.0027,16.5,6.0 +Mallory 150,630,0.0033,16.5,6.0 +Mallory 150,630,0.0039,16.5,6.0 +Mallory 150,630,0.0047,16.5,6.0 +Mallory 150,630,0.0056,16.5,6.0 +Mallory 150,630,0.0068,16.5,6.0 +Mallory 150,630,0.0082,16.5,6.0 +Mallory 150,630,0.0100,16.5,6.0 +Mallory 150,630,0.0120,16.5,6.0 +Mallory 150,630,0.0150,16.5,6.0 +Mallory 150,630,0.0180,16.5,6.5 +Mallory 150,630,0.0220,16.5,7.0 +Mallory 150,630,0.0270,20.5,6.5 +Mallory 150,630,0.0330,20.5,8.0 +Mallory 150,630,0.0390,20.5,8.0 +Mallory 150,630,0.0470,20.5,8.0 +Mallory 150,630,0.0560,20.5,8.5 +Mallory 150,630,0.0680,20.5,9.0 +Mallory 150,630,0.0820,20.5,9.5 +Mallory 150,630,0.1000,28.0,8.5 +Mallory 150,630,0.1200,28.0,9.0 +Mallory 150,630,0.1500,28.0,10.0 +Mallory 150,630,0.1800,28.0,10.5 +Mallory 150,630,0.2200,28.0,11.5 +Mallory 150,630,0.2700,28.0,12.5 +Mallory 150,630,0.3300,33.0,13.0 +Mallory 150,630,0.3900,33.0,14.5 +Mallory 150,630,0.4700,33.0,15.0 +Mallory 150,630,0.5600,33.0,15.5 +Mallory 150,630,0.6800,33.0,17.5 +Mallory 150,630,0.8200,33.0,18.5 +Mallory 150,630,1.0000,33.0,20.5 +Mallory 150,1000,0.0010,16.5,6.5 +Mallory 150,1000,0.0015,16.5,6.5 +Mallory 150,1000,0.0022,16.5,6.5 +Mallory 150,1000,0.0033,16.5,6.5 +Mallory 150,1000,0.0047,16.5,7.0 +Mallory 150,1000,0.0068,16.5,8.0 +Mallory 150,1000,0.0100,20.5,7.0 +Mallory 150,1000,0.0150,20.5,8.5 +Mallory 150,1000,0.0220,20.5,9.5 +Mallory 150,1000,0.0330,28 ,8.5 +Mallory 150,1000,0.0470,28 ,9.5 +Mallory 150,1000,0.0680,28 ,11.0 +Mallory 150,1000,0.1000,28 ,13.0 +Mallory 150,1000,0.1500,33 ,14.0 +Mallory 150,1000,0.2200,33 ,17.5 +Mallory 150,1000,0.3300,33 ,20.5 +Mallory 150,1000,0.4700,33 ,24.0 + +Orange Drop 715P,100,0.0056,14.5,6.4 +Orange Drop 715P,100,0.006,14.5,6.4 +Orange Drop 715P,100,0.0068,14.5,6.6 +Orange Drop 715P,100,0.0075,14.5,6.6 +Orange Drop 715P,100,0.0082,14.5,6.9 +Orange Drop 715P,100,0.009,14.5,6.6 +Orange Drop 715P,100,0.01,14.5,6.6 +Orange Drop 715P,100,0.012,14.5,7.1 +Orange Drop 715P,100,0.015,14.5,7.4 +Orange Drop 715P,100,0.018,14.5,7.9 +Orange Drop 715P,100,0.022,14.5,8.4 +Orange Drop 715P,100,0.025,14.5,8.9 +Orange Drop 715P,100,0.027,14.5,8.9 +Orange Drop 715P,100,0.033,14.5,9.7 +Orange Drop 715P,100,0.039,17.8,8.6 +Orange Drop 715P,100,0.047,17.8,9.1 +Orange Drop 715P,100,0.05,17.8,9.4 +Orange Drop 715P,100,0.056,17.8,9.7 +Orange Drop 715P,100,0.062,17.8,10.2 +Orange Drop 715P,100,0.068,17.8,10.4 +Orange Drop 715P,100,0.075,22.9,9.1 +Orange Drop 715P,100,0.082,22.9,9.4 +Orange Drop 715P,100,0.09,22.9,9.7 +Orange Drop 715P,100,0.1,22.9,10.2 +Orange Drop 715P,100,0.12,22.9,10.9 +Orange Drop 715P,100,0.15,22.9,11.7 +Orange Drop 715P,100,0.18,22.9,12.7 +Orange Drop 715P,100,0.2,22.9,13.2 +Orange Drop 715P,100,0.22,22.9,13.7 +Orange Drop 715P,100,0.25,31.8,11.9 +Orange Drop 715P,100,0.27,31.8,12.2 +Orange Drop 715P,100,0.3,31.8,12.7 +Orange Drop 715P,100,0.33,31.8,13.2 +Orange Drop 715P,200,0.01,17.8,6.4 +Orange Drop 715P,200,0.012,17.8,6.6 +Orange Drop 715P,200,0.015,17.8,7.1 +Orange Drop 715P,200,0.018,17.8,7.4 +Orange Drop 715P,200,0.022,17.8,7.9 +Orange Drop 715P,200,0.027,17.8,8.4 +Orange Drop 715P,200,0.033,17.8,9.1 +Orange Drop 715P,200,0.039,22.9,8.1 +Orange Drop 715P,200,0.047,22.9,8.6 +Orange Drop 715P,200,0.056,22.9,9.4 +Orange Drop 715P,200,0.068,22.9,9.9 +Orange Drop 715P,200,0.082,31.8,9.1 +Orange Drop 715P,200,0.1,31.8,9.7 +Orange Drop 715P,200,0.12,31.8,10.4 +Orange Drop 715P,200,0.15,31.8,11.2 +Orange Drop 715P,200,0.18,31.8,11.9 +Orange Drop 715P,200,0.22,31.8,13 +Orange Drop 715P,200,0.27,41.9,12.4 +Orange Drop 715P,200,0.33,41.9,13.5 +Orange Drop 715P,200,0.39,41.9,14.2 +Orange Drop 715P,200,0.47,41.9,15.2 +Orange Drop 715P,400,0.001,17.8,8.9 +Orange Drop 715P,400,0.0012,17.8,9.1 +Orange Drop 715P,400,0.0015,17.8,8.1 +Orange Drop 715P,400,0.0018,17.8,8.6 +Orange Drop 715P,400,0.0022,17.8,8.4 +Orange Drop 715P,400,0.0027,17.8,8.9 +Orange Drop 715P,400,0.0033,17.8,8.1 +Orange Drop 715P,400,0.0039,17.8,8.6 +Orange Drop 715P,400,0.0047,17.8,8.6 +Orange Drop 715P,400,0.0056,17.8,9.1 +Orange Drop 715P,400,0.0068,17.8,7.4 +Orange Drop 715P,400,0.0082,17.8,7.6 +Orange Drop 715P,400,0.01,17.8,7.6 +Orange Drop 715P,400,0.012,17.8,8.1 +Orange Drop 715P,400,0.015,17.8,8.6 +Orange Drop 715P,400,0.018,22.9,7.9 +Orange Drop 715P,400,0.022,22.9,8.4 +Orange Drop 715P,400,0.027,22.9,9.1 +Orange Drop 715P,400,0.033,22.9,9.7 +Orange Drop 715P,400,0.039,31.8,8.9 +Orange Drop 715P,400,0.047,31.8,9.4 +Orange Drop 715P,400,0.056,31.8,9.9 +Orange Drop 715P,400,0.068,31.8,10.7 +Orange Drop 715P,400,0.082,31.8,11.4 +Orange Drop 715P,400,0.1,31.8,12.2 +Orange Drop 715P,400,0.12,31.8,13.2 +Orange Drop 715P,400,0.15,31.8,14.2 +Orange Drop 715P,400,0.18,41.9,13.7 +Orange Drop 715P,400,0.22,41.9,14.7 +Orange Drop 715P,400,0.27,41.9,16 +Orange Drop 715P,400,0.33,41.9,17.8 +Orange Drop 715P,400,0.39,41.9,19.1 +Orange Drop 715P,400,0.47,41.9,20.8 +Orange Drop 715P,600,0.001,17.8,8.9 +Orange Drop 715P,600,0.0012,17.8,9.1 +Orange Drop 715P,600,0.0015,17.8,8.1 +Orange Drop 715P,600,0.0018,17.8,8.6 +Orange Drop 715P,600,0.0022,17.8,8.4 +Orange Drop 715P,600,0.0027,17.8,8.9 +Orange Drop 715P,600,0.0033,17.8,8.1 +Orange Drop 715P,600,0.0039,17.8,8.6 +Orange Drop 715P,600,0.0047,17.8,8.6 +Orange Drop 715P,600,0.0056,17.8,9.1 +Orange Drop 715P,600,0.0068,17.8,9.7 +Orange Drop 715P,600,0.0082,22.9,8.6 +Orange Drop 715P,600,0.01,22.9,9.1 +Orange Drop 715P,600,0.012,22.9,9.7 +Orange Drop 715P,600,0.015,22.9,10.7 +Orange Drop 715P,600,0.018,22.9,11.2 +Orange Drop 715P,600,0.022,22.9,12.2 +Orange Drop 715P,600,0.027,31.8,10.2 +Orange Drop 715P,600,0.033,31.8,11.7 +Orange Drop 715P,600,0.039,31.8,12.4 +Orange Drop 715P,600,0.047,31.8,13.2 +Orange Drop 715P,600,0.056,31.8,14.2 +Orange Drop 715P,600,0.068,31.8,15.2 +Orange Drop 715P,600,0.082,31.8,16.5 +Orange Drop 715P,600,0.1,31.8,18 +Orange Drop 715P,600,0.12,41.9,16.5 +Orange Drop 715P,600,0.15,41.9,18 +Orange Drop 715P,600,0.18,41.9,19.6 +Orange Drop 715P,600,0.22,41.9,21.1 +Orange Drop 715P,800,0.0056,31.8,7.1 +Orange Drop 715P,800,0.0068,31.8,7.4 +Orange Drop 715P,800,0.0082,31.8,7.9 +Orange Drop 715P,800,0.01,31.8,8.4 +Orange Drop 715P,800,0.012,31.8,8.9 +Orange Drop 715P,800,0.015,31.8,9.7 +Orange Drop 715P,800,0.018,31.8,10.4 +Orange Drop 715P,800,0.022,31.8,11.2 +Orange Drop 715P,800,0.027,31.8,11.9 +Orange Drop 715P,800,0.033,31.8,13 +Orange Drop 715P,800,0.039,41.9,11.9 +Orange Drop 715P,800,0.047,41.9,12.7 +Orange Drop 715P,800,0.056,41.9,13.5 +Orange Drop 715P,800,0.068,41.9,14.7 +Orange Drop 715P,800,0.082,41.9,15.7 +Orange Drop 715P,800,0.1,41.9,17 +Orange Drop 715P,1000,0.0056,31.8,7.1 +Orange Drop 715P,1000,0.0068,31.8,7.4 +Orange Drop 715P,1000,0.0082,31.8,7.9 +Orange Drop 715P,1000,0.01,31.8,8.4 +Orange Drop 715P,1000,0.012,31.8,8.9 +Orange Drop 715P,1000,0.015,31.8,9.7 +Orange Drop 715P,1000,0.018,31.8,10.4 +Orange Drop 715P,1000,0.022,31.8,11.2 +Orange Drop 715P,1000,0.027,31.8,11.9 +Orange Drop 715P,1000,0.033,31.8,13 +Orange Drop 715P,1000,0.039,41.9,11.9 +Orange Drop 715P,1000,0.047,41.9,12.7 +Orange Drop 715P,1000,0.056,41.9,13.5 +Orange Drop 715P,1000,0.068,41.9,14.7 +Orange Drop 715P,1000,0.082,41.9,15.7 +Orange Drop 715P,1000,0.1,41.9,17 + +Orange Drop 716P,100,0.0082,14.5,5.8 +Orange Drop 716P,100,0.009,14.5,6.1 +Orange Drop 716P,100,0.01,14.5,6.1 +Orange Drop 716P,100,0.012,14.5,5.8 +Orange Drop 716P,100,0.015,14.5,6.4 +Orange Drop 716P,100,0.018,14.5,6.6 +Orange Drop 716P,100,0.022,14.5,7.1 +Orange Drop 716P,100,0.025,14.5,7.4 +Orange Drop 716P,100,0.027,14.5,6.9 +Orange Drop 716P,100,0.033,14.5,7.4 +Orange Drop 716P,100,0.039,14.5,7.9 +Orange Drop 716P,100,0.047,14.5,8.6 +Orange Drop 716P,100,0.05,17.8,7.1 +Orange Drop 716P,100,0.056,17.8,7.4 +Orange Drop 716P,100,0.062,17.8,7.9 +Orange Drop 716P,100,0.068,17.8,8.1 +Orange Drop 716P,100,0.075,17.8,8.4 +Orange Drop 716P,100,0.082,17.8,8.9 +Orange Drop 716P,100,0.09,17.8,9.1 +Orange Drop 716P,100,0.1,17.8,9.7 +Orange Drop 716P,100,0.12,22.9,8.4 +Orange Drop 716P,100,0.15,22.9,9.4 +Orange Drop 716P,100,0.18,22.9,10.2 +Orange Drop 716P,100,0.2,22.9,10.7 +Orange Drop 716P,100,0.22,22.9,11.2 +Orange Drop 716P,100,0.25,22.9,11.9 +Orange Drop 716P,100,0.27,22.9,12.4 +Orange Drop 716P,100,0.3,31.8,10.4 +Orange Drop 716P,100,0.33,31.8,10.7 +Orange Drop 716P,200,0.01,17.8,6.4 +Orange Drop 716P,200,0.012,17.8,6.9 +Orange Drop 716P,200,0.015,17.8,6.6 +Orange Drop 716P,200,0.018,17.8,6.4 +Orange Drop 716P,200,0.022,17.8,6.9 +Orange Drop 716P,200,0.027,17.8,7.4 +Orange Drop 716P,200,0.033,17.8,8.1 +Orange Drop 716P,200,0.039,17.8,8.1 +Orange Drop 716P,200,0.047,17.8,8.6 +Orange Drop 716P,200,0.056,22.9,7.6 +Orange Drop 716P,200,0.068,22.9,8.4 +Orange Drop 716P,200,0.082,22.9,9.1 +Orange Drop 716P,200,0.1,22.9,9.9 +Orange Drop 716P,200,0.12,22.9,10.2 +Orange Drop 716P,200,0.15,22.9,11.4 +Orange Drop 716P,200,0.18,31.8,9.9 +Orange Drop 716P,200,0.22,31.8,10.9 +Orange Drop 716P,200,0.27,31.8,11.9 +Orange Drop 716P,200,0.33,31.8,11.9 +Orange Drop 716P,200,0.39,31.8,13 +Orange Drop 716P,200,0.47,31.8,14.2 +Orange Drop 716P,200,0.56,31.8,15.5 +Orange Drop 716P,200,0.68,41.9,14.2 +Orange Drop 716P,200,0.82,41.9,15.5 +Orange Drop 716P,200,1,41.9,17.3 +Orange Drop 716P,400,0.001,17.8,6.4 +Orange Drop 716P,400,0.0012,17.8,5.6 +Orange Drop 716P,400,0.0015,17.8,6.1 +Orange Drop 716P,400,0.0018,17.8,6.4 +Orange Drop 716P,400,0.0022,17.8,6.6 +Orange Drop 716P,400,0.0027,17.8,6.1 +Orange Drop 716P,400,0.0033,17.8,6.1 +Orange Drop 716P,400,0.0039,17.8,6.1 +Orange Drop 716P,400,0.0047,17.8,6.4 +Orange Drop 716P,400,0.0056,17.8,6.1 +Orange Drop 716P,400,0.0068,17.8,6.1 +Orange Drop 716P,400,0.0082,17.8,6.4 +Orange Drop 716P,400,0.01,17.8,6.9 +Orange Drop 716P,400,0.012,17.8,7.4 +Orange Drop 716P,400,0.015,17.8,7.9 +Orange Drop 716P,400,0.018,22.9,7.1 +Orange Drop 716P,400,0.022,22.9,7.6 +Orange Drop 716P,400,0.027,22.9,7.9 +Orange Drop 716P,400,0.033,22.9,8.4 +Orange Drop 716P,400,0.039,22.9,9.1 +Orange Drop 716P,400,0.047,22.9,9.9 +Orange Drop 716P,400,0.056,22.9,10.2 +Orange Drop 716P,400,0.068,22.9,10.9 +Orange Drop 716P,400,0.082,31.8,9.7 +Orange Drop 716P,400,0.1,31.8,10.7 +Orange Drop 716P,400,0.12,31.8,11.4 +Orange Drop 716P,400,0.15,31.8,11.7 +Orange Drop 716P,400,0.18,31.8,12.7 +Orange Drop 716P,400,0.22,31.8,14.5 +Orange Drop 716P,400,0.27,31.8,16 +Orange Drop 716P,400,0.33,41.9,14.5 +Orange Drop 716P,400,0.39,41.9,15.7 +Orange Drop 716P,400,0.47,41.9,17.3 +Orange Drop 716P,600,0.001,17.8,6.9 +Orange Drop 716P,600,0.0012,17.8,6.1 +Orange Drop 716P,600,0.0015,17.8,6.6 +Orange Drop 716P,600,0.0018,17.8,6.9 +Orange Drop 716P,600,0.0022,17.8,7.1 +Orange Drop 716P,600,0.0027,17.8,6.4 +Orange Drop 716P,600,0.0033,17.8,6.4 +Orange Drop 716P,600,0.0039,17.8,6.6 +Orange Drop 716P,600,0.0047,17.8,7.1 +Orange Drop 716P,600,0.0056,17.8,7.6 +Orange Drop 716P,600,0.0068,17.8,8.1 +Orange Drop 716P,600,0.0082,17.8,8.1 +Orange Drop 716P,600,0.01,17.8,8.6 +Orange Drop 716P,600,0.012,22.9,7.9 +Orange Drop 716P,600,0.015,22.9,8.6 +Orange Drop 716P,600,0.018,22.9,9.1 +Orange Drop 716P,600,0.022,22.9,9.9 +Orange Drop 716P,600,0.027,22.9,10.4 +Orange Drop 716P,600,0.033,22.9,11.2 +Orange Drop 716P,600,0.039,22.9,12.2 +Orange Drop 716P,600,0.047,31.8,10.7 +Orange Drop 716P,600,0.056,31.8,11.4 +Orange Drop 716P,600,0.068,31.8,11.4 +Orange Drop 716P,600,0.082,31.8,12.4 +Orange Drop 716P,600,0.1,31.8,13.7 +Orange Drop 716P,600,0.12,31.8,15 +Orange Drop 716P,600,0.15,41.9,14 +Orange Drop 716P,600,0.18,41.9,15 +Orange Drop 716P,600,0.22,41.9,16.5 +Orange Drop 716P,800,0.0056,31.8,6.4 +Orange Drop 716P,800,0.0068,31.8,6.9 +Orange Drop 716P,800,0.0082,31.8,7.4 +Orange Drop 716P,800,0.01,31.8,7.4 +Orange Drop 716P,800,0.012,31.8,7.9 +Orange Drop 716P,800,0.015,31.8,8.6 +Orange Drop 716P,800,0.018,31.8,9.4 +Orange Drop 716P,800,0.022,31.8,9.7 +Orange Drop 716P,800,0.027,31.8,10.7 +Orange Drop 716P,800,0.033,31.8,11.7 +Orange Drop 716P,800,0.039,31.8,11.7 +Orange Drop 716P,800,0.047,31.8,12.7 +Orange Drop 716P,800,0.056,31.8,13.7 +Orange Drop 716P,800,0.068,31.8,15 +Orange Drop 716P,800,0.082,41.9,13.2 +Orange Drop 716P,800,0.1,41.9,14.5 +Orange Drop 716P,800,0.12,41.9,15.7 +Orange Drop 716P,800,0.14,41.9,17 +Orange Drop 716P,1000,0.0056,31.8,6.4 +Orange Drop 716P,1000,0.0068,31.8,6.9 +Orange Drop 716P,1000,0.0082,31.8,7.4 +Orange Drop 716P,1000,0.01,31.8,7.4 +Orange Drop 716P,1000,0.012,31.8,7.9 +Orange Drop 716P,1000,0.015,31.8,8.6 +Orange Drop 716P,1000,0.018,31.8,9.4 +Orange Drop 716P,1000,0.022,31.8,9.7 +Orange Drop 716P,1000,0.027,31.8,10.7 +Orange Drop 716P,1000,0.033,31.8,11.7 +Orange Drop 716P,1000,0.039,31.8,11.7 +Orange Drop 716P,1000,0.047,31.8,12.7 +Orange Drop 716P,1000,0.056,31.8,13.7 +Orange Drop 716P,1000,0.068,31.8,15 +Orange Drop 716P,1000,0.082,41.9,13.2 +Orange Drop 716P,1000,0.1,41.9,14.5 +Orange Drop 716P,1000,0.12,41.9,15.7 +Orange Drop 716P,1000,0.14,41.9,17 + +Sprague TVA Atom,6,200,17.45,7.925 +Sprague TVA Atom,10,5000,38.1,12.319 +Sprague TVA Atom,16,25,12.7,6.35 +Sprague TVA Atom,16,50,17.45,6.35 +Sprague TVA Atom,16,100,17.45,7.925 +Sprague TVA Atom,16,200,20.625,7.925 +Sprague TVA Atom,16,250,20.625,9.525 +Sprague TVA Atom,16,500,23.8,9.525 +Sprague TVA Atom,16,600,31.75,9.525 +Sprague TVA Atom,16,800,31.75,9.525 +Sprague TVA Atom,16,1000,38.1,9.525 +Sprague TVA Atom,16,1200,38.1,11.125 +Sprague TVA Atom,16,1500,38.1,11.125 +Sprague TVA Atom,16,2000,38.1,12.319 +Sprague TVA Atom,16,3000,38.1,12.319 +Sprague TVA Atom,16,5000,53.975,25.4 +Sprague TVA Atom,16,10000,66.675,31.75 +Sprague TVA Atom,25,10,12.7,6.35 +Sprague TVA Atom,25,25,12.7,6.35 +Sprague TVA Atom,25,50,17.45,6.35 +Sprague TVA Atom,25,75,17.45,7.925 +Sprague TVA Atom,25,100,20.625,7.925 +Sprague TVA Atom,25,150,20.625,9.525 +Sprague TVA Atom,25,200,20.625,9.525 +Sprague TVA Atom,25,250,23.8,9.525 +Sprague TVA Atom,25,500,31.75,11.125 +Sprague TVA Atom,25,1000,38.1,12.319 +Sprague TVA Atom,25,1500,38.1,12.319 +Sprague TVA Atom,25,2000,38.1,12.319 +Sprague TVA Atom,25,2500,38.1,12.319 +Sprague TVA Atom,25,5000,66.675,28.575 +Sprague TVA Atom,35,500,38.1,11.125 +Sprague TVA Atom,35,5500,38.1,12.319 +Sprague TVA Atom,50,1,12.7,6.35 +Sprague TVA Atom,50,2,12.7,6.35 +Sprague TVA Atom,50,5,12.7,6.35 +Sprague TVA Atom,50,6,12.7,6.35 +Sprague TVA Atom,50,10,12.7,6.35 +Sprague TVA Atom,50,15,17.45,6.35 +Sprague TVA Atom,50,20,17.45,6.35 +Sprague TVA Atom,50,25,17.45,6.35 +Sprague TVA Atom,50,40,20.625,7.925 +Sprague TVA Atom,50,50,20.625,7.925 +Sprague TVA Atom,50,75,20.625,9.525 +Sprague TVA Atom,50,100,20.625,9.525 +Sprague TVA Atom,50,150,23.8,9.525 +Sprague TVA Atom,50,200,31.75,9.525 +Sprague TVA Atom,50,250,38.1,9.525 +Sprague TVA Atom,50,300,31.75,11.125 +Sprague TVA Atom,50,400,38.1,12.319 +Sprague TVA Atom,50,500,38.1,12.319 +Sprague TVA Atom,50,600,38.1,12.319 +Sprague TVA Atom,50,1000,38.1,12.319 +Sprague TVA Atom,50,1500,38.1,12.319 +Sprague TVA Atom,50,2000,53.975,28.575 +Sprague TVA Atom,50,2500,66.675,28.575 +Sprague TVA Atom,50,3000,66.675,31.75 +Sprague TVA Atom,50,5000,79.375,34.925 +Sprague TVA Atom,63,1,12.7,6.35 +Sprague TVA Atom,100,10,17.45,7.925 +Sprague TVA Atom,100,50,31.75,9.525 +Sprague TVA Atom,100,100,38.1,11.125 +Sprague TVA Atom,100,250,38.1,12.319 +Sprague TVA Atom,100,500,53.975,28.575 +Sprague TVA Atom,150,1,12.7,6.35 +Sprague TVA Atom,150,2,17.45,6.35 +Sprague TVA Atom,150,4,20.625,7.925 +Sprague TVA Atom,150,5,20.625,7.925 +Sprague TVA Atom,150,8,20.625,9.525 +Sprague TVA Atom,150,10,20.625,9.525 +Sprague TVA Atom,150,16,23.8,9.525 +Sprague TVA Atom,150,20,31.75,9.525 +Sprague TVA Atom,150,25,31.75,9.525 +Sprague TVA Atom,150,30,31.75,11.125 +Sprague TVA Atom,150,40,38.1,11.125 +Sprague TVA Atom,150,50,38.1,11.125 +Sprague TVA Atom,150,80,38.1,12.319 +Sprague TVA Atom,150,100,38.1,12.319 +Sprague TVA Atom,150,150,38.1,12.319 +Sprague TVA Atom,150,200,53.975,25.4 +Sprague TVA Atom,150,300,66.675,28.575 +Sprague TVA Atom,200,3,20.625,7.925 +Sprague TVA Atom,200,5,20.625,9.525 +Sprague TVA Atom,200,10,23.8,9.525 +Sprague TVA Atom,200,20,31.75,11.125 +Sprague TVA Atom,200,100,38.1,12.319 +Sprague TVA Atom,250,4,20.625,9.525 +Sprague TVA Atom,250,10,31.75,9.525 +Sprague TVA Atom,250,12,31.75,11.125 +Sprague TVA Atom,250,20,38.1,11.125 +Sprague TVA Atom,250,30,38.1,12.319 +Sprague TVA Atom,250,40,38.1,12.319 +Sprague TVA Atom,250,50,38.1,12.319 +Sprague TVA Atom,250,60,38.1,12.319 +Sprague TVA Atom,250,100,38.1,12.319 +Sprague TVA Atom,350,1,17.45,7.925 +Sprague TVA Atom,350,3,23.8,9.525 +Sprague TVA Atom,350,4,31.75,9.525 +Sprague TVA Atom,350,5,31.75,9.525 +Sprague TVA Atom,350,8,38.1,11.125 +Sprague TVA Atom,350,10,38.1,11.125 +Sprague TVA Atom,350,15,38.1,12.319 +Sprague TVA Atom,350,20,38.1,12.319 +Sprague TVA Atom,350,60,38.1,12.319 +Sprague TVA Atom,350,100,66.675,25.4 +Sprague TVA Atom,450,1,20.625,9.525 +Sprague TVA Atom,450,2,31.75,9.525 +Sprague TVA Atom,450,4,38.1,11.125 +Sprague TVA Atom,450,5,38.1,11.125 +Sprague TVA Atom,450,8,38.1,12.319 +Sprague TVA Atom,450,10,38.1,12.319 +Sprague TVA Atom,450,12,38.1,12.319 +Sprague TVA Atom,450,20,38.1,12.319 +Sprague TVA Atom,450,30,38.1,12.319 +Sprague TVA Atom,450,40,38.1,12.319 +Sprague TVA Atom,450,50,53.975,28.575 +Sprague TVA Atom,450,100,79.375,31.75 +Sprague TVA Atom,450,60,53.975,28.575 +Sprague TVA Atom,450,80,66.675,25.4 +Sprague TVA Atom,450,16,38.1,12.319 +Sprague TVA Atom,500,20,38.1,12.319 +Sprague TVA Atom,500,40,60.325,25.4 +Sprague TVA Atom,500,30,38.1,12.319 +Sprague TVA Atom,600,10,73.025,25.4 +Sprague TVA Atom,600,20,98.425,25.4 +Sprague TVA Atom,10 NP,50,17.45,7.925 +Sprague TVA Atom,25 NP,10,17.45,6.35 +Sprague TVA Atom,25 NP,16,17.45,6.35 +Sprague TVA Atom,25 NP,25,17.45,7.925 +Sprague TVA Atom,25 NP,50,20.625,7.925 +Sprague TVA Atom,25 NP,100,23.8,9.525 +Sprague TVA Atom,30 NP,20,17.45,7.925 +Sprague TVA Atom,50 NP,2,12.7,6.35 +Sprague TVA Atom,50 NP,3,12.7,6.35 +Sprague TVA Atom,50 NP,5,17.45,6.35 +Sprague TVA Atom,50 NP,8,17.45,6.35 +Sprague TVA Atom,50 NP,10,17.45,7.925 +Sprague TVA Atom,50 NP,25,20.625,9.525 +Sprague TVA Atom,50 NP,50,23.8,9.525 +Sprague TVA Atom,50 NP,100,38.1,9.525 +Sprague TVA Atom,100 NP,10,41.275,12.7 +Sprague TVA Atom,100 NP,20,38.1,12.319 +Sprague TVA Atom,200 NP,60,66.675,25.4 +Sprague TVA Atom,300 NP,1,34.925,12.7 +Sprague TVA Atom,350 NP,5,38.1,12.319 +Sprague TVA Atom,400 NP,20,53.975,25.4 diff --git a/diylc/diylc-library/src/org/diylc/components/passive/AxialElectrolyticCapacitor.datasheet b/diylc/diylc-library/src/org/diylc/components/passive/AxialElectrolyticCapacitor.datasheet new file mode 100644 index 00000000..ef351b8d --- /dev/null +++ b/diylc/diylc-library/src/org/diylc/components/passive/AxialElectrolyticCapacitor.datasheet @@ -0,0 +1,316 @@ +Sprague TVA Atom,6 VDC,200 uF,17.45,7.925 +Sprague TVA Atom,10 VDC,5000 uF,38.1,12.319 +Sprague TVA Atom,16 VDC,25 uF,12.7,6.35 +Sprague TVA Atom,16 VDC,50 uF,17.45,6.35 +Sprague TVA Atom,16 VDC,100 uF,17.45,7.925 +Sprague TVA Atom,16 VDC,200 uF,20.625,7.925 +Sprague TVA Atom,16 VDC,250 uF,20.625,9.525 +Sprague TVA Atom,16 VDC,500 uF,23.8,9.525 +Sprague TVA Atom,16 VDC,600 uF,31.75,9.525 +Sprague TVA Atom,16 VDC,800 uF,31.75,9.525 +Sprague TVA Atom,16 VDC,1000 uF,38.1,9.525 +Sprague TVA Atom,16 VDC,1200 uF,38.1,11.125 +Sprague TVA Atom,16 VDC,1500 uF,38.1,11.125 +Sprague TVA Atom,16 VDC,2000 uF,38.1,12.319 +Sprague TVA Atom,16 VDC,3000 uF,38.1,12.319 +Sprague TVA Atom,16 VDC,5000 uF,53.975,25.4 +Sprague TVA Atom,16 VDC,10000 uF,66.675,31.75 +Sprague TVA Atom,25 VDC,10 uF,12.7,6.35 +Sprague TVA Atom,25 VDC,25 uF,12.7,6.35 +Sprague TVA Atom,25 VDC,50 uF,17.45,6.35 +Sprague TVA Atom,25 VDC,75 uF,17.45,7.925 +Sprague TVA Atom,25 VDC,100 uF,20.625,7.925 +Sprague TVA Atom,25 VDC,150 uF,20.625,9.525 +Sprague TVA Atom,25 VDC,200 uF,20.625,9.525 +Sprague TVA Atom,25 VDC,250 uF,23.8,9.525 +Sprague TVA Atom,25 VDC,500 uF,31.75,11.125 +Sprague TVA Atom,25 VDC,1000 uF,38.1,12.319 +Sprague TVA Atom,25 VDC,1500 uF,38.1,12.319 +Sprague TVA Atom,25 VDC,2000 uF,38.1,12.319 +Sprague TVA Atom,25 VDC,2500 uF,38.1,12.319 +Sprague TVA Atom,25 VDC,5000 uF,66.675,28.575 +Sprague TVA Atom,35 VDC,500 uF,38.1,11.125 +Sprague TVA Atom,35 VDC,5500 uF,38.1,12.319 +Sprague TVA Atom,50 VDC,1 uF,12.7,6.35 +Sprague TVA Atom,50 VDC,2 uF,12.7,6.35 +Sprague TVA Atom,50 VDC,5 uF,12.7,6.35 +Sprague TVA Atom,50 VDC,6 uF,12.7,6.35 +Sprague TVA Atom,50 VDC,10 uF,12.7,6.35 +Sprague TVA Atom,50 VDC,15 uF,17.45,6.35 +Sprague TVA Atom,50 VDC,20 uF,17.45,6.35 +Sprague TVA Atom,50 VDC,25 uF,17.45,6.35 +Sprague TVA Atom,50 VDC,40 uF,20.625,7.925 +Sprague TVA Atom,50 VDC,50 uF,20.625,7.925 +Sprague TVA Atom,50 VDC,75 uF,20.625,9.525 +Sprague TVA Atom,50 VDC,100 uF,20.625,9.525 +Sprague TVA Atom,50 VDC,150 uF,23.8,9.525 +Sprague TVA Atom,50 VDC,200 uF,31.75,9.525 +Sprague TVA Atom,50 VDC,250 uF,38.1,9.525 +Sprague TVA Atom,50 VDC,300 uF,31.75,11.125 +Sprague TVA Atom,50 VDC,400 uF,38.1,12.319 +Sprague TVA Atom,50 VDC,500 uF,38.1,12.319 +Sprague TVA Atom,50 VDC,600 uF,38.1,12.319 +Sprague TVA Atom,50 VDC,1000 uF,38.1,12.319 +Sprague TVA Atom,50 VDC,1500 uF,38.1,12.319 +Sprague TVA Atom,50 VDC,2000 uF,53.975,28.575 +Sprague TVA Atom,50 VDC,2500 uF,66.675,28.575 +Sprague TVA Atom,50 VDC,3000 uF,66.675,31.75 +Sprague TVA Atom,50 VDC,5000 uF,79.375,34.925 +Sprague TVA Atom,63 VDC,1 uF,12.7,6.35 +Sprague TVA Atom,100 VDC,10 uF,17.45,7.925 +Sprague TVA Atom,100 VDC,50 uF,31.75,9.525 +Sprague TVA Atom,100 VDC,100 uF,38.1,11.125 +Sprague TVA Atom,100 VDC,250 uF,38.1,12.319 +Sprague TVA Atom,100 VDC,500 uF,53.975,28.575 +Sprague TVA Atom,150 VDC,1 uF,12.7,6.35 +Sprague TVA Atom,150 VDC,2 uF,17.45,6.35 +Sprague TVA Atom,150 VDC,4 uF,20.625,7.925 +Sprague TVA Atom,150 VDC,5 uF,20.625,7.925 +Sprague TVA Atom,150 VDC,8 uF,20.625,9.525 +Sprague TVA Atom,150 VDC,10 uF,20.625,9.525 +Sprague TVA Atom,150 VDC,16 uF,23.8,9.525 +Sprague TVA Atom,150 VDC,20 uF,31.75,9.525 +Sprague TVA Atom,150 VDC,25 uF,31.75,9.525 +Sprague TVA Atom,150 VDC,30 uF,31.75,11.125 +Sprague TVA Atom,150 VDC,40 uF,38.1,11.125 +Sprague TVA Atom,150 VDC,50 uF,38.1,11.125 +Sprague TVA Atom,150 VDC,80 uF,38.1,12.319 +Sprague TVA Atom,150 VDC,100 uF,38.1,12.319 +Sprague TVA Atom,150 VDC,150 uF,38.1,12.319 +Sprague TVA Atom,150 VDC,200 uF,53.975,25.4 +Sprague TVA Atom,150 VDC,300 uF,66.675,28.575 +Sprague TVA Atom,200 VDC,3 uF,20.625,7.925 +Sprague TVA Atom,200 VDC,5 uF,20.625,9.525 +Sprague TVA Atom,200 VDC,10 uF,23.8,9.525 +Sprague TVA Atom,200 VDC,20 uF,31.75,11.125 +Sprague TVA Atom,200 VDC,100 uF,38.1,12.319 +Sprague TVA Atom,250 VDC,4 uF,20.625,9.525 +Sprague TVA Atom,250 VDC,10 uF,31.75,9.525 +Sprague TVA Atom,250 VDC,12 uF,31.75,11.125 +Sprague TVA Atom,250 VDC,20 uF,38.1,11.125 +Sprague TVA Atom,250 VDC,30 uF,38.1,12.319 +Sprague TVA Atom,250 VDC,40 uF,38.1,12.319 +Sprague TVA Atom,250 VDC,50 uF,38.1,12.319 +Sprague TVA Atom,250 VDC,60 uF,38.1,12.319 +Sprague TVA Atom,250 VDC,100 uF,38.1,12.319 +Sprague TVA Atom,350 VDC,1 uF,17.45,7.925 +Sprague TVA Atom,350 VDC,3 uF,23.8,9.525 +Sprague TVA Atom,350 VDC,4 uF,31.75,9.525 +Sprague TVA Atom,350 VDC,5 uF,31.75,9.525 +Sprague TVA Atom,350 VDC,8 uF,38.1,11.125 +Sprague TVA Atom,350 VDC,10 uF,38.1,11.125 +Sprague TVA Atom,350 VDC,15 uF,38.1,12.319 +Sprague TVA Atom,350 VDC,20 uF,38.1,12.319 +Sprague TVA Atom,350 VDC,60 uF,38.1,12.319 +Sprague TVA Atom,350 VDC,100 uF,66.675,25.4 +Sprague TVA Atom,450 VDC,1 uF,20.625,9.525 +Sprague TVA Atom,450 VDC,2 uF,31.75,9.525 +Sprague TVA Atom,450 VDC,4 uF,38.1,11.125 +Sprague TVA Atom,450 VDC,5 uF,38.1,11.125 +Sprague TVA Atom,450 VDC,8 uF,38.1,12.319 +Sprague TVA Atom,450 VDC,10 uF,38.1,12.319 +Sprague TVA Atom,450 VDC,12 uF,38.1,12.319 +Sprague TVA Atom,450 VDC,20 uF,38.1,12.319 +Sprague TVA Atom,450 VDC,30 uF,38.1,12.319 +Sprague TVA Atom,450 VDC,40 uF,38.1,12.319 +Sprague TVA Atom,450 VDC,50 uF,53.975,28.575 +Sprague TVA Atom,450 VDC,100 uF,79.375,31.75 +Sprague TVA Atom,450 VDC,60 uF,53.975,28.575 +Sprague TVA Atom,450 VDC,80 uF,66.675,25.4 +Sprague TVA Atom,450 VDC,16 uF,38.1,12.319 +Sprague TVA Atom,500 VDC,20 uF,38.1,12.319 +Sprague TVA Atom,500 VDC,40 uF,60.325,25.4 +Sprague TVA Atom,500 VDC,30 uF,38.1,12.319 +Sprague TVA Atom,600 VDC,10 uF,73.025,25.4 +Sprague TVA Atom,600 VDC,20 uF,98.425,25.4 +Sprague TVA Atom,10 VDC NP,50 uF,17.45,7.925 +Sprague TVA Atom,25 VDC NP,10 uF,17.45,6.35 +Sprague TVA Atom,25 VDC NP,16 uF,17.45,6.35 +Sprague TVA Atom,25 VDC NP,25 uF,17.45,7.925 +Sprague TVA Atom,25 VDC NP,50 uF,20.625,7.925 +Sprague TVA Atom,25 VDC NP,100 uF,23.8,9.525 +Sprague TVA Atom,30 VDC NP,20 uF,17.45,7.925 +Sprague TVA Atom,50 VDC NP,2 uF,12.7,6.35 +Sprague TVA Atom,50 VDC NP,3 uF,12.7,6.35 +Sprague TVA Atom,50 VDC NP,5 uF,17.45,6.35 +Sprague TVA Atom,50 VDC NP,8 uF,17.45,6.35 +Sprague TVA Atom,50 VDC NP,10 uF,17.45,7.925 +Sprague TVA Atom,50 VDC NP,25 uF,20.625,9.525 +Sprague TVA Atom,50 VDC NP,50 uF,23.8,9.525 +Sprague TVA Atom,50 VDC NP,100 uF,38.1,9.525 +Sprague TVA Atom,100 VDC NP,10 uF,41.275,12.7 +Sprague TVA Atom,100 VDC NP,20 uF,38.1,12.319 +Sprague TVA Atom,200 VDC NP,60 uF,66.675,25.4 +Sprague TVA Atom,300 VDC NP,1 uF,34.925,12.7 +Sprague TVA Atom,350 VDC NP,5 uF,38.1,12.319 +Sprague TVA Atom,400 VDC NP,20 uF,53.975,25.4 +F&T Typ A,16 VDC,2200,30,10 +F&T Typ A,16 VDC,3300,30,12 +F&T Typ A,16 VDC,4700,30,14 +F&T Typ A,16 VDC,4700,37,14 +F&T Typ A,16 VDC,5600,30,16 +F&T Typ A,16 VDC,8200,39,16 +F&T Typ A,16 VDC,8200,30,18 +F&T Typ A,16 VDC,10000,39,18 +F&T Typ A,16 VDC,12000,36,21 +F&T Typ A,16 VDC,18000,38,25 +F&T Typ A,16 VDC,33000,49,25 +F&T Typ A,16 VDC,47000,50,30 +F&T Typ A,16 VDC,56000,50,35 +F&T Typ A,16 VDC,82000,66,35 +F&T Typ A,25 VDC,1200,30,10 +F&T Typ A,25 VDC,1800,30,12 +F&T Typ A,25 VDC,2700,30,14 +F&T Typ A,25 VDC,3300,37,14 +F&T Typ A,25 VDC,3300,30,16 +F&T Typ A,25 VDC,4700,39,16 +F&T Typ A,25 VDC,4700,30,18 +F&T Typ A,25 VDC,5600,39,18 +F&T Typ A,25 VDC,6800,36,21 +F&T Typ A,25 VDC,10000,38,25 +F&T Typ A,25 VDC,18000,49,25 +F&T Typ A,25 VDC,27000,50,30 +F&T Typ A,25 VDC,33000,50,35 +F&T Typ A,25 VDC,47000,66,35 +F&T Typ A,40 VDC,560,30,10 +F&T Typ A,40 VDC,1000,30,12 +F&T Typ A,40 VDC,1500,30,14 +F&T Typ A,40 VDC,1800,37,14 +F&T Typ A,40 VDC,1800,30,16 +F&T Typ A,40 VDC,2200,39,16 +F&T Typ A,40 VDC,2200,30,18 +F&T Typ A,40 VDC,3300,39,18 +F&T Typ A,40 VDC,3900,36,21 +F&T Typ A,40 VDC,5600,38,25 +F&T Typ A,40 VDC,10000,49,25 +F&T Typ A,40 VDC,15000,50,30 +F&T Typ A,40 VDC,22000,50,35 +F&T Typ A,40 VDC,27000,66,35 +F&T Typ A,63 VDC,330,30,10 +F&T Typ A,63 VDC,470,30,12 +F&T Typ A,63 VDC,680,30,14 +F&T Typ A,63 VDC,820,37,14 +F&T Typ A,63 VDC,1000,30,16 +F&T Typ A,63 VDC,1200,39,16 +F&T Typ A,63 VDC,1200,30,18 +F&T Typ A,63 VDC,1500,39,18 +F&T Typ A,63 VDC,2200,36,21 +F&T Typ A,63 VDC,3300,38,25 +F&T Typ A,63 VDC,5600,49,25 +F&T Typ A,63 VDC,8200,50,30 +F&T Typ A,63 VDC,10000,50,30 +F&T Typ A,63 VDC,12000,50,35 +F&T Typ A,63 VDC,15000,66,35 +F&T Typ A,80 VDC,220,30,10 +F&T Typ A,80 VDC,330,30,12 +F&T Typ A,80 VDC,470,30,14 +F&T Typ A,80 VDC,680,37,14 +F&T Typ A,80 VDC,680,30,16 +F&T Typ A,80 VDC,1000,39,16 +F&T Typ A,80 VDC,1000,30,18 +F&T Typ A,80 VDC,1200,39,18 +F&T Typ A,80 VDC,1500,36,21 +F&T Typ A,80 VDC,2200,38,25 +F&T Typ A,80 VDC,3900,49,25 +F&T Typ A,80 VDC,5600,50,30 +F&T Typ A,80 VDC,8200,50,35 +F&T Typ A,80 VDC,12000,66,35 +F&T Typ A,100 VDC,150,30,10 +F&T Typ A,100 VDC,220,30,12 +F&T Typ A,100 VDC,330,30,14 +F&T Typ A,100 VDC,390,37,14 +F&T Typ A,100 VDC,470,30,16 +F&T Typ A,100 VDC,560,39,16 +F&T Typ A,100 VDC,560,30,18 +F&T Typ A,100 VDC,680,39,18 +F&T Typ A,100 VDC,1000,36,21 +F&T Typ A,100 VDC,1500,38,25 +F&T Typ A,100 VDC,2200,49,25 +F&T Typ A,100 VDC,3300,50,30 +F&T Typ A,100 VDC,4700,50,35 +F&T Typ A,100 VDC,6800,66,35 +F&T Typ A,160 VDC,56,30,10 +F&T Typ A,160 VDC,100,30,12 +F&T Typ A,160 VDC,120,30,14 +F&T Typ A,160 VDC,150,37,14 +F&T Typ A,160 VDC,150,30,16 +F&T Typ A,160 VDC,220,39,16 +F&T Typ A,160 VDC,220,30,18 +F&T Typ A,160 VDC,270,39,18 +F&T Typ A,160 VDC,330,36,21 +F&T Typ A,160 VDC,560,38,25 +F&T Typ A,160 VDC,1000,49,25 +F&T Typ A,160 VDC,1500,50,30 +F&T Typ A,160 VDC,1800,50,35 +F&T Typ A,160 VDC,2700,66,35 +F&T Typ A,250 VDC,33,30,10 +F&T Typ A,250 VDC,56,30,12 +F&T Typ A,250 VDC,82,30,14 +F&T Typ A,250 VDC,100,37,14 +F&T Typ A,250 VDC,100,30,16 +F&T Typ A,250 VDC,150,39,16 +F&T Typ A,250 VDC,150,30,18 +F&T Typ A,250 VDC,180,39,18 +F&T Typ A,250 VDC,220,36,21 +F&T Typ A,250 VDC,390,38,25 +F&T Typ A,250 VDC,680,49,25 +F&T Typ A,250 VDC,820,50,30 +F&T Typ A,250 VDC,1200,50,35 +F&T Typ A,250 VDC,1800,66,35 +F&T Typ A,350 VDC,22,30,10 +F&T Typ A,350 VDC,33,30,12 +F&T Typ A,350 VDC,47,30,14 +F&T Typ A,350 VDC,56,37,14 +F&T Typ A,350 VDC,56,30,16 +F&T Typ A,350 VDC,68,39,16 +F&T Typ A,350 VDC,68,30,18 +F&T Typ A,350 VDC,100,39,18 +F&T Typ A,350 VDC,120,36,21 +F&T Typ A,350 VDC,220,38,25 +F&T Typ A,350 VDC,330,49,25 +F&T Typ A,350 VDC,470,50,30 +F&T Typ A,350 VDC,680,50,35 +F&T Typ A,350 VDC,820,66,35 +F&T Typ A,400 VDC,18,30,10 +F&T Typ A,400 VDC,27,30,12 +F&T Typ A,400 VDC,39,30,14 +F&T Typ A,400 VDC,47,37,14 +F&T Typ A,400 VDC,47,30,16 +F&T Typ A,400 VDC,56,39,16 +F&T Typ A,400 VDC,56,30,18 +F&T Typ A,400 VDC,68,39,18 +F&T Typ A,400 VDC,100,36,21 +F&T Typ A,400 VDC,150,38,25 +F&T Typ A,400 VDC,220,49,25 +F&T Typ A,400 VDC,330,50,30 +F&T Typ A,400 VDC,470,50,35 +F&T Typ A,400 VDC,680,66,35 +F&T Typ A,450 VDC,10,30,10 +F&T Typ A,450 VDC,15,30,12 +F&T Typ A,450 VDC,22,30,14 +F&T Typ A,450 VDC,33,37,14 +F&T Typ A,450 VDC,39,30,16 +F&T Typ A,450 VDC,47,39,16 +F&T Typ A,450 VDC,47,30,18 +F&T Typ A,450 VDC,56,39,18 +F&T Typ A,450 VDC,100,36,21 +F&T Typ A,450 VDC,150,38,25 +F&T Typ A,450 VDC,220,49,25 +F&T Typ A,450 VDC,330,50,30 +F&T Typ A,450 VDC,470,50,35 +F&T Typ A,450 VDC,560,66,35 +F&T Typ A,500 VDC,4.7,30,10 +F&T Typ A,500 VDC,6.8,30,10 +F&T Typ A,500 VDC,10,30,12 +F&T Typ A,500 VDC,12,30,14 +F&T Typ A,500 VDC,15,37,14 +F&T Typ A,500 VDC,15,30,16 +F&T Typ A,500 VDC,22,39,16 +F&T Typ A,500 VDC,22,30,18 +F&T Typ A,500 VDC,33,39,18 +F&T Typ A,500 VDC,47,36,21 +F&T Typ A,500 VDC,82,38,25 +F&T Typ A,500 VDC,120,49,25 +F&T Typ A,500 VDC,180,50,30 +F&T Typ A,500 VDC,220,50,35 +F&T Typ A,500 VDC,330,66,35 \ No newline at end of file diff --git a/diylc/diylc-library/src/org/diylc/components/passive/AxialElectrolyticCapacitor.java b/diylc/diylc-library/src/org/diylc/components/passive/AxialElectrolyticCapacitor.java index efaac9d8..bf0a6da0 100644 --- a/diylc/diylc-library/src/org/diylc/components/passive/AxialElectrolyticCapacitor.java +++ b/diylc/diylc-library/src/org/diylc/components/passive/AxialElectrolyticCapacitor.java @@ -1,26 +1,23 @@ /* + * + * DIY Layout Creator (DIYLC). Copyright (c) 2009-2018 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 + * . + * + */ +package org.diylc.components.passive; - DIY Layout Creator (DIYLC). - Copyright (c) 2009-2018 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 . - -*/ -package org.diylc.components.passive; - import java.awt.Color; import java.awt.Graphics2D; import java.awt.Shape; @@ -32,6 +29,7 @@ import org.diylc.appframework.miscutils.ConfigurationManager; import org.diylc.common.IPlugInPort; import org.diylc.common.ObjectCache; import org.diylc.components.AbstractLeadedComponent; +import org.diylc.components.passive.CapacitorDimensionService.CapacitorDimensions; import org.diylc.components.transform.SimpleComponentTransformer; import org.diylc.core.CreationMethod; import org.diylc.core.IDIYComponent; @@ -40,190 +38,289 @@ import org.diylc.core.annotations.ComponentDescriptor; import org.diylc.core.annotations.EditableProperty; import org.diylc.core.annotations.PositiveMeasureValidator; import org.diylc.core.measures.Capacitance; +import org.diylc.core.measures.CapacitanceUnit; import org.diylc.core.measures.Size; import org.diylc.core.measures.SizeUnit; +import org.diylc.core.measures.VoltageUnit; import org.diylc.utils.Constants; - -@ComponentDescriptor(name = "Electrolytic Capacitor (Axial)", author = "Branislav Stojkovic", category = "Passive", - creationMethod = CreationMethod.POINT_BY_POINT, instanceNamePrefix = "C", - description = "Axial electrolytic capacitor, similar to Sprague Atom, F&T, etc", zOrder = IDIYComponent.COMPONENT, - transformer = SimpleComponentTransformer.class, enableCache = true) -public class AxialElectrolyticCapacitor extends AbstractLeadedComponent { - - private static final long serialVersionUID = 1L; - - public static Size DEFAULT_WIDTH = new Size(1d / 2, SizeUnit.in); - public static Size DEFAULT_HEIGHT = new Size(1d / 8, SizeUnit.in); - public static Color BODY_COLOR = Color.decode("#6B6DCE"); - public static Color BORDER_COLOR = BODY_COLOR.darker(); - public static Color MARKER_COLOR = Color.decode("#8CACEA"); - public static Color TICK_COLOR = Color.white; - - private Capacitance value = null; - @Deprecated - private Voltage voltage = Voltage._63V; - private org.diylc.core.measures.Voltage voltageNew = null; - - private Color markerColor = MARKER_COLOR; - private Color tickColor = TICK_COLOR; - private boolean polarized = true; - - public AxialElectrolyticCapacitor() { - super(); - this.bodyColor = BODY_COLOR; - this.borderColor = BORDER_COLOR; - this.labelColor = TICK_COLOR; - } - - @EditableProperty(validatorClass = PositiveMeasureValidator.class) - public Capacitance getValue() { - return value; - } - - public void setValue(Capacitance value) { - this.value = value; - } - - @Override - public String getValueForDisplay() { - return (getValue() == null ? "" : getValue().toString()) + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString()); - } - - @Deprecated - public Voltage getVoltage() { - return voltage; - } - - @Deprecated - public void setVoltage(Voltage voltage) { - this.voltage = voltage; - } - - @EditableProperty(name = "Voltage") - public org.diylc.core.measures.Voltage getVoltageNew() { - return voltageNew; - } - - public void setVoltageNew(org.diylc.core.measures.Voltage voltageNew) { - this.voltageNew = voltageNew; - } - - public void drawIcon(Graphics2D g2d, int width, int height) { - g2d.rotate(-Math.PI / 4, width / 2, height / 2); - g2d.setColor(LEAD_COLOR_ICON); - g2d.drawLine(0, height / 2, width, height / 2); - g2d.setColor(BODY_COLOR); - g2d.fillRect(4, height / 2 - 3, width - 8, 6); - g2d.setColor(MARKER_COLOR); - g2d.fillRect(width - 9, height / 2 - 3, 5, 6); - g2d.setColor(TICK_COLOR); - g2d.drawLine(width - 6, height / 2 - 1, width - 6, height / 2 + 1); - g2d.setColor(BORDER_COLOR); - g2d.drawRect(4, height / 2 - 3, width - 8, 6); - } - - @Override - protected Size getDefaultWidth() { - return DEFAULT_HEIGHT; - } - - @Override - protected Size getDefaultLength() { - return DEFAULT_WIDTH; - } - - @EditableProperty(name = "Marker") - public Color getMarkerColor() { - return markerColor; - } - - public void setMarkerColor(Color coverColor) { - this.markerColor = coverColor; - } - - @EditableProperty(name = "Tick") - public Color getTickColor() { - return tickColor; - } - - public void setTickColor(Color tickColor) { - this.tickColor = tickColor; - } - - @EditableProperty(name = "Polarized") - public boolean getPolarized() { - return polarized; - } - - public void setPolarized(boolean polarized) { - this.polarized = polarized; - } - - @Override - protected Shape getBodyShape() { - double length = getLength().convertToPixels(); - double width = getWidth().convertToPixels(); - RoundRectangle2D rect = new RoundRectangle2D.Double(0f, 0f, length, width, width / 6, width / 6); - Area a = new Area(rect); - double notchDiameter = width / 4; - a.subtract(new Area(new Ellipse2D.Double(notchDiameter, -notchDiameter * 3 / 4, notchDiameter, notchDiameter))); - a.subtract(new Area(new Ellipse2D.Double(notchDiameter, width - notchDiameter / 4, notchDiameter, notchDiameter))); - - if (!getPolarized()) { - a.subtract(new Area(new Ellipse2D.Double(length - notchDiameter * 2, -notchDiameter * 3 / 4, notchDiameter, - notchDiameter))); - a.subtract(new Area(new Ellipse2D.Double(length - notchDiameter * 2, width - notchDiameter / 4, notchDiameter, - notchDiameter))); - } - return a; - } - - @Override - protected void decorateComponentBody(Graphics2D g2d, boolean outlineMode) { - int width = (int) getWidth().convertToPixels(); - int length = (int) getLength().convertToPixels(); - g2d.setColor(blend(getBorderColor(), getBodyColor())); - int notchDiameter = width / 4; - g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1)); - g2d.drawLine(notchDiameter, 0, notchDiameter, width); - g2d.drawLine(notchDiameter * 2, 0, notchDiameter * 2, width); - if (polarized) { - int markerLength = (int) (getLength().convertToPixels() * 0.2); - if (!outlineMode) { - g2d.setColor(markerColor); - Rectangle2D markerRect = new Rectangle2D.Double(length - markerLength, 0, markerLength + 2, width); - Area markerArea = new Area(markerRect); - markerArea.intersect((Area) getBodyShape()); - g2d.fill(markerArea); - } - Color finalTickColor; - if (outlineMode) { - Theme theme = - (Theme) ConfigurationManager.getInstance().readObject(IPlugInPort.THEME_KEY, Constants.DEFAULT_THEME); - finalTickColor = theme.getOutlineColor(); - } else { - finalTickColor = tickColor; - } - g2d.setColor(finalTickColor); - g2d.setStroke(ObjectCache.getInstance().fetchZoomableStroke(2)); - g2d.drawLine((int) getLength().convertToPixels() - markerLength / 2, (int) (width / 2 - width * 0.15), - (int) getLength().convertToPixels() - markerLength / 2, (int) (width / 2 + width * 0.15)); - } else { - g2d.drawLine(length - notchDiameter, 0, length - notchDiameter, width); - g2d.drawLine(length - notchDiameter * 2, 0, length - notchDiameter * 2, width); - } - } - - public static Color blend(Color c0, Color c1) { - double totalAlpha = c0.getAlpha() + c1.getAlpha(); - double weight0 = c0.getAlpha() / totalAlpha; - double weight1 = c1.getAlpha() / totalAlpha; - - double r = weight0 * c0.getRed() + weight1 * c1.getRed(); - double g = weight0 * c0.getGreen() + weight1 * c1.getGreen(); - double b = weight0 * c0.getBlue() + weight1 * c1.getBlue(); - double a = Math.max(c0.getAlpha(), c1.getAlpha()); - - return new Color((int) r, (int) g, (int) b, (int) a); - } -} + +@ComponentDescriptor(name = "Electrolytic Capacitor (Axial)", author = "Branislav Stojkovic", + category = "Passive", creationMethod = CreationMethod.POINT_BY_POINT, instanceNamePrefix = "C", + description = "Axial electrolytic capacitor, similar to Sprague Atom, F&T, etc", + zOrder = IDIYComponent.COMPONENT, transformer = SimpleComponentTransformer.class, + enableCache = true, enableDatasheet = true, datasheetCreationStepCount = 3) +public class AxialElectrolyticCapacitor extends AbstractLeadedComponent { + + private static final long serialVersionUID = 1L; + + public static Size DEFAULT_WIDTH = new Size(1d / 2, SizeUnit.in); + public static Size DEFAULT_HEIGHT = new Size(1d / 8, SizeUnit.in); + public static Color BODY_COLOR = Color.decode("#6B6DCE"); + public static Color BORDER_COLOR = BODY_COLOR.darker(); + public static Color MARKER_COLOR = Color.decode("#8CACEA"); + public static Color TICK_COLOR = Color.white; + + private Capacitance value = null; + @Deprecated + private Voltage voltage = Voltage._63V; + private org.diylc.core.measures.Voltage voltageNew = null; + + private Color markerColor = MARKER_COLOR; + private Color tickColor = TICK_COLOR; + private boolean polarized = true; + + private AutoSize autoSize = AutoSize.OFF; + + public AxialElectrolyticCapacitor() { + super(); + this.bodyColor = BODY_COLOR; + this.borderColor = BORDER_COLOR; + this.labelColor = TICK_COLOR; + } + + public AxialElectrolyticCapacitor(String[] parameters) { + this(); + String autoSizeValue = parameters[0]; + Double voltageValue = Double.parseDouble(parameters[1].split(" ")[0]); + Double capacitanceValue = Double.parseDouble(parameters[2].split(" ")[0]); + setValue(new Capacitance(capacitanceValue, CapacitanceUnit.uF)); + setVoltageNew(new org.diylc.core.measures.Voltage(voltageValue, VoltageUnit.V)); + if (parameters[1].endsWith(" NP")) { + setPolarized(false); + } + for (AutoSize size : AutoSize.values()) { + if (size.toString().equalsIgnoreCase(autoSizeValue)) { + setAutoSize(size); + } + } + } + + @EditableProperty(validatorClass = PositiveMeasureValidator.class) + public Capacitance getValue() { + return value; + } + + public void setValue(Capacitance value) { + this.value = value; + } + + @Override + public String getValueForDisplay() { + return (getValue() == null ? "" : getValue().toString()) + + (getVoltageNew() == null ? "" : " " + getVoltageNew().toString()); + } + + @Deprecated + public Voltage getVoltage() { + return voltage; + } + + @Deprecated + public void setVoltage(Voltage voltage) { + this.voltage = voltage; + } + + @EditableProperty(name = "Voltage") + public org.diylc.core.measures.Voltage getVoltageNew() { + return voltageNew; + } + + public void setVoltageNew(org.diylc.core.measures.Voltage voltageNew) { + this.voltageNew = voltageNew; + } + + public void drawIcon(Graphics2D g2d, int width, int height) { + g2d.rotate(-Math.PI / 4, width / 2, height / 2); + g2d.setColor(LEAD_COLOR_ICON); + g2d.drawLine(0, height / 2, width, height / 2); + g2d.setColor(BODY_COLOR); + g2d.fillRect(4, height / 2 - 3, width - 8, 6); + g2d.setColor(MARKER_COLOR); + g2d.fillRect(width - 9, height / 2 - 3, 5, 6); + g2d.setColor(TICK_COLOR); + g2d.drawLine(width - 6, height / 2 - 1, width - 6, height / 2 + 1); + g2d.setColor(BORDER_COLOR); + g2d.drawRect(4, height / 2 - 3, width - 8, 6); + } + + @Override + protected Size getDefaultWidth() { + return DEFAULT_HEIGHT; + } + + @Override + protected Size getDefaultLength() { + return DEFAULT_WIDTH; + } + + @EditableProperty(name = "Marker") + public Color getMarkerColor() { + return markerColor; + } + + public void setMarkerColor(Color coverColor) { + this.markerColor = coverColor; + } + + @EditableProperty(name = "Tick") + public Color getTickColor() { + return tickColor; + } + + public void setTickColor(Color tickColor) { + this.tickColor = tickColor; + } + + @EditableProperty(name = "Polarized") + public boolean getPolarized() { + return polarized; + } + + public void setPolarized(boolean polarized) { + this.polarized = polarized; + } + + @Override + protected Shape getBodyShape() { + double lengthFinal = getLength().convertToPixels(); + double widthFinal = getWidth().convertToPixels(); + + + + RoundRectangle2D rect = new RoundRectangle2D.Double(0f, 0f, lengthFinal, widthFinal, + widthFinal / 6, widthFinal / 6); + Area a = new Area(rect); + double notchDiameter = widthFinal / 4; + a.subtract(new Area( + new Ellipse2D.Double(notchDiameter, -notchDiameter * 3 / 4, notchDiameter, notchDiameter))); + a.subtract(new Area(new Ellipse2D.Double(notchDiameter, widthFinal - notchDiameter / 4, + notchDiameter, notchDiameter))); + + if (!getPolarized()) { + a.subtract(new Area(new Ellipse2D.Double(lengthFinal - notchDiameter * 2, + -notchDiameter * 3 / 4, notchDiameter, notchDiameter))); + a.subtract(new Area(new Ellipse2D.Double(lengthFinal - notchDiameter * 2, + widthFinal - notchDiameter / 4, notchDiameter, notchDiameter))); + } + return a; + } + + @Override + protected void decorateComponentBody(Graphics2D g2d, boolean outlineMode) { + double widthFinal = getWidth().convertToPixels(); + double lengthFinal = getLength().convertToPixels(); + + g2d.setColor(blend(getBorderColor(), getBodyColor())); + int notchDiameter = (int) widthFinal / 4; + g2d.setStroke(ObjectCache.getInstance().fetchBasicStroke(1)); + g2d.drawLine(notchDiameter, 0, notchDiameter, (int) widthFinal); + g2d.drawLine(notchDiameter * 2, 0, notchDiameter * 2, (int) widthFinal); + if (polarized) { + int markerLength = (int) (getLength().convertToPixels() * 0.2); + if (!outlineMode) { + g2d.setColor(markerColor); + Rectangle2D markerRect = + new Rectangle2D.Double(lengthFinal - markerLength, 0, markerLength + 2, widthFinal); + Area markerArea = new Area(markerRect); + markerArea.intersect((Area) getBodyShape()); + g2d.fill(markerArea); + } + Color finalTickColor; + if (outlineMode) { + Theme theme = (Theme) ConfigurationManager.getInstance().readObject(IPlugInPort.THEME_KEY, + Constants.DEFAULT_THEME); + finalTickColor = theme.getOutlineColor(); + } else { + finalTickColor = tickColor; + } + g2d.setColor(finalTickColor); + g2d.setStroke(ObjectCache.getInstance().fetchZoomableStroke(2)); + g2d.drawLine((int) getLength().convertToPixels() - markerLength / 2, + (int) (widthFinal / 2 - widthFinal * 0.15), + (int) getLength().convertToPixels() - markerLength / 2, + (int) (widthFinal / 2 + widthFinal * 0.15)); + } else { + g2d.drawLine((int) lengthFinal - notchDiameter, 0, (int) lengthFinal - notchDiameter, + (int) widthFinal); + g2d.drawLine((int) lengthFinal - notchDiameter * 2, 0, (int) lengthFinal - notchDiameter * 2, + (int) widthFinal); + } + } + + public static Color blend(Color c0, Color c1) { + double totalAlpha = c0.getAlpha() + c1.getAlpha(); + double weight0 = c0.getAlpha() / totalAlpha; + double weight1 = c1.getAlpha() / totalAlpha; + + double r = weight0 * c0.getRed() + weight1 * c1.getRed(); + double g = weight0 * c0.getGreen() + weight1 * c1.getGreen(); + double b = weight0 * c0.getBlue() + weight1 * c1.getBlue(); + double a = Math.max(c0.getAlpha(), c1.getAlpha()); + + return new Color((int) r, (int) g, (int) b, (int) a); + } + + @EditableProperty(name = "Auto Size") + public AutoSize getAutoSize() { + if (autoSize == null) { + autoSize = AutoSize.OFF; + } + return autoSize; + } + + public void setAutoSize(AutoSize autoSize) { + this.autoSize = autoSize; + } + + @EditableProperty + @Override + public Size getLength() { + AutoSize autoSize = getAutoSize(); + if (autoSize != null && autoSize != AutoSize.OFF && getVoltageNew() != null + && getVoltageNew().getNormalizedValue() != null && getValue() != null + && getValue().getNormalizedValue() != null) { + + CapacitorDimensions d = CapacitorDimensionService.getInstance().lookup(this.getClass(), + autoSize.toString(), getVoltageNew(), getValue(), getPolarized()); + + if (d != null) { + return d.getLength(); + } + } + + return super.getLength(); + } + + @EditableProperty + @Override + public Size getWidth() { + AutoSize autoSize = getAutoSize(); + if (autoSize != null && autoSize != AutoSize.OFF && getVoltageNew() != null + && getVoltageNew().getNormalizedValue() != null && getValue() != null + && getValue().getNormalizedValue() != null) { + + CapacitorDimensions d = CapacitorDimensionService.getInstance().lookup(this.getClass(), + autoSize.toString(), getVoltageNew(), getValue(), getPolarized()); + + if (d != null) { + return d.getDiameter(); + } + } + return super.getWidth(); + } + + private static enum AutoSize { + OFF("Off"), SPRAGUE_TVA_ATOM("Sprague TVA Atom"), FT_TYP_A("F&T Typ A"); + + private String label; + + AutoSize(String label) { + this.label = label; + } + + @Override + public String toString() { + return label; + } + } +} diff --git a/diylc/diylc-library/src/org/diylc/components/passive/AxialFilmCapacitor.datasheet b/diylc/diylc-library/src/org/diylc/components/passive/AxialFilmCapacitor.datasheet new file mode 100644 index 00000000..fe112ca3 --- /dev/null +++ b/diylc/diylc-library/src/org/diylc/components/passive/AxialFilmCapacitor.datasheet @@ -0,0 +1,143 @@ +Mallory 150,63 VDC,0.15 uF,16.5,6 +Mallory 150,63 VDC,0.18 uF,16.5,6 +Mallory 150,63 VDC,0.22 uF,16.5,6 +Mallory 150,63 VDC,0.27 uF,16.5,6 +Mallory 150,63 VDC,0.33 uF,16.5,6 +Mallory 150,63 VDC,0.39 uF,16.5,6.5 +Mallory 150,63 VDC,0.47 uF,16.5,7 +Mallory 150,63 VDC,0.56 uF,16.5,7 +Mallory 150,63 VDC,0.68 uF,20.5,7 +Mallory 150,63 VDC,0.82 uF,20.5,8 +Mallory 150,63 VDC,1 uF,20.5,8 +Mallory 150,63 VDC,1.5 uF,20.5,9.5 +Mallory 150,63 VDC,2.2 uF,28,9.5 +Mallory 150,63 VDC,3.3 uF,28,11 +Mallory 150,63 VDC,4.7 uF,28,12.5 +Mallory 150,63 VDC,6.8 uF,33,14.5 +Mallory 150,63 VDC,10 uF,33,15.5 +Mallory 150,100 VDC,0.068 uF,16.5,6 +Mallory 150,100 VDC,0.082 uF,16.5,6 +Mallory 150,100 VDC,0.1 uF,16.5,6 +Mallory 150,100 VDC,0.12 uF,16.5,6 +Mallory 150,100 VDC,0.15 uF,16.5,6 +Mallory 150,100 VDC,0.18 uF,16.5,6.5 +Mallory 150,100 VDC,0.22 uF,16.5,6.5 +Mallory 150,100 VDC,0.27 uF,16.5,6.5 +Mallory 150,100 VDC,0.33 uF,16.5,8 +Mallory 150,100 VDC,0.39 uF,16.5,8 +Mallory 150,100 VDC,0.47 uF,20.5,7 +Mallory 150,100 VDC,0.56 uF,20.5,8 +Mallory 150,100 VDC,0.68 uF,20.5,8.5 +Mallory 150,100 VDC,0.82 uF,20.5,9.5 +Mallory 150,100 VDC,1 uF,20.5,10 +Mallory 150,250 VDC,0.012 uF,16.5,6 +Mallory 150,250 VDC,0.015 uF,16.5,6 +Mallory 150,250 VDC,0.018 uF,16.5,6 +Mallory 150,250 VDC,0.022 uF,16.5,6 +Mallory 150,250 VDC,0.027 uF,16.5,6 +Mallory 150,250 VDC,0.033 uF,16.5,6 +Mallory 150,250 VDC,0.039 uF,16.5,6 +Mallory 150,250 VDC,0.047 uF,16.5,6 +Mallory 150,250 VDC,0.056 uF,16.5,6 +Mallory 150,250 VDC,0.068 uF,16.5,6 +Mallory 150,250 VDC,0.082 uF,16.5,6 +Mallory 150,250 VDC,0.1 uF,16.5,6.5 +Mallory 150,250 VDC,0.12 uF,16.5,7 +Mallory 150,250 VDC,0.15 uF,16.5,8 +Mallory 150,250 VDC,0.18 uF,16.5,8 +Mallory 150,250 VDC,0.22 uF,16.5,8.5 +Mallory 150,250 VDC,0.27 uF,20.5,8 +Mallory 150,250 VDC,0.33 uF,20.5,8.5 +Mallory 150,250 VDC,0.39 uF,20.5,9 +Mallory 150,250 VDC,0.47 uF,20.5,9.5 +Mallory 150,250 VDC,0.56 uF,20.5,10 +Mallory 150,250 VDC,0.68 uF,28,9 +Mallory 150,250 VDC,0.82 uF,28,9.5 +Mallory 150,250 VDC,1 uF,28,10.5 +Mallory 150,250 VDC,1.5 uF,28,12.5 +Mallory 150,250 VDC,2.2 uF,33,13.5 +Mallory 150,250 VDC,3.3 uF,33,15.5 +Mallory 150,250 VDC,4.7 uF,33,18.5 +Mallory 150,250 VDC,6.8 uF,33,21.5 +Mallory 150,400 VDC,0.0082 uF,16.5,6 +Mallory 150,400 VDC,0.01 uF,16.5,6 +Mallory 150,400 VDC,0.012 uF,16.5,6 +Mallory 150,400 VDC,0.015 uF,16.5,6 +Mallory 150,400 VDC,0.018 uF,16.5,6 +Mallory 150,400 VDC,0.022 uF,16.5,6 +Mallory 150,400 VDC,0.027 uF,16.5,6 +Mallory 150,400 VDC,0.033 uF,16.5,6 +Mallory 150,400 VDC,0.039 uF,16.5,6.5 +Mallory 150,400 VDC,0.047 uF,16.5,7 +Mallory 150,400 VDC,0.056 uF,16.5,8 +Mallory 150,400 VDC,0.068 uF,20.5,7 +Mallory 150,400 VDC,0.082 uF,20.5,8 +Mallory 150,400 VDC,0.1 uF,20.5,8 +Mallory 150,400 VDC,0.12 uF,20.5,8 +Mallory 150,400 VDC,0.15 uF,20.5,9 +Mallory 150,400 VDC,0.18 uF,28,8 +Mallory 150,400 VDC,0.22 uF,28,8.5 +Mallory 150,400 VDC,0.27 uF,28,9 +Mallory 150,400 VDC,0.33 uF,28,10 +Mallory 150,400 VDC,0.39 uF,28,10.5 +Mallory 150,400 VDC,0.47 uF,33,11.5 +Mallory 150,400 VDC,0.56 uF,33,11.5 +Mallory 150,400 VDC,0.68 uF,33,12.5 +Mallory 150,400 VDC,0.82 uF,33,13.5 +Mallory 150,400 VDC,1 uF,33,14.5 +Mallory 150,400 VDC,1.5 uF,33,17.5 +Mallory 150,400 VDC,2.2 uF,33,20.5 +Mallory 150,630 VDC,0.001 uF,16.5,6 +Mallory 150,630 VDC,0.0012 uF,16.5,6 +Mallory 150,630 VDC,0.0015 uF,16.5,6 +Mallory 150,630 VDC,0.0018 uF,16.5,6 +Mallory 150,630 VDC,0.0022 uF,16.5,6 +Mallory 150,630 VDC,0.0027 uF,16.5,6 +Mallory 150,630 VDC,0.0033 uF,16.5,6 +Mallory 150,630 VDC,0.0039 uF,16.5,6 +Mallory 150,630 VDC,0.0047 uF,16.5,6 +Mallory 150,630 VDC,0.0056 uF,16.5,6 +Mallory 150,630 VDC,0.0068 uF,16.5,6 +Mallory 150,630 VDC,0.0082 uF,16.5,6 +Mallory 150,630 VDC,0.01 uF,16.5,6 +Mallory 150,630 VDC,0.012 uF,16.5,6 +Mallory 150,630 VDC,0.015 uF,16.5,6 +Mallory 150,630 VDC,0.018 uF,16.5,6.5 +Mallory 150,630 VDC,0.022 uF,16.5,7 +Mallory 150,630 VDC,0.027 uF,20.5,6.5 +Mallory 150,630 VDC,0.033 uF,20.5,8 +Mallory 150,630 VDC,0.039 uF,20.5,8 +Mallory 150,630 VDC,0.047 uF,20.5,8 +Mallory 150,630 VDC,0.056 uF,20.5,8.5 +Mallory 150,630 VDC,0.068 uF,20.5,9 +Mallory 150,630 VDC,0.082 uF,20.5,9.5 +Mallory 150,630 VDC,0.1 uF,28,8.5 +Mallory 150,630 VDC,0.12 uF,28,9 +Mallory 150,630 VDC,0.15 uF,28,10 +Mallory 150,630 VDC,0.18 uF,28,10.5 +Mallory 150,630 VDC,0.22 uF,28,11.5 +Mallory 150,630 VDC,0.27 uF,28,12.5 +Mallory 150,630 VDC,0.33 uF,33,13 +Mallory 150,630 VDC,0.39 uF,33,14.5 +Mallory 150,630 VDC,0.47 uF,33,15 +Mallory 150,630 VDC,0.56 uF,33,15.5 +Mallory 150,630 VDC,0.68 uF,33,17.5 +Mallory 150,630 VDC,0.82 uF,33,18.5 +Mallory 150,630 VDC,1 uF,33,20.5 +Mallory 150,1000 VDC,0.001 uF,16.5,6.5 +Mallory 150,1000 VDC,0.0015 uF,16.5,6.5 +Mallory 150,1000 VDC,0.0022 uF,16.5,6.5 +Mallory 150,1000 VDC,0.0033 uF,16.5,6.5 +Mallory 150,1000 VDC,0.0047 uF,16.5,7 +Mallory 150,1000 VDC,0.0068 uF,16.5,8 +Mallory 150,1000 VDC,0.01 uF,20.5,7 +Mallory 150,1000 VDC,0.015 uF,20.5,8.5 +Mallory 150,1000 VDC,0.022 uF,20.5,9.5 +Mallory 150,1000 VDC,0.033 uF,28,8.5 +Mallory 150,1000 VDC,0.047 uF,28,9.5 +Mallory 150,1000 VDC,0.068 uF,28,11 +Mallory 150,1000 VDC,0.1 uF,28,13 +Mallory 150,1000 VDC,0.15 uF,33,14 +Mallory 150,1000 VDC,0.22 uF,33,17.5 +Mallory 150,1000 VDC,0.33 uF,33,20.5 +Mallory 150,1000 VDC,0.47 uF,33,24 \ No newline at end of file diff --git a/diylc/diylc-library/src/org/diylc/components/passive/AxialFilmCapacitor.java b/diylc/diylc-library/src/org/diylc/components/passive/AxialFilmCapacitor.java index 42545cf0..bf4b7d69 100644 --- a/diylc/diylc-library/src/org/diylc/components/passive/AxialFilmCapacitor.java +++ b/diylc/diylc-library/src/org/diylc/components/passive/AxialFilmCapacitor.java @@ -22,15 +22,21 @@ import java.awt.Color; import java.awt.Graphics2D; import java.awt.Shape; import java.awt.geom.Rectangle2D; +import org.diylc.components.passive.CapacitorDimensionService.CapacitorDimensions; import org.diylc.components.transform.SimpleComponentTransformer; import org.diylc.core.CreationMethod; import org.diylc.core.IDIYComponent; import org.diylc.core.annotations.ComponentDescriptor; +import org.diylc.core.annotations.EditableProperty; +import org.diylc.core.measures.Capacitance; +import org.diylc.core.measures.CapacitanceUnit; +import org.diylc.core.measures.Size; +import org.diylc.core.measures.VoltageUnit; @ComponentDescriptor(name = "Film Capacitor (Axial)", author = "Branislav Stojkovic", category = "Passive", creationMethod = CreationMethod.POINT_BY_POINT, instanceNamePrefix = "C", description = "Axial film capacitor, similar to Mallory 150s", zOrder = IDIYComponent.COMPONENT, - transformer = SimpleComponentTransformer.class) + transformer = SimpleComponentTransformer.class, enableDatasheet = true, datasheetCreationStepCount = 3) public class AxialFilmCapacitor extends AbstractFilmCapacitor { private static final long serialVersionUID = 1L; @@ -39,11 +45,28 @@ public class AxialFilmCapacitor extends AbstractFilmCapacitor { public static Color BORDER_COLOR = BODY_COLOR.darker(); public static Color OUTER_FOIL_COLOR = Color.white; + private AutoSize autoSize = AutoSize.OFF; + public AxialFilmCapacitor() { super(); this.bodyColor = BODY_COLOR; this.borderColor = BORDER_COLOR; } + + public AxialFilmCapacitor(String[] parameters) { + this(); + String autoSizeValue = parameters[0]; + Double voltageValue = Double.parseDouble(parameters[1].split(" ")[0]); + Double capacitanceValue = Double.parseDouble(parameters[2].split(" ")[0]); + setValue(new Capacitance(capacitanceValue, CapacitanceUnit.uF)); + setVoltageNew(new org.diylc.core.measures.Voltage(voltageValue, VoltageUnit.V)); + + for (AutoSize size : AutoSize.values()) { + if (size.toString().equalsIgnoreCase(autoSizeValue)) { + setAutoSize(size); + } + } + } public void drawIcon(Graphics2D g2d, int width, int height) { g2d.rotate(-Math.PI / 4, width / 2, height / 2); @@ -57,12 +80,78 @@ public class AxialFilmCapacitor extends AbstractFilmCapacitor { @Override protected Shape getBodyShape() { - return new Rectangle2D.Double(0f, 0f, getLength().convertToPixels(), - getClosestOdd(getWidth().convertToPixels())); + double lengthFinal = getLength().convertToPixels(); + double widthFinal = getWidth().convertToPixels(); + + return new Rectangle2D.Double(0f, 0f, lengthFinal, getClosestOdd(widthFinal)); } - + @Override protected boolean supportsStandingMode() { return true; } + + @EditableProperty(name = "Auto Size") + public AutoSize getAutoSize() { + if (autoSize == null) { + autoSize = AutoSize.OFF; + } + return autoSize; + } + + public void setAutoSize(AutoSize autoSize) { + this.autoSize = autoSize; + } + + @EditableProperty + @Override + public Size getLength() { + AutoSize autoSize = getAutoSize(); + if (autoSize != null && autoSize != AutoSize.OFF && getVoltageNew() != null + && getVoltageNew().getNormalizedValue() != null && getValue() != null + && getValue().getNormalizedValue() != null) { + + CapacitorDimensions d = CapacitorDimensionService.getInstance().lookup(this.getClass(), + autoSize.toString(), getVoltageNew(), getValue()); + + if (d != null) { + return d.getLength(); + } + } + + return super.getLength(); + } + + @EditableProperty + @Override + public Size getWidth() { + AutoSize autoSize = getAutoSize(); + if (autoSize != null && autoSize != AutoSize.OFF && getVoltageNew() != null + && getVoltageNew().getNormalizedValue() != null && getValue() != null + && getValue().getNormalizedValue() != null) { + + CapacitorDimensions d = CapacitorDimensionService.getInstance().lookup(this.getClass(), + autoSize.toString(), getVoltageNew(), getValue()); + + if (d != null) { + return d.getDiameter(); + } + } + return super.getWidth(); + } + + private static enum AutoSize { + OFF("Off"), MALLORY150("Mallory 150"); + + private String label; + + AutoSize(String label) { + this.label = label; + } + + @Override + public String toString() { + return label; + } + } } diff --git a/diylc/diylc-library/src/org/diylc/components/passive/CapacitorDimensionService.java b/diylc/diylc-library/src/org/diylc/components/passive/CapacitorDimensionService.java new file mode 100644 index 00000000..53845a2b --- /dev/null +++ b/diylc/diylc-library/src/org/diylc/components/passive/CapacitorDimensionService.java @@ -0,0 +1,104 @@ +/* + * + * DIY Layout Creator (DIYLC). Copyright (c) 2009-2018 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 + * . + * + */ +package org.diylc.components.passive; + +import java.text.DecimalFormat; +import java.text.NumberFormat; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import org.diylc.core.measures.Capacitance; +import org.diylc.core.measures.Size; +import org.diylc.core.measures.SizeUnit; +import org.diylc.core.measures.Voltage; +import org.diylc.presenter.DatasheetService; + +public class CapacitorDimensionService { + + private static final double TOLERANCE = 10d; + + private static CapacitorDimensionService instance; + + private static NumberFormat format = new DecimalFormat("##.###"); + + private Map cache = new HashMap(); + + public static CapacitorDimensionService getInstance() { + if (instance == null) { + instance = new CapacitorDimensionService(); + } + return instance; + } + + public CapacitorDimensions lookup(Class clazz, String key, Voltage voltage, Capacitance value) { + return lookup(clazz, key, voltage, value, null); + } + + public CapacitorDimensions lookup(Class clazz, String key, Voltage voltage, Capacitance value, + Boolean polarized) { + + String lookupKey = key + "|" + format.format(voltage.getNormalizedValue()) + " VDC" + + (Optional.ofNullable(polarized).map(p -> p ? "" : " NP").orElse("")); + + String cacheKey = clazz.getName() + lookupKey + "|" + format.format(value.getNormalizedValue()); + + return cache.computeIfAbsent(cacheKey, k -> { + String[] lookup = DatasheetService.getInstance().lookup(clazz, TOLERANCE, lookupKey, + value.getNormalizedValue()); + + if (lookup != null) { + Size length = new Size(Double.parseDouble(lookup[3]), SizeUnit.mm); + Size diameter = new Size(Double.parseDouble(lookup[4]), SizeUnit.mm); + return new CapacitorDimensions(length, diameter); + } + return null; + }); + } + + public static class CapacitorDimensions { + private Size length; + private Size diameter; + private Size height; + + public CapacitorDimensions(Size length, Size diameter, Size height) { + super(); + this.length = length; + this.diameter = diameter; + this.height = height; + } + + public CapacitorDimensions(Size length, Size diameter) { + super(); + this.length = length; + this.diameter = diameter; + } + + public Size getLength() { + return length; + } + + public Size getDiameter() { + return diameter; + } + + public Size getHeight() { + return height; + } + } +} diff --git a/diylc/diylc-library/src/org/diylc/components/passive/RadialFilmCapacitor.datasheet b/diylc/diylc-library/src/org/diylc/components/passive/RadialFilmCapacitor.datasheet new file mode 100644 index 00000000..84a03081 --- /dev/null +++ b/diylc/diylc-library/src/org/diylc/components/passive/RadialFilmCapacitor.datasheet @@ -0,0 +1,300 @@ +Orange Drop 715P,100 VDC,0.0056 uF,14.5,6.4 +Orange Drop 715P,100 VDC,0.006 uF,14.5,6.4 +Orange Drop 715P,100 VDC,0.0068 uF,14.5,6.6 +Orange Drop 715P,100 VDC,0.0075 uF,14.5,6.6 +Orange Drop 715P,100 VDC,0.0082 uF,14.5,6.9 +Orange Drop 715P,100 VDC,0.009 uF,14.5,6.6 +Orange Drop 715P,100 VDC,0.01 uF,14.5,6.6 +Orange Drop 715P,100 VDC,0.012 uF,14.5,7.1 +Orange Drop 715P,100 VDC,0.015 uF,14.5,7.4 +Orange Drop 715P,100 VDC,0.018 uF,14.5,7.9 +Orange Drop 715P,100 VDC,0.022 uF,14.5,8.4 +Orange Drop 715P,100 VDC,0.025 uF,14.5,8.9 +Orange Drop 715P,100 VDC,0.027 uF,14.5,8.9 +Orange Drop 715P,100 VDC,0.033 uF,14.5,9.7 +Orange Drop 715P,100 VDC,0.039 uF,17.8,8.6 +Orange Drop 715P,100 VDC,0.047 uF,17.8,9.1 +Orange Drop 715P,100 VDC,0.05 uF,17.8,9.4 +Orange Drop 715P,100 VDC,0.056 uF,17.8,9.7 +Orange Drop 715P,100 VDC,0.062 uF,17.8,10.2 +Orange Drop 715P,100 VDC,0.068 uF,17.8,10.4 +Orange Drop 715P,100 VDC,0.075 uF,22.9,9.1 +Orange Drop 715P,100 VDC,0.082 uF,22.9,9.4 +Orange Drop 715P,100 VDC,0.09 uF,22.9,9.7 +Orange Drop 715P,100 VDC,0.1 uF,22.9,10.2 +Orange Drop 715P,100 VDC,0.12 uF,22.9,10.9 +Orange Drop 715P,100 VDC,0.15 uF,22.9,11.7 +Orange Drop 715P,100 VDC,0.18 uF,22.9,12.7 +Orange Drop 715P,100 VDC,0.2 uF,22.9,13.2 +Orange Drop 715P,100 VDC,0.22 uF,22.9,13.7 +Orange Drop 715P,100 VDC,0.25 uF,31.8,11.9 +Orange Drop 715P,100 VDC,0.27 uF,31.8,12.2 +Orange Drop 715P,100 VDC,0.3 uF,31.8,12.7 +Orange Drop 715P,100 VDC,0.33 uF,31.8,13.2 +Orange Drop 715P,200 VDC,0.01 uF,17.8,6.4 +Orange Drop 715P,200 VDC,0.012 uF,17.8,6.6 +Orange Drop 715P,200 VDC,0.015 uF,17.8,7.1 +Orange Drop 715P,200 VDC,0.018 uF,17.8,7.4 +Orange Drop 715P,200 VDC,0.022 uF,17.8,7.9 +Orange Drop 715P,200 VDC,0.027 uF,17.8,8.4 +Orange Drop 715P,200 VDC,0.033 uF,17.8,9.1 +Orange Drop 715P,200 VDC,0.039 uF,22.9,8.1 +Orange Drop 715P,200 VDC,0.047 uF,22.9,8.6 +Orange Drop 715P,200 VDC,0.056 uF,22.9,9.4 +Orange Drop 715P,200 VDC,0.068 uF,22.9,9.9 +Orange Drop 715P,200 VDC,0.082 uF,31.8,9.1 +Orange Drop 715P,200 VDC,0.1 uF,31.8,9.7 +Orange Drop 715P,200 VDC,0.12 uF,31.8,10.4 +Orange Drop 715P,200 VDC,0.15 uF,31.8,11.2 +Orange Drop 715P,200 VDC,0.18 uF,31.8,11.9 +Orange Drop 715P,200 VDC,0.22 uF,31.8,13 +Orange Drop 715P,200 VDC,0.27 uF,41.9,12.4 +Orange Drop 715P,200 VDC,0.33 uF,41.9,13.5 +Orange Drop 715P,200 VDC,0.39 uF,41.9,14.2 +Orange Drop 715P,200 VDC,0.47 uF,41.9,15.2 +Orange Drop 715P,400 VDC,0.001 uF,17.8,8.9 +Orange Drop 715P,400 VDC,0.0012 uF,17.8,9.1 +Orange Drop 715P,400 VDC,0.0015 uF,17.8,8.1 +Orange Drop 715P,400 VDC,0.0018 uF,17.8,8.6 +Orange Drop 715P,400 VDC,0.0022 uF,17.8,8.4 +Orange Drop 715P,400 VDC,0.0027 uF,17.8,8.9 +Orange Drop 715P,400 VDC,0.0033 uF,17.8,8.1 +Orange Drop 715P,400 VDC,0.0039 uF,17.8,8.6 +Orange Drop 715P,400 VDC,0.0047 uF,17.8,8.6 +Orange Drop 715P,400 VDC,0.0056 uF,17.8,9.1 +Orange Drop 715P,400 VDC,0.0068 uF,17.8,7.4 +Orange Drop 715P,400 VDC,0.0082 uF,17.8,7.6 +Orange Drop 715P,400 VDC,0.01 uF,17.8,7.6 +Orange Drop 715P,400 VDC,0.012 uF,17.8,8.1 +Orange Drop 715P,400 VDC,0.015 uF,17.8,8.6 +Orange Drop 715P,400 VDC,0.018 uF,22.9,7.9 +Orange Drop 715P,400 VDC,0.022 uF,22.9,8.4 +Orange Drop 715P,400 VDC,0.027 uF,22.9,9.1 +Orange Drop 715P,400 VDC,0.033 uF,22.9,9.7 +Orange Drop 715P,400 VDC,0.039 uF,31.8,8.9 +Orange Drop 715P,400 VDC,0.047 uF,31.8,9.4 +Orange Drop 715P,400 VDC,0.056 uF,31.8,9.9 +Orange Drop 715P,400 VDC,0.068 uF,31.8,10.7 +Orange Drop 715P,400 VDC,0.082 uF,31.8,11.4 +Orange Drop 715P,400 VDC,0.1 uF,31.8,12.2 +Orange Drop 715P,400 VDC,0.12 uF,31.8,13.2 +Orange Drop 715P,400 VDC,0.15 uF,31.8,14.2 +Orange Drop 715P,400 VDC,0.18 uF,41.9,13.7 +Orange Drop 715P,400 VDC,0.22 uF,41.9,14.7 +Orange Drop 715P,400 VDC,0.27 uF,41.9,16 +Orange Drop 715P,400 VDC,0.33 uF,41.9,17.8 +Orange Drop 715P,400 VDC,0.39 uF,41.9,19.1 +Orange Drop 715P,400 VDC,0.47 uF,41.9,20.8 +Orange Drop 715P,600 VDC,0.001 uF,17.8,8.9 +Orange Drop 715P,600 VDC,0.0012 uF,17.8,9.1 +Orange Drop 715P,600 VDC,0.0015 uF,17.8,8.1 +Orange Drop 715P,600 VDC,0.0018 uF,17.8,8.6 +Orange Drop 715P,600 VDC,0.0022 uF,17.8,8.4 +Orange Drop 715P,600 VDC,0.0027 uF,17.8,8.9 +Orange Drop 715P,600 VDC,0.0033 uF,17.8,8.1 +Orange Drop 715P,600 VDC,0.0039 uF,17.8,8.6 +Orange Drop 715P,600 VDC,0.0047 uF,17.8,8.6 +Orange Drop 715P,600 VDC,0.0056 uF,17.8,9.1 +Orange Drop 715P,600 VDC,0.0068 uF,17.8,9.7 +Orange Drop 715P,600 VDC,0.0082 uF,22.9,8.6 +Orange Drop 715P,600 VDC,0.01 uF,22.9,9.1 +Orange Drop 715P,600 VDC,0.012 uF,22.9,9.7 +Orange Drop 715P,600 VDC,0.015 uF,22.9,10.7 +Orange Drop 715P,600 VDC,0.018 uF,22.9,11.2 +Orange Drop 715P,600 VDC,0.022 uF,22.9,12.2 +Orange Drop 715P,600 VDC,0.027 uF,31.8,10.2 +Orange Drop 715P,600 VDC,0.033 uF,31.8,11.7 +Orange Drop 715P,600 VDC,0.039 uF,31.8,12.4 +Orange Drop 715P,600 VDC,0.047 uF,31.8,13.2 +Orange Drop 715P,600 VDC,0.056 uF,31.8,14.2 +Orange Drop 715P,600 VDC,0.068 uF,31.8,15.2 +Orange Drop 715P,600 VDC,0.082 uF,31.8,16.5 +Orange Drop 715P,600 VDC,0.1 uF,31.8,18 +Orange Drop 715P,600 VDC,0.12 uF,41.9,16.5 +Orange Drop 715P,600 VDC,0.15 uF,41.9,18 +Orange Drop 715P,600 VDC,0.18 uF,41.9,19.6 +Orange Drop 715P,600 VDC,0.22 uF,41.9,21.1 +Orange Drop 715P,800 VDC,0.0056 uF,31.8,7.1 +Orange Drop 715P,800 VDC,0.0068 uF,31.8,7.4 +Orange Drop 715P,800 VDC,0.0082 uF,31.8,7.9 +Orange Drop 715P,800 VDC,0.01 uF,31.8,8.4 +Orange Drop 715P,800 VDC,0.012 uF,31.8,8.9 +Orange Drop 715P,800 VDC,0.015 uF,31.8,9.7 +Orange Drop 715P,800 VDC,0.018 uF,31.8,10.4 +Orange Drop 715P,800 VDC,0.022 uF,31.8,11.2 +Orange Drop 715P,800 VDC,0.027 uF,31.8,11.9 +Orange Drop 715P,800 VDC,0.033 uF,31.8,13 +Orange Drop 715P,800 VDC,0.039 uF,41.9,11.9 +Orange Drop 715P,800 VDC,0.047 uF,41.9,12.7 +Orange Drop 715P,800 VDC,0.056 uF,41.9,13.5 +Orange Drop 715P,800 VDC,0.068 uF,41.9,14.7 +Orange Drop 715P,800 VDC,0.082 uF,41.9,15.7 +Orange Drop 715P,800 VDC,0.1 uF,41.9,17 +Orange Drop 715P,1000 VDC,0.0056 uF,31.8,7.1 +Orange Drop 715P,1000 VDC,0.0068 uF,31.8,7.4 +Orange Drop 715P,1000 VDC,0.0082 uF,31.8,7.9 +Orange Drop 715P,1000 VDC,0.01 uF,31.8,8.4 +Orange Drop 715P,1000 VDC,0.012 uF,31.8,8.9 +Orange Drop 715P,1000 VDC,0.015 uF,31.8,9.7 +Orange Drop 715P,1000 VDC,0.018 uF,31.8,10.4 +Orange Drop 715P,1000 VDC,0.022 uF,31.8,11.2 +Orange Drop 715P,1000 VDC,0.027 uF,31.8,11.9 +Orange Drop 715P,1000 VDC,0.033 uF,31.8,13 +Orange Drop 715P,1000 VDC,0.039 uF,41.9,11.9 +Orange Drop 715P,1000 VDC,0.047 uF,41.9,12.7 +Orange Drop 715P,1000 VDC,0.056 uF,41.9,13.5 +Orange Drop 715P,1000 VDC,0.068 uF,41.9,14.7 +Orange Drop 715P,1000 VDC,0.082 uF,41.9,15.7 +Orange Drop 715P,1000 VDC,0.1 uF,41.9,17 +Orange Drop 716P,100 VDC,0.0082 uF,14.5,5.8 +Orange Drop 716P,100 VDC,0.009 uF,14.5,6.1 +Orange Drop 716P,100 VDC,0.01 uF,14.5,6.1 +Orange Drop 716P,100 VDC,0.012 uF,14.5,5.8 +Orange Drop 716P,100 VDC,0.015 uF,14.5,6.4 +Orange Drop 716P,100 VDC,0.018 uF,14.5,6.6 +Orange Drop 716P,100 VDC,0.022 uF,14.5,7.1 +Orange Drop 716P,100 VDC,0.025 uF,14.5,7.4 +Orange Drop 716P,100 VDC,0.027 uF,14.5,6.9 +Orange Drop 716P,100 VDC,0.033 uF,14.5,7.4 +Orange Drop 716P,100 VDC,0.039 uF,14.5,7.9 +Orange Drop 716P,100 VDC,0.047 uF,14.5,8.6 +Orange Drop 716P,100 VDC,0.05 uF,17.8,7.1 +Orange Drop 716P,100 VDC,0.056 uF,17.8,7.4 +Orange Drop 716P,100 VDC,0.062 uF,17.8,7.9 +Orange Drop 716P,100 VDC,0.068 uF,17.8,8.1 +Orange Drop 716P,100 VDC,0.075 uF,17.8,8.4 +Orange Drop 716P,100 VDC,0.082 uF,17.8,8.9 +Orange Drop 716P,100 VDC,0.09 uF,17.8,9.1 +Orange Drop 716P,100 VDC,0.1 uF,17.8,9.7 +Orange Drop 716P,100 VDC,0.12 uF,22.9,8.4 +Orange Drop 716P,100 VDC,0.15 uF,22.9,9.4 +Orange Drop 716P,100 VDC,0.18 uF,22.9,10.2 +Orange Drop 716P,100 VDC,0.2 uF,22.9,10.7 +Orange Drop 716P,100 VDC,0.22 uF,22.9,11.2 +Orange Drop 716P,100 VDC,0.25 uF,22.9,11.9 +Orange Drop 716P,100 VDC,0.27 uF,22.9,12.4 +Orange Drop 716P,100 VDC,0.3 uF,31.8,10.4 +Orange Drop 716P,100 VDC,0.33 uF,31.8,10.7 +Orange Drop 716P,200 VDC,0.01 uF,17.8,6.4 +Orange Drop 716P,200 VDC,0.012 uF,17.8,6.9 +Orange Drop 716P,200 VDC,0.015 uF,17.8,6.6 +Orange Drop 716P,200 VDC,0.018 uF,17.8,6.4 +Orange Drop 716P,200 VDC,0.022 uF,17.8,6.9 +Orange Drop 716P,200 VDC,0.027 uF,17.8,7.4 +Orange Drop 716P,200 VDC,0.033 uF,17.8,8.1 +Orange Drop 716P,200 VDC,0.039 uF,17.8,8.1 +Orange Drop 716P,200 VDC,0.047 uF,17.8,8.6 +Orange Drop 716P,200 VDC,0.056 uF,22.9,7.6 +Orange Drop 716P,200 VDC,0.068 uF,22.9,8.4 +Orange Drop 716P,200 VDC,0.082 uF,22.9,9.1 +Orange Drop 716P,200 VDC,0.1 uF,22.9,9.9 +Orange Drop 716P,200 VDC,0.12 uF,22.9,10.2 +Orange Drop 716P,200 VDC,0.15 uF,22.9,11.4 +Orange Drop 716P,200 VDC,0.18 uF,31.8,9.9 +Orange Drop 716P,200 VDC,0.22 uF,31.8,10.9 +Orange Drop 716P,200 VDC,0.27 uF,31.8,11.9 +Orange Drop 716P,200 VDC,0.33 uF,31.8,11.9 +Orange Drop 716P,200 VDC,0.39 uF,31.8,13 +Orange Drop 716P,200 VDC,0.47 uF,31.8,14.2 +Orange Drop 716P,200 VDC,0.56 uF,31.8,15.5 +Orange Drop 716P,200 VDC,0.68 uF,41.9,14.2 +Orange Drop 716P,200 VDC,0.82 uF,41.9,15.5 +Orange Drop 716P,200 VDC,1 uF,41.9,17.3 +Orange Drop 716P,400 VDC,0.001 uF,17.8,6.4 +Orange Drop 716P,400 VDC,0.0012 uF,17.8,5.6 +Orange Drop 716P,400 VDC,0.0015 uF,17.8,6.1 +Orange Drop 716P,400 VDC,0.0018 uF,17.8,6.4 +Orange Drop 716P,400 VDC,0.0022 uF,17.8,6.6 +Orange Drop 716P,400 VDC,0.0027 uF,17.8,6.1 +Orange Drop 716P,400 VDC,0.0033 uF,17.8,6.1 +Orange Drop 716P,400 VDC,0.0039 uF,17.8,6.1 +Orange Drop 716P,400 VDC,0.0047 uF,17.8,6.4 +Orange Drop 716P,400 VDC,0.0056 uF,17.8,6.1 +Orange Drop 716P,400 VDC,0.0068 uF,17.8,6.1 +Orange Drop 716P,400 VDC,0.0082 uF,17.8,6.4 +Orange Drop 716P,400 VDC,0.01 uF,17.8,6.9 +Orange Drop 716P,400 VDC,0.012 uF,17.8,7.4 +Orange Drop 716P,400 VDC,0.015 uF,17.8,7.9 +Orange Drop 716P,400 VDC,0.018 uF,22.9,7.1 +Orange Drop 716P,400 VDC,0.022 uF,22.9,7.6 +Orange Drop 716P,400 VDC,0.027 uF,22.9,7.9 +Orange Drop 716P,400 VDC,0.033 uF,22.9,8.4 +Orange Drop 716P,400 VDC,0.039 uF,22.9,9.1 +Orange Drop 716P,400 VDC,0.047 uF,22.9,9.9 +Orange Drop 716P,400 VDC,0.056 uF,22.9,10.2 +Orange Drop 716P,400 VDC,0.068 uF,22.9,10.9 +Orange Drop 716P,400 VDC,0.082 uF,31.8,9.7 +Orange Drop 716P,400 VDC,0.1 uF,31.8,10.7 +Orange Drop 716P,400 VDC,0.12 uF,31.8,11.4 +Orange Drop 716P,400 VDC,0.15 uF,31.8,11.7 +Orange Drop 716P,400 VDC,0.18 uF,31.8,12.7 +Orange Drop 716P,400 VDC,0.22 uF,31.8,14.5 +Orange Drop 716P,400 VDC,0.27 uF,31.8,16 +Orange Drop 716P,400 VDC,0.33 uF,41.9,14.5 +Orange Drop 716P,400 VDC,0.39 uF,41.9,15.7 +Orange Drop 716P,400 VDC,0.47 uF,41.9,17.3 +Orange Drop 716P,600 VDC,0.001 uF,17.8,6.9 +Orange Drop 716P,600 VDC,0.0012 uF,17.8,6.1 +Orange Drop 716P,600 VDC,0.0015 uF,17.8,6.6 +Orange Drop 716P,600 VDC,0.0018 uF,17.8,6.9 +Orange Drop 716P,600 VDC,0.0022 uF,17.8,7.1 +Orange Drop 716P,600 VDC,0.0027 uF,17.8,6.4 +Orange Drop 716P,600 VDC,0.0033 uF,17.8,6.4 +Orange Drop 716P,600 VDC,0.0039 uF,17.8,6.6 +Orange Drop 716P,600 VDC,0.0047 uF,17.8,7.1 +Orange Drop 716P,600 VDC,0.0056 uF,17.8,7.6 +Orange Drop 716P,600 VDC,0.0068 uF,17.8,8.1 +Orange Drop 716P,600 VDC,0.0082 uF,17.8,8.1 +Orange Drop 716P,600 VDC,0.01 uF,17.8,8.6 +Orange Drop 716P,600 VDC,0.012 uF,22.9,7.9 +Orange Drop 716P,600 VDC,0.015 uF,22.9,8.6 +Orange Drop 716P,600 VDC,0.018 uF,22.9,9.1 +Orange Drop 716P,600 VDC,0.022 uF,22.9,9.9 +Orange Drop 716P,600 VDC,0.027 uF,22.9,10.4 +Orange Drop 716P,600 VDC,0.033 uF,22.9,11.2 +Orange Drop 716P,600 VDC,0.039 uF,22.9,12.2 +Orange Drop 716P,600 VDC,0.047 uF,31.8,10.7 +Orange Drop 716P,600 VDC,0.056 uF,31.8,11.4 +Orange Drop 716P,600 VDC,0.068 uF,31.8,11.4 +Orange Drop 716P,600 VDC,0.082 uF,31.8,12.4 +Orange Drop 716P,600 VDC,0.1 uF,31.8,13.7 +Orange Drop 716P,600 VDC,0.12 uF,31.8,15 +Orange Drop 716P,600 VDC,0.15 uF,41.9,14 +Orange Drop 716P,600 VDC,0.18 uF,41.9,15 +Orange Drop 716P,600 VDC,0.22 uF,41.9,16.5 +Orange Drop 716P,800 VDC,0.0056 uF,31.8,6.4 +Orange Drop 716P,800 VDC,0.0068 uF,31.8,6.9 +Orange Drop 716P,800 VDC,0.0082 uF,31.8,7.4 +Orange Drop 716P,800 VDC,0.01 uF,31.8,7.4 +Orange Drop 716P,800 VDC,0.012 uF,31.8,7.9 +Orange Drop 716P,800 VDC,0.015 uF,31.8,8.6 +Orange Drop 716P,800 VDC,0.018 uF,31.8,9.4 +Orange Drop 716P,800 VDC,0.022 uF,31.8,9.7 +Orange Drop 716P,800 VDC,0.027 uF,31.8,10.7 +Orange Drop 716P,800 VDC,0.033 uF,31.8,11.7 +Orange Drop 716P,800 VDC,0.039 uF,31.8,11.7 +Orange Drop 716P,800 VDC,0.047 uF,31.8,12.7 +Orange Drop 716P,800 VDC,0.056 uF,31.8,13.7 +Orange Drop 716P,800 VDC,0.068 uF,31.8,15 +Orange Drop 716P,800 VDC,0.082 uF,41.9,13.2 +Orange Drop 716P,800 VDC,0.1 uF,41.9,14.5 +Orange Drop 716P,800 VDC,0.12 uF,41.9,15.7 +Orange Drop 716P,800 VDC,0.14 uF,41.9,17 +Orange Drop 716P,1000 VDC,0.0056 uF,31.8,6.4 +Orange Drop 716P,1000 VDC,0.0068 uF,31.8,6.9 +Orange Drop 716P,1000 VDC,0.0082 uF,31.8,7.4 +Orange Drop 716P,1000 VDC,0.01 uF,31.8,7.4 +Orange Drop 716P,1000 VDC,0.012 uF,31.8,7.9 +Orange Drop 716P,1000 VDC,0.015 uF,31.8,8.6 +Orange Drop 716P,1000 VDC,0.018 uF,31.8,9.4 +Orange Drop 716P,1000 VDC,0.022 uF,31.8,9.7 +Orange Drop 716P,1000 VDC,0.027 uF,31.8,10.7 +Orange Drop 716P,1000 VDC,0.033 uF,31.8,11.7 +Orange Drop 716P,1000 VDC,0.039 uF,31.8,11.7 +Orange Drop 716P,1000 VDC,0.047 uF,31.8,12.7 +Orange Drop 716P,1000 VDC,0.056 uF,31.8,13.7 +Orange Drop 716P,1000 VDC,0.068 uF,31.8,15 +Orange Drop 716P,1000 VDC,0.082 uF,41.9,13.2 +Orange Drop 716P,1000 VDC,0.1 uF,41.9,14.5 +Orange Drop 716P,1000 VDC,0.12 uF,41.9,15.7 +Orange Drop 716P,1000 VDC,0.14 uF,41.9,17 \ No newline at end of file diff --git a/diylc/diylc-library/src/org/diylc/components/passive/RadialFilmCapacitor.java b/diylc/diylc-library/src/org/diylc/components/passive/RadialFilmCapacitor.java index 4b351833..db52e75a 100644 --- a/diylc/diylc-library/src/org/diylc/components/passive/RadialFilmCapacitor.java +++ b/diylc/diylc-library/src/org/diylc/components/passive/RadialFilmCapacitor.java @@ -1,75 +1,97 @@ /* + * + * DIY Layout Creator (DIYLC). Copyright (c) 2009-2018 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 + * . + * + */ +package org.diylc.components.passive; - DIY Layout Creator (DIYLC). - Copyright (c) 2009-2018 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 . - -*/ -package org.diylc.components.passive; - import java.awt.Color; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.Shape; import java.awt.geom.RoundRectangle2D; +import org.diylc.components.passive.CapacitorDimensionService.CapacitorDimensions; import org.diylc.components.transform.SimpleComponentTransformer; import org.diylc.core.CreationMethod; import org.diylc.core.IDIYComponent; import org.diylc.core.annotations.ComponentDescriptor; import org.diylc.core.annotations.EditableProperty; +import org.diylc.core.measures.Capacitance; +import org.diylc.core.measures.CapacitanceUnit; import org.diylc.core.measures.Size; import org.diylc.core.measures.SizeUnit; - -@ComponentDescriptor(name = "Film Capacitor (Radial)", author = "Branislav Stojkovic", category = "Passive", - creationMethod = CreationMethod.POINT_BY_POINT, instanceNamePrefix = "C", - description = "Radial film capacitor, similar to Sprague Orange Drop", zOrder = IDIYComponent.COMPONENT, - transformer = SimpleComponentTransformer.class) -public class RadialFilmCapacitor extends AbstractFilmCapacitor { - - private static final long serialVersionUID = 1L; - - public static Color BODY_COLOR = Color.decode("#FF8000"); +import org.diylc.core.measures.VoltageUnit; + +@ComponentDescriptor(name = "Film Capacitor (Radial)", author = "Branislav Stojkovic", + category = "Passive", creationMethod = CreationMethod.POINT_BY_POINT, instanceNamePrefix = "C", + description = "Radial film capacitor, similar to Sprague Orange Drop", + zOrder = IDIYComponent.COMPONENT, transformer = SimpleComponentTransformer.class, + enableDatasheet = true, datasheetCreationStepCount = 3) +public class RadialFilmCapacitor extends AbstractFilmCapacitor { + + private static final long serialVersionUID = 1L; + + public static Color BODY_COLOR = Color.decode("#FF8000"); public static Color BORDER_COLOR = BODY_COLOR.darker(); - + public static Size PIN_SPACING = new Size(0.1d, SizeUnit.in); - private Size pinSpacing = PIN_SPACING; - - public RadialFilmCapacitor() { - super(); - this.bodyColor = BODY_COLOR; - this.borderColor = BORDER_COLOR; - } - - public void drawIcon(Graphics2D g2d, int width, int height) { - g2d.rotate(-Math.PI / 4, width / 2, height / 2); - g2d.setColor(LEAD_COLOR_ICON); - g2d.drawLine(0, height / 2, width, height / 2); - g2d.setColor(BODY_COLOR); - g2d.fillRoundRect(4, height / 2 - 3, width - 8, 6, 5, 5); - g2d.setColor(BORDER_COLOR); - g2d.drawRoundRect(4, height / 2 - 3, width - 8, 6, 5, 5); - } - - @Override - protected Shape getBodyShape() { - double radius = getWidth().convertToPixels() * 0.7; - return new RoundRectangle2D.Double(0f, 0f, getLength().convertToPixels(), getClosestOdd(getWidth() - .convertToPixels()), radius, radius); + private Size pinSpacing = PIN_SPACING; + + private AutoSize autoSize = AutoSize.OFF; + + public RadialFilmCapacitor() { + super(); + this.bodyColor = BODY_COLOR; + this.borderColor = BORDER_COLOR; + } + + public RadialFilmCapacitor(String[] parameters) { + this(); + String autoSizeValue = parameters[0]; + Double voltageValue = Double.parseDouble(parameters[1].split(" ")[0]); + Double capacitanceValue = Double.parseDouble(parameters[2].split(" ")[0]); + setValue(new Capacitance(capacitanceValue, CapacitanceUnit.uF)); + setVoltageNew(new org.diylc.core.measures.Voltage(voltageValue, VoltageUnit.V)); + + for (AutoSize size : AutoSize.values()) { + if (size.toString().equalsIgnoreCase(autoSizeValue)) { + setAutoSize(size); + } + } + } + + public void drawIcon(Graphics2D g2d, int width, int height) { + g2d.rotate(-Math.PI / 4, width / 2, height / 2); + g2d.setColor(LEAD_COLOR_ICON); + g2d.drawLine(0, height / 2, width, height / 2); + g2d.setColor(BODY_COLOR); + g2d.fillRoundRect(4, height / 2 - 3, width - 8, 6, 5, 5); + g2d.setColor(BORDER_COLOR); + g2d.drawRoundRect(4, height / 2 - 3, width - 8, 6, 5, 5); + } + + @Override + protected Shape getBodyShape() { + double lengthFinal = getLength().convertToPixels(); + double widthFinal = getWidth().convertToPixels(); + + double radius = widthFinal * 0.7; + return new RoundRectangle2D.Double(0f, 0f, lengthFinal, getClosestOdd(widthFinal), radius, + radius); } @Override @@ -87,5 +109,69 @@ public class RadialFilmCapacitor extends AbstractFilmCapacitor { public void setPinSpacing(Size pinSpacing) { this.pinSpacing = pinSpacing; - } -} + } + + @EditableProperty(name = "Auto Size") + public AutoSize getAutoSize() { + if (autoSize == null) { + autoSize = AutoSize.OFF; + } + return autoSize; + } + + public void setAutoSize(AutoSize autoSize) { + this.autoSize = autoSize; + } + + @EditableProperty + @Override + public Size getLength() { + AutoSize autoSize = getAutoSize(); + if (autoSize != null && autoSize != AutoSize.OFF && getVoltageNew() != null + && getVoltageNew().getNormalizedValue() != null && getValue() != null + && getValue().getNormalizedValue() != null) { + + CapacitorDimensions d = CapacitorDimensionService.getInstance().lookup(this.getClass(), + autoSize.toString(), getVoltageNew(), getValue()); + + if (d != null) { + return d.getLength(); + } + } + + return super.getLength(); + } + + @EditableProperty + @Override + public Size getWidth() { + AutoSize autoSize = getAutoSize(); + if (autoSize != null && autoSize != AutoSize.OFF && getVoltageNew() != null + && getVoltageNew().getNormalizedValue() != null && getValue() != null + && getValue().getNormalizedValue() != null) { + + CapacitorDimensions d = CapacitorDimensionService.getInstance().lookup(this.getClass(), + autoSize.toString(), getVoltageNew(), getValue()); + + if (d != null) { + return d.getDiameter(); + } + } + return super.getWidth(); + } + + private static enum AutoSize { + OFF("Off"), ORANGE_DROP_715P("Orange Drop 715P"), ORANGE_DROP_716P("Orange Drop 716P"); + + private String label; + + AutoSize(String label) { + this.label = label; + } + + @Override + public String toString() { + return label; + } + } +} diff --git a/diylc/diylc-library/test/org/diylc/components/passive/CapacitorDimensionServiceTests.java b/diylc/diylc-library/test/org/diylc/components/passive/CapacitorDimensionServiceTests.java new file mode 100644 index 00000000..342bd508 --- /dev/null +++ b/diylc/diylc-library/test/org/diylc/components/passive/CapacitorDimensionServiceTests.java @@ -0,0 +1,50 @@ +package org.diylc.components.passive; + +import org.diylc.components.passive.CapacitorDimensionService.CapacitorDimensions; +import org.diylc.core.measures.Capacitance; +import org.diylc.core.measures.CapacitanceUnit; +import org.diylc.core.measures.Size; +import org.diylc.core.measures.SizeUnit; +import org.diylc.core.measures.Voltage; +import org.diylc.core.measures.VoltageUnit; +import org.junit.Assert; +import org.junit.Test; + +public class CapacitorDimensionServiceTests { + + @Test + public void testMissingType() { + Assert.assertNull(CapacitorDimensionService.getInstance().lookup(AxialFilmCapacitor.class, + "bla", new Voltage(100d, VoltageUnit.V), new Capacitance(10d, CapacitanceUnit.uF))); + } + + @Test + public void testMissingCategory() { + Assert.assertNull(CapacitorDimensionService.getInstance().lookup(AxialFilmCapacitor.class, + "Mallory 150", new Voltage(500d, VoltageUnit.V), new Capacitance(10d, CapacitanceUnit.nF))); + } + + @Test + public void testMissingValue() { + Assert.assertNull(CapacitorDimensionService.getInstance().lookup(AxialFilmCapacitor.class, + "Mallory 150", new Voltage(600d, VoltageUnit.V), new Capacitance(10d, CapacitanceUnit.uF))); + } + + @Test + public void testExactValue63v() { + CapacitorDimensions dim = CapacitorDimensionService.getInstance().lookup(AxialFilmCapacitor.class, + "Mallory 150", new Voltage(63d, VoltageUnit.V), new Capacitance(0.22d, CapacitanceUnit.uF)); + Assert.assertNotNull(dim); + Assert.assertEquals(new Size(16.5, SizeUnit.mm).convertToPixels(), dim.getLength(), 0.0001); + Assert.assertEquals(new Size(6d, SizeUnit.mm).convertToPixels(), dim.getDiameter(), 0.0001); + } + + @Test + public void testCloseValue() { + CapacitorDimensions dim = CapacitorDimensionService.getInstance().lookup(AxialFilmCapacitor.class, + "Mallory 150", new Voltage(63d, VoltageUnit.V), new Capacitance(0.23d, CapacitanceUnit.uF)); + Assert.assertNotNull(dim); + Assert.assertEquals(new Size(16.5, SizeUnit.mm).convertToPixels(), dim.getLength(), 0.0001); + Assert.assertEquals(new Size(6d, SizeUnit.mm).convertToPixels(), dim.getDiameter(), 0.0001); + } +} diff --git a/diylc/diylc-swing/src/org/diylc/swing/plugins/canvas/CanvasPanel.java b/diylc/diylc-swing/src/org/diylc/swing/plugins/canvas/CanvasPanel.java index 504d3c12..168d4395 100644 --- a/diylc/diylc-swing/src/org/diylc/swing/plugins/canvas/CanvasPanel.java +++ b/diylc/diylc-swing/src/org/diylc/swing/plugins/canvas/CanvasPanel.java @@ -221,7 +221,7 @@ public class CanvasPanel extends JComponent implements Autoscroll { @Override public void actionPerformed(ActionEvent e) { - CanvasPanel.this.plugInPort.setNewComponentTypeSlot(null, null, false); + CanvasPanel.this.plugInPort.setNewComponentTypeSlot(null, null, null, false); } }); @@ -241,7 +241,7 @@ public class CanvasPanel extends JComponent implements Autoscroll { for (Map.Entry> entry : componentTypes.entrySet()) { for (ComponentType type : entry.getValue()) { if (type.getInstanceClass().getCanonicalName().equals(clazz)) { - CanvasPanel.this.plugInPort.setNewComponentTypeSlot(type, null, false); + CanvasPanel.this.plugInPort.setNewComponentTypeSlot(type, null, null, false); // hack: fake mouse movement to repaint CanvasPanel.this.plugInPort.mouseMoved(getMousePosition(), false, false, false); return; @@ -275,7 +275,7 @@ public class CanvasPanel extends JComponent implements Autoscroll { LOG.error("Could not find type: " + typeName); return; } - this.plugInPort.setNewComponentTypeSlot(type, null, false); + this.plugInPort.setNewComponentTypeSlot(type, null, null, false); } // hack: fake mouse movement to repaint diff --git a/diylc/diylc-swing/src/org/diylc/swing/plugins/toolbox/ComponentButtonFactory.java b/diylc/diylc-swing/src/org/diylc/swing/plugins/toolbox/ComponentButtonFactory.java index a06e2989..e7806b8a 100644 --- a/diylc/diylc-swing/src/org/diylc/swing/plugins/toolbox/ComponentButtonFactory.java +++ b/diylc/diylc-swing/src/org/diylc/swing/plugins/toolbox/ComponentButtonFactory.java @@ -17,6 +17,7 @@ */ package org.diylc.swing.plugins.toolbox; +import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.FlowLayout; @@ -28,11 +29,15 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.ArrayList; import java.util.List; +import java.util.Optional; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Collectors; +import java.util.stream.Stream; import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JLabel; +import javax.swing.JMenu; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPopupMenu; @@ -40,6 +45,8 @@ import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import javax.swing.border.Border; import javax.swing.border.EmptyBorder; +import javax.swing.event.MenuEvent; +import javax.swing.event.MenuListener; import org.apache.log4j.Logger; import org.diylc.appframework.miscutils.Utils; import org.diylc.common.ComponentType; @@ -57,24 +64,25 @@ import org.diylc.swingframework.openide.DropDownButtonFactory; * @author Branislav Stojkovic */ public class ComponentButtonFactory { - + private static final Logger LOG = Logger.getLogger(ComponentButtonFactory.class); public static int MARGIN = 3; - public static JButton create(final IPlugInPort plugInPort, final ComponentType componentType, final JPopupMenu menu) { + public static JButton create(final IPlugInPort plugInPort, final ComponentType componentType, + final JPopupMenu menu) { JButton button = DropDownButtonFactory.createDropDownButton(componentType.getIcon(), menu); button.setBorder(BorderFactory.createEmptyBorder(MARGIN + 1, MARGIN + 1, MARGIN, MARGIN)); - button.setToolTipText("" + componentType.getName() + "
" + componentType.getDescription() - + "
Author: " + componentType.getAuthor() + "

Right click to select all components of this type" - + ""); + button.setToolTipText("" + componentType.getName() + "
" + + componentType.getDescription() + "
Author: " + componentType.getAuthor() + + "

Right click to select all components of this type" + ""); button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - plugInPort.setNewComponentTypeSlot(componentType, null, false); + plugInPort.setNewComponentTypeSlot(componentType, null, null, false); } }); @@ -95,7 +103,7 @@ public class ComponentButtonFactory { newSelection.addAll(plugInPort.getSelectedComponents()); } plugInPort.updateSelection(newSelection); - plugInPort.setNewComponentTypeSlot(null, null, false); + plugInPort.setNewComponentTypeSlot(null, null, null, false); plugInPort.refresh(); } } @@ -105,26 +113,27 @@ public class ComponentButtonFactory { @Override public void keyPressed(KeyEvent e) { - plugInPort.keyPressed(e.getKeyCode(), Utils.isMac() ? e.isControlDown() : e.isMetaDown(), e.isShiftDown(), e.isAltDown()); + plugInPort.keyPressed(e.getKeyCode(), Utils.isMac() ? e.isControlDown() : e.isMetaDown(), + e.isShiftDown(), e.isAltDown()); } }); return button; } - + private static final Pattern contributedPattern = Pattern.compile("^(.*)\\[(.*)\\]"); public static JMenuItem createVariantItem(final IPlugInPort plugInPort, final Template variant, final ComponentType componentType) { - + String display = variant.getName(); - + Matcher match = contributedPattern.matcher(display); if (match.find()) { String name = match.group(1); String owner = match.group(2); - display = "" + name + "[" + owner + "]"; + display = "" + name + "[" + owner + "]"; } - + final JMenuItem item = new JMenuItem(display) { private static final long serialVersionUID = 1L; @@ -139,14 +148,17 @@ public class ComponentButtonFactory { @Override public void actionPerformed(ActionEvent e) { - plugInPort.setNewComponentTypeSlot(componentType, variant, false); + plugInPort.setNewComponentTypeSlot(componentType, variant, null, false); } }); - + String defaultVariant = plugInPort.getDefaultVariant(componentType); - JLabel label = new JLabel(variant.getName().equals(defaultVariant) ? IconLoader.PinGreen.getIcon() : IconLoader.PinGrey.getIcon()); - label.setToolTipText(variant.getName().equals(defaultVariant) ? "Remove default variant" : "Set default variant"); + JLabel label = + new JLabel(variant.getName().equals(defaultVariant) ? IconLoader.PinGreen.getIcon() + : IconLoader.PinGrey.getIcon()); + label.setToolTipText(variant.getName().equals(defaultVariant) ? "Remove default variant" + : "Set default variant"); label.addMouseListener(new MouseAdapter() { @Override @@ -178,9 +190,9 @@ public class ComponentButtonFactory { JPopupMenu m = (JPopupMenu) c; m.setVisible(false); } - int result = - JOptionPane.showConfirmDialog(SwingUtilities.getRoot(item), "Are you sure you want to delete variant \"" - + variant.getName() + "\"", "Delete", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); + int result = JOptionPane.showConfirmDialog(SwingUtilities.getRoot(item), + "Are you sure you want to delete variant \"" + variant.getName() + "\"", "Delete", + JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); if (result != JOptionPane.YES_OPTION) { return; } @@ -194,10 +206,87 @@ public class ComponentButtonFactory { item.add(label); return item; } - - public static JButton createBuildingBlockButton(final IPlugInPort plugInPort, final String blockName, final JPopupMenu menu) { - JButton button = DropDownButtonFactory.createDropDownButton(blockName, IconLoader.ComponentLarge.getIcon(), menu); - + + public static List createDatasheetItems(final IPlugInPort plugInPort, + final ComponentType componentType, List path) { + int depth = path.size(); + List datasheet = componentType.getDatasheet(); + if (datasheet == null) { + return null; + } + Stream stream = datasheet.stream(); + for (int i = 0; i < depth; i++) { + final int finalI = i; + stream = stream.filter(line -> line[finalI].equals(path.get(finalI))); + } + List filteredDatasheet = stream.collect(Collectors.toList()); + + return filteredDatasheet.stream().map(x -> x[depth]).distinct().map(value -> { + + if (depth < componentType.getDatasheetCreationStepCount() - 1) { + final JMenu submenu = new JMenu(value) { + + private static final long serialVersionUID = 1L; + + // Customize item size to fit the delete button + public java.awt.Dimension getPreferredSize() { + Dimension d = super.getPreferredSize(); + return new Dimension(d.width + 32, d.height); + } + }; + + submenu.add(new JMenuItem("Loading...")); + + submenu.addMenuListener(new MenuListener() { + + @Override + public void menuSelected(MenuEvent e) { + submenu.removeAll(); + List newPath = new ArrayList(path); + newPath.add(value); + List childItems = createDatasheetItems(plugInPort, componentType, newPath); + for (Component childItem : childItems) { + submenu.add(childItem); + } + } + + @Override + public void menuDeselected(MenuEvent e) {} + + @Override + public void menuCanceled(MenuEvent e) {} + }); + + return (Component) submenu; + } + + JMenuItem item = new JMenuItem(value); + + item.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + Optional findFirst = + filteredDatasheet.stream().filter(line -> line[depth] == value).findFirst(); + + if (findFirst.isPresent()) { + plugInPort.setNewComponentTypeSlot(componentType, null, findFirst.get(), + false); + } else { + LOG.error("Could not find datasheet item for: " + value); + } + } + }); + + return (Component) item; + }).collect(Collectors.toList()); + } + + public static JButton createBuildingBlockButton(final IPlugInPort plugInPort, + final String blockName, final JPopupMenu menu) { + JButton button = DropDownButtonFactory.createDropDownButton(blockName, + IconLoader.ComponentLarge.getIcon(), menu); + button.setVerticalTextPosition(SwingConstants.CENTER); button.setHorizontalTextPosition(SwingConstants.LEFT); @@ -214,13 +303,14 @@ public class ComponentButtonFactory { LOG.error("Error loading building block", e1); } } - }); + }); button.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { - plugInPort.keyPressed(e.getKeyCode(), Utils.isMac() ? e.isControlDown() : e.isMetaDown(), e.isShiftDown(), e.isAltDown()); + plugInPort.keyPressed(e.getKeyCode(), Utils.isMac() ? e.isControlDown() : e.isMetaDown(), + e.isShiftDown(), e.isAltDown()); } }); return button; diff --git a/diylc/diylc-swing/src/org/diylc/swing/plugins/toolbox/ComponentTabbedPane.java b/diylc/diylc-swing/src/org/diylc/swing/plugins/toolbox/ComponentTabbedPane.java index 0faab4ab..4893b387 100644 --- a/diylc/diylc-swing/src/org/diylc/swing/plugins/toolbox/ComponentTabbedPane.java +++ b/diylc/diylc-swing/src/org/diylc/swing/plugins/toolbox/ComponentTabbedPane.java @@ -115,7 +115,7 @@ class ComponentTabbedPane extends JTabbedPane { @Override public void stateChanged(ChangeEvent e) { ConfigurationManager.getInstance().writeValue(LAST_SELECTED_TAB, getSelectedIndex()); - ComponentTabbedPane.this.plugInPort.setNewComponentTypeSlot(null, null, false); + ComponentTabbedPane.this.plugInPort.setNewComponentTypeSlot(null, null, null, false); // Refresh recent components if needed if (pendingRecentComponents != null) { refreshRecentComponentsToolbar(pendingRecentComponents); diff --git a/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/CustomTreeModel.java b/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/CustomTreeModel.java index ae626647..7499d664 100644 --- a/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/CustomTreeModel.java +++ b/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/CustomTreeModel.java @@ -124,7 +124,7 @@ public class CustomTreeModel implements TreeModel { @Override public void mouseClicked(MouseEvent e) { - plugInPort.setNewComponentTypeSlot(type, null, false); + plugInPort.setNewComponentTypeSlot(type, null, null, false); } })); } @@ -161,7 +161,7 @@ public class CustomTreeModel implements TreeModel { @Override public void mouseClicked(MouseEvent e) { - plugInPort.setNewComponentTypeSlot(type, null, false); + plugInPort.setNewComponentTypeSlot(type, null, null, false); } })); } @@ -202,7 +202,7 @@ public class CustomTreeModel implements TreeModel { @Override public void mouseClicked(MouseEvent e) { - plugInPort.setNewComponentTypeSlot(type, null, false); + plugInPort.setNewComponentTypeSlot(type, null, null, false); } })); this.visibleLeaves.put(category, visibleTypes); diff --git a/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreeGestureListener.java b/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreeGestureListener.java index 417e135c..f3f10874 100644 --- a/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreeGestureListener.java +++ b/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreeGestureListener.java @@ -67,7 +67,7 @@ class TreeGestureListener implements DragGestureListener { } } else { - presenter.setNewComponentTypeSlot(type, null, true); + presenter.setNewComponentTypeSlot(type, null, null, true); start = true; } diff --git a/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreePanel.java b/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreePanel.java index 4d3a4794..a57907e8 100644 --- a/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreePanel.java +++ b/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreePanel.java @@ -351,9 +351,18 @@ public class TreePanel extends JPanel { } if (componentType != null) { - popup.add(new SelectAllAction(plugInPort, componentType)); + popup.add(new SelectAllAction(plugInPort, componentType)); + popup.add(shortcutSubmenu); popup.add(new JSeparator()); + + if (componentType.getDatasheet() != null) { + List items = ComponentButtonFactory.createDatasheetItems(plugInPort, componentType, new ArrayList()); + for (Component item : items) { + popup.add(item); + } + popup.add(new JSeparator()); + } List