From f8b88755e4e05ddd3d21c8cbb57a55f6dc77f9aa Mon Sep 17 00:00:00 2001 From: bancika Date: Sun, 19 Apr 2020 20:08:01 +0200 Subject: [PATCH] Added mirrored pin display options for "DIL IC" --- .../src/org/diylc/presenter/update.xml | 8 ++++++-- .../components/semiconductors/DIL_IC.java | 20 ++++++++++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/diylc/diylc-core/src/org/diylc/presenter/update.xml b/diylc/diylc-core/src/org/diylc/presenter/update.xml index bea4113a..6cd7cccc 100644 --- a/diylc/diylc-core/src/org/diylc/presenter/update.xml +++ b/diylc/diylc-core/src/org/diylc/presenter/update.xml @@ -3000,7 +3000,7 @@ NEW_FEATURE - "Add Flexible Leads" action added in the context menu that replaces straight leads of leaded components with flexible leads and adds leds to some components that do not have them (e.g. Transistors, Tube Sockets, Potentiometers, etc) + "Add Flexible Leads" action added in the context menu that replaces straight leads of leaded components with flexible leads and adds leads to some components that do not have them (e.g. Transistors, Tube Sockets, Potentiometers, etc) NEW_FEATURE @@ -3013,7 +3013,11 @@ NEW_FEATURE Added support for automated regression testing of core functionalities which should reduce regression bugs in the long run - + + + NEW_FEATURE + Added mirrored pin display options for "DIL IC" + IMPROVEMENT Standardize how folded transistors are displayed - updated TO-92 and TO-1 packages diff --git a/diylc/diylc-library/src/org/diylc/components/semiconductors/DIL_IC.java b/diylc/diylc-library/src/org/diylc/components/semiconductors/DIL_IC.java index 621834af..462233e7 100644 --- a/diylc/diylc-library/src/org/diylc/components/semiconductors/DIL_IC.java +++ b/diylc/diylc-library/src/org/diylc/components/semiconductors/DIL_IC.java @@ -454,8 +454,7 @@ public class DIL_IC extends AbstractTransparentComponent { } else { g2d.drawString(Integer.toString(pinNo), textX2, textY2); } - } - if (displayNumbers == DisplayNumbers.CONNECTOR) { + } else if (displayNumbers == DisplayNumbers.CONNECTOR) { if (pinNo > pinCount.getValue() / 2) { k++; g2d.drawString(Integer.toString(pinNo - (pinCount.getValue() / 2) + k), textX1, textY1); @@ -463,6 +462,21 @@ public class DIL_IC extends AbstractTransparentComponent { g2d.drawString(Integer.toString(pinNo + j), textX2, textY2); j++; } + } else if (displayNumbers == DisplayNumbers.DIP_MIRROR) { + if (pinNo > pinCount.getValue() / 2) { + g2d.drawString(Integer.toString(pinCount.getValue() - pinCount.getValue() + j + 1), textX1, textY1); + j++; + } else { + g2d.drawString(Integer.toString(pinCount.getValue() - pinNo + 1), textX2, textY2); + } + } else if (displayNumbers == DisplayNumbers.CONNECTOR_MIRROR) { + if (pinNo > pinCount.getValue() / 2) { + k++; + g2d.drawString(Integer.toString(pinNo - (pinCount.getValue() / 2) + k - 1), textX1, textY1); + } else { + g2d.drawString(Integer.toString(pinNo + j + 1), textX2, textY2); + j++; + } } } } @@ -582,7 +596,7 @@ public class DIL_IC extends AbstractTransparentComponent { public enum DisplayNumbers { - NO("No"), DIP("DIP"), CONNECTOR("Connector"); + NO("No"), DIP("DIP"), CONNECTOR("Connector"), DIP_MIRROR("DIP (Mirrored)"), CONNECTOR_MIRROR("Connector (Mirrored)"); private String label;