mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-13 02:32:09 +10:00
IC improvements
This commit is contained in:
@@ -129,6 +129,14 @@ public @interface ComponentDescriptor {
|
||||
*/
|
||||
int datasheetCreationStepCount() default 0;
|
||||
|
||||
/**
|
||||
* If datasheet is enabled, the column that names the part a row describes. It is what the AI
|
||||
* refers to a model by, while the columns before it only group rows in the toolbox.
|
||||
*
|
||||
* @return index of the model name column
|
||||
*/
|
||||
int datasheetModelColumn() default 0;
|
||||
|
||||
/**
|
||||
* @return true if the component type should not be listed in the palette (toolbox and
|
||||
* component tree), while still being resolvable via
|
||||
|
||||
+5
-2
@@ -52,6 +52,7 @@ import org.diylc.plugins.chatbot.model.AiCatalogIndexEntry;
|
||||
import org.diylc.plugins.chatbot.model.pinout.AiPinout;
|
||||
import org.diylc.presenter.ComparatorFactory;
|
||||
import org.diylc.presenter.ComponentProcessor;
|
||||
import org.diylc.presenter.DatasheetService;
|
||||
import org.diylc.presenter.ReleaseHistory;
|
||||
|
||||
/**
|
||||
@@ -175,11 +176,13 @@ public class ComponentCatalogGenerator {
|
||||
comp.put("notes", notes);
|
||||
}
|
||||
|
||||
// a datasheet lists one row per part, so the model names are its distinct first column
|
||||
// a datasheet lists one row per part, so the model names are the distinct values of its model
|
||||
// column
|
||||
List<String[]> datasheet = ct.getDatasheet();
|
||||
if (datasheet != null) {
|
||||
int column = DatasheetService.getInstance().getModelColumn(ct.getInstanceClass());
|
||||
List<String> models = datasheet.stream()
|
||||
.map(row -> row[0].trim())
|
||||
.map(row -> row[column].trim())
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
comp.put("datasheetModels", models);
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.apache.log4j.Logger;
|
||||
import org.diylc.common.PropertyWrapper;
|
||||
import org.diylc.core.IDIYComponent;
|
||||
import org.diylc.core.IDatasheetSupport;
|
||||
import org.diylc.core.annotations.ComponentDescriptor;
|
||||
import org.diylc.core.measures.AbstractMeasure;
|
||||
import org.diylc.core.measures.Unit;
|
||||
|
||||
@@ -128,6 +129,16 @@ public class DatasheetService {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param clazz
|
||||
* @return the datasheet column that names the model a row describes, see
|
||||
* {@link ComponentDescriptor#datasheetModelColumn()}.
|
||||
*/
|
||||
public int getModelColumn(Class<?> clazz) {
|
||||
ComponentDescriptor descriptor = clazz.getAnnotation(ComponentDescriptor.class);
|
||||
return descriptor == null ? 0 : descriptor.datasheetModelColumn();
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the rows of a datasheet series by its name, ignoring case. When no series has exactly
|
||||
* that name, every series whose name contains it is returned instead.
|
||||
@@ -141,14 +152,16 @@ public class DatasheetService {
|
||||
if (datasheet == null || series == null || series.isBlank()) {
|
||||
return new ArrayList<String[]>();
|
||||
}
|
||||
int column = getModelColumn(clazz);
|
||||
String name = series.trim();
|
||||
List<String[]> rows = datasheet.stream()
|
||||
.filter(row -> row.length > 0 && row[0].trim().equalsIgnoreCase(name))
|
||||
.filter(row -> row.length > column && row[column].trim().equalsIgnoreCase(name))
|
||||
.collect(Collectors.toList());
|
||||
if (rows.isEmpty()) {
|
||||
String lowerName = name.toLowerCase();
|
||||
rows = datasheet.stream()
|
||||
.filter(row -> row.length > 0 && row[0].trim().toLowerCase().contains(lowerName))
|
||||
.filter(row -> row.length > column
|
||||
&& row[column].trim().toLowerCase().contains(lowerName))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
return rows;
|
||||
@@ -170,7 +183,7 @@ public class DatasheetService {
|
||||
return null;
|
||||
}
|
||||
Object value = component.getValue();
|
||||
if (value == null) {
|
||||
if (value == null || (value instanceof String text && text.isBlank())) {
|
||||
// nothing to preserve, but nothing to choose by either
|
||||
return rows.size() == 1 ? rows.get(0) : null;
|
||||
}
|
||||
|
||||
@@ -594,8 +594,8 @@
|
||||
<awt-color hex="595959"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Display Pin #s</string>
|
||||
<diylc.semiconductors.DIL__IC_-DisplayNumbers>NO</diylc.semiconductors.DIL__IC_-DisplayNumbers>
|
||||
<string>Pin Labels</string>
|
||||
<diylc.semiconductors.DIL__IC_-DisplayNumbers>NAMES</diylc.semiconductors.DIL__IC_-DisplayNumbers>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Pin Spacing</string>
|
||||
@@ -655,8 +655,8 @@
|
||||
<awt-color hex="595959"/>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Display Pin #s</string>
|
||||
<diylc.semiconductors.DIL__IC_-DisplayNumbers>NO</diylc.semiconductors.DIL__IC_-DisplayNumbers>
|
||||
<string>Pin Labels</string>
|
||||
<diylc.semiconductors.DIL__IC_-DisplayNumbers>NAMES</diylc.semiconductors.DIL__IC_-DisplayNumbers>
|
||||
</entry>
|
||||
<entry>
|
||||
<string>Pin Spacing</string>
|
||||
|
||||
@@ -505,10 +505,38 @@
|
||||
<releaseDate>2026-10-30 00:00:00.000 CET</releaseDate>
|
||||
<name></name>
|
||||
<changes>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>NEW_FEATURE</changeType>
|
||||
<description>Added 'Pin Names' property to 'DIP IC', 'SIP IC' and 'Multiwatt IC' to name each pin, e.g. 1OUT, 1IN-, VCC+; the names are drawn on the component and used in node tooltips, netlists and AI analysis</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>NEW_FEATURE</changeType>
|
||||
<description>Added 'Pin Labels' property to 'SIP IC' and 'Multiwatt IC' to show pin names or pin numbers next to the pins</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>Re-modeled factory variants of Resistor component type as datasheet in order to make them available to the AI; this will produce more accurate AI-driven edits</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>NEW_FEATURE</changeType>
|
||||
<description>Added datasheets to 'DIP IC', 'SIP IC' and 'Multiwatt IC' - pick a part by its number from the component's submenu to set its pin count, spacing and pin names at once; the AI Assistant can place these parts by part number too</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>BUG_FIX</changeType>
|
||||
<description>'DIP IC' with 'Display Pin #s' set to 'No' numbered its pins in the wrong order in netlists and AI analysis, e.g. pin 8 of an 8-pin IC was reported as pin 5</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>BUG_FIX</changeType>
|
||||
<description>'Multiwatt IC' numbered its pins row by row instead of alternating between the two rows as on the real package</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>BUG_FIX</changeType>
|
||||
<description>'Multiwatt IC' in the Multiwatt 11 package had its leads 1.27mm apart instead of 1.7mm; existing Multiwatt 11 parts change shape when the project is opened</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>BUG_FIX</changeType>
|
||||
<description>'SIP IC' body was drawn too short when 'Pin Spacing' is not a multiple of 0.1 inch, leaving the last pin outside the body</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
</changes>
|
||||
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
||||
</org.diylc.appframework.update.Version>
|
||||
|
||||
Reference in New Issue
Block a user