From fa85d46af0b91477cf354947df628af0dc0d2800 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 28 Mar 2019 16:38:50 +0100 Subject: ee.xsd: o Renaming to . o Adding on , removing from . A part can have exactly one part. create-order: o Creating anonymous part objects, with two references, one schematic reference and one part-uri reference to the selected part. o Redoing how the order is calculated with the new ObjDb structure. ee.part.Part: o Absorbing bom_file_utils into Part. Much better wrapper object around the xml goop. --- demo/thirdparty/olinuxino/ee/reports/order.rst | 832 ++++++ demo/thirdparty/olinuxino/py/olinuxino.py | 35 +- demo/thirdparty/unlockoslo-alpha-3/.gitignore | 2 + .../unlockoslo-alpha-3/ee/digikey/downloaded.xml | 2821 ++++++++++++++++++++ .../unlockoslo-alpha-3/ee/digikey/normalized.xml | 1131 ++++++++ .../unlockoslo-alpha-3/ee/digikey/search-list.xml | 214 ++ demo/thirdparty/unlockoslo-alpha-3/ee/order.xml | 620 +++++ .../unlockoslo-alpha-3/ee/reports/order.rst | 1012 +++++++ demo/thirdparty/unlockoslo-alpha-3/ee/sch.xml | 771 ++++++ src/ee/db.py | 117 +- src/ee/digikey/search_parts.py | 60 +- src/ee/kicad/make_bom.py | 45 +- src/ee/order/__init__.py | 115 +- src/ee/order/templates/order.rst.j2 | 28 +- src/ee/part/__init__.py | 159 +- src/ee/part/create_distributor_search_list.py | 15 +- src/ee/project/__init__.py | 17 + src/ee/project/report.py | 16 +- src/ee/supplier/seeed.py | 22 +- src/ee/xml/bom_file_utils.py | 49 - src/ee/xml/types.py | 144 +- test/test_db.py | 82 + xsd/ee.xsd | 8 +- 23 files changed, 7996 insertions(+), 319 deletions(-) create mode 100644 demo/thirdparty/unlockoslo-alpha-3/.gitignore create mode 100644 demo/thirdparty/unlockoslo-alpha-3/ee/digikey/downloaded.xml create mode 100644 demo/thirdparty/unlockoslo-alpha-3/ee/digikey/normalized.xml create mode 100644 demo/thirdparty/unlockoslo-alpha-3/ee/digikey/search-list.xml create mode 100644 demo/thirdparty/unlockoslo-alpha-3/ee/order.xml create mode 100644 demo/thirdparty/unlockoslo-alpha-3/ee/reports/order.rst create mode 100644 demo/thirdparty/unlockoslo-alpha-3/ee/sch.xml delete mode 100644 src/ee/xml/bom_file_utils.py create mode 100644 test/test_db.py diff --git a/demo/thirdparty/olinuxino/ee/reports/order.rst b/demo/thirdparty/olinuxino/ee/reports/order.rst index d0f21a3..bdf7e6d 100644 --- a/demo/thirdparty/olinuxino/ee/reports/order.rst +++ b/demo/thirdparty/olinuxino/ee/reports/order.rst @@ -6,2081 +6,2913 @@ Has unresolved parts: yes. Parts for Order =============== +.. _ref-ANT1: + ANT1 ---- Part not resolved. +.. _ref-C1: + C1 -- Part not resolved. +.. _ref-C2: + C2 -- Part not resolved. +.. _ref-C3: + C3 -- Part not resolved. +.. _ref-C4: + C4 -- Part not resolved. +.. _ref-C5: + C5 -- Part not resolved. +.. _ref-C6: + C6 -- Part not resolved. +.. _ref-C7: + C7 -- Part not resolved. +.. _ref-C8: + C8 -- Part not resolved. +.. _ref-C9: + C9 -- Part not resolved. +.. _ref-C10: + C10 --- Part not resolved. +.. _ref-C11: + C11 --- Part not resolved. +.. _ref-C12: + C12 --- Part not resolved. +.. _ref-C13: + C13 --- Part not resolved. +.. _ref-C14: + C14 --- Part not resolved. +.. _ref-C15: + C15 --- Part not resolved. +.. _ref-C16: + C16 --- Part not resolved. +.. _ref-C17: + C17 --- Part not resolved. +.. _ref-C18: + C18 --- Part not resolved. +.. _ref-C19: + C19 --- Part not resolved. +.. _ref-C20: + C20 --- Part not resolved. +.. _ref-C21: + C21 --- Part not resolved. +.. _ref-C22: + C22 --- Part not resolved. +.. _ref-C23: + C23 --- Part not resolved. +.. _ref-C24: + C24 --- Part not resolved. +.. _ref-C25: + C25 --- Part not resolved. +.. _ref-C26: + C26 --- Part not resolved. +.. _ref-C27: + C27 --- Part not resolved. +.. _ref-C28: + C28 --- Part not resolved. +.. _ref-C29: + C29 --- Part not resolved. +.. _ref-C30: + C30 --- Part not resolved. +.. _ref-C31: + C31 --- Part not resolved. +.. _ref-C32: + C32 --- Part not resolved. +.. _ref-C33: + C33 --- Part not resolved. +.. _ref-C34: + C34 --- Part not resolved. +.. _ref-C35: + C35 --- Part not resolved. +.. _ref-C36: + C36 --- Part not resolved. +.. _ref-C37: + C37 --- Part not resolved. +.. _ref-C38: + C38 --- Part not resolved. +.. _ref-C39: + C39 --- Part not resolved. +.. _ref-C40: + C40 --- Part not resolved. +.. _ref-C41: + C41 --- Part not resolved. +.. _ref-C42: + C42 --- Part not resolved. +.. _ref-C43: + C43 --- Part not resolved. +.. _ref-C44: + C44 --- Part not resolved. +.. _ref-C45: + C45 --- Part not resolved. +.. _ref-C46: + C46 --- Part not resolved. +.. _ref-C47: + C47 --- Part not resolved. +.. _ref-C48: + C48 --- Part not resolved. +.. _ref-C49: + C49 --- Part not resolved. +.. _ref-C50: + C50 --- Part not resolved. +.. _ref-C51: + C51 --- Part not resolved. +.. _ref-C52: + C52 --- Part not resolved. +.. _ref-C53: + C53 --- Part not resolved. +.. _ref-C54: + C54 --- Part not resolved. +.. _ref-C55: + C55 --- Part not resolved. +.. _ref-C56: + C56 --- Part not resolved. +.. _ref-C57: + C57 --- Part not resolved. +.. _ref-C58: + C58 --- Part not resolved. +.. _ref-C59: + C59 --- Part not resolved. +.. _ref-C60: + C60 --- Part not resolved. +.. _ref-C61: + C61 --- Part not resolved. +.. _ref-C62: + C62 --- Part not resolved. +.. _ref-C63: + C63 --- Part not resolved. +.. _ref-C64: + C64 --- Part not resolved. +.. _ref-C65: + C65 --- Part not resolved. +.. _ref-C66: + C66 --- Part not resolved. +.. _ref-C67: + C67 --- Part not resolved. +.. _ref-C68: + C68 --- Part not resolved. +.. _ref-C69: + C69 --- Part not resolved. +.. _ref-C70: + C70 --- Part not resolved. +.. _ref-C71: + C71 --- Part not resolved. +.. _ref-C72: + C72 --- Part not resolved. +.. _ref-C73: + C73 --- Part not resolved. +.. _ref-C74: + C74 --- Part not resolved. +.. _ref-C75: + C75 --- Part not resolved. +.. _ref-C76: + C76 --- Part not resolved. +.. _ref-C77: + C77 --- Part not resolved. +.. _ref-C78: + C78 --- Part not resolved. +.. _ref-C79: + C79 --- Part not resolved. +.. _ref-C80: + C80 --- Part not resolved. +.. _ref-C81: + C81 --- Part not resolved. +.. _ref-C82: + C82 --- Part not resolved. +.. _ref-C83: + C83 --- Part not resolved. +.. _ref-C84: + C84 --- Part not resolved. +.. _ref-C85: + C85 --- Part not resolved. +.. _ref-C86: + C86 --- Part not resolved. +.. _ref-C87: + C87 --- Part not resolved. +.. _ref-C89: + C89 --- Part not resolved. +.. _ref-C90: + C90 --- Part not resolved. +.. _ref-C91: + C91 --- Part not resolved. +.. _ref-C92: + C92 --- Part not resolved. +.. _ref-C105: + C105 ---- Part not resolved. +.. _ref-C106: + C106 ---- Part not resolved. +.. _ref-C107: + C107 ---- Part not resolved. +.. _ref-C109: + C109 ---- Part not resolved. +.. _ref-C110: + C110 ---- Part not resolved. +.. _ref-C115: + C115 ---- Part not resolved. +.. _ref-C116: + C116 ---- Part not resolved. +.. _ref-C117: + C117 ---- Part not resolved. +.. _ref-C118: + C118 ---- Part not resolved. +.. _ref-C119: + C119 ---- Part not resolved. +.. _ref-C120: + C120 ---- Part not resolved. +.. _ref-C121: + C121 ---- Part not resolved. +.. _ref-C122: + C122 ---- Part not resolved. +.. _ref-C123: + C123 ---- Part not resolved. +.. _ref-C124: + C124 ---- Part not resolved. +.. _ref-C125: + C125 ---- Part not resolved. +.. _ref-C126: + C126 ---- Part not resolved. +.. _ref-C127: + C127 ---- Part not resolved. +.. _ref-C128: + C128 ---- Part not resolved. +.. _ref-C129: + C129 ---- Part not resolved. +.. _ref-C130: + C130 ---- Part not resolved. +.. _ref-C131: + C131 ---- Part not resolved. +.. _ref-C132: + C132 ---- Part not resolved. +.. _ref-C133: + C133 ---- Part not resolved. +.. _ref-C134: + C134 ---- Part not resolved. +.. _ref-C135: + C135 ---- Part not resolved. +.. _ref-C136: + C136 ---- Part not resolved. +.. _ref-C137: + C137 ---- Part not resolved. +.. _ref-C138: + C138 ---- Part not resolved. +.. _ref-C139: + C139 ---- Part not resolved. +.. _ref-C140: + C140 ---- Part not resolved. +.. _ref-C141: + C141 ---- Part not resolved. +.. _ref-C142: + C142 ---- Part not resolved. +.. _ref-C143: + C143 ---- Part not resolved. +.. _ref-C144: + C144 ---- Part not resolved. +.. _ref-C145: + C145 ---- Part not resolved. +.. _ref-C146: + C146 ---- Part not resolved. +.. _ref-C147: + C147 ---- Part not resolved. +.. _ref-C148: + C148 ---- Part not resolved. +.. _ref-C149: + C149 ---- Part not resolved. +.. _ref-C150: + C150 ---- Part not resolved. +.. _ref-C151: + C151 ---- Part not resolved. +.. _ref-C152: + C152 ---- Part not resolved. +.. _ref-C153: + C153 ---- Part not resolved. +.. _ref-C154: + C154 ---- Part not resolved. +.. _ref-C155: + C155 ---- Part not resolved. +.. _ref-C156: + C156 ---- Part not resolved. +.. _ref-C157: + C157 ---- Part not resolved. +.. _ref-C158: + C158 ---- Part not resolved. +.. _ref-C159: + C159 ---- Part not resolved. +.. _ref-C160: + C160 ---- Part not resolved. +.. _ref-C161: + C161 ---- Part not resolved. +.. _ref-C162: + C162 ---- Part not resolved. +.. _ref-C163: + C163 ---- Part not resolved. +.. _ref-C164: + C164 ---- Part not resolved. +.. _ref-C165: + C165 ---- Part not resolved. +.. _ref-C166: + C166 ---- Part not resolved. +.. _ref-C167: + C167 ---- Part not resolved. +.. _ref-C168: + C168 ---- Part not resolved. +.. _ref-C169: + C169 ---- Part not resolved. +.. _ref-C170: + C170 ---- Part not resolved. +.. _ref-C171: + C171 ---- Part not resolved. +.. _ref-C172: + C172 ---- Part not resolved. +.. _ref-C173: + C173 ---- Part not resolved. +.. _ref-C174: + C174 ---- Part not resolved. +.. _ref-C175: + C175 ---- Part not resolved. +.. _ref-C176: + C176 ---- Part not resolved. +.. _ref-C177: + C177 ---- Part not resolved. +.. _ref-C178: + C178 ---- Part not resolved. +.. _ref-C179: + C179 ---- Part not resolved. +.. _ref-C180: + C180 ---- Part not resolved. +.. _ref-C181: + C181 ---- Part not resolved. +.. _ref-C182: + C182 ---- Part not resolved. +.. _ref-C183: + C183 ---- Part not resolved. +.. _ref-C184: + C184 ---- Part not resolved. +.. _ref-C185: + C185 ---- Part not resolved. +.. _ref-C186: + C186 ---- Part not resolved. +.. _ref-C187: + C187 ---- Part not resolved. +.. _ref-C188: + C188 ---- Part not resolved. +.. _ref-C189: + C189 ---- Part not resolved. +.. _ref-C190: + C190 ---- Part not resolved. +.. _ref-C191: + C191 ---- Part not resolved. +.. _ref-C192: + C192 ---- Part not resolved. +.. _ref-C193: + C193 ---- Part not resolved. +.. _ref-C194: + C194 ---- Part not resolved. +.. _ref-C195: + C195 ---- Part not resolved. +.. _ref-C196: + C196 ---- Part not resolved. +.. _ref-C197: + C197 ---- Part not resolved. +.. _ref-C198: + C198 ---- Part not resolved. +.. _ref-C199: + C199 ---- Part not resolved. +.. _ref-C200: + C200 ---- Part not resolved. +.. _ref-C201: + C201 ---- Part not resolved. +.. _ref-C202: + C202 ---- Part not resolved. +.. _ref-C203: + C203 ---- Part not resolved. +.. _ref-C204: + C204 ---- Part not resolved. +.. _ref-C205: + C205 ---- Part not resolved. +.. _ref-C206: + C206 ---- Part not resolved. +.. _ref-C207: + C207 ---- Part not resolved. +.. _ref-C208: + C208 ---- Part not resolved. +.. _ref-C209: + C209 ---- Part not resolved. +.. _ref-C210: + C210 ---- Part not resolved. +.. _ref-C211: + C211 ---- Part not resolved. +.. _ref-C212: + C212 ---- Part not resolved. +.. _ref-C213: + C213 ---- Part not resolved. +.. _ref-C214: + C214 ---- Part not resolved. +.. _ref-C215: + C215 ---- Part not resolved. +.. _ref-C216: + C216 ---- Part not resolved. +.. _ref-C217: + C217 ---- Part not resolved. +.. _ref-C218: + C218 ---- Part not resolved. +.. _ref-C219: + C219 ---- Part not resolved. +.. _ref-CHGLED1: + CHGLED1 ------- Part not resolved. +.. _ref-D1: + D1 -- Part not resolved. +.. _ref-D2: + D2 -- Part not resolved. +.. _ref-D3: + D3 -- Part not resolved. +.. _ref-D4: + D4 -- Part not resolved. +.. _ref-D5: + D5 -- Part not resolved. +.. _ref-DBG_UART1: + DBG_UART1 --------- Part not resolved. +.. _ref-DDR-VCC1: + DDR-VCC1 -------- Part not resolved. +.. _ref-FET1: + FET1 ---- Part not resolved. +.. _ref-FET2: + FET2 ---- Part not resolved. +.. _ref-FUSE1: + FUSE1 ----- Part not resolved. +.. _ref-FUSE2: + FUSE2 ----- Part not resolved. +.. _ref-GND1: + GND1 ---- Part not resolved. +.. _ref-GNDA1: + GNDA1 ----- Part not resolved. +.. _ref-GPIO1: + GPIO1 ----- Part not resolved. +.. _ref-GPIO_LED1: + GPIO_LED1 --------- Part not resolved. +.. _ref-HDMI1: + HDMI1 ----- Part not resolved. +.. _ref-HEADPHONES/LINEOUT1: + HEADPHONES/LINEOUT1 ------------------- Part not resolved. +.. _ref-HPHONEOUTL/LINEOUTL1: + HPHONEOUTL/LINEOUTL1 -------------------- Part not resolved. +.. _ref-HPHONEOUTR/LINEOUTR1: + HPHONEOUTR/LINEOUTR1 -------------------- Part not resolved. +.. _ref-HSIC1: + HSIC1 ----- Part not resolved. +.. _ref-HSIC_E1: + HSIC_E1 ------- Part not resolved. +.. _ref-IPS1: + IPS1 ---- Part not resolved. +.. _ref-L1: + L1 -- Part not resolved. +.. _ref-L2: + L2 -- Part not resolved. +.. _ref-L3: + L3 -- Part not resolved. +.. _ref-L4: + L4 -- Part not resolved. +.. _ref-L5: + L5 -- Part not resolved. +.. _ref-L6: + L6 -- Part not resolved. +.. _ref-L8: + L8 -- Part not resolved. +.. _ref-L14: + L14 --- Part not resolved. +.. _ref-L15: + L15 --- Part not resolved. +.. _ref-L16: + L16 --- Part not resolved. +.. _ref-L17: + L17 --- Part not resolved. +.. _ref-L18: + L18 --- Part not resolved. +.. _ref-L19: + L19 --- Part not resolved. +.. _ref-L20: + L20 --- Part not resolved. +.. _ref-L21: + L21 --- Part not resolved. +.. _ref-L23: + L23 --- Part not resolved. +.. _ref-L24: + L24 --- Part not resolved. +.. _ref-LAN1: + LAN1 ---- Part not resolved. +.. _ref-LCD_CON1: + LCD_CON1 -------- Part not resolved. +.. _ref-LINEINL/MICIN2: + LINEINL/MICIN2 -------------- Part not resolved. +.. _ref-LINEINR/MICIN1: + LINEINR/MICIN1 -------------- Part not resolved. +.. _ref-LIPO_BAT1: + LIPO_BAT1 --------- Part not resolved. +.. _ref-MIC/LINEIN1: + MIC/LINEIN1 ----------- Part not resolved. +.. _ref-MICRO_SD1: + MICRO_SD1 --------- Part not resolved. +.. _ref-MIPI-DSI1: + MIPI-DSI1 --------- Part not resolved. +.. _ref-Mounting_hole1: + Mounting_hole1 -------------- Part not resolved. +.. _ref-Mounting_hole2: + Mounting_hole2 -------------- Part not resolved. +.. _ref-Mounting_hole3: + Mounting_hole3 -------------- Part not resolved. +.. _ref-NAND_E1: + NAND_E1 ------- Part not resolved. +.. _ref-PHYRST1: + PHYRST1 ------- Part not resolved. +.. _ref-PWR1: + PWR1 ---- Part not resolved. +.. _ref-PWRLED1: + PWRLED1 ------- Part not resolved. +.. _ref-PWRON1: + PWRON1 ------ Part not resolved. +.. _ref-PWR_PC1: + PWR_PC1 ------- Part not resolved. +.. _ref-Q2: + Q2 -- Part not resolved. +.. _ref-Q3: + Q3 -- Part not resolved. +.. _ref-Q4: + Q4 -- Part not resolved. +.. _ref-R1: + R1 -- Part not resolved. +.. _ref-R2: + R2 -- Part not resolved. +.. _ref-R3: + R3 -- Part not resolved. +.. _ref-R4: + R4 -- Part not resolved. +.. _ref-R5: + R5 -- Part not resolved. +.. _ref-R6: + R6 -- Part not resolved. +.. _ref-R7: + R7 -- Part not resolved. +.. _ref-R8: + R8 -- Part not resolved. +.. _ref-R9: + R9 -- Part not resolved. +.. _ref-R10: + R10 --- Part not resolved. +.. _ref-R11: + R11 --- Part not resolved. +.. _ref-R12: + R12 --- Part not resolved. +.. _ref-R13: + R13 --- Part not resolved. +.. _ref-R14: + R14 --- Part not resolved. +.. _ref-R15: + R15 --- Part not resolved. +.. _ref-R16: + R16 --- Part not resolved. +.. _ref-R17: + R17 --- Part not resolved. +.. _ref-R18: + R18 --- Part not resolved. +.. _ref-R19: + R19 --- Part not resolved. +.. _ref-R20: + R20 --- Part not resolved. +.. _ref-R21: + R21 --- Part not resolved. +.. _ref-R22: + R22 --- Part not resolved. +.. _ref-R23: + R23 --- Part not resolved. +.. _ref-R24: + R24 --- Part not resolved. +.. _ref-R25: + R25 --- Part not resolved. +.. _ref-R26: + R26 --- Part not resolved. +.. _ref-R27: + R27 --- Part not resolved. +.. _ref-R28: + R28 --- Part not resolved. +.. _ref-R29: + R29 --- Part not resolved. +.. _ref-R30: + R30 --- Part not resolved. +.. _ref-R31: + R31 --- Part not resolved. +.. _ref-R32: + R32 --- Part not resolved. +.. _ref-R33: + R33 --- Part not resolved. +.. _ref-R34: + R34 --- Part not resolved. +.. _ref-R35: + R35 --- Part not resolved. +.. _ref-R36: + R36 --- Part not resolved. +.. _ref-R37: + R37 --- Part not resolved. +.. _ref-R38: + R38 --- Part not resolved. +.. _ref-R39: + R39 --- Part not resolved. +.. _ref-R40: + R40 --- Part not resolved. +.. _ref-R41: + R41 --- Part not resolved. +.. _ref-R42: + R42 --- Part not resolved. +.. _ref-R43: + R43 --- Part not resolved. +.. _ref-R44: + R44 --- Part not resolved. +.. _ref-R45: + R45 --- Part not resolved. +.. _ref-R46: + R46 --- Part not resolved. +.. _ref-R47: + R47 --- Part not resolved. +.. _ref-R48: + R48 --- Part not resolved. +.. _ref-R49: + R49 --- Part not resolved. +.. _ref-R50: + R50 --- Part not resolved. +.. _ref-R51: + R51 --- Part not resolved. +.. _ref-R52: + R52 --- Part not resolved. +.. _ref-R53: + R53 --- Part not resolved. +.. _ref-R54: + R54 --- Part not resolved. +.. _ref-R55: + R55 --- Part not resolved. +.. _ref-R56: + R56 --- Part not resolved. +.. _ref-R57: + R57 --- Part not resolved. +.. _ref-R58: + R58 --- Part not resolved. +.. _ref-R59: + R59 --- Part not resolved. +.. _ref-R60: + R60 --- Part not resolved. +.. _ref-R61: + R61 --- Part not resolved. +.. _ref-R62: + R62 --- Part not resolved. +.. _ref-R63: + R63 --- Part not resolved. +.. _ref-R64: + R64 --- Part not resolved. +.. _ref-R65: + R65 --- Part not resolved. +.. _ref-R66: + R66 --- Part not resolved. +.. _ref-R70: + R70 --- Part not resolved. +.. _ref-R71: + R71 --- Part not resolved. +.. _ref-R74: + R74 --- Part not resolved. +.. _ref-R75: + R75 --- Part not resolved. +.. _ref-R76: + R76 --- Part not resolved. +.. _ref-R77: + R77 --- Part not resolved. +.. _ref-R78: + R78 --- Part not resolved. +.. _ref-R79: + R79 --- Part not resolved. +.. _ref-R80: + R80 --- Part not resolved. +.. _ref-R81: + R81 --- Part not resolved. +.. _ref-R82: + R82 --- Part not resolved. +.. _ref-R83: + R83 --- Part not resolved. +.. _ref-R84: + R84 --- Part not resolved. +.. _ref-R85: + R85 --- Part not resolved. +.. _ref-R86: + R86 --- Part not resolved. +.. _ref-R87: + R87 --- Part not resolved. +.. _ref-R88: + R88 --- Part not resolved. +.. _ref-R89: + R89 --- Part not resolved. +.. _ref-R90: + R90 --- Part not resolved. +.. _ref-R91: + R91 --- Part not resolved. +.. _ref-R92: + R92 --- Part not resolved. +.. _ref-R93: + R93 --- Part not resolved. +.. _ref-R94: + R94 --- Part not resolved. +.. _ref-R95: + R95 --- Part not resolved. +.. _ref-R96: + R96 --- Part not resolved. +.. _ref-R97: + R97 --- Part not resolved. +.. _ref-R98: + R98 --- Part not resolved. +.. _ref-R99: + R99 --- Part not resolved. +.. _ref-R100: + R100 ---- Part not resolved. +.. _ref-R101: + R101 ---- Part not resolved. +.. _ref-R102: + R102 ---- Part not resolved. +.. _ref-R103: + R103 ---- Part not resolved. +.. _ref-R104: + R104 ---- Part not resolved. +.. _ref-R105: + R105 ---- Part not resolved. +.. _ref-R106: + R106 ---- Part not resolved. +.. _ref-R107: + R107 ---- Part not resolved. +.. _ref-R108: + R108 ---- Part not resolved. +.. _ref-R109: + R109 ---- Part not resolved. +.. _ref-R110: + R110 ---- Part not resolved. +.. _ref-R111: + R111 ---- Part not resolved. +.. _ref-R112: + R112 ---- Part not resolved. +.. _ref-R113: + R113 ---- Part not resolved. +.. _ref-R114: + R114 ---- Part not resolved. +.. _ref-R115: + R115 ---- Part not resolved. +.. _ref-R116: + R116 ---- Part not resolved. +.. _ref-R117: + R117 ---- Part not resolved. +.. _ref-R118: + R118 ---- Part not resolved. +.. _ref-R119: + R119 ---- Part not resolved. +.. _ref-R120: + R120 ---- Part not resolved. +.. _ref-RESET1: + RESET1 ------ Part not resolved. +.. _ref-RM1: + RM1 --- Part not resolved. +.. _ref-RM2: + RM2 --- Part not resolved. +.. _ref-RM3: + RM3 --- Part not resolved. +.. _ref-RM4: + RM4 --- Part not resolved. +.. _ref-RM5: + RM5 --- Part not resolved. +.. _ref-RM7: + RM7 --- Part not resolved. +.. _ref-RM8: + RM8 --- Part not resolved. +.. _ref-RM9: + RM9 --- Part not resolved. +.. _ref-RM12: + RM12 ---- Part not resolved. +.. _ref-RM14: + RM14 ---- Part not resolved. +.. _ref-RM15: + RM15 ---- Part not resolved. +.. _ref-T1: + T1 -- Part not resolved. +.. _ref-U1: + U1 -- Part not resolved. +.. _ref-U1: + U1 -- Part not resolved. +.. _ref-U1: + U1 -- Part not resolved. +.. _ref-U1: + U1 -- Part not resolved. +.. _ref-U2: + U2 -- Part not resolved. +.. _ref-U3: + U3 -- Part not resolved. +.. _ref-U4: + U4 -- Part not resolved. +.. _ref-U5: + U5 -- Part not resolved. +.. _ref-U6: + U6 -- Part not resolved. +.. _ref-U7: + U7 -- Part not resolved. +.. _ref-U8: + U8 -- Part not resolved. +.. _ref-U9: + U9 -- Part not resolved. +.. _ref-U10: + U10 --- Part not resolved. +.. _ref-U11: + U11 --- Part not resolved. +.. _ref-U12: + U12 --- Part not resolved. +.. _ref-U13: + U13 --- Part not resolved. +.. _ref-U14: + U14 --- Part not resolved. +.. _ref-U15: + U15 --- Part not resolved. +.. _ref-UBOOT1: + UBOOT1 ------ Part not resolved. +.. _ref-UEXT1: + UEXT1 ----- Part not resolved. +.. _ref-USB1: + USB1 ---- Part not resolved. +.. _ref-USB-OTG1: + USB-OTG1 -------- Part not resolved. +.. _ref-VCC-PC1: + VCC-PC1 ------- Part not resolved. +.. _ref-VCC-PL1: + VCC-PL1 ------- Part not resolved. +.. _ref-VR1: + VR1 --- Part not resolved. +.. _ref-5V_E1: + 5V_E1 ----- diff --git a/demo/thirdparty/olinuxino/py/olinuxino.py b/demo/thirdparty/olinuxino/py/olinuxino.py index 0b6fd1e..49b634f 100644 --- a/demo/thirdparty/olinuxino/py/olinuxino.py +++ b/demo/thirdparty/olinuxino/py/olinuxino.py @@ -3,9 +3,8 @@ import re from ee import EeException, EeVal from ee.kicad import Component from ee.kicad.make_bom import MakeBomStrategy -from ee.xml import types, bom_file_utils -from ee.part import fact_keys -from ee.xml.bom_file_utils import facts +from ee.xml import types +from ee.part import fact_keys, Part c_value_re = re.compile("([0-9]+\\.?[0-9]*[mupn]F)/([0-9]+\\.?[0-9]*[k]?V)/([0-9]+)%(?:/([A-Z][0-9][A-Z]))?") r_value_re = re.compile(r"([^/]+)(?:/([^/]+)(?:/([^/]+))?)?") @@ -14,14 +13,14 @@ r_value_re = re.compile(r"([^/]+)(?:/([^/]+)(?:/([^/]+))?)?") class OlinuxinoMakeBomStrategy(MakeBomStrategy): @staticmethod - def set_default(fs, fact_key: str, value): - fact = bom_file_utils.find_fact(fs, fact_key) + def set_default(part: Part, fact_key: str, value): + fact = part.find_fact(fact_key) if fact: return - fs.add_fact(types.Fact(key=fact_key, value=value)) + part.get_facts().append(types.Fact(key=fact_key, value=value)) - def process_part(self, component: Component, part: types.Part): + def process_part(self, component: Component, part: Part): debug = False print(component.ref) @@ -35,7 +34,7 @@ class OlinuxinoMakeBomStrategy(MakeBomStrategy): s = component.footprint.split(":") fp_lib, fp_part = s[0], s[1] - fs = facts(part, create=True) + fs = part.get_facts() na = v.startswith("NA(") and v.endswith(")") or v == "NA" if na: @@ -63,11 +62,11 @@ class OlinuxinoMakeBomStrategy(MakeBomStrategy): if na: print(" NA".format()) - fs.add_fact(types.Fact(key=fact_keys.capacitance, value=capacitance)) - fs.add_fact(types.Fact(key=fact_keys.max_voltage, value=voltage)) - fs.add_fact(types.Fact(key=fact_keys.value_tolerance, value=tolerance)) + fs.append(types.Fact(key=fact_keys.capacitance, value=capacitance)) + fs.append(types.Fact(key=fact_keys.max_voltage, value=voltage)) + fs.append(types.Fact(key=fact_keys.value_tolerance, value=tolerance)) if rs_198_class_2: - fs.add_fact(types.Fact(key=fact_keys.rs_198_class_2, value=rs_198_class_2)) + fs.append(types.Fact(key=fact_keys.rs_198_class_2, value=rs_198_class_2)) elif component.ref_type == "R": # NA @@ -89,18 +88,18 @@ class OlinuxinoMakeBomStrategy(MakeBomStrategy): resistance = str(EeVal.parse(resistance)) - fs.add_fact(types.Fact(key=fact_keys.resistance, value=resistance)) + fs.append(types.Fact(key=fact_keys.resistance, value=resistance)) if tolerance: - fs.add_fact(types.Fact(key=fact_keys.value_tolerance, value=tolerance)) + fs.append(types.Fact(key=fact_keys.value_tolerance, value=tolerance)) if size: - fs.add_fact(types.Fact(key=fact_keys.imperial_footprint_size, value=size)) + fs.append(types.Fact(key=fact_keys.imperial_footprint_size, value=size)) - self.set_default(fs, fact_keys.value_tolerance, "10%") + self.set_default(part, fact_keys.value_tolerance, "10%") else: - fs.add_fact(types.Fact(key=fact_keys.value, value=v)) + fs.append(types.Fact(key=fact_keys.value, value=v)) if na: - fs.add_fact(types.Fact(key=fact_keys.place_part, value="no")) + fs.append(types.Fact(key=fact_keys.place_part, value="no")) # raise EeException("Unknown component kind: ref={}, ref type:{}, value={}, fp_lib={}, fp_part={}". # format(component.ref, component.ref_type, v, fp_lib, fp_part)) diff --git a/demo/thirdparty/unlockoslo-alpha-3/.gitignore b/demo/thirdparty/unlockoslo-alpha-3/.gitignore new file mode 100644 index 0000000..d8f275d --- /dev/null +++ b/demo/thirdparty/unlockoslo-alpha-3/.gitignore @@ -0,0 +1,2 @@ +.ee +.ninja_* diff --git a/demo/thirdparty/unlockoslo-alpha-3/ee/digikey/downloaded.xml b/demo/thirdparty/unlockoslo-alpha-3/ee/digikey/downloaded.xml new file mode 100644 index 0000000..c01d02f --- /dev/null +++ b/demo/thirdparty/unlockoslo-alpha-3/ee/digikey/downloaded.xml @@ -0,0 +1,2821 @@ + + + + https://digikey.com + + + D1 + + + S1MTR + + + + too-many + + + + https://digikey.com + TERM BLK 3P SIDE ENT 2.54MM SMD + + + + + + + + + + 14010213102000 + + + 1195-3656-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/digikey-fact-key#7 + + Cut Tape (CT) + + + http://purl.org/trygvis/ee/digikey-fact-key#1989 + + Active + + + http://purl.org/trygvis/ee/digikey-fact-key#2168 + + 1 + + + http://purl.org/trygvis/ee/digikey-fact-key#1075 + + 2 + + + http://purl.org/trygvis/ee/digikey-fact-key#89 + + 0.100" (2.54mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#802 + + Horizontal with Board + + + http://purl.org/trygvis/ee/digikey-fact-key#2155 + + 6A + + + http://purl.org/trygvis/ee/digikey-fact-key#2191 + + 160V + + + http://purl.org/trygvis/ee/digikey-fact-key#78 + + 20-26 AWG + + + http://purl.org/trygvis/ee/digikey-fact-key#69 + + Surface Mount + + + http://purl.org/trygvis/ee/digikey-fact-key#1487 + + Screwless - Spring Cage, Tension Clamp + + + http://purl.org/trygvis/ee/digikey-fact-key#5 + + Board Guide, Solder Retention + + + http://purl.org/trygvis/ee/digikey-fact-key#37 + + Black + + + http://purl.org/trygvis/ee/digikey-fact-key#252 + + -40°C ~ 125°C + + + http://purl.org/trygvis/ee/digikey-fact-key#1330 + + Liquid Crystal Polymer (LCP), Glass Filled + + + http://purl.org/trygvis/ee/digikey-fact-key#1482 + + Copper Alloy - Tin Plated + + + http://purl.org/trygvis/ee/digikey-fact-key#1483 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#1484 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#1485 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#1486 + + - + + + + + 1 + + + + 10 + + + + 25 + + + + 50 + + + + 100 + + + + 250 + + + + + + https://digikey.com + TERM BLK 8P SIDE ENT 2.54MM SMD + + + + + + + + + + 14010813102000 + + + 1195-3662-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/digikey-fact-key#7 + + Cut Tape (CT) + + + http://purl.org/trygvis/ee/digikey-fact-key#1989 + + Active + + + http://purl.org/trygvis/ee/digikey-fact-key#2168 + + 1 + + + http://purl.org/trygvis/ee/digikey-fact-key#1075 + + 8 + + + http://purl.org/trygvis/ee/digikey-fact-key#89 + + 0.100" (2.54mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#802 + + Horizontal with Board + + + http://purl.org/trygvis/ee/digikey-fact-key#2155 + + 6A + + + http://purl.org/trygvis/ee/digikey-fact-key#2191 + + 160V + + + http://purl.org/trygvis/ee/digikey-fact-key#78 + + 20-26 AWG + + + http://purl.org/trygvis/ee/digikey-fact-key#69 + + Surface Mount + + + http://purl.org/trygvis/ee/digikey-fact-key#1487 + + Screwless - Spring Cage, Tension Clamp + + + http://purl.org/trygvis/ee/digikey-fact-key#5 + + Board Guide, Solder Retention + + + http://purl.org/trygvis/ee/digikey-fact-key#37 + + Black + + + http://purl.org/trygvis/ee/digikey-fact-key#252 + + -40°C ~ 125°C + + + http://purl.org/trygvis/ee/digikey-fact-key#1330 + + Liquid Crystal Polymer (LCP), Glass Filled + + + http://purl.org/trygvis/ee/digikey-fact-key#1482 + + Copper Alloy - Tin Plated + + + http://purl.org/trygvis/ee/digikey-fact-key#1483 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#1484 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#1485 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#1486 + + - + + + + + 1 + + + + 10 + + + + 25 + + + + 50 + + + + 100 + + + + 250 + + + + + + https://digikey.com + TERM BLK 3P SIDE ENT 2.54MM SMD + + + + + + + + + + 14011213102000 + + + 1195-3666-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/digikey-fact-key#7 + + Cut Tape (CT) + + + http://purl.org/trygvis/ee/digikey-fact-key#1989 + + Active + + + http://purl.org/trygvis/ee/digikey-fact-key#2168 + + 1 + + + http://purl.org/trygvis/ee/digikey-fact-key#1075 + + 12 + + + http://purl.org/trygvis/ee/digikey-fact-key#89 + + 0.100" (2.54mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#802 + + Horizontal with Board + + + http://purl.org/trygvis/ee/digikey-fact-key#2155 + + 6A + + + http://purl.org/trygvis/ee/digikey-fact-key#2191 + + 160V + + + http://purl.org/trygvis/ee/digikey-fact-key#78 + + 20-26 AWG + + + http://purl.org/trygvis/ee/digikey-fact-key#69 + + Surface Mount + + + http://purl.org/trygvis/ee/digikey-fact-key#1487 + + Screwless - Spring Cage, Tension Clamp + + + http://purl.org/trygvis/ee/digikey-fact-key#5 + + Board Guide, Solder Retention + + + http://purl.org/trygvis/ee/digikey-fact-key#37 + + Black + + + http://purl.org/trygvis/ee/digikey-fact-key#252 + + -40°C ~ 125°C + + + http://purl.org/trygvis/ee/digikey-fact-key#1330 + + Liquid Crystal Polymer (LCP), Glass Filled + + + http://purl.org/trygvis/ee/digikey-fact-key#1482 + + Copper Alloy - Tin Plated + + + http://purl.org/trygvis/ee/digikey-fact-key#1483 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#1484 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#1485 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#1486 + + - + + + + + 1 + + + + 10 + + + + 25 + + + + 50 + + + + 100 + + + + 250 + + + + + + https://digikey.com + 270 Ohms ±1% 0.063W, 1/16W Chip Resistor 0402 (1005 Metric) Moisture Resistant Thick Film + + + + + + + + + + + RC1005F271CS + + + 1276-3970-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/digikey-fact-key#7 + + Cut Tape (CT) + + + http://purl.org/trygvis/ee/digikey-fact-key#1989 + + Active + + + http://purl.org/trygvis/ee/digikey-fact-key#2085 + + 270 Ohms + + + http://purl.org/trygvis/ee/digikey-fact-key#3 + + ±1% + + + http://purl.org/trygvis/ee/digikey-fact-key#2 + + 0.063W, 1/16W + + + http://purl.org/trygvis/ee/digikey-fact-key#174 + + Thick Film + + + http://purl.org/trygvis/ee/digikey-fact-key#5 + + Moisture Resistant + + + http://purl.org/trygvis/ee/digikey-fact-key#17 + + ±100ppm/°C + + + http://purl.org/trygvis/ee/digikey-fact-key#252 + + -55°C ~ 155°C + + + http://purl.org/trygvis/ee/digikey-fact-key#16 + + 0402 (1005 Metric) + + + http://purl.org/trygvis/ee/digikey-fact-key#1291 + + 0402 + + + http://purl.org/trygvis/ee/digikey-fact-key#46 + + 0.039" L x 0.020" W (1.00mm x 0.50mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#1500 + + 0.016" (0.40mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#1127 + + 2 + + + http://purl.org/trygvis/ee/digikey-fact-key#1531 + + - + + + + + 1 + + + + 10 + + + + 100 + + + + 1000 + + + + 2500 + + + + 5000 + + + + + + https://digikey.com + 0.1µF ±10% 50V Ceramic Capacitor X7R 0805 (2012 Metric) + + + + + + + + + + + + + + + + CL21B104KBFNNNG + + + 1276-6468-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/digikey-fact-key#7 + + Cut Tape (CT) + + + http://purl.org/trygvis/ee/digikey-fact-key#1989 + + Active + + + http://purl.org/trygvis/ee/digikey-fact-key#2049 + + 0.1µF + + + http://purl.org/trygvis/ee/digikey-fact-key#3 + + ±10% + + + http://purl.org/trygvis/ee/digikey-fact-key#14 + + 50V + + + http://purl.org/trygvis/ee/digikey-fact-key#17 + + X7R + + + http://purl.org/trygvis/ee/digikey-fact-key#252 + + -55°C ~ 125°C + + + http://purl.org/trygvis/ee/digikey-fact-key#5 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#707 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#405 + + General Purpose + + + http://purl.org/trygvis/ee/digikey-fact-key#69 + + Surface Mount, MLCC + + + http://purl.org/trygvis/ee/digikey-fact-key#16 + + 0805 (2012 Metric) + + + http://purl.org/trygvis/ee/digikey-fact-key#46 + + 0.079" L x 0.049" W (2.00mm x 1.25mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#1500 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#1501 + + 0.053" (1.35mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#508 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#4 + + - + + + + + 1 + + + + 10 + + + + 100 + + + + 500 + + + + 1000 + + + + + + https://digikey.com + TEMPERATURE SENSOR SWITCH + + + + + + + + + + + + + + + + + TMP102AIDRLT + + + 296-22055-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/digikey-fact-key#7 + + Cut Tape (CT) + + + http://purl.org/trygvis/ee/digikey-fact-key#1989 + + Active + + + http://purl.org/trygvis/ee/digikey-fact-key#345 + + Digital, Local + + + http://purl.org/trygvis/ee/digikey-fact-key#1847 + + -40°C ~ 125°C + + + http://purl.org/trygvis/ee/digikey-fact-key#1848 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#41 + + I²C/SMBus + + + http://purl.org/trygvis/ee/digikey-fact-key#276 + + 1.4V ~ 3.6V + + + http://purl.org/trygvis/ee/digikey-fact-key#688 + + 11 b + + + http://purl.org/trygvis/ee/digikey-fact-key#5 + + One-Shot, Output Switch, Shutdown Mode + + + http://purl.org/trygvis/ee/digikey-fact-key#1846 + + ±2°C (±3°C) + + + http://purl.org/trygvis/ee/digikey-fact-key#1602 + + -25°C ~ 85°C (-40°C ~ 125°C) + + + http://purl.org/trygvis/ee/digikey-fact-key#252 + + -55°C ~ 150°C + + + http://purl.org/trygvis/ee/digikey-fact-key#69 + + Surface Mount + + + http://purl.org/trygvis/ee/digikey-fact-key#16 + + SOT-563, SOT-666 + + + http://purl.org/trygvis/ee/digikey-fact-key#1291 + + SOT-563 + + + + + 1 + + + + 10 + + + + 25 + + + + 100 + + + + + + https://digikey.com + IC FF D-TYPE DUAL 1BIT 14DIP + + + + + + + + + + + + + TPS54202DDCT + + + 296-44151-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/digikey-fact-key#7 + + Cut Tape (CT) + + + http://purl.org/trygvis/ee/digikey-fact-key#1989 + + Active + + + http://purl.org/trygvis/ee/digikey-fact-key#110 + + Step-Down + + + http://purl.org/trygvis/ee/digikey-fact-key#255 + + Positive + + + http://purl.org/trygvis/ee/digikey-fact-key#1098 + + Buck + + + http://purl.org/trygvis/ee/digikey-fact-key#41 + + Adjustable + + + http://purl.org/trygvis/ee/digikey-fact-key#87 + + 1 + + + http://purl.org/trygvis/ee/digikey-fact-key#1471 + + 4.5V + + + http://purl.org/trygvis/ee/digikey-fact-key#573 + + 28V + + + http://purl.org/trygvis/ee/digikey-fact-key#1779 + + 0.596V + + + http://purl.org/trygvis/ee/digikey-fact-key#1429 + + 28V + + + http://purl.org/trygvis/ee/digikey-fact-key#129 + + 2A + + + http://purl.org/trygvis/ee/digikey-fact-key#384 + + 500kHz + + + http://purl.org/trygvis/ee/digikey-fact-key#1320 + + Yes + + + http://purl.org/trygvis/ee/digikey-fact-key#252 + + -40°C ~ 125°C (TJ) + + + http://purl.org/trygvis/ee/digikey-fact-key#69 + + Surface Mount + + + http://purl.org/trygvis/ee/digikey-fact-key#16 + + SOT-23-6 Thin, TSOT-23-6 + + + http://purl.org/trygvis/ee/digikey-fact-key#1291 + + TSOT-23-6 + + + + + 1 + + + + 10 + + + + 100 + + + + + + https://digikey.com + 22µF ±20% 10V Ceramic Capacitor X5R 0805 (2012 Metric) + + + + + + + + + + + + + + GRM21BR61A226ME51L + + + 490-10511-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/digikey-fact-key#7 + + Cut Tape (CT) + + + http://purl.org/trygvis/ee/digikey-fact-key#1989 + + Not For New Designs + + + http://purl.org/trygvis/ee/digikey-fact-key#2049 + + 22µF + + + http://purl.org/trygvis/ee/digikey-fact-key#3 + + ±20% + + + http://purl.org/trygvis/ee/digikey-fact-key#14 + + 10V + + + http://purl.org/trygvis/ee/digikey-fact-key#17 + + X5R + + + http://purl.org/trygvis/ee/digikey-fact-key#252 + + -55°C ~ 85°C + + + http://purl.org/trygvis/ee/digikey-fact-key#5 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#707 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#405 + + General Purpose + + + http://purl.org/trygvis/ee/digikey-fact-key#69 + + Surface Mount, MLCC + + + http://purl.org/trygvis/ee/digikey-fact-key#16 + + 0805 (2012 Metric) + + + http://purl.org/trygvis/ee/digikey-fact-key#46 + + 0.079" L x 0.049" W (2.00mm x 1.25mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#1500 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#1501 + + 0.055" (1.40mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#508 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#4 + + - + + + + + 1 + + + + 10 + + + + 100 + + + + 500 + + + + 1000 + + + + + + https://digikey.com + 75pF ±5% 50V Ceramic Capacitor C0G, NP0 0402 (1005 Metric) + + + + + + + + + + + + + + GRM1555C1H750JA01D + + + 490-5951-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/digikey-fact-key#7 + + Cut Tape (CT) + + + http://purl.org/trygvis/ee/digikey-fact-key#1989 + + Not For New Designs + + + http://purl.org/trygvis/ee/digikey-fact-key#2049 + + 75pF + + + http://purl.org/trygvis/ee/digikey-fact-key#3 + + ±5% + + + http://purl.org/trygvis/ee/digikey-fact-key#14 + + 50V + + + http://purl.org/trygvis/ee/digikey-fact-key#17 + + C0G, NP0 + + + http://purl.org/trygvis/ee/digikey-fact-key#252 + + -55°C ~ 125°C + + + http://purl.org/trygvis/ee/digikey-fact-key#5 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#707 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#405 + + General Purpose + + + http://purl.org/trygvis/ee/digikey-fact-key#69 + + Surface Mount, MLCC + + + http://purl.org/trygvis/ee/digikey-fact-key#16 + + 0402 (1005 Metric) + + + http://purl.org/trygvis/ee/digikey-fact-key#46 + + 0.039" L x 0.020" W (1.00mm x 0.50mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#1500 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#1501 + + 0.022" (0.55mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#508 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#4 + + - + + + + + 1 + + + + 10 + + + + 100 + + + + 500 + + + + 1000 + + + + 2500 + + + + 5000 + + + + + + https://digikey.com + 100 kOhms ±1% 0.063W, 1/16W Chip Resistor 0402 (1005 Metric) Automotive AEC-Q200 Thick Film + + + + + + + + + + CRCW0402100KFKED + + + 541-100KLCT-ND + + + + resolved + + + + http://purl.org/trygvis/ee/digikey-fact-key#7 + + Cut Tape (CT) + + + http://purl.org/trygvis/ee/digikey-fact-key#1989 + + Active + + + http://purl.org/trygvis/ee/digikey-fact-key#2085 + + 100 kOhms + + + http://purl.org/trygvis/ee/digikey-fact-key#3 + + ±1% + + + http://purl.org/trygvis/ee/digikey-fact-key#2 + + 0.063W, 1/16W + + + http://purl.org/trygvis/ee/digikey-fact-key#174 + + Thick Film + + + http://purl.org/trygvis/ee/digikey-fact-key#5 + + Automotive AEC-Q200 + + + http://purl.org/trygvis/ee/digikey-fact-key#17 + + ±100ppm/°C + + + http://purl.org/trygvis/ee/digikey-fact-key#252 + + -55°C ~ 155°C + + + http://purl.org/trygvis/ee/digikey-fact-key#16 + + 0402 (1005 Metric) + + + http://purl.org/trygvis/ee/digikey-fact-key#1291 + + 0402 + + + http://purl.org/trygvis/ee/digikey-fact-key#46 + + 0.039" L x 0.020" W (1.00mm x 0.50mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#1500 + + 0.016" (0.40mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#1127 + + 2 + + + http://purl.org/trygvis/ee/digikey-fact-key#1531 + + - + + + + + 1 + + + + 10 + + + + 100 + + + + 1000 + + + + 2500 + + + + 5000 + + + + + + https://digikey.com + 15µH Shielded Wirewound Inductor 2.4A 65 mOhm Max Nonstandard + + + + + + + + + + + + + NRS8040T150MJGJ + + + 587-2973-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/digikey-fact-key#7 + + Cut Tape (CT) + + + http://purl.org/trygvis/ee/digikey-fact-key#1989 + + Active + + + http://purl.org/trygvis/ee/digikey-fact-key#183 + + Wirewound + + + http://purl.org/trygvis/ee/digikey-fact-key#1221 + + Ferrite + + + http://purl.org/trygvis/ee/digikey-fact-key#2087 + + 15µH + + + http://purl.org/trygvis/ee/digikey-fact-key#3 + + ±20% + + + http://purl.org/trygvis/ee/digikey-fact-key#2088 + + 2.4A + + + http://purl.org/trygvis/ee/digikey-fact-key#1219 + + 2.9A + + + http://purl.org/trygvis/ee/digikey-fact-key#80 + + Shielded + + + http://purl.org/trygvis/ee/digikey-fact-key#314 + + 65 mOhm Max + + + http://purl.org/trygvis/ee/digikey-fact-key#705 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#706 + + 16MHz + + + http://purl.org/trygvis/ee/digikey-fact-key#707 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#252 + + -25°C ~ 125°C + + + http://purl.org/trygvis/ee/digikey-fact-key#1222 + + 100kHz + + + http://purl.org/trygvis/ee/digikey-fact-key#69 + + Surface Mount + + + http://purl.org/trygvis/ee/digikey-fact-key#16 + + Nonstandard + + + http://purl.org/trygvis/ee/digikey-fact-key#1291 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#46 + + 0.315" L x 0.315" W (8.00mm x 8.00mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#1500 + + 0.157" (4.00mm) + + + + + 1 + + + + 10 + + + + 100 + + + + 500 + + + + + + https://digikey.com + 10µF ±10% 35V Ceramic Capacitor X5R 0805 (2012 Metric) + + + + + + + + + + GMK212BBJ106KG-T + + + 587-4893-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/digikey-fact-key#7 + + Cut Tape (CT) + + + http://purl.org/trygvis/ee/digikey-fact-key#1989 + + Active + + + http://purl.org/trygvis/ee/digikey-fact-key#2049 + + 10µF + + + http://purl.org/trygvis/ee/digikey-fact-key#3 + + ±10% + + + http://purl.org/trygvis/ee/digikey-fact-key#14 + + 35V + + + http://purl.org/trygvis/ee/digikey-fact-key#17 + + X5R + + + http://purl.org/trygvis/ee/digikey-fact-key#252 + + -55°C ~ 85°C + + + http://purl.org/trygvis/ee/digikey-fact-key#5 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#707 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#405 + + SMPS Filtering + + + http://purl.org/trygvis/ee/digikey-fact-key#1531 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#69 + + Surface Mount, MLCC + + + http://purl.org/trygvis/ee/digikey-fact-key#16 + + 0805 (2012 Metric) + + + http://purl.org/trygvis/ee/digikey-fact-key#46 + + 0.079" L x 0.049" W (2.00mm x 1.25mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#1500 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#1501 + + 0.057" (1.45mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#508 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#4 + + - + + + + + 1 + + + + 10 + + + + 100 + + + + 500 + + + + 1000 + + + + + + https://digikey.com + DIODE ZENER 3.3V 300MW SOT23 + + + + + + + + + BZX384C3V3-E3-08 + + + BZX384C3V3-E3-08GICT-ND + + + + resolved + + + + http://purl.org/trygvis/ee/digikey-fact-key#7 + + Cut Tape (CT) + + + http://purl.org/trygvis/ee/digikey-fact-key#1989 + + Active + + + http://purl.org/trygvis/ee/digikey-fact-key#920 + + 3.3V + + + http://purl.org/trygvis/ee/digikey-fact-key#3 + + ±5% + + + http://purl.org/trygvis/ee/digikey-fact-key#2109 + + 200mW + + + http://purl.org/trygvis/ee/digikey-fact-key#921 + + 95 Ohms + + + http://purl.org/trygvis/ee/digikey-fact-key#2269 + + 5µA @ 1V + + + http://purl.org/trygvis/ee/digikey-fact-key#252 + + -55°C ~ 150°C + + + http://purl.org/trygvis/ee/digikey-fact-key#69 + + Surface Mount + + + http://purl.org/trygvis/ee/digikey-fact-key#16 + + SC-76, SOD-323 + + + http://purl.org/trygvis/ee/digikey-fact-key#1291 + + SOD-323 + + + + + 1 + + + + 10 + + + + 25 + + + + 100 + + + + 250 + + + + 500 + + + + 1000 + + + + + + https://digikey.com + DIODE SCHOTTKY 60V 3A SMB + + + + + + + + + + + + DMN2041L-7 + + + DMN2041L-7DICT-ND + + + + resolved + + + + http://purl.org/trygvis/ee/digikey-fact-key#7 + + Cut Tape (CT) + + + http://purl.org/trygvis/ee/digikey-fact-key#1989 + + Active + + + http://purl.org/trygvis/ee/digikey-fact-key#606 + + N-Channel + + + http://purl.org/trygvis/ee/digikey-fact-key#570 + + MOSFET (Metal Oxide) + + + http://purl.org/trygvis/ee/digikey-fact-key#2068 + + 20V + + + http://purl.org/trygvis/ee/digikey-fact-key#608 + + 6.4A (Ta) + + + http://purl.org/trygvis/ee/digikey-fact-key#1993 + + 2.5V, 4.5V + + + http://purl.org/trygvis/ee/digikey-fact-key#612 + + 28 mOhm @ 6A, 4.5V + + + http://purl.org/trygvis/ee/digikey-fact-key#1236 + + 1.2V @ 250µA + + + http://purl.org/trygvis/ee/digikey-fact-key#2262 + + 15.6nC @ 10V + + + http://purl.org/trygvis/ee/digikey-fact-key#1994 + + ±12V + + + http://purl.org/trygvis/ee/digikey-fact-key#2263 + + 550pF @ 10V + + + http://purl.org/trygvis/ee/digikey-fact-key#959 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#1174 + + 780mW (Ta) + + + http://purl.org/trygvis/ee/digikey-fact-key#252 + + -55°C ~ 150°C (TJ) + + + http://purl.org/trygvis/ee/digikey-fact-key#69 + + Surface Mount + + + http://purl.org/trygvis/ee/digikey-fact-key#1291 + + SOT-23-3 + + + http://purl.org/trygvis/ee/digikey-fact-key#16 + + TO-236-3, SC-59, SOT-23-3 + + + + + 1 + + + + 10 + + + + 100 + + + + 500 + + + + 1000 + + + + + + https://digikey.com + DIODE SCHOTTKY 60V 3A SMB + + + + + + + + + + DMP3056L-7 + + + DMP3056L-7DICT-ND + + + + resolved + + + + http://purl.org/trygvis/ee/digikey-fact-key#7 + + Cut Tape (CT) + + + http://purl.org/trygvis/ee/digikey-fact-key#1989 + + Active + + + http://purl.org/trygvis/ee/digikey-fact-key#606 + + P-Channel + + + http://purl.org/trygvis/ee/digikey-fact-key#570 + + MOSFET (Metal Oxide) + + + http://purl.org/trygvis/ee/digikey-fact-key#2068 + + 30V + + + http://purl.org/trygvis/ee/digikey-fact-key#608 + + 4.3A (Ta) + + + http://purl.org/trygvis/ee/digikey-fact-key#1993 + + 4.5V, 10V + + + http://purl.org/trygvis/ee/digikey-fact-key#612 + + 50 mOhm @ 6A, 10V + + + http://purl.org/trygvis/ee/digikey-fact-key#1236 + + 2.1V @ 250µA + + + http://purl.org/trygvis/ee/digikey-fact-key#2262 + + 11.8nC @ 10V + + + http://purl.org/trygvis/ee/digikey-fact-key#1994 + + ±25V + + + http://purl.org/trygvis/ee/digikey-fact-key#2263 + + 642pF @ 25V + + + http://purl.org/trygvis/ee/digikey-fact-key#959 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#1174 + + 1.38W (Ta) + + + http://purl.org/trygvis/ee/digikey-fact-key#252 + + -55°C ~ 150°C (TJ) + + + http://purl.org/trygvis/ee/digikey-fact-key#69 + + Surface Mount + + + http://purl.org/trygvis/ee/digikey-fact-key#1291 + + SOT-23 + + + http://purl.org/trygvis/ee/digikey-fact-key#16 + + TO-236-3, SC-59, SOT-23-3 + + + + + 1 + + + + 10 + + + + 100 + + + + 500 + + + + 1000 + + + + + + https://digikey.com + LED RED CLEAR 1206 SMD + + + + + + + + + + CMD15-21VRD/TR8 + + + L62301CT-ND + + + + resolved + + + + http://purl.org/trygvis/ee/digikey-fact-key#7 + + Cut Tape (CT) + + + http://purl.org/trygvis/ee/digikey-fact-key#1989 + + Active + + + http://purl.org/trygvis/ee/digikey-fact-key#37 + + Red + + + http://purl.org/trygvis/ee/digikey-fact-key#207 + + Standard + + + http://purl.org/trygvis/ee/digikey-fact-key#525 + + Red + + + http://purl.org/trygvis/ee/digikey-fact-key#1843 + + Diffused + + + http://purl.org/trygvis/ee/digikey-fact-key#206 + + 4mcd + + + http://purl.org/trygvis/ee/digikey-fact-key#2028 + + Rectangle with Flat Top + + + http://purl.org/trygvis/ee/digikey-fact-key#2029 + + 2.00mm x 1.50mm + + + http://purl.org/trygvis/ee/digikey-fact-key#319 + + 2V + + + http://purl.org/trygvis/ee/digikey-fact-key#543 + + 20mA + + + http://purl.org/trygvis/ee/digikey-fact-key#551 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#69 + + Surface Mount + + + http://purl.org/trygvis/ee/digikey-fact-key#969 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#968 + + 640nm + + + http://purl.org/trygvis/ee/digikey-fact-key#5 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#16 + + 1206 (3216 Metric) + + + http://purl.org/trygvis/ee/digikey-fact-key#1291 + + 1206 + + + http://purl.org/trygvis/ee/digikey-fact-key#46 + + 3.20mm L x 1.50mm W + + + http://purl.org/trygvis/ee/digikey-fact-key#966 + + 1.30mm + + + + + 1 + + + + 10 + + + + 25 + + + + 100 + + + + 250 + + + + 500 + + + + 1000 + + + + + + https://digikey.com + LED GREEN DIFFUSED 1206 SMD + + + + + + + + + + CMD15-21VGD/TR8 + + + L62305CT-ND + + + + resolved + + + + http://purl.org/trygvis/ee/digikey-fact-key#7 + + Cut Tape (CT) + + + http://purl.org/trygvis/ee/digikey-fact-key#1989 + + Active + + + http://purl.org/trygvis/ee/digikey-fact-key#37 + + Green + + + http://purl.org/trygvis/ee/digikey-fact-key#207 + + Standard + + + http://purl.org/trygvis/ee/digikey-fact-key#525 + + Green + + + http://purl.org/trygvis/ee/digikey-fact-key#1843 + + Diffused + + + http://purl.org/trygvis/ee/digikey-fact-key#206 + + 6.5mcd + + + http://purl.org/trygvis/ee/digikey-fact-key#2028 + + Rectangle with Flat Top + + + http://purl.org/trygvis/ee/digikey-fact-key#2029 + + 2.00mm x 1.50mm + + + http://purl.org/trygvis/ee/digikey-fact-key#319 + + 2.1V + + + http://purl.org/trygvis/ee/digikey-fact-key#543 + + 20mA + + + http://purl.org/trygvis/ee/digikey-fact-key#551 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#69 + + Surface Mount + + + http://purl.org/trygvis/ee/digikey-fact-key#969 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#968 + + 570nm + + + http://purl.org/trygvis/ee/digikey-fact-key#5 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#16 + + 1206 (3216 Metric) + + + http://purl.org/trygvis/ee/digikey-fact-key#1291 + + 1206 + + + http://purl.org/trygvis/ee/digikey-fact-key#46 + + 3.20mm L x 1.50mm W + + + http://purl.org/trygvis/ee/digikey-fact-key#966 + + 1.30mm + + + + + 1 + + + + 10 + + + + 25 + + + + 100 + + + + 250 + + + + 500 + + + + 1000 + + + + + + https://digikey.com + 10 kOhms ±1% 0.063W, 1/16W Chip Resistor 0402 (1005 Metric) Automotive AEC-Q200 Thick Film + + + + + + + + + + + + + RMCF0402FT10K0 + + + RMCF0402FT10K0CT-ND + + + + resolved + + + + http://purl.org/trygvis/ee/digikey-fact-key#7 + + Cut Tape (CT) + + + http://purl.org/trygvis/ee/digikey-fact-key#1989 + + Active + + + http://purl.org/trygvis/ee/digikey-fact-key#2085 + + 10 kOhms + + + http://purl.org/trygvis/ee/digikey-fact-key#3 + + ±1% + + + http://purl.org/trygvis/ee/digikey-fact-key#2 + + 0.063W, 1/16W + + + http://purl.org/trygvis/ee/digikey-fact-key#174 + + Thick Film + + + http://purl.org/trygvis/ee/digikey-fact-key#5 + + Automotive AEC-Q200 + + + http://purl.org/trygvis/ee/digikey-fact-key#17 + + ±100ppm/°C + + + http://purl.org/trygvis/ee/digikey-fact-key#252 + + -55°C ~ 155°C + + + http://purl.org/trygvis/ee/digikey-fact-key#16 + + 0402 (1005 Metric) + + + http://purl.org/trygvis/ee/digikey-fact-key#1291 + + 0402 + + + http://purl.org/trygvis/ee/digikey-fact-key#46 + + 0.039" L x 0.020" W (1.00mm x 0.50mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#1500 + + 0.016" (0.40mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#1127 + + 2 + + + http://purl.org/trygvis/ee/digikey-fact-key#1531 + + - + + + + + 1 + + + + 10 + + + + 100 + + + + 1000 + + + + 2500 + + + + 5000 + + + + + + https://digikey.com + CONN HDR 28POS 0.1 TIN PCB + + + + + + + + + + + + PPTC202LFBN-RC + + + S6104-ND + + + + resolved + + + + http://purl.org/trygvis/ee/digikey-fact-key#7 + + Tray + + + http://purl.org/trygvis/ee/digikey-fact-key#1989 + + Active + + + http://purl.org/trygvis/ee/digikey-fact-key#28 + + Header + + + http://purl.org/trygvis/ee/digikey-fact-key#512 + + Female Socket + + + http://purl.org/trygvis/ee/digikey-fact-key#91 + + Board to Board + + + http://purl.org/trygvis/ee/digikey-fact-key#88 + + 40 + + + http://purl.org/trygvis/ee/digikey-fact-key#564 + + All + + + http://purl.org/trygvis/ee/digikey-fact-key#1790 + + 0.100" (2.54mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#2172 + + 2 + + + http://purl.org/trygvis/ee/digikey-fact-key#2024 + + 0.100" (2.54mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#69 + + Through Hole + + + http://purl.org/trygvis/ee/digikey-fact-key#589 + + Solder + + + http://purl.org/trygvis/ee/digikey-fact-key#518 + + Push-Pull + + + http://purl.org/trygvis/ee/digikey-fact-key#1791 + + Tin + + + http://purl.org/trygvis/ee/digikey-fact-key#1792 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#1693 + + Black + + + http://purl.org/trygvis/ee/digikey-fact-key#2018 + + 0.335" (8.51mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#2012 + + 0.126" (3.20mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#252 + + -40°C ~ 105°C + + + http://purl.org/trygvis/ee/digikey-fact-key#903 + + UL94 V-0 + + + http://purl.org/trygvis/ee/digikey-fact-key#1795 + + Tin + + + http://purl.org/trygvis/ee/digikey-fact-key#1263 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#697 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#5 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#66 + + 3A + + + http://purl.org/trygvis/ee/digikey-fact-key#63 + + 250V + + + http://purl.org/trygvis/ee/digikey-fact-key#405 + + - + + + http://purl.org/trygvis/ee/digikey-fact-key#2023 + + Polyester + + + http://purl.org/trygvis/ee/digikey-fact-key#2011 + + Square + + + http://purl.org/trygvis/ee/digikey-fact-key#1084 + + Phosphor Bronze + + + http://purl.org/trygvis/ee/digikey-fact-key#1796 + + - + + + + + 1 + + + + 10 + + + + 100 + + + + 500 + + + + 1000 + + + + 5000 + + + + + + https://digikey.com + 13.3 kOhms ±1% 0.063W, 1/16W Chip Resistor 0402 (1005 Metric) Moisture Resistant Thick Film + + + + + + + + + + + RC0402FR-0713K3L + + + YAG2974CT-ND + + + + resolved + + + + http://purl.org/trygvis/ee/digikey-fact-key#7 + + Cut Tape (CT) + + + http://purl.org/trygvis/ee/digikey-fact-key#1989 + + Active + + + http://purl.org/trygvis/ee/digikey-fact-key#2085 + + 13.3 kOhms + + + http://purl.org/trygvis/ee/digikey-fact-key#3 + + ±1% + + + http://purl.org/trygvis/ee/digikey-fact-key#2 + + 0.063W, 1/16W + + + http://purl.org/trygvis/ee/digikey-fact-key#174 + + Thick Film + + + http://purl.org/trygvis/ee/digikey-fact-key#5 + + Moisture Resistant + + + http://purl.org/trygvis/ee/digikey-fact-key#17 + + ±100ppm/°C + + + http://purl.org/trygvis/ee/digikey-fact-key#252 + + -55°C ~ 155°C + + + http://purl.org/trygvis/ee/digikey-fact-key#16 + + 0402 (1005 Metric) + + + http://purl.org/trygvis/ee/digikey-fact-key#1291 + + 0402 + + + http://purl.org/trygvis/ee/digikey-fact-key#46 + + 0.039" L x 0.020" W (1.00mm x 0.50mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#1500 + + 0.016" (0.40mm) + + + http://purl.org/trygvis/ee/digikey-fact-key#1127 + + 2 + + + http://purl.org/trygvis/ee/digikey-fact-key#1531 + + - + + + + + 1 + + + + 10 + + + + 100 + + + + 1000 + + + + 2500 + + + + 5000 + + + + + + diff --git a/demo/thirdparty/unlockoslo-alpha-3/ee/digikey/normalized.xml b/demo/thirdparty/unlockoslo-alpha-3/ee/digikey/normalized.xml new file mode 100644 index 0000000..eec4be1 --- /dev/null +++ b/demo/thirdparty/unlockoslo-alpha-3/ee/digikey/normalized.xml @@ -0,0 +1,1131 @@ + + + + https://digikey.com + TERM BLK 3P SIDE ENT 2.54MM SMD + + + + + + + + + + 14010213102000 + + + 1195-3656-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/fact-key#temperature-min + 40 + + + http://purl.org/trygvis/ee/fact-key#temperature-max + 5 + + + + + 1 + + + + 10 + + + + 25 + + + + 50 + + + + 100 + + + + 250 + + + + + + https://digikey.com + TERM BLK 8P SIDE ENT 2.54MM SMD + + + + + + + + + + 14010813102000 + + + 1195-3662-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/fact-key#temperature-min + 40 + + + http://purl.org/trygvis/ee/fact-key#temperature-max + 5 + + + + + 1 + + + + 10 + + + + 25 + + + + 50 + + + + 100 + + + + 250 + + + + + + https://digikey.com + TERM BLK 3P SIDE ENT 2.54MM SMD + + + + + + + + + + 14011213102000 + + + 1195-3666-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/fact-key#temperature-min + 40 + + + http://purl.org/trygvis/ee/fact-key#temperature-max + 5 + + + + + 1 + + + + 10 + + + + 25 + + + + 50 + + + + 100 + + + + 250 + + + + + + https://digikey.com + 270 Ohms ±1% 0.063W, 1/16W Chip Resistor 0402 (1005 Metric) Moisture Resistant Thick Film + + + + + + + + + + + RC1005F271CS + + + 1276-3970-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/fact-key#tolerance + ±1% + + + http://purl.org/trygvis/ee/fact-key#temperature-min + 55 + + + http://purl.org/trygvis/ee/fact-key#temperature-max + 5 + + + http://purl.org/trygvis/ee/fact-key#part-height + 0.40 + + + + + 1 + + + + 10 + + + + 100 + + + + 1000 + + + + 2500 + + + + 5000 + + + + + + https://digikey.com + 0.1µF ±10% 50V Ceramic Capacitor X7R 0805 (2012 Metric) + + + + + + + + + + + + + + + + CL21B104KBFNNNG + + + 1276-6468-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/fact-key#capacitance + 100 nF + + + http://purl.org/trygvis/ee/fact-key#tolerance + ±10% + + + http://purl.org/trygvis/ee/fact-key#temperature-min + 55 + + + http://purl.org/trygvis/ee/fact-key#temperature-max + 5 + + + + + 1 + + + + 10 + + + + 100 + + + + 500 + + + + 1000 + + + + + + https://digikey.com + TEMPERATURE SENSOR SWITCH + + + + + + + + + + + + + + + + + TMP102AIDRLT + + + 296-22055-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/fact-key#temperature-min + 55 + + + http://purl.org/trygvis/ee/fact-key#temperature-max + 0 + + + + + 1 + + + + 10 + + + + 25 + + + + 100 + + + + + + https://digikey.com + IC FF D-TYPE DUAL 1BIT 14DIP + + + + + + + + + + + + + TPS54202DDCT + + + 296-44151-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/fact-key#voltage-input-min + 4.5 + + + http://purl.org/trygvis/ee/fact-key#voltage-input-max + 28 + + + http://purl.org/trygvis/ee/fact-key#voltage-output-max + 28 + + + http://purl.org/trygvis/ee/fact-key#temperature-min + 40 + + + http://purl.org/trygvis/ee/fact-key#temperature-max + 5 + + + + + 1 + + + + 10 + + + + 100 + + + + + + https://digikey.com + 22µF ±20% 10V Ceramic Capacitor X5R 0805 (2012 Metric) + + + + + + + + + + + + + + GRM21BR61A226ME51L + + + 490-10511-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/fact-key#capacitance + 22 uF + + + http://purl.org/trygvis/ee/fact-key#tolerance + ±20% + + + http://purl.org/trygvis/ee/fact-key#temperature-min + 55 + + + http://purl.org/trygvis/ee/fact-key#temperature-max + 5 + + + + + 1 + + + + 10 + + + + 100 + + + + 500 + + + + 1000 + + + + + + https://digikey.com + 75pF ±5% 50V Ceramic Capacitor C0G, NP0 0402 (1005 Metric) + + + + + + + + + + + + + + GRM1555C1H750JA01D + + + 490-5951-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/fact-key#capacitance + 75 pF + + + http://purl.org/trygvis/ee/fact-key#tolerance + ±5% + + + http://purl.org/trygvis/ee/fact-key#temperature-min + 55 + + + http://purl.org/trygvis/ee/fact-key#temperature-max + 5 + + + + + 1 + + + + 10 + + + + 100 + + + + 500 + + + + 1000 + + + + 2500 + + + + 5000 + + + + + + https://digikey.com + 100 kOhms ±1% 0.063W, 1/16W Chip Resistor 0402 (1005 Metric) Automotive AEC-Q200 Thick Film + + + + + + + + + + CRCW0402100KFKED + + + 541-100KLCT-ND + + + + resolved + + + + http://purl.org/trygvis/ee/fact-key#tolerance + ±1% + + + http://purl.org/trygvis/ee/fact-key#temperature-min + 55 + + + http://purl.org/trygvis/ee/fact-key#temperature-max + 5 + + + http://purl.org/trygvis/ee/fact-key#part-height + 0.40 + + + + + 1 + + + + 10 + + + + 100 + + + + 1000 + + + + 2500 + + + + 5000 + + + + + + https://digikey.com + 15µH Shielded Wirewound Inductor 2.4A 65 mOhm Max Nonstandard + + + + + + + + + + + + + NRS8040T150MJGJ + + + 587-2973-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/fact-key#tolerance + ±20% + + + http://purl.org/trygvis/ee/fact-key#temperature-min + 25 + + + http://purl.org/trygvis/ee/fact-key#temperature-max + 5 + + + http://purl.org/trygvis/ee/fact-key#part-height + 4.00 + + + + + 1 + + + + 10 + + + + 100 + + + + 500 + + + + + + https://digikey.com + 10µF ±10% 35V Ceramic Capacitor X5R 0805 (2012 Metric) + + + + + + + + + + GMK212BBJ106KG-T + + + 587-4893-1-ND + + + + resolved + + + + http://purl.org/trygvis/ee/fact-key#capacitance + 10 uF + + + http://purl.org/trygvis/ee/fact-key#tolerance + ±10% + + + http://purl.org/trygvis/ee/fact-key#temperature-min + 55 + + + http://purl.org/trygvis/ee/fact-key#temperature-max + 5 + + + + + 1 + + + + 10 + + + + 100 + + + + 500 + + + + 1000 + + + + + + https://digikey.com + DIODE ZENER 3.3V 300MW SOT23 + + + + + + + + + BZX384C3V3-E3-08 + + + BZX384C3V3-E3-08GICT-ND + + + + resolved + + + + http://purl.org/trygvis/ee/fact-key#tolerance + ±5% + + + http://purl.org/trygvis/ee/fact-key#temperature-min + 55 + + + http://purl.org/trygvis/ee/fact-key#temperature-max + 0 + + + + + 1 + + + + 10 + + + + 25 + + + + 100 + + + + 250 + + + + 500 + + + + 1000 + + + + + + https://digikey.com + DIODE SCHOTTKY 60V 3A SMB + + + + + + + + + + + + DMN2041L-7 + + + DMN2041L-7DICT-ND + + + + resolved + + + + http://purl.org/trygvis/ee/fact-key#temperature-min + 55 + + + http://purl.org/trygvis/ee/fact-key#temperature-max + 0 + + + + + 1 + + + + 10 + + + + 100 + + + + 500 + + + + 1000 + + + + + + https://digikey.com + DIODE SCHOTTKY 60V 3A SMB + + + + + + + + + + DMP3056L-7 + + + DMP3056L-7DICT-ND + + + + resolved + + + + http://purl.org/trygvis/ee/fact-key#temperature-min + 55 + + + http://purl.org/trygvis/ee/fact-key#temperature-max + 0 + + + + + 1 + + + + 10 + + + + 100 + + + + 500 + + + + 1000 + + + + + + https://digikey.com + 10 kOhms ±1% 0.063W, 1/16W Chip Resistor 0402 (1005 Metric) Automotive AEC-Q200 Thick Film + + + + + + + + + + + + + RMCF0402FT10K0 + + + RMCF0402FT10K0CT-ND + + + + resolved + + + + http://purl.org/trygvis/ee/fact-key#tolerance + ±1% + + + http://purl.org/trygvis/ee/fact-key#temperature-min + 55 + + + http://purl.org/trygvis/ee/fact-key#temperature-max + 5 + + + http://purl.org/trygvis/ee/fact-key#part-height + 0.40 + + + + + 1 + + + + 10 + + + + 100 + + + + 1000 + + + + 2500 + + + + 5000 + + + + + + https://digikey.com + CONN HDR 28POS 0.1 TIN PCB + + + + + + + + + + + + PPTC202LFBN-RC + + + S6104-ND + + + + resolved + + + + http://purl.org/trygvis/ee/fact-key#temperature-min + 40 + + + http://purl.org/trygvis/ee/fact-key#temperature-max + 5 + + + + + 1 + + + + 10 + + + + 100 + + + + 500 + + + + 1000 + + + + 5000 + + + + + + https://digikey.com + 13.3 kOhms ±1% 0.063W, 1/16W Chip Resistor 0402 (1005 Metric) Moisture Resistant Thick Film + + + + + + + + + + + RC0402FR-0713K3L + + + YAG2974CT-ND + + + + resolved + + + + http://purl.org/trygvis/ee/fact-key#tolerance + ±1% + + + http://purl.org/trygvis/ee/fact-key#temperature-min + 55 + + + http://purl.org/trygvis/ee/fact-key#temperature-max + 5 + + + http://purl.org/trygvis/ee/fact-key#part-height + 0.40 + + + + + 1 + + + + 10 + + + + 100 + + + + 1000 + + + + 2500 + + + + 5000 + + + + + + diff --git a/demo/thirdparty/unlockoslo-alpha-3/ee/digikey/search-list.xml b/demo/thirdparty/unlockoslo-alpha-3/ee/digikey/search-list.xml new file mode 100644 index 0000000..2973c6b --- /dev/null +++ b/demo/thirdparty/unlockoslo-alpha-3/ee/digikey/search-list.xml @@ -0,0 +1,214 @@ + + + + + + C1 + + + CL21B104KBFNNNG + + + + + + + C2 + + + GMK212BBJ106KG-T + + + + + + + C4 + + + GRM1555C1H750JA01D + + + + + + + C5 + + + GRM21BR61A226ME51L + + + + + + + D1 + + + S1MTR + + + + + + + D2 + + + CMD15-21VRD/TR8 + + + + + + + D13 + + + BZX384C3V3-E3-08 + + + + + + + D21 + + + CMD15-21VGD/TR8 + + + + + + + L1 + + + NRS8040T150MJGJ + + + + + + + P1 + + + 14011213102000 + + + + + + + P2 + + + 14010813102000 + + + + + + + P3 + + + PPTC202LFBN-RC + + + + + + + P4 + + + 14010213102000 + + + + + + + Q1 + + + DMN2041L-7 + + + + + + + Q7 + + + DMP3056L-7 + + + + + + + R1 + + + RMCF0402FT10K0 + + + + + + + R2 + + + RC1005F271CS + + + + + + + R21 + + + CRCW0402100KFKED + + + + + + + R22 + + + RC0402FR-0713K3L + + + + + + + U1 + + + TPS54202DDCT + + + + + + + U2 + + + TMP102AIDRLT + + + + + diff --git a/demo/thirdparty/unlockoslo-alpha-3/ee/order.xml b/demo/thirdparty/unlockoslo-alpha-3/ee/order.xml new file mode 100644 index 0000000..428dc16 --- /dev/null +++ b/demo/thirdparty/unlockoslo-alpha-3/ee/order.xml @@ -0,0 +1,620 @@ + + + + https://digikey.com + + + https://digikey.com/pn#1276-6468-1-ND + + + C1 + + + + + https://digikey.com + + + https://digikey.com/pn#587-4893-1-ND + + + C2 + + + + + https://digikey.com + + + https://digikey.com/pn#1276-6468-1-ND + + + C3 + + + + + https://digikey.com + + + https://digikey.com/pn#490-5951-1-ND + + + C4 + + + + + https://digikey.com + + + https://digikey.com/pn#490-10511-1-ND + + + C5 + + + + + https://digikey.com + + + https://digikey.com/pn#490-10511-1-ND + + + C6 + + + + + https://digikey.com + + + https://digikey.com/pn#BZX384C3V3-E3-08GICT-ND + + + D13 + + + + + https://digikey.com + + + https://digikey.com/pn#BZX384C3V3-E3-08GICT-ND + + + D14 + + + + + https://digikey.com + + + https://digikey.com/pn#BZX384C3V3-E3-08GICT-ND + + + D15 + + + + + https://digikey.com + + + https://digikey.com/pn#BZX384C3V3-E3-08GICT-ND + + + D16 + + + + + https://digikey.com + + + https://digikey.com/pn#BZX384C3V3-E3-08GICT-ND + + + D17 + + + + + https://digikey.com + + + https://digikey.com/pn#BZX384C3V3-E3-08GICT-ND + + + D18 + + + + + https://digikey.com + + + https://digikey.com/pn#BZX384C3V3-E3-08GICT-ND + + + D19 + + + + + https://digikey.com + + + https://digikey.com/pn#BZX384C3V3-E3-08GICT-ND + + + D20 + + + + + https://digikey.com + + + https://digikey.com/pn#587-2973-1-ND + + + L1 + + + + + https://digikey.com + + + https://digikey.com/pn#1195-3666-1-ND + + + P1 + + + + + https://digikey.com + + + https://digikey.com/pn#1195-3662-1-ND + + + P2 + + + + + https://digikey.com + + + https://digikey.com/pn#S6104-ND + + + P3 + + + + + https://digikey.com + + + https://digikey.com/pn#1195-3656-1-ND + + + P4 + + + + + https://digikey.com + + + https://digikey.com/pn#DMN2041L-7DICT-ND + + + Q1 + + + + + https://digikey.com + + + https://digikey.com/pn#DMN2041L-7DICT-ND + + + Q2 + + + + + https://digikey.com + + + https://digikey.com/pn#DMN2041L-7DICT-ND + + + Q3 + + + + + https://digikey.com + + + https://digikey.com/pn#DMN2041L-7DICT-ND + + + Q4 + + + + + https://digikey.com + + + https://digikey.com/pn#DMN2041L-7DICT-ND + + + Q5 + + + + + https://digikey.com + + + https://digikey.com/pn#DMN2041L-7DICT-ND + + + Q6 + + + + + https://digikey.com + + + https://digikey.com/pn#DMP3056L-7DICT-ND + + + Q7 + + + + + https://digikey.com + + + https://digikey.com/pn#RMCF0402FT10K0CT-ND + + + R1 + + + + + https://digikey.com + + + https://digikey.com/pn#1276-3970-1-ND + + + R2 + + + + + https://digikey.com + + + https://digikey.com/pn#RMCF0402FT10K0CT-ND + + + R3 + + + + + https://digikey.com + + + https://digikey.com/pn#1276-3970-1-ND + + + R4 + + + + + https://digikey.com + + + https://digikey.com/pn#RMCF0402FT10K0CT-ND + + + R5 + + + + + https://digikey.com + + + https://digikey.com/pn#1276-3970-1-ND + + + R6 + + + + + https://digikey.com + + + https://digikey.com/pn#RMCF0402FT10K0CT-ND + + + R7 + + + + + https://digikey.com + + + https://digikey.com/pn#1276-3970-1-ND + + + R8 + + + + + https://digikey.com + + + https://digikey.com/pn#RMCF0402FT10K0CT-ND + + + R9 + + + + + https://digikey.com + + + https://digikey.com/pn#1276-3970-1-ND + + + R10 + + + + + https://digikey.com + + + https://digikey.com/pn#RMCF0402FT10K0CT-ND + + + R11 + + + + + https://digikey.com + + + https://digikey.com/pn#1276-3970-1-ND + + + R12 + + + + + https://digikey.com + + + https://digikey.com/pn#RMCF0402FT10K0CT-ND + + + R13 + + + + + https://digikey.com + + + https://digikey.com/pn#RMCF0402FT10K0CT-ND + + + R14 + + + + + https://digikey.com + + + https://digikey.com/pn#RMCF0402FT10K0CT-ND + + + R15 + + + + + https://digikey.com + + + https://digikey.com/pn#RMCF0402FT10K0CT-ND + + + R16 + + + + + https://digikey.com + + + https://digikey.com/pn#RMCF0402FT10K0CT-ND + + + R17 + + + + + https://digikey.com + + + https://digikey.com/pn#RMCF0402FT10K0CT-ND + + + R18 + + + + + https://digikey.com + + + https://digikey.com/pn#RMCF0402FT10K0CT-ND + + + R19 + + + + + https://digikey.com + + + https://digikey.com/pn#RMCF0402FT10K0CT-ND + + + R20 + + + + + https://digikey.com + + + https://digikey.com/pn#541-100KLCT-ND + + + R21 + + + + + https://digikey.com + + + https://digikey.com/pn#YAG2974CT-ND + + + R22 + + + + + https://digikey.com + + + https://digikey.com/pn#1276-3970-1-ND + + + R23 + + + + + https://digikey.com + + + https://digikey.com/pn#RMCF0402FT10K0CT-ND + + + R24 + + + + + https://digikey.com + + + https://digikey.com/pn#RMCF0402FT10K0CT-ND + + + R25 + + + + + https://digikey.com + + + https://digikey.com/pn#RMCF0402FT10K0CT-ND + + + R26 + + + + + https://digikey.com + + + https://digikey.com/pn#1276-3970-1-ND + + + R27 + + + + + https://digikey.com + + + https://digikey.com/pn#1276-3970-1-ND + + + R28 + + + + + https://digikey.com + + + https://digikey.com/pn#296-44151-1-ND + + + U1 + + + + + https://digikey.com + + + https://digikey.com/pn#296-22055-1-ND + + + U2 + + + + + diff --git a/demo/thirdparty/unlockoslo-alpha-3/ee/reports/order.rst b/demo/thirdparty/unlockoslo-alpha-3/ee/reports/order.rst new file mode 100644 index 0000000..10c1aa0 --- /dev/null +++ b/demo/thirdparty/unlockoslo-alpha-3/ee/reports/order.rst @@ -0,0 +1,1012 @@ +Order +===== + +Has unresolved parts: yes. + +Parts for Order +=============== + +.. _ref-C1: + +C1 +-- + +Selected supplier: https://digikey.com, pn: CL21B104KBFNNNG, spn: 1276-6468-1-ND. +Part: `CL21B104KBFNNNG `_ + +.. _ref-C2: + +C2 +-- + +Selected supplier: https://digikey.com, pn: GMK212BBJ106KG-T, spn: 587-4893-1-ND. +Part: `GMK212BBJ106KG-T `_ + +.. _ref-C3: + +C3 +-- + +Selected supplier: https://digikey.com, pn: CL21B104KBFNNNG, spn: 1276-6468-1-ND. +Part: `CL21B104KBFNNNG `_ + +.. _ref-C4: + +C4 +-- + +Selected supplier: https://digikey.com, pn: GRM1555C1H750JA01D, spn: 490-5951-1-ND. +Part: `GRM1555C1H750JA01D `_ + +.. _ref-C5: + +C5 +-- + +Selected supplier: https://digikey.com, pn: GRM21BR61A226ME51L, spn: 490-10511-1-ND. +Part: `GRM21BR61A226ME51L `_ + +.. _ref-C6: + +C6 +-- + +Selected supplier: https://digikey.com, pn: GRM21BR61A226ME51L, spn: 490-10511-1-ND. +Part: `GRM21BR61A226ME51L `_ + +.. _ref-D1: + +D1 +-- + +Part not resolved. + +.. _ref-D2: + +D2 +-- + +Part not resolved. + +.. _ref-D3: + +D3 +-- + +Part not resolved. + +.. _ref-D4: + +D4 +-- + +Part not resolved. + +.. _ref-D5: + +D5 +-- + +Part not resolved. + +.. _ref-D6: + +D6 +-- + +Part not resolved. + +.. _ref-D7: + +D7 +-- + +Part not resolved. + +.. _ref-D8: + +D8 +-- + +Part not resolved. + +.. _ref-D9: + +D9 +-- + +Part not resolved. + +.. _ref-D10: + +D10 +--- + +Part not resolved. + +.. _ref-D11: + +D11 +--- + +Part not resolved. + +.. _ref-D12: + +D12 +--- + +Part not resolved. + +.. _ref-D13: + +D13 +--- + +Selected supplier: https://digikey.com, pn: BZX384C3V3-E3-08, spn: BZX384C3V3-E3-08GICT-ND. +Part: `BZX384C3V3-E3-08 `_ + +.. _ref-D14: + +D14 +--- + +Selected supplier: https://digikey.com, pn: BZX384C3V3-E3-08, spn: BZX384C3V3-E3-08GICT-ND. +Part: `BZX384C3V3-E3-08 `_ + +.. _ref-D15: + +D15 +--- + +Selected supplier: https://digikey.com, pn: BZX384C3V3-E3-08, spn: BZX384C3V3-E3-08GICT-ND. +Part: `BZX384C3V3-E3-08 `_ + +.. _ref-D16: + +D16 +--- + +Selected supplier: https://digikey.com, pn: BZX384C3V3-E3-08, spn: BZX384C3V3-E3-08GICT-ND. +Part: `BZX384C3V3-E3-08 `_ + +.. _ref-D17: + +D17 +--- + +Selected supplier: https://digikey.com, pn: BZX384C3V3-E3-08, spn: BZX384C3V3-E3-08GICT-ND. +Part: `BZX384C3V3-E3-08 `_ + +.. _ref-D18: + +D18 +--- + +Selected supplier: https://digikey.com, pn: BZX384C3V3-E3-08, spn: BZX384C3V3-E3-08GICT-ND. +Part: `BZX384C3V3-E3-08 `_ + +.. _ref-D19: + +D19 +--- + +Selected supplier: https://digikey.com, pn: BZX384C3V3-E3-08, spn: BZX384C3V3-E3-08GICT-ND. +Part: `BZX384C3V3-E3-08 `_ + +.. _ref-D20: + +D20 +--- + +Selected supplier: https://digikey.com, pn: BZX384C3V3-E3-08, spn: BZX384C3V3-E3-08GICT-ND. +Part: `BZX384C3V3-E3-08 `_ + +.. _ref-D21: + +D21 +--- + +Part not resolved. + +.. _ref-D22: + +D22 +--- + +Part not resolved. + +.. _ref-D23: + +D23 +--- + +Part not resolved. + +.. _ref-J1: + +J1 +-- + +Part not resolved. + +.. _ref-J2: + +J2 +-- + +Part not resolved. + +.. _ref-L1: + +L1 +-- + +Selected supplier: https://digikey.com, pn: NRS8040T150MJGJ, spn: 587-2973-1-ND. +Part: `NRS8040T150MJGJ `_ + +.. _ref-MK1: + +MK1 +--- + +Part not resolved. + +.. _ref-MK2: + +MK2 +--- + +Part not resolved. + +.. _ref-MK3: + +MK3 +--- + +Part not resolved. + +.. _ref-MK4: + +MK4 +--- + +Part not resolved. + +.. _ref-P1: + +P1 +-- + +Selected supplier: https://digikey.com, pn: 14011213102000, spn: 1195-3666-1-ND. +Part: `14011213102000 `_ + +.. _ref-P2: + +P2 +-- + +Selected supplier: https://digikey.com, pn: 14010813102000, spn: 1195-3662-1-ND. +Part: `14010813102000 `_ + +.. _ref-P3: + +P3 +-- + +Selected supplier: https://digikey.com, pn: PPTC202LFBN-RC, spn: S6104-ND. +Part: `PPTC202LFBN-RC `_ + +.. _ref-P4: + +P4 +-- + +Selected supplier: https://digikey.com, pn: 14010213102000, spn: 1195-3656-1-ND. +Part: `14010213102000 `_ + +.. _ref-Q1: + +Q1 +-- + +Selected supplier: https://digikey.com, pn: DMN2041L-7, spn: DMN2041L-7DICT-ND. +Part: `DMN2041L-7 `_ + +.. _ref-Q2: + +Q2 +-- + +Selected supplier: https://digikey.com, pn: DMN2041L-7, spn: DMN2041L-7DICT-ND. +Part: `DMN2041L-7 `_ + +.. _ref-Q3: + +Q3 +-- + +Selected supplier: https://digikey.com, pn: DMN2041L-7, spn: DMN2041L-7DICT-ND. +Part: `DMN2041L-7 `_ + +.. _ref-Q4: + +Q4 +-- + +Selected supplier: https://digikey.com, pn: DMN2041L-7, spn: DMN2041L-7DICT-ND. +Part: `DMN2041L-7 `_ + +.. _ref-Q5: + +Q5 +-- + +Selected supplier: https://digikey.com, pn: DMN2041L-7, spn: DMN2041L-7DICT-ND. +Part: `DMN2041L-7 `_ + +.. _ref-Q6: + +Q6 +-- + +Selected supplier: https://digikey.com, pn: DMN2041L-7, spn: DMN2041L-7DICT-ND. +Part: `DMN2041L-7 `_ + +.. _ref-Q7: + +Q7 +-- + +Selected supplier: https://digikey.com, pn: DMP3056L-7, spn: DMP3056L-7DICT-ND. +Part: `DMP3056L-7 `_ + +.. _ref-R1: + +R1 +-- + +Selected supplier: https://digikey.com, pn: RMCF0402FT10K0, spn: RMCF0402FT10K0CT-ND. +Part: `RMCF0402FT10K0 `_ + +.. _ref-R2: + +R2 +-- + +Selected supplier: https://digikey.com, pn: RC1005F271CS, spn: 1276-3970-1-ND. +Part: `RC1005F271CS `_ + +.. _ref-R3: + +R3 +-- + +Selected supplier: https://digikey.com, pn: RMCF0402FT10K0, spn: RMCF0402FT10K0CT-ND. +Part: `RMCF0402FT10K0 `_ + +.. _ref-R4: + +R4 +-- + +Selected supplier: https://digikey.com, pn: RC1005F271CS, spn: 1276-3970-1-ND. +Part: `RC1005F271CS `_ + +.. _ref-R5: + +R5 +-- + +Selected supplier: https://digikey.com, pn: RMCF0402FT10K0, spn: RMCF0402FT10K0CT-ND. +Part: `RMCF0402FT10K0 `_ + +.. _ref-R6: + +R6 +-- + +Selected supplier: https://digikey.com, pn: RC1005F271CS, spn: 1276-3970-1-ND. +Part: `RC1005F271CS `_ + +.. _ref-R7: + +R7 +-- + +Selected supplier: https://digikey.com, pn: RMCF0402FT10K0, spn: RMCF0402FT10K0CT-ND. +Part: `RMCF0402FT10K0 `_ + +.. _ref-R8: + +R8 +-- + +Selected supplier: https://digikey.com, pn: RC1005F271CS, spn: 1276-3970-1-ND. +Part: `RC1005F271CS `_ + +.. _ref-R9: + +R9 +-- + +Selected supplier: https://digikey.com, pn: RMCF0402FT10K0, spn: RMCF0402FT10K0CT-ND. +Part: `RMCF0402FT10K0 `_ + +.. _ref-R10: + +R10 +--- + +Selected supplier: https://digikey.com, pn: RC1005F271CS, spn: 1276-3970-1-ND. +Part: `RC1005F271CS `_ + +.. _ref-R11: + +R11 +--- + +Selected supplier: https://digikey.com, pn: RMCF0402FT10K0, spn: RMCF0402FT10K0CT-ND. +Part: `RMCF0402FT10K0 `_ + +.. _ref-R12: + +R12 +--- + +Selected supplier: https://digikey.com, pn: RC1005F271CS, spn: 1276-3970-1-ND. +Part: `RC1005F271CS `_ + +.. _ref-R13: + +R13 +--- + +Selected supplier: https://digikey.com, pn: RMCF0402FT10K0, spn: RMCF0402FT10K0CT-ND. +Part: `RMCF0402FT10K0 `_ + +.. _ref-R14: + +R14 +--- + +Selected supplier: https://digikey.com, pn: RMCF0402FT10K0, spn: RMCF0402FT10K0CT-ND. +Part: `RMCF0402FT10K0 `_ + +.. _ref-R15: + +R15 +--- + +Selected supplier: https://digikey.com, pn: RMCF0402FT10K0, spn: RMCF0402FT10K0CT-ND. +Part: `RMCF0402FT10K0 `_ + +.. _ref-R16: + +R16 +--- + +Selected supplier: https://digikey.com, pn: RMCF0402FT10K0, spn: RMCF0402FT10K0CT-ND. +Part: `RMCF0402FT10K0 `_ + +.. _ref-R17: + +R17 +--- + +Selected supplier: https://digikey.com, pn: RMCF0402FT10K0, spn: RMCF0402FT10K0CT-ND. +Part: `RMCF0402FT10K0 `_ + +.. _ref-R18: + +R18 +--- + +Selected supplier: https://digikey.com, pn: RMCF0402FT10K0, spn: RMCF0402FT10K0CT-ND. +Part: `RMCF0402FT10K0 `_ + +.. _ref-R19: + +R19 +--- + +Selected supplier: https://digikey.com, pn: RMCF0402FT10K0, spn: RMCF0402FT10K0CT-ND. +Part: `RMCF0402FT10K0 `_ + +.. _ref-R20: + +R20 +--- + +Selected supplier: https://digikey.com, pn: RMCF0402FT10K0, spn: RMCF0402FT10K0CT-ND. +Part: `RMCF0402FT10K0 `_ + +.. _ref-R21: + +R21 +--- + +Selected supplier: https://digikey.com, pn: CRCW0402100KFKED, spn: 541-100KLCT-ND. +Part: `CRCW0402100KFKED `_ + +.. _ref-R22: + +R22 +--- + +Selected supplier: https://digikey.com, pn: RC0402FR-0713K3L, spn: YAG2974CT-ND. +Part: `RC0402FR-0713K3L `_ + +.. _ref-R23: + +R23 +--- + +Selected supplier: https://digikey.com, pn: RC1005F271CS, spn: 1276-3970-1-ND. +Part: `RC1005F271CS `_ + +.. _ref-R24: + +R24 +--- + +Selected supplier: https://digikey.com, pn: RMCF0402FT10K0, spn: RMCF0402FT10K0CT-ND. +Part: `RMCF0402FT10K0 `_ + +.. _ref-R25: + +R25 +--- + +Selected supplier: https://digikey.com, pn: RMCF0402FT10K0, spn: RMCF0402FT10K0CT-ND. +Part: `RMCF0402FT10K0 `_ + +.. _ref-R26: + +R26 +--- + +Selected supplier: https://digikey.com, pn: RMCF0402FT10K0, spn: RMCF0402FT10K0CT-ND. +Part: `RMCF0402FT10K0 `_ + +.. _ref-R27: + +R27 +--- + +Selected supplier: https://digikey.com, pn: RC1005F271CS, spn: 1276-3970-1-ND. +Part: `RC1005F271CS `_ + +.. _ref-R28: + +R28 +--- + +Selected supplier: https://digikey.com, pn: RC1005F271CS, spn: 1276-3970-1-ND. +Part: `RC1005F271CS `_ + +.. _ref-TP1: + +TP1 +--- + +Part not resolved. + +.. _ref-U1: + +U1 +-- + +Selected supplier: https://digikey.com, pn: TPS54202DDCT, spn: 296-44151-1-ND. +Part: `TPS54202DDCT `_ + +.. _ref-U2: + +U2 +-- + +Selected supplier: https://digikey.com, pn: TMP102AIDRLT, spn: 296-22055-1-ND. +Part: `TMP102AIDRLT `_ + + +Part details +============ + +From https://digikey.com +------------------------ + +.. _part-CL21B104KBFNNNG: + +CL21B104KBFNNNG +~~~~~~~~~~~~~~~ + +=========== === +MPN CL21B104KBFNNNG +SPN 1276-6468-1-ND +Used by: +=========== === + +Documentation +............. + + +* `Datasheets: CL21B104KBFNNNG Spec `__ +* `Datasheets: CL21B104KBFNNNG Characteristics `__ +* `Datasheets: MLCC Catalog `__ +* `Datasheets: CL Series, MLCC Datasheet `__ +* `Product Training Modules: High Cap MLCC Family `__ +* `Product Training Modules: Soft Termination MLCC `__ +* `Environmental Information: MLCC RoHS 2 Compliance `__ +* `Featured Product: Multi-Layer Ceramic Capacitors `__ +* `HTML Datasheet: CL Series, MLCC Datasheet `__ +* `Online Catalog: CL Series, General Purpose `__ + +.. _part-GMK212BBJ106KG-T: + +GMK212BBJ106KG-T +~~~~~~~~~~~~~~~~ + +=========== === +MPN GMK212BBJ106KG-T +SPN 587-4893-1-ND +Used by: +=========== === + +Documentation +............. + + +* `Datasheets: MLCC Capacitor Catalog `__ +* `Datasheets: GMK212BBJ106KG-T View all Specification `__ +* `Featured Product: Multilayer Chip Capacitors `__ +* `Online Catalog: M Series, General Purpose `__ + +.. _part-GRM1555C1H750JA01D: + +GRM1555C1H750JA01D +~~~~~~~~~~~~~~~~~~ + +=========== === +MPN GRM1555C1H750JA01D +SPN 490-5951-1-ND +Used by: +=========== === + +Documentation +............. + + +* `Datasheets: Chip Monolithic Ceramic Caps Catalog `__ +* `Datasheets: Chip Monolithic Ceramic Caps Part Numbering `__ +* `Datasheets: GRM1555C1H750JA01 Ref Sheet `__ +* `Design Resources: GRM1555C1H750JA01D SimSurfing Design Tool `__ +* `HTML Datasheet: Chip Monolithic Ceramic Caps Catalog `__ +* `EDA / CAD Models: GRM1555C1H750JA01D by SnapEDA `__ +* `EDA / CAD Models: Download from Ultra Librarian `__ +* `Online Catalog: GRM Series `__ + +.. _part-GRM21BR61A226ME51L: + +GRM21BR61A226ME51L +~~~~~~~~~~~~~~~~~~ + +=========== === +MPN GRM21BR61A226ME51L +SPN 490-10511-1-ND +Used by: +=========== === + +Documentation +............. + + +* `Datasheets: GRM21BR61A226ME51x Ref Sheet `__ +* `Datasheets: Chip Monolithic Ceramic Caps Part Numbering `__ +* `Datasheets: Chip Monolithic Ceramic Caps Catalog `__ +* `Product Training Modules: High Capacitance (Hi-Cap) MLCC `__ +* `Design Resources: GRM21BR61A226ME51L SimSurfing Design Tool `__ +* `HTML Datasheet: Chip Monolithic Ceramic Caps Catalog `__ +* `EDA / CAD Models: GRM21BR61A226ME51L by SnapEDA `__ +* `Online Catalog: GRM Series `__ + +.. _part-BZX384C3V3-E3-08: + +BZX384C3V3-E3-08 +~~~~~~~~~~~~~~~~ + +=========== === +MPN BZX384C3V3-E3-08 +SPN BZX384C3V3-E3-08GICT-ND +Used by: +=========== === + +Documentation +............. + + +* `Datasheets: BZX384 Series `__ +* `HTML Datasheet: BZX384 Series `__ +* `Online Catalog: BZX384 Zener Diode `__ + +.. _part-NRS8040T150MJGJ: + +NRS8040T150MJGJ +~~~~~~~~~~~~~~~ + +=========== === +MPN NRS8040T150MJGJ +SPN 587-2973-1-ND +Used by: +=========== === + +Documentation +............. + + +* `Datasheets: NRS8040T150MJGJ View all Specification `__ +* `Datasheets: NR(H,S,V) Series Catalog `__ +* `Product Training Modules: NR Series Power Inductors `__ +* `Featured Product: NR Series Inductors `__ +* `HTML Datasheet: NR(H,S,V) Series Catalog `__ +* `EDA / CAD Models: Download from Ultra Librarian `__ +* `Online Catalog: NR, NRH, NRS and NRV Series `__ + +.. _part-14011213102000: + +14011213102000 +~~~~~~~~~~~~~~ + +=========== === +MPN 14011213102000 +SPN 1195-3666-1-ND +Used by: +=========== === + +Documentation +............. + + +* `Datasheets: 1401yy13102yyy Drawing `__ +* `Product Training Modules: har-flexicon Connector and Terminal Block Series `__ +* `Mfg CAD Models: 14011213102000.stp `__ +* `Online Catalog: har-flexicon® Series `__ + +.. _part-14010813102000: + +14010813102000 +~~~~~~~~~~~~~~ + +=========== === +MPN 14010813102000 +SPN 1195-3662-1-ND +Used by: +=========== === + +Documentation +............. + + +* `Datasheets: 1401yy13102yyy Drawing `__ +* `Product Training Modules: har-flexicon Connector and Terminal Block Series `__ +* `Mfg CAD Models: 14010813102000.stp `__ +* `Online Catalog: har-flexicon® Series `__ + +.. _part-PPTC202LFBN-RC: + +PPTC202LFBN-RC +~~~~~~~~~~~~~~ + +=========== === +MPN PPTC202LFBN-RC +SPN S6104-ND +Used by: +=========== === + +Documentation +............. + + +* `Datasheets: xPxCyyyLFBN-RC Drawing `__ +* `Datasheets: Female Headers .100" Data Sheet `__ +* `Video File: Scaredy Pi | The Resident Geeks `__ +* `Environmental Information: RoHS Cert `__ +* `HTML Datasheet: xPxCyyyLFBN-RC Drawing `__ +* `Online Catalog: PPPC and PPTC Series `__ + +.. _part-14010213102000: + +14010213102000 +~~~~~~~~~~~~~~ + +=========== === +MPN 14010213102000 +SPN 1195-3656-1-ND +Used by: +=========== === + +Documentation +............. + + +* `Datasheets: 1401yy13102yyy Drawing `__ +* `Product Training Modules: har-flexicon Connector and Terminal Block Series `__ +* `Mfg CAD Models: 14010213102000.stp `__ +* `Online Catalog: har-flexicon® Series `__ + +.. _part-DMN2041L-7: + +DMN2041L-7 +~~~~~~~~~~ + +=========== === +MPN DMN2041L-7 +SPN DMN2041L-7DICT-ND +Used by: +=========== === + +Documentation +............. + + +* `Datasheets: DMN2041L `__ +* `Environmental Information: RoHS Cert `__ +* `PCN Design/Specification: Bond Wire 11/Nov/2011 `__ +* `PCN Assembly/Origin: Mult Dev Alt Wafer Source 26/Apr/2018 `__ +* `PCN Other: Multiple Device Changes 29/Apr/2013 `__ +* `Online Catalog: N-Channel MOSFET (Metal Oxide) `__ + +.. _part-DMP3056L-7: + +DMP3056L-7 +~~~~~~~~~~ + +=========== === +MPN DMP3056L-7 +SPN DMP3056L-7DICT-ND +Used by: +=========== === + +Documentation +............. + + +* `Datasheets: DMP3056L `__ +* `Environmental Information: RoHS Cert `__ +* `PCN Assembly/Origin: Mult Dev Assembly Add 7/Dec/2018 `__ +* `Online Catalog: P-Channel MOSFET (Metal Oxide) `__ + +.. _part-RMCF0402FT10K0: + +RMCF0402FT10K0 +~~~~~~~~~~~~~~ + +=========== === +MPN RMCF0402FT10K0 +SPN RMCF0402FT10K0CT-ND +Used by: +=========== === + +Documentation +............. + + +* `Datasheets: RMCF,RMCP Series Datasheet `__ +* `Datasheets: Resistor Packaging Spec `__ +* `Environmental Information: RoHS Compliance Status `__ +* `PCN Part Number: Global Part Number 9/Aug/2010 `__ +* `EDA / CAD Models: RMCF0402FT10K0 by SnapEDA `__ +* `EDA / CAD Models: Download from Ultra Librarian `__ +* `Online Catalog: RMCF Series `__ + +.. _part-RC1005F271CS: + +RC1005F271CS +~~~~~~~~~~~~ + +=========== === +MPN RC1005F271CS +SPN 1276-3970-1-ND +Used by: +=========== === + +Documentation +............. + + +* `Datasheets: RC Series Datasheet `__ +* `Datasheets: Thick-Film Chip Resistor Catalog `__ +* `Environmental Information: RoHS Cert Chip Resistor `__ +* `Featured Product: Chip Resistors and Arrays `__ +* `Online Catalog: RC1005 Series `__ + +.. _part-CRCW0402100KFKED: + +CRCW0402100KFKED +~~~~~~~~~~~~~~~~ + +=========== === +MPN CRCW0402100KFKED +SPN 541-100KLCT-ND +Used by: +=========== === + +Documentation +............. + + +* `Datasheets: D/CRCW e3 Series Datasheet `__ +* `HTML Datasheet: D/CRCW e3 Series Datasheet `__ +* `EDA / CAD Models: Download from Ultra Librarian `__ +* `Online Catalog: CRCW - Automotive Series `__ + +.. _part-RC0402FR-0713K3L: + +RC0402FR-0713K3L +~~~~~~~~~~~~~~~~ + +=========== === +MPN RC0402FR-0713K3L +SPN YAG2974CT-ND +Used by: +=========== === + +Documentation +............. + + +* `Datasheets: RC Series, L Datasheet `__ +* `Datasheets: Chip Resistor Marking `__ +* `Product Training Modules: Chip Resistor `__ +* `HTML Datasheet: Chip Resistor Marking `__ +* `Online Catalog: RC0402 Series `__ + +.. _part-TPS54202DDCT: + +TPS54202DDCT +~~~~~~~~~~~~ + +=========== === +MPN TPS54202DDCT +SPN 296-44151-1-ND +Used by: +=========== === + +Documentation +............. + + +* `Datasheets: TPS54202 Datasheet `__ +* `Featured Product: TPS5420 Step-Down Converters `__ +* `Featured Product: Power Management `__ +* `PCN Assembly/Origin: LBC7 Wafer Chg 15/Oct/2018 `__ +* `PCN Assembly/Origin: Wafer Fab 04/Jan/2018 `__ +* `Manufacturer Product Page: TPS54202DDCT Specifications `__ +* `Online Catalog: Buck (Step-Down) IC `__ + +.. _part-TMP102AIDRLT: + +TMP102AIDRLT +~~~~~~~~~~~~ + +=========== === +MPN TMP102AIDRLT +SPN 296-22055-1-ND +Used by: +=========== === + +Documentation +............. + + +* `Datasheets: TMP102 Datasheet `__ +* `Video File: TMP102 Low Power Digital Temperature Sensor with SMBus/Two-Wire Serial Interface in SOT563 `__ +* `Design Resources: Development Tool Selector `__ +* `Design Resources: Sensor Selector `__ +* `Design Resources: Industrial Automation Product Selector `__ +* `PCN Design/Specification: TMP102 Datasheet Update 22/Apr/2014 `__ +* `PCN Design/Specification: TMP302/102 Datasheet Chg 24/Oct/2018 `__ +* `PCN Design/Specification: TMP102 23/Jan/2019 `__ +* `Manufacturer Product Page: TMP102AIDRLT Specifications `__ +* `EDA / CAD Models: Download from Ultra Librarian `__ +* `Online Catalog: TMP102 `__ + diff --git a/demo/thirdparty/unlockoslo-alpha-3/ee/sch.xml b/demo/thirdparty/unlockoslo-alpha-3/ee/sch.xml new file mode 100644 index 0000000..9d5a32e --- /dev/null +++ b/demo/thirdparty/unlockoslo-alpha-3/ee/sch.xml @@ -0,0 +1,771 @@ + + + + + + C1 + + + CL21B104KBFNNNG + + + + + + + C2 + + + GMK212BBJ106KG-T + + + + + + + C3 + + + CL21B104KBFNNNG + + + + + + + C4 + + + GRM1555C1H750JA01D + + + + + + + C5 + + + GRM21BR61A226ME51L + + + + + + + C6 + + + GRM21BR61A226ME51L + + + + + + + D1 + + + S1MTR + + + + + + + D2 + + + CMD15-21VRD/TR8 + + + + + + + D3 + + + S1MTR + + + + + + + D4 + + + CMD15-21VRD/TR8 + + + + + + + D5 + + + S1MTR + + + + + + + D6 + + + CMD15-21VRD/TR8 + + + + + + + D7 + + + S1MTR + + + + + + + D8 + + + CMD15-21VRD/TR8 + + + + + + + D9 + + + S1MTR + + + + + + + D10 + + + CMD15-21VRD/TR8 + + + + + + + D11 + + + S1MTR + + + + + + + D12 + + + CMD15-21VRD/TR8 + + + + + http://purl.org/ee/part-type#diode + + + D13 + + + BZX384C3V3-E3-08 + + + + + http://purl.org/ee/part-type#diode + + + D14 + + + BZX384C3V3-E3-08 + + + + + http://purl.org/ee/part-type#diode + + + D15 + + + BZX384C3V3-E3-08 + + + + + http://purl.org/ee/part-type#diode + + + D16 + + + BZX384C3V3-E3-08 + + + + + http://purl.org/ee/part-type#diode + + + D17 + + + BZX384C3V3-E3-08 + + + + + http://purl.org/ee/part-type#diode + + + D18 + + + BZX384C3V3-E3-08 + + + + + http://purl.org/ee/part-type#diode + + + D19 + + + BZX384C3V3-E3-08 + + + + + http://purl.org/ee/part-type#diode + + + D20 + + + BZX384C3V3-E3-08 + + + + + + + D21 + + + CMD15-21VGD/TR8 + + + + + + + D22 + + + CMD15-21VGD/TR8 + + + + + + + D23 + + + CMD15-21VGD/TR8 + + + + + + + J1 + + + + + + + J2 + + + + + + + L1 + + + NRS8040T150MJGJ + + + + + + + MK1 + + + + + + + MK2 + + + + + + + MK3 + + + + + + + MK4 + + + + + + + P1 + + + 14011213102000 + + + + + + + P2 + + + 14010813102000 + + + + + + + P3 + + + PPTC202LFBN-RC + + + + + + + P4 + + + 14010213102000 + + + + + + + Q1 + + + DMN2041L-7 + + + + + + + Q2 + + + DMN2041L-7 + + + + + + + Q3 + + + DMN2041L-7 + + + + + + + Q4 + + + DMN2041L-7 + + + + + + + Q5 + + + DMN2041L-7 + + + + + + + Q6 + + + DMN2041L-7 + + + + + + + Q7 + + + DMP3056L-7 + + + + + + + R1 + + + RMCF0402FT10K0 + + + + + + + R2 + + + RC1005F271CS + + + + + + + R3 + + + RMCF0402FT10K0 + + + + + + + R4 + + + RC1005F271CS + + + + + + + R5 + + + RMCF0402FT10K0 + + + + + + + R6 + + + RC1005F271CS + + + + + + + R7 + + + RMCF0402FT10K0 + + + + + + + R8 + + + RC1005F271CS + + + + + + + R9 + + + RMCF0402FT10K0 + + + + + + + R10 + + + RC1005F271CS + + + + + + + R11 + + + RMCF0402FT10K0 + + + + + + + R12 + + + RC1005F271CS + + + + + + + R13 + + + RMCF0402FT10K0 + + + + + + + R14 + + + RMCF0402FT10K0 + + + + + + + R15 + + + RMCF0402FT10K0 + + + + + + + R16 + + + RMCF0402FT10K0 + + + + + + + R17 + + + RMCF0402FT10K0 + + + + + + + R18 + + + RMCF0402FT10K0 + + + + + + + R19 + + + RMCF0402FT10K0 + + + + + + + R20 + + + RMCF0402FT10K0 + + + + + + + R21 + + + CRCW0402100KFKED + + + + + + + R22 + + + RC0402FR-0713K3L + + + + + + + R23 + + + RC1005F271CS + + + + + + + R24 + + + RMCF0402FT10K0 + + + + + + + R25 + + + RMCF0402FT10K0 + + + + + + + R26 + + + RMCF0402FT10K0 + + + + + + + R27 + + + RC1005F271CS + + + + + + + R28 + + + RC1005F271CS + + + + + + + TP1 + + + + + + + U1 + + + TPS54202DDCT + + + + + + + U2 + + + TMP102AIDRLT + + + + + diff --git a/src/ee/db.py b/src/ee/db.py index e471278..57533ef 100644 --- a/src/ee/db.py +++ b/src/ee/db.py @@ -1,4 +1,4 @@ -from typing import TypeVar, Generic, Callable, MutableMapping, List, Iterable, Union, Any +from typing import TypeVar, Generic, Callable, MutableMapping, List, Iterable, Union, Any, Mapping K = TypeVar('K') V = TypeVar('V') @@ -34,9 +34,11 @@ class Index(Generic[K, V]): class ListIndex(Index[K, V]): - def __init__(self, key_callable: KeyCallable): + def __init__(self, name, key_callable: KeyCallable, multiple=False): + self.name = name self.idx: MutableMapping[K, V] = {} self.key_callable = key_callable + self.multiple = multiple def add(self, value: V): keys = self.key_callable(value) @@ -44,6 +46,9 @@ class ListIndex(Index[K, V]): if keys is None: return + if not self.multiple: + keys = [keys] + for key in keys: if key is None: continue @@ -54,8 +59,9 @@ class ListIndex(Index[K, V]): else: self.idx[key] = [value] - def get(self, key: K) -> Iterable[V]: - return [self.idx[key]] + def get(self, key: K) -> List[V]: + items = self.idx.get(key, None) + return self.idx[key] if items is not None else [] def clear(self): return self.idx.clear() @@ -71,12 +77,15 @@ class ListIndex(Index[K, V]): class UniqueIndex(Index[K, V]): - def __init__(self, key_callable: KeyCallable): + def __init__(self, name, key_callable: KeyCallable, multiple=False): + self.name = name self.idx: MutableMapping[K, V] = {} self.key_callable = key_callable + self.multiple = multiple def get(self, key: K) -> Iterable[V]: - return [self.idx[key]] + items = self.idx.get(key, None) + return [self.idx[key]] if items is not None else [] def get_single(self, key: K) -> V: return self.idx[key] @@ -84,16 +93,75 @@ class UniqueIndex(Index[K, V]): def add(self, value: V): keys = self.key_callable(value) - if not isinstance(keys, Iterable): + if keys is None: + return + + if not self.multiple: keys = [keys] for key in keys: - key = self.key_callable(value) present = self.idx.get(key, None) if present is not None: - raise KeyError("Duplicate part in index: {}".format(key)) + raise KeyError("Duplicate key in index '{}': key={}, value={}".format(self.name, key, repr(value))) + + self.idx[key] = value + + def clear(self): + return self.idx.clear() + + def __iter__(self): + return self.idx.__iter__() + + def items(self): + return self.idx.items() + + def values(self): + return self.idx.values() + + +class MultiIndex(Index[K, V]): + def __init__(self, name, key_callable: KeyCallable, multiple=False): + self.name = name + self.idx: MutableMapping[K, V] = {} + self.key_callable = key_callable + self.multiple = multiple + + # TODO: this should return a new index + def get(self, key: K) -> Mapping[K, V]: + items = self.idx.get(key, None) + return self.idx[key] if items is not None else {} - self.idx[key] = True + def get_single(self, key: K) -> V: + return self.idx[key] + + def add(self, value: V): + keys = self.key_callable(value) + + if keys is None: + return + + if not self.multiple: + keys = [keys] + + for tpl in keys: + if not isinstance(tpl, tuple): + raise KeyError("The key must be a tuple, index='{}', key='{}'".format(self.name, repr(tpl))) + + parent_idx = self.idx + for sub_key in tpl[0:-1]: + if sub_key is None: + raise KeyError("Got None sub-key: index='{}', key='{}'".format(self.name, repr(tpl))) + idx = parent_idx.get(sub_key, None) + if idx is None: + idx = {} + parent_idx[sub_key] = idx + parent_idx = idx + + values = parent_idx.get(tpl[-1], None) + if values is None: + values = [] + parent_idx[tpl[-1]] = values + values.append(value) def clear(self): return self.idx.clear() @@ -125,19 +193,28 @@ class ObjDb(Generic[V]): def __len__(self) -> int: return len(self.values) - def add_index(self, name, key_callable: KeyCallable) -> ListIndex[Any, V]: - idx = ListIndex(key_callable) - self._indexes[name] = idx + def add_index(self, name, key_callable: KeyCallable, **kwargs) -> ListIndex[Any, V]: + idx = ListIndex(name, key_callable, **kwargs) + return self._add(name, idx) + + def add_unique_index(self, name, key_callable: KeyCallable, **kwargs) -> UniqueIndex[Any, V]: + idx = UniqueIndex(name, key_callable, **kwargs) + return self._add(name, idx) + + def add_multi_index(self, name, key_callable: KeyCallable, **kwargs) -> MultiIndex[Any, V]: + idx = MultiIndex(name, key_callable, **kwargs) + return self._add(name, idx) + + def index(self, name) -> Index: + return self._indexes[name] + + def _add(self, name, idx): + if name in self._indexes: + raise KeyError("Index already exist: {}".format(name)) for value in self.values: idx.add(value) - return idx - - def add_unique_index(self, name, key_callable: KeyCallable) -> UniqueIndex[Any, V]: - idx = UniqueIndex(key_callable) self._indexes[name] = idx - return idx - def index(self, name) -> Index: - return self._indexes[name] + return idx diff --git a/src/ee/digikey/search_parts.py b/src/ee/digikey/search_parts.py index 358266a..7d19c5b 100644 --- a/src/ee/digikey/search_parts.py +++ b/src/ee/digikey/search_parts.py @@ -2,47 +2,46 @@ from pathlib import Path from typing import List from ee.digikey import Digikey, DigikeyParser, DigikeyClient, SearchResponseTypes, DigikeyProduct -from ee.part import PartDb, load_db, save_db -from ee.xml import types, bom_file_utils +from ee.part import PartDb, load_db, save_db, Part +from ee.xml import types from ee.xml.uris import DIGIKEY_URI, make_digikey_fact_key __all__ = ["search_parts"] -def resolved(p: DigikeyProduct) -> types.Part: +def resolved(p: DigikeyProduct) -> Part: # TODO: fix uri - part = types.Part(uri="https://digikey.com/pn#{}".format(p.part_number), - distributor_info=types.DistributorInfo(), - links=types.LinkList(), - facts=types.FactList(), - references=types.ReferencesList()) - part.distributor_infoProp.stateProp = "resolved" - links = part.linksProp.link + xml = types.Part(uri="https://digikey.com/pn#{}".format(p.part_number), + supplier=DIGIKEY_URI, + description=p.description, + distributor_info=types.DistributorInfo(state="resolved"), + links=types.LinkList(), + facts=types.FactList(), + references=types.ReferencesList()) + part = Part(xml) if p.url: - links.append(types.Link(url=p.url, relation="canonical", media_type="text/html")) + part.get_links().append(types.Link(url=p.url, relation="canonical", media_type="text/html")) for d in p.documents: title = "{}: {}".format(d.kind, d.title) - links.append(types.Link(url=d.url, relation="http://purl.org/ee/link-relation#documentation", - media_type="text/html", title=title)) + part.get_links().append(types.Link(url=d.url, relation="http://purl.org/ee/link-relation#documentation", + media_type="text/html", title=title)) - supplier_part_numbers = part.referencesProp.supplier_part_numberProp - supplier_part_numbers.append(types.SupplierPartNumber(value=p.part_number, supplier=DIGIKEY_URI)) + part.add_spn(p.part_number) - part_numbers = part.referencesProp.part_numberProp if p.mpn: - part_numbers.append(types.PartNumber(value=p.mpn)) - facts: List[types.Fact] = part.factsProp.factProp + part.add_mpn(p.mpn) + facts: List[types.Fact] = xml.factsProp.factProp for a in p.attributes: key = make_digikey_fact_key(a.attribute_type.id) facts.append(types.Fact(key=key, label=a.attribute_type.label, value=a.value)) if len(p.price_breaks): - part.price_breaksProp = types.PriceBreakList() + xml.price_breaksProp = types.PriceBreakList() - price_breaks: List[types.PriceBreak] = part.price_breaksProp.price_break + price_breaks: List[types.PriceBreak] = xml.price_breaksProp.price_break for pb in p.price_breaks: amount = types.Amount(value=str(pb.per_piece_price.amount), currency=pb.per_piece_price.currency) price_breaks.append(types.PriceBreak(pb.quantity, amount=amount)) @@ -57,29 +56,34 @@ def search_parts(in_path: Path, out_path: Path, cache_dir: Path): parser = DigikeyParser(Digikey()) client = DigikeyClient(cache_dir) - for part in in_db.iterparts(): - dpn = next((p.valueProp for p in bom_file_utils.supplier_part_numbers(part) - if p.supplierProp == DIGIKEY_URI), None) - mpn = next((p.valueProp for p in bom_file_utils.part_numbers(part)), None) + for xml in in_db.iterparts(): + if xml.supplierProp is not None and xml.supplierProp != DIGIKEY_URI: + continue + + part = Part(xml) + + dpn = part.get_only_spn() + mpn = part.get_only_mpn() is_mpn = query = None if dpn is not None: - query = dpn + query = dpn.valueProp is_mpn = False elif mpn is not None: - query = mpn + query = mpn.valueProp is_mpn = True if query is None: # TODO: use schematic reference - print("could not find pn or dpn: part.uri={}".format(part.uriProp)) + print("could not find pn or dpn: part.uri={}".format(xml.uriProp)) continue out_id = query out_part = types.Part(uri=out_id, distributor_info=types.DistributorInfo(), - references=part.referencesProp) + supplier=DIGIKEY_URI, + references=xml.referencesProp) di = out_part.distributor_infoProp text = client.search(query) diff --git a/src/ee/kicad/make_bom.py b/src/ee/kicad/make_bom.py index 0a8f4bb..ddaa6b9 100644 --- a/src/ee/kicad/make_bom.py +++ b/src/ee/kicad/make_bom.py @@ -8,7 +8,7 @@ from ee import EeException from ee.kicad.model import Component from ee.kicad.read_schematic import read_schematics from ee.kicad.to_bom import to_bom, to_bom_xml -from ee.part import PartDb, save_db +from ee.part import PartDb, save_db, Part from ee.xml import types, uris __all__ = [ @@ -21,61 +21,60 @@ __all__ = [ "make_bom", ] -StrategyCallable = Callable[[Component, types.Part], Optional[types.Part]] +StrategyCallable = Callable[[Component, Part], Optional[Part]] -def apply_strategies(c: Component, part: types.Part, strategies: List[StrategyCallable]): +def apply_strategies(c: Component, part: Part, strategies: List[StrategyCallable]): for strategy in strategies: part = strategy(c, part) if part is None: return - if not isinstance(part, types.Part): - raise EeException("Values returned from strategy must be a types.Part, got {}".format(type(part))) + if not isinstance(part, Part): + raise EeException("Values returned from strategy must be a Part, got {}".format(type(part))) return part -def part_type_strategy(component: Component, part: types.Part) -> types.Part: +def part_type_strategy(component: Component, part: Part) -> Part: fp = component.footprint if fp is None: return part lib, part_name = fp.split(":") + xml = part.underlying if lib == "Capacitor_SMD": - part.part_typeProp = uris.CAPACITOR + xml.part_typeProp = uris.CAPACITOR elif lib == "Resistor_SMD": - part.part_typeProp = uris.RESISTOR + xml.part_typeProp = uris.RESISTOR elif lib == "Diode_SMD": - part.part_typeProp = uris.DIODE + xml.part_typeProp = uris.DIODE elif lib == "Inductor_SMD": - part.part_typeProp = uris.INDUCTOR + xml.part_typeProp = uris.INDUCTOR elif lib == "Crystal": - part.part_typeProp = uris.CRYSTAL + xml.part_typeProp = uris.CRYSTAL return part -def mpn_strategy(component: Component, part: types.Part) -> types.Part: +def mpn_strategy(component: Component, part: Part) -> Part: mpn = component.get_field("mpn") if mpn is not None: - pn = types.PartNumber(value=mpn.value) - part.referencesProp.add_part_number(pn) + part.add_mpn(mpn.value) return part def dpn_strategy_factory(dpn_mappings: Mapping[str, str]) -> StrategyCallable: - def dpn_strategy(component: Component, part: types.Part) -> types.Part: + def dpn_strategy(component: Component, part: Part) -> Part: for field_name, distributor in dpn_mappings: s = component.get_field(field_name) if s is None: continue - pn = types.SupplierPartNumber(value=s.value, supplier=distributor) - part.referencesProp.add_part_number(pn) + part.add_spn(s.value) return part @@ -111,21 +110,15 @@ def work(sch, out: Path, strategy: MakeBomStrategy, new_mode, pretty): parts = PartDb() components = to_bom(sch) for c in components: - part = types.Part() - part.referencesProp = types.ReferencesList() - part.referencesProp.schematic_reference.append(types.SchematicReference(reference=c.ref)) + xml = types.Part() + part = Part(xml) + part.add_schematic_reference(c.ref) part = strategy.process_part(c, part) if part is None: continue - if len(part.referencesProp.schematic_reference) == 0 and \ - len(part.referencesProp.part_number) == 0 and \ - len(part.referencesProp.supplier_part_number) == 0: - # No need to dirty the xml with empty lists - part.referencesProp = None - parts.add_entry(part, True) save_db(out, parts) diff --git a/src/ee/order/__init__.py b/src/ee/order/__init__.py index a384cb7..83723ba 100644 --- a/src/ee/order/__init__.py +++ b/src/ee/order/__init__.py @@ -4,111 +4,104 @@ from typing import List, Tuple from ee import EeException from ee.db import ObjDb -from ee.part import PartDb, load_db, save_db -from ee.project import Project, report -from ee.xml import types, bom_file_utils +from ee.part import PartDb, load_db, save_db, Part +from ee.project import Project, report, SupplierDescriptor +from ee.xml import types __all__ = ["create_order"] class OrderPart(object): def __init__(self, part: types.Part): - self.part = part - self.ref = next((ref.referenceProp for ref in bom_file_utils.schematic_references(part)), None) + self.part = Part(part) + ref = self.part.get_only_schematic_reference() + self.ref = ref.referenceProp if ref else None self.available_from: List[Tuple[str, types.Part]] = [] - self.selected_supplier_and_part = None + self.selected_part = None - rl = part.referencesProp = part.referencesProp or types.ReferencesList() # type: types.ReferencesList - rl.schematic_referenceProp = rl.schematic_referenceProp or [] - rl.part_numberProp = rl.part_numberProp or [] - rl.supplier_part_numberProp = rl.supplier_part_numberProp or [] - - -def make_report(out_file, order_parts: ObjDb[OrderPart], has_unresolved_parts): - parts_by_supplier = {} - - for supplier, order_parts in order_parts.index("selected_part").items(): - parts = {} - for op in order_parts: - p = op.selected_supplier_and_part[1] - parts[p.uriProp] = p - parts_by_supplier[supplier] = parts.values() +def make_report(out_file, has_unresolved_parts, order_parts: ObjDb[OrderPart], supplier_parts: ObjDb[Path]): kwargs = { "order_parts": order_parts, - "parts_by_supplier": parts_by_supplier, + "supplier_parts": supplier_parts, "has_unresolved_parts": has_unresolved_parts, } report.save_report("ee.order", "order.rst.j2", out_file, **kwargs) -def create_order(project: Project, schematic_path: Path, out_path: Path, part_db_dirs: List[Path], +def create_order(project: Project, schematic_path: Path, out_path: Path, part_dbs: List[Path], fail_on_missing_parts: bool): - sch_db = load_db(schematic_path) - - dbs = [(path.parent.name, load_db(path)) for path in part_db_dirs] - - def supplier_index(op: OrderPart): - return [spn.supplierProp for spn in bom_file_utils.supplier_part_numbers(op.part)] - - def selected_part_index(op: OrderPart): - return [op.selected_supplier_and_part[0]] if op.selected_supplier_and_part else None - - def available_from_index(op: OrderPart): - return set([s for s, s_part in op.available_from]) - - def supplier_part_index(op: OrderPart): - return set([s_part.uriProp for s, s_part in op.available_from]) - - def pn_index(op: OrderPart): - return [pn.value for pn in bom_file_utils.part_numbers(op.part)] + supplier_parts = ObjDb[Part]() + supplier_parts.add_unique_index("uri", lambda p: p.uri) + supplier_parts.add_index("spn", lambda p: [ref.valueProp for ref in p.get_spns()], + multiple=True) + supplier_pn_idx = supplier_parts.add_multi_index("supplier,pn", lambda p: [ + (p.supplier, ref.valueProp) for ref in p.get_mpns()], multiple=True) + supplier_spn_idx = supplier_parts.add_multi_index("supplier,spn", lambda p: [ + (p.supplier, ref.valueProp) for ref in p.get_spns()], multiple=True) + + suppliers: List[SupplierDescriptor] = [project.get_supplier_by_key(path.parent.name) for path in part_dbs] + for path in part_dbs: + for xml in load_db(path).iterparts(): + if not xml.supplierProp: + continue + supplier_parts.add(Part(xml)) + sch_db = load_db(schematic_path) order_parts: ObjDb[OrderPart] = ObjDb[OrderPart]() + order_parts.add_multi_index("supplier,pn", lambda op: [ + (op.part.supplierProp, ref.valueProp) for ref in + op.part.get_mpns()] if op.part.supplier else None, multiple=True) + order_parts.add_multi_index("supplier,spn", lambda op: [ + (op.part.supplier, ref.valueProp) for ref in op.part.get_spns()], multiple=True) + for sch_part in sch_db.iterparts(): order_parts.add(OrderPart(sch_part)) for order_part in order_parts: - sch_part_numbers = order_part.part.referencesProp.part_number - sch_supplier_part_numbers: List[types.SupplierPartNumber] = order_part.part.referencesProp.supplier_part_number + sch_part_numbers = [pn.valueProp for pn in order_part.part.get_mpns()] + sch_supplier_part_numbers = [spn.valueProp for spn in order_part.part.get_spns()] - for supplier, db in dbs: - for supplier_part in db.iterparts(sort=True): - for sch_pn in sch_part_numbers: - for pn in bom_file_utils.part_numbers(supplier_part): - if sch_pn.valueProp == pn.valueProp: - order_part.available_from.append((supplier, supplier_part)) + for supplier in suppliers: + pns = supplier_pn_idx.get(supplier.uri) + spns = supplier_spn_idx.get(supplier.uri) - for sch_spn in sch_supplier_part_numbers: - for spn in bom_file_utils.supplier_part_numbers(supplier_part): - if sch_spn.valueProp == spn.valueProp and sch_spn.supplierProp == spn.supplierProp: - order_part.available_from.append((supplier, supplier_part)) + for sch_pn in sch_part_numbers: + for supplier_part in pns.get(sch_pn, []): + order_part.available_from.append((supplier.uri, supplier_part)) + for sch_spn in sch_supplier_part_numbers: + for supplier_part in spns.get(sch_spn, []): + order_part.available_from.append((supplier.uri, supplier_part)) has_unresolved_parts = False for order_part in order_parts: if len(order_part.available_from) == 0: has_unresolved_parts = True elif len(order_part.available_from) == 1: - order_part.selected_supplier_and_part = order_part.available_from[0] + order_part.selected_part = order_part.available_from[0] else: raise EeException("unimplemented: part available from multiple suppliers") + order_parts.add_index("partUri", lambda op: op.selected_part[1].uri if op.selected_part else None) + order_parts.add_multi_index("supplier,part", lambda op: ( + op.selected_part[0], op.selected_part[1].uri) if op.selected_part else None) + if has_unresolved_parts and fail_on_missing_parts: raise EeException("The order has parts that can't be found from any supplier") - order_parts.add_index("selected_part", selected_part_index) - out_file = project.report_dir / (os.path.splitext(out_path.name)[0] + ".rst") - make_report(out_file, order_parts, has_unresolved_parts) + make_report(out_file, has_unresolved_parts, order_parts, supplier_parts) out_parts = PartDb() for order_part in order_parts: - if not order_part.selected_supplier_and_part: + if not order_part.selected_part: continue - supplier, supplier_part = order_part.selected_supplier_and_part + supplier, supplier_part = order_part.selected_part - references = types.ReferencesList(schematic_reference=order_part.part.referencesProp.schematic_reference) - part = types.Part(uri=supplier_part.uri, references=references) + part = Part(types.Part(supplier=supplier_part.supplier)) + part.add_schematic_reference(order_part.part.get_exactly_one_schematic_reference().referenceProp) + part.add_part_reference(supplier_part.uri) out_parts.add_entry(part, True) diff --git a/src/ee/order/templates/order.rst.j2 b/src/ee/order/templates/order.rst.j2 index bc382a2..8dad217 100644 --- a/src/ee/order/templates/order.rst.j2 +++ b/src/ee/order/templates/order.rst.j2 @@ -1,3 +1,4 @@ +{% set order_part_uri_idx = order_parts.index("partUri") -%} Order ===== @@ -6,6 +7,8 @@ Has unresolved parts: {{ "yes" if has_unresolved_parts else "no" }}. Parts for Order =============== {% for op in order_parts %} +.. _ref-{{ op.ref }}: + {{ op.ref | subsection }} {% if op.available_from|length == 0 %} Part not resolved. @@ -23,30 +26,39 @@ MANY Part details ============ -{% for supplier, parts in parts_by_supplier.items() %} +{%- set part_by_uri=supplier_parts.index("uri") %} +{% for supplier, partUris in order_parts.index("supplier,part").items() %} {{ ("From " + supplier) | subsection }} -{% for part in parts %} +{% for partUri in partUris %} +{%- set part=part_by_uri.get_single(partUri) %} {%- set pn=part|first_pn %} {%- set spn=part|first_spn %} {%- set title=pn.valueProp if pn else (spn.valueProp if spn else "???") %} -{%- set links=part.linksProp.link %} .. _part-{{title}}: {{ title|subsubsection }} -{#- +=========== === +{%- if part.description %} +Description {{ part.description }} +{%- endif %} +MPN {{ pn.value }} +SPN {{ spn.value }} +Used by: {% for op in order_part_uri_idx.get(part.uriProp) %}`{{ op.ref }} `_{{ ", " if not loop.last }}{% endfor %} +=========== === +{# Facts ..... {% for f in part.facts.fact %} f={{f}} {% endfor %} -#} -Media -..... +#} +Documentation +............. -{% for l in links %} +{% for l in part.get_links() %} {%- if l.relationProp == "http://purl.org/ee/link-relation#documentation" %} * `{{ l.title }} <{{ l.url }}>`__ {%- endif %} diff --git a/src/ee/part/__init__.py b/src/ee/part/__init__.py index 4ed6edb..7a58f75 100644 --- a/src/ee/part/__init__.py +++ b/src/ee/part/__init__.py @@ -1,24 +1,154 @@ from pathlib import Path -from typing import List, MutableMapping, Optional, Iterator +from typing import List, MutableMapping, Optional, Iterator, Union -from ee.xml import types, bom_file_utils +from ee import EeException +from ee.money import Money +from ee.xml import types __all__ = [ + "Part", "PartDb", "load_db", "save_db", ] +class Part(object): + def __init__(self, xml: types.Part): + assert type(xml) == types.Part + self.xml = xml + xml.referencesProp = xml.referencesProp if xml.referencesProp is not None else types.ReferencesList() + xml.price_breaksProp = xml.price_breaksProp if xml.price_breaksProp is not None else types.PriceBreakList() + xml.linksProp = xml.linksProp if xml.linksProp is not None else types.LinkList() + xml.factsProp = xml.factsProp if xml.factsProp is not None else types.FactList() + + def clean_xml(self): + x = self.xml + if len(x.referencesProp.part_referenceProp) == 0 and \ + len(x.referencesProp.schematic_referenceProp) == 0 and \ + len(x.referencesProp.part_numberProp) == 0 and \ + len(x.referencesProp.supplier_part_numberProp) == 0: + x.referencesProp = None + if len(x.price_breaksProp.price_break) == 0: + x.price_breaksProp = None + if len(x.linksProp.link) == 0: + x.linksProp = None + if len(x.factsProp.fact) == 0: + x.factsProp = None + + @property + def underlying(self) -> types.Part: + return self.xml + + @property + def uri(self) -> str: + return self.xml.uriProp + + @property + def supplier(self) -> str: + return self.xml.supplierProp + + # Part number ref + + def add_part_reference(self, uri): + self.get_part_references().append(types.PartReference(part_uri=uri)) + + def get_part_references(self) -> List[types.PartReference]: + return self.xml.referencesProp.part_referenceProp + + # Schematic references + + def add_schematic_reference(self, ref): + self.get_schematic_references().append(types.SchematicReference(reference=ref)) + + def get_schematic_references(self) -> List[types.SchematicReference]: + return self.xml.referencesProp.schematic_referenceProp + + def get_only_schematic_reference(self) -> Optional[types.SchematicReference]: + return next(iter(self.get_schematic_references()), None) + + def get_exactly_one_schematic_reference(self) -> types.SchematicReference: + refs = self.get_schematic_references() + if len(refs) == 0: + raise EeException("This part does not contain any schematic references{}". + format(", uri=" + self.uri if self.uri else "")) + if len(refs) != 1: + raise EeException("This part does not contain exactly one schematic reference: {}". + format(", ".join([ref.referenceProp for ref in refs]))) + + return refs[0] + + # MPNs + + def add_mpn(self, mpn: str): + self.get_mpns().append(types.PartNumber(value=mpn)) + + def get_mpns(self) -> List[types.PartNumber]: + return self.xml.referencesProp.part_numberProp + + def get_only_mpn(self) -> Optional[types.PartNumber]: + return next(iter(self.get_mpns()), None) + + def get_exactly_one_mpn(self) -> types.PartNumber: + mpns = self.get_mpns() + if len(mpns) == 0: + raise EeException("This part does not contain any manufacturer part numbers{}". + format(", uri=" + self.uri if self.uri else "")) + if len(mpns) != 1: + raise EeException("This part does not contain exactly one mpn: {}". + format(", ".join([mpn.valueProp for mpn in mpns]))) + + return mpns[0] + + # SPNs + + def add_spn(self, mpn: str): + self.get_spns().append(types.SupplierPartNumber(value=mpn)) + + def get_spns(self) -> List[types.SupplierPartNumber]: + return self.xml.referencesProp.supplier_part_numberProp + + def get_only_spn(self) -> Optional[types.SupplierPartNumber]: + return next(iter(self.get_spns()), None) + + def get_exactly_one_spn(self) -> types.SupplierPartNumber: + spns = self.get_spns() + if len(spns) == 0: + raise EeException("This part does not contain any manufacturer part numbers{}". + format(", uri=" + self.uri if self.uri else "")) + if len(spns) != 1: + raise EeException("This part does not contain exactly one spn: {}". + format(", ".join([spn.valueProp for spn in spns]))) + + return spns[0] + + # Price breaks + + def add_price_break(self, quantity, price: Money): + amount = types.Amount(value=price.amount, currency=price.currency) + pb = types.PriceBreak(quantity=quantity, amount=amount) + self.xml.price_breaksProp.price_break.append(pb) + + # Links + + def get_links(self) -> List[types.Link]: + return self.xml.linksProp.link + + # Facts + + def get_facts(self) -> List[types.Fact]: + return self.xml.factsProp.fact + + def find_fact(self, key: str) -> Optional[types.Fact]: + return next((f for f in self.get_facts() if f.keyProp == key), None) + + class Entry(object): def __init__(self, new: bool, part: types.Part): self.new = new self.part = part - self.pn = next((p.valueProp for p in bom_file_utils.part_numbers(part)), None) - - def dpn(self, uri: str): - return [spn for spn in bom_file_utils.supplier_part_numbers(self.part) if spn.supplierProp == uri] + self.pn = next((p.valueProp for p in Part(part).get_mpns()), None) class PartDb(object): @@ -27,7 +157,10 @@ class PartDb(object): self.pn_index: MutableMapping[str, Entry] = {} self.new_entries = 0 - def add_entry(self, part: types.Part, new: bool): + def add_entry(self, part: Union[Part, types.Part], new: bool): + if isinstance(part, Part): + part = part.underlying + e = Entry(new, part) self.parts.append(e) @@ -63,10 +196,18 @@ def load_db(path: Path) -> PartDb: return db +def find_root_tag(root): + return next((tag for tag, klass in types.GDSClassesMapping.items() if klass == type(root)), None) + + def save_db(path: Path, db: PartDb, sort=False): part_db = types.PartDb() parts = part_db.parts = types.PartList() - parts.partProp.extend(db.iterparts(sort=sort)) + + for part in db.iterparts(sort=sort): + p = Part(part) + p.clean_xml() + parts.partProp.append(p.underlying) with path.open("w") as f: - part_db.export(outfile=f, level=0, name_=bom_file_utils.find_root_tag(part_db)) + part_db.export(outfile=f, level=0, name_=find_root_tag(part_db)) diff --git a/src/ee/part/create_distributor_search_list.py b/src/ee/part/create_distributor_search_list.py index 10160d4..be362a8 100644 --- a/src/ee/part/create_distributor_search_list.py +++ b/src/ee/part/create_distributor_search_list.py @@ -1,7 +1,7 @@ from pathlib import Path -from ee.part import PartDb, load_db, save_db -from ee.xml import types, bom_file_utils +from ee.part import PartDb, load_db, save_db, Part +from ee.xml import types __all__ = ["create_distributor_search_list"] @@ -12,12 +12,13 @@ def create_distributor_search_list(in_path: Path, out_path: Path): print("loaded {} existing parts".format(in_parts.size())) - for part in in_parts.iterparts(): - pn_value = next((p.valueProp for p in bom_file_utils.part_numbers(part)), None) + for xml in in_parts.iterparts(): + part = Part(xml) + pn_value = next((p.valueProp for p in part.get_mpns()), None) if pn_value is None: # TODO: use schematic reference if found - print("Skipping part with no part number: uri={}".format(part.uriProp)) + print("Skipping part with no part number: uri={}".format(xml.uriProp)) continue entry = out_parts.find_by_pn(pn_value) @@ -25,8 +26,8 @@ def create_distributor_search_list(in_path: Path, out_path: Path): if entry is not None: continue - new_part = types.Part(id=pn_value) - new_part.referencesProp = part.referencesProp + new_part = types.Part() + new_part.referencesProp = xml.referencesProp out_parts.add_entry(new_part, True) diff --git a/src/ee/project/__init__.py b/src/ee/project/__init__.py index 6851256..bca9984 100644 --- a/src/ee/project/__init__.py +++ b/src/ee/project/__init__.py @@ -1,7 +1,9 @@ import configparser from pathlib import Path +from ee import EeException from ee.tools import mk_parents +from ee.xml.uris import DIGIKEY_URI def load_config(project_dir: Path) -> configparser.ConfigParser: @@ -17,6 +19,12 @@ def load_config(project_dir: Path) -> configparser.ConfigParser: return config +class SupplierDescriptor(object): + def __init__(self, key: str, uri: str): + self.key = key + self.uri = uri + + class Project(object): def __init__(self, project_dir: Path, cfg: configparser.ConfigParser): self.report_dir = project_dir / "ee" / "reports" @@ -24,6 +32,15 @@ class Project(object): self.project_dir = project_dir self._cfg = cfg + # TODO: read from config + self._suppliers = [SupplierDescriptor("digikey", DIGIKEY_URI)] + + def get_supplier_by_key(self, key) -> SupplierDescriptor: + sd = next((s for s in self._suppliers if s.key == key), None) + if sd: + return sd + raise EeException("No such supplier configured: {}".format(key)) + @property def cfg(self): return self._cfg diff --git a/src/ee/project/report.py b/src/ee/project/report.py index 80e590a..26cdaa3 100644 --- a/src/ee/project/report.py +++ b/src/ee/project/report.py @@ -3,8 +3,9 @@ from typing import Optional from jinja2 import Environment, PackageLoader, select_autoescape +from ee.part import Part from ee.tools import mk_parents -from ee.xml import types, bom_file_utils +from ee.xml import types class Message(object): @@ -29,12 +30,16 @@ def subsubsubsection_filter(s: str): return "{}\n{}".format(s, "." * len(s)) -def first_pn_filter(part: types.Part): - return next(iter(bom_file_utils.part_numbers(part)), None) +def first_ref_filter(part: Part) -> Optional[types.SchematicReference]: + return part.get_only_schematic_reference() -def first_spn_filter(part: types.Part): - return next(iter(bom_file_utils.supplier_part_numbers(part)), None) +def first_pn_filter(part: Part) -> Optional[types.PartNumber]: + return part.get_only_mpn() + + +def first_spn_filter(part: Part) -> Optional[types.SupplierPartNumber]: + return part.get_only_spn() def save_report(package: str, template_name: str, out_file: Path, **kwargs): @@ -45,6 +50,7 @@ def save_report(package: str, template_name: str, out_file: Path, **kwargs): env.filters["subsection"] = subsection_filter env.filters["subsubsection"] = subsubsection_filter env.filters["subsubsubsection"] = subsubsubsection_filter + env.filters["first_ref"] = first_ref_filter env.filters["first_pn"] = first_pn_filter env.filters["first_spn"] = first_spn_filter diff --git a/src/ee/supplier/seeed.py b/src/ee/supplier/seeed.py index 2df2068..45cff44 100644 --- a/src/ee/supplier/seeed.py +++ b/src/ee/supplier/seeed.py @@ -9,7 +9,7 @@ import requests from selenium import webdriver import ee._utils -from ee.part import PartDb, save_db +from ee.part import Part, PartDb, save_db from ee.xml import types _title_re = re.compile(r"^([^(]*)\( *[0-9]* *\) *") @@ -113,13 +113,10 @@ def download_opls(out_dir: Path, cache_dir: Path): ladder_price = p["ladder_price"] - part = types.Part(references=types.ReferencesList(), price_breaks=types.PriceBreakList()) - part_numbers = part.referencesProp.part_numberProp - supplier_part_numbers = part.referencesProp.supplier_part_numberProp - pbs = part.price_breaksProp.price_breakProp + xml = types.Part(references=types.ReferencesList(), price_breaks=types.PriceBreakList()) + xml.supplierProp = supplier_uri - if desc: - part.descriptionProp = desc + xml.descriptionProp = desc uri_params = { "opl": opls_type, @@ -128,17 +125,18 @@ def download_opls(out_dir: Path, cache_dir: Path): uri_params["sku"] = sku if mpn: uri_params["mpn"] = mpn - part.uriProp = "http://purl.org/ee/supplier/seeed?{}".format(urlencode(uri_params)) + xml.uriProp = "http://purl.org/ee/supplier/seeed?{}".format(urlencode(uri_params)) + + part = Part(xml) if mpn: - part_numbers.append(types.PartNumber(mpn)) + part.add_mpn(mpn) if sku: - supplier_part_numbers.append(types.SupplierPartNumber(value=mpn, supplier=supplier_uri)) + part.add_spn(sku) for item in ladder_price: price = money.parse(item["price"], currency="USD") - amount = types.Amount(value=price.amount, currency=price.currency) - pbs.append(types.PriceBreak(quantity=item["qty"], amount=amount)) + part.add_price_break(item["qty"], price) db.add_entry(part, True) diff --git a/src/ee/xml/bom_file_utils.py b/src/ee/xml/bom_file_utils.py deleted file mode 100644 index 97b609f..0000000 --- a/src/ee/xml/bom_file_utils.py +++ /dev/null @@ -1,49 +0,0 @@ -from typing import List, Optional - -from ee.xml import types - -__all__ = [ - "facts", - "find_root_tag", - "schematic_references", - "part_numbers", - "supplier_part_numbers", -] - - -def find_root_tag(root): - return next((tag for tag, klass in types.GDSClassesMapping.items() if klass == type(root)), None) - - -def schematic_references(part: types.Part) -> List[types.SchematicReference]: - return [] if part.referencesProp is None or part.referencesProp.schematic_reference is None else \ - part.referencesProp.schematic_reference - - -def part_numbers(part: types.Part) -> List[types.PartNumber]: - return [] if part.referencesProp is None or part.referencesProp.part_number is None else \ - part.referencesProp.part_number - - -def supplier_part_numbers(part: types.Part) -> List[types.SupplierPartNumber]: - return [] if part.referencesProp is None or part.referencesProp.supplier_part_number is None else \ - part.referencesProp.supplier_part_number - - -def facts(part: types.Part, create=False) -> Optional[types.FactList]: - fs: types.FactList = part.factsProp - - if fs is not None: - return fs - - if not create: - return - - fs = types.FactList() - part.factsProp = fs - return fs - - -def find_fact(fs: types.FactList, key: str) -> Optional[types.Fact]: - l: List[types.Fact] = fs.factProp - return next((f for f in l if f.keyProp == key), None) diff --git a/src/ee/xml/types.py b/src/ee/xml/types.py index 60d659d..8e5e39f 100644 --- a/src/ee/xml/types.py +++ b/src/ee/xml/types.py @@ -807,10 +807,11 @@ class PartDb(GeneratedsSuper): class Part(GeneratedsSuper): subclass = None superclass = None - def __init__(self, uri=None, part_type=None, description=None, links=None, references=None, distributor_info=None, facts=None, price_breaks=None, **kwargs_): + def __init__(self, uri=None, supplier=None, part_type=None, description=None, links=None, references=None, distributor_info=None, facts=None, price_breaks=None, **kwargs_): self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.uri = _cast(None, uri) + self.supplier = supplier self.part_type = part_type self.description = description self.links = links @@ -829,6 +830,11 @@ class Part(GeneratedsSuper): else: return Part(*args_, **kwargs_) factory = staticmethod(factory) + def get_supplier(self): + return self.supplier + def set_supplier(self, supplier): + self.supplier = supplier + supplierProp = property(get_supplier, set_supplier) def get_part_type(self): return self.part_type def set_part_type(self, part_type): @@ -871,6 +877,7 @@ class Part(GeneratedsSuper): uriProp = property(get_uri, set_uri) def hasContent_(self): if ( + self.supplier is not None or self.part_type is not None or self.description is not None or self.links is not None or @@ -912,6 +919,9 @@ class Part(GeneratedsSuper): eol_ = '\n' else: eol_ = '' + if self.supplier is not None: + showIndent(outfile, level, pretty_print) + outfile.write('<%ssupplier>%s%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.supplier), input_name='supplier')), namespaceprefix_ , eol_)) if self.part_type is not None: showIndent(outfile, level, pretty_print) outfile.write('<%spart-type>%s%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.part_type), input_name='part-type')), namespaceprefix_ , eol_)) @@ -941,7 +951,11 @@ class Part(GeneratedsSuper): already_processed.add('uri') self.uri = value def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): - if nodeName_ == 'part-type': + if nodeName_ == 'supplier': + supplier_ = child_.text + supplier_ = self.gds_validate_string(supplier_, node, 'supplier') + self.supplier = supplier_ + elif nodeName_ == 'part-type': part_type_ = child_.text part_type_ = self.gds_validate_string(part_type_, node, 'part_type') self.part_type = part_type_ @@ -1066,38 +1080,38 @@ class PartList(GeneratedsSuper): # end class PartList -class PartUri(GeneratedsSuper): +class PartReference(GeneratedsSuper): subclass = None superclass = None - def __init__(self, value=None, **kwargs_): + def __init__(self, part_uri=None, **kwargs_): self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') - self.value = value + self.part_uri = part_uri def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( - CurrentSubclassModule_, PartUri) + CurrentSubclassModule_, PartReference) if subclass is not None: return subclass(*args_, **kwargs_) - if PartUri.subclass: - return PartUri.subclass(*args_, **kwargs_) + if PartReference.subclass: + return PartReference.subclass(*args_, **kwargs_) else: - return PartUri(*args_, **kwargs_) + return PartReference(*args_, **kwargs_) factory = staticmethod(factory) - def get_value(self): - return self.value - def set_value(self, value): - self.value = value - valueProp = property(get_value, set_value) + def get_part_uri(self): + return self.part_uri + def set_part_uri(self, part_uri): + self.part_uri = part_uri + part_uriProp = property(get_part_uri, set_part_uri) def hasContent_(self): if ( - self.value is not None + self.part_uri is not None ): return True else: return False - def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='PartUri', pretty_print=True): - imported_ns_def_ = GenerateDSNamespaceDefs_.get('PartUri') + def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='PartReference', pretty_print=True): + imported_ns_def_ = GenerateDSNamespaceDefs_.get('PartReference') if imported_ns_def_ is not None: namespacedef_ = imported_ns_def_ if pretty_print: @@ -1109,24 +1123,24 @@ class PartUri(GeneratedsSuper): showIndent(outfile, level, pretty_print) outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() - self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='PartUri') + self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='PartReference') if self.hasContent_(): outfile.write('>%s' % (eol_, )) - self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='PartUri', pretty_print=pretty_print) + self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='PartReference', pretty_print=pretty_print) showIndent(outfile, level, pretty_print) outfile.write('%s' % (namespaceprefix_, name_, eol_)) else: outfile.write('/>%s' % (eol_, )) - def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='PartUri'): + def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='PartReference'): pass - def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='PartUri', fromsubclass_=False, pretty_print=True): + def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='PartReference', fromsubclass_=False, pretty_print=True): if pretty_print: eol_ = '\n' else: eol_ = '' - if self.value is not None: + if self.part_uri is not None: showIndent(outfile, level, pretty_print) - outfile.write('<%svalue>%s%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.value), input_name='value')), namespaceprefix_ , eol_)) + outfile.write('<%spart-uri>%s%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.part_uri), input_name='part-uri')), namespaceprefix_ , eol_)) def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) @@ -1137,11 +1151,11 @@ class PartUri(GeneratedsSuper): def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): - if nodeName_ == 'value': - value_ = child_.text - value_ = self.gds_validate_string(value_, node, 'value') - self.value = value_ -# end class PartUri + if nodeName_ == 'part-uri': + part_uri_ = child_.text + part_uri_ = self.gds_validate_string(part_uri_, node, 'part_uri') + self.part_uri = part_uri_ +# end class PartReference class PartNumber(GeneratedsSuper): @@ -1225,11 +1239,10 @@ class PartNumber(GeneratedsSuper): class SupplierPartNumber(GeneratedsSuper): subclass = None superclass = None - def __init__(self, value=None, supplier=None, **kwargs_): + def __init__(self, value=None, **kwargs_): self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') self.value = value - self.supplier = supplier def factory(*args_, **kwargs_): if CurrentSubclassModule_ is not None: subclass = getSubclassFromModule_( @@ -1246,15 +1259,9 @@ class SupplierPartNumber(GeneratedsSuper): def set_value(self, value): self.value = value valueProp = property(get_value, set_value) - def get_supplier(self): - return self.supplier - def set_supplier(self, supplier): - self.supplier = supplier - supplierProp = property(get_supplier, set_supplier) def hasContent_(self): if ( - self.value is not None or - self.supplier is not None + self.value is not None ): return True else: @@ -1290,9 +1297,6 @@ class SupplierPartNumber(GeneratedsSuper): if self.value is not None: showIndent(outfile, level, pretty_print) outfile.write('<%svalue>%s%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.value), input_name='value')), namespaceprefix_ , eol_)) - if self.supplier is not None: - showIndent(outfile, level, pretty_print) - outfile.write('<%ssupplier>%s%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.supplier), input_name='supplier')), namespaceprefix_ , eol_)) def build(self, node): already_processed = set() self.buildAttributes(node, node.attrib, already_processed) @@ -1307,10 +1311,6 @@ class SupplierPartNumber(GeneratedsSuper): value_ = child_.text value_ = self.gds_validate_string(value_, node, 'value') self.value = value_ - elif nodeName_ == 'supplier': - supplier_ = child_.text - supplier_ = self.gds_validate_string(supplier_, node, 'supplier') - self.supplier = supplier_ # end class SupplierPartNumber @@ -1395,17 +1395,17 @@ class SchematicReference(GeneratedsSuper): class ReferencesList(GeneratedsSuper): subclass = None superclass = None - def __init__(self, schematic_reference=None, part_uri=None, part_number=None, supplier_part_number=None, **kwargs_): + def __init__(self, part_reference=None, schematic_reference=None, part_number=None, supplier_part_number=None, **kwargs_): self.original_tagname_ = None self.parent_object_ = kwargs_.get('parent_object_') + if part_reference is None: + self.part_reference = [] + else: + self.part_reference = part_reference if schematic_reference is None: self.schematic_reference = [] else: self.schematic_reference = schematic_reference - if part_uri is None: - self.part_uri = [] - else: - self.part_uri = part_uri if part_number is None: self.part_number = [] else: @@ -1425,6 +1425,19 @@ class ReferencesList(GeneratedsSuper): else: return ReferencesList(*args_, **kwargs_) factory = staticmethod(factory) + def get_part_reference(self): + return self.part_reference + def set_part_reference(self, part_reference): + self.part_reference = part_reference + def add_part_reference(self, value): + self.part_reference.append(value) + def add_part_reference(self, value): + self.part_reference.append(value) + def insert_part_reference_at(self, index, value): + self.part_reference.insert(index, value) + def replace_part_reference_at(self, index, value): + self.part_reference[index] = value + part_referenceProp = property(get_part_reference, set_part_reference) def get_schematic_reference(self): return self.schematic_reference def set_schematic_reference(self, schematic_reference): @@ -1438,19 +1451,6 @@ class ReferencesList(GeneratedsSuper): def replace_schematic_reference_at(self, index, value): self.schematic_reference[index] = value schematic_referenceProp = property(get_schematic_reference, set_schematic_reference) - def get_part_uri(self): - return self.part_uri - def set_part_uri(self, part_uri): - self.part_uri = part_uri - def add_part_uri(self, value): - self.part_uri.append(value) - def add_part_uri(self, value): - self.part_uri.append(value) - def insert_part_uri_at(self, index, value): - self.part_uri.insert(index, value) - def replace_part_uri_at(self, index, value): - self.part_uri[index] = value - part_uriProp = property(get_part_uri, set_part_uri) def get_part_number(self): return self.part_number def set_part_number(self, part_number): @@ -1479,8 +1479,8 @@ class ReferencesList(GeneratedsSuper): supplier_part_numberProp = property(get_supplier_part_number, set_supplier_part_number) def hasContent_(self): if ( + self.part_reference or self.schematic_reference or - self.part_uri or self.part_number or self.supplier_part_number ): @@ -1515,10 +1515,10 @@ class ReferencesList(GeneratedsSuper): eol_ = '\n' else: eol_ = '' + for part_reference_ in self.part_reference: + part_reference_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='part-reference', pretty_print=pretty_print) for schematic_reference_ in self.schematic_reference: schematic_reference_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='schematic-reference', pretty_print=pretty_print) - for part_uri_ in self.part_uri: - part_uri_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='part-uri', pretty_print=pretty_print) for part_number_ in self.part_number: part_number_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='part-number', pretty_print=pretty_print) for supplier_part_number_ in self.supplier_part_number: @@ -1533,16 +1533,16 @@ class ReferencesList(GeneratedsSuper): def buildAttributes(self, node, attrs, already_processed): pass def buildChildren(self, child_, node, nodeName_, fromsubclass_=False): - if nodeName_ == 'schematic-reference': + if nodeName_ == 'part-reference': + obj_ = PartReference.factory(parent_object_=self) + obj_.build(child_) + self.part_reference.append(obj_) + obj_.original_tagname_ = 'part-reference' + elif nodeName_ == 'schematic-reference': obj_ = SchematicReference.factory(parent_object_=self) obj_.build(child_) self.schematic_reference.append(obj_) obj_.original_tagname_ = 'schematic-reference' - elif nodeName_ == 'part-uri': - obj_ = PartUri.factory(parent_object_=self) - obj_.build(child_) - self.part_uri.append(obj_) - obj_.original_tagname_ = 'part-uri' elif nodeName_ == 'part-number': obj_ = PartNumber.factory(parent_object_=self) obj_.build(child_) @@ -2437,7 +2437,7 @@ __all__ = [ "PartDb", "PartList", "PartNumber", - "PartUri", + "PartReference", "PriceBreak", "PriceBreakList", "ReferencesList", diff --git a/test/test_db.py b/test/test_db.py new file mode 100644 index 0000000..7fc3cae --- /dev/null +++ b/test/test_db.py @@ -0,0 +1,82 @@ +from typing import Optional + +import pytest + +from ee.db import * + + +class MyPartNumber(object): + def __init__(self, number, supplier=None): + self.supplier = supplier + self.number = number + + def __repr__(self): + if self.supplier: + return "(supplier={}, number={})".format(self.supplier, self.number) + else: + return "(number={})".format(self.number) + + +class MyPart(object): + def __init__(self, mpn: MyPartNumber, spn: Optional[MyPartNumber] = None): + self.mpn = mpn + self.spn = spn + + def __repr__(self): + mpn = self.mpn if self.mpn else "" + spn = self.spn if self.spn else "" + return "(Part: mpn={}, spn={})".format(mpn, spn) + + +suppliers = [("supplier-a", "SA-"), ("supplier-b", "SB-"), ("supplier-c", None)] +mpns = ["RES" + value for value in ["100", "101", "103"]] + + +def test_basic(): + db = ObjDb() + build_db(db) + + assert len(db) == 11 + + +def build_db(db: ObjDb): + db.add(MyPart(MyPartNumber("RES100"))) + db.add(MyPart(MyPartNumber("RES101"))) + db.add(MyPart(MyPartNumber("RES102"))) + db.add(MyPart(MyPartNumber("RES103"))) + db.add(MyPart(MyPartNumber("RES104"))) + + db.add(MyPart(MyPartNumber("RES100"), MyPartNumber("SA-RES100", "supplier-a"))) + db.add(MyPart(MyPartNumber("RES101"), MyPartNumber("SA-RES101", "supplier-a"))) + db.add(MyPart(MyPartNumber("RES102"), MyPartNumber("SA-RES102", "supplier-a"))) + db.add(MyPart(MyPartNumber("RES103"), MyPartNumber("SA-RES103", "supplier-a"))) + + db.add(MyPart(MyPartNumber("RES101"), MyPartNumber("SB-RES101", "supplier-b"))) + db.add(MyPart(MyPartNumber("RES102"), MyPartNumber("SB-RES102", "supplier-b"))) + + +def test_index(): + db = ObjDb() + mpn_idx = db.add_index("mpn", lambda part: part.mpn.number if part.mpn else None) + spn_idx = db.add_unique_index("spn", lambda part: part.spn.number if part.spn else None) + supplier_pn = db.add_multi_index("supplier_pn", + lambda part: (part.spn.supplier, part.spn.number) if part.spn else None) + build_db(db) + + assert len(mpn_idx.values()) == 5 + tmp = mpn_idx.get("RES100") + assert len(mpn_idx.get("RES100")) == 2 + + # for supplier, spn in spn_idx.items(): + # print("SPN: {}={}".format(supplier, spn)) + assert len(spn_idx.items()) == (len(suppliers) - 1) * len(mpns) + + assert len((supplier_pn.items())) == 2 + assert "supplier-a" in supplier_pn + assert "SA-RES103" in supplier_pn.get("supplier-a") + assert "supplier-b" in supplier_pn + + +@pytest.mark.skipif('False') +def test_skip(): + pass diff --git a/xsd/ee.xsd b/xsd/ee.xsd index 0e322e5..446bab7 100644 --- a/xsd/ee.xsd +++ b/xsd/ee.xsd @@ -44,6 +44,7 @@ TODO: rename 'id' to 'url'. + @@ -62,9 +63,9 @@ TODO: rename 'id' to 'url'. - + - + @@ -77,7 +78,6 @@ TODO: rename 'id' to 'url'. - @@ -90,8 +90,8 @@ TODO: rename 'id' to 'url'. + - -- cgit v1.2.3