diff --git a/electronics_lib/PassiveConnector_Header.py b/electronics_lib/PassiveConnector_Header.py index fcb0306f1..10e0e04f6 100644 --- a/electronics_lib/PassiveConnector_Header.py +++ b/electronics_lib/PassiveConnector_Header.py @@ -48,9 +48,28 @@ def part_footprint_mfr_name(self, length: int) -> Tuple[str, str, str]: """JST S*B-PH-K series connector: 2.00mm shrouded and polarized, in horizontal (right-angle) through-hole.""" -class JstPhKHorizontal(FootprintPassiveConnector): +class JstPhKHorizontal(FootprintPassiveConnector, JlcPart): allowed_pins = range(2, 16+1) + PART_NUMBERS = { # white colored, -S part suffix + 2: 'C173752', + 3: 'C157929', + 4: 'C157926', + 5: 'C157923', + 6: 'C157920', + 7: 'C157917', + 8: 'C157915', + 9: 'C157912', + 10: 'C157947', + 11: 'C157945', + 12: 'C157943', + 13: 'C157940', + 14: 'C157938', + 15: 'C157936', + 16: 'C157934', + } def part_footprint_mfr_name(self, length: int) -> Tuple[str, str, str]: + self.assign(self.lcsc_part, self.PART_NUMBERS[length]) + self.assign(self.actual_basic_part, False) return (f'Connector_JST:JST_PH_S{length}B-PH-K_1x{length:02d}_P2.00mm_Horizontal', "JST", f"S{length}B-PH-K") diff --git a/examples/jlcpcb_pcba_postprocess.py b/examples/jlcpcb_pcba_postprocess.py index ce771ba5c..b2cfbab14 100644 --- a/examples/jlcpcb_pcba_postprocess.py +++ b/examples/jlcpcb_pcba_postprocess.py @@ -62,6 +62,8 @@ 'OptoDevice:Osram_BPW34S-SMD': 180, 'Connector_Coaxial:BNC_Amphenol_B6252HB-NPP3G-50_Horizontal': 180, + + 'Connector_JST:JST_PH_S2B-PH-K_1x02_P2.00mm_Horizontal': 180, } # footprint position export doesn't include the footprint library name @@ -82,6 +84,9 @@ 'RF_Module:ESP32-WROOM-32': (0, 0.8), 'Connector_Coaxial:BNC_Amphenol_B6252HB-NPP3G-50_Horizontal': (0, -2.5), + + 'Connector_JST:JST_PH_S2B-PH-K_1x02_P2.00mm_Horizontal': (1, 0), + 'Connector_JST:JST_PH_S6B-PH-K_1x06_P2.00mm_Horizontal': (5, 0), } PACKAGE_OFFSETS = {footprint.split(':')[-1]: offset for footprint, offset in _FOOTPRINT_OFFSETS.items()}