Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JST SH: Add MPNs with 'suction cap' attribute and 'JST ' dev prefix #131

Merged
merged 2 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions generate_jst_sh_connectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from typing import Iterable, Optional

from common import init_cache, now, save_cache
from entities.attribute import StringAttribute
from entities.common import (
Align, Angle, Author, Category, Created, Deprecated, Description, Fill, GeneratedBy, GrabArea, Height, Keywords,
Layer, Name, Polygon, Position, Position3D, Rotation, Rotation3D, Value, Version, Vertex, Width
Expand Down Expand Up @@ -604,7 +605,8 @@ def generate_dev(
version: str,
create_date: Optional[str],
generated_by: str,
dev_name: str
dev_name: str,
suction_cap_variant_available: bool
) -> Device:

connector_uuid_stub = f'cmp-pinheader-1x{connector.circuits}'
Expand All @@ -613,7 +615,7 @@ def generate_dev(

dev = Device(
uuid=dev_uuid(connector, 'dev'),
name=Name(dev_name),
name=Name('JST ' + dev_name), # prefix device name
description=Description(description),
keywords=Keywords(keywords),
author=Author(author),
Expand All @@ -633,6 +635,11 @@ def generate_dev(

dev.add_part(Part(dev_name, Manufacturer("JST")))
nbes4 marked this conversation as resolved.
Show resolved Hide resolved

if suction_cap_variant_available:
part_with_suction_cap = Part(dev_name + 'T', Manufacturer("JST"))
part_with_suction_cap.add_attribute(StringAttribute("FEATURES", "Suction Cap"))
dev.add_part(part_with_suction_cap)

return dev


Expand All @@ -650,6 +657,7 @@ def generate_jst(
generated_by: str,
footprint_spec: FootprintSpecification,
available_circuits: Iterable[int],
suction_cap_variant_available: bool,
device_naming_pattern: str,
reverse_pad_order: bool,
rotation: int
Expand Down Expand Up @@ -685,7 +693,8 @@ def generate_jst(
version=version,
create_date=create_date,
generated_by=generated_by,
dev_name=device_naming_pattern.format(f"{circuits:02d}").upper().replace(' ', '-')
dev_name=device_naming_pattern.format(f"{circuits:02d}").upper(),
suction_cap_variant_available=suction_cap_variant_available
)

pkg.serialize(path.join('out', library, 'pkg'))
Expand All @@ -710,7 +719,7 @@ def generate_jst(
generated_by="", # leave empty, not used yet
pkgcats=["e4d3a6bf-af32-48a2-b427-5e794bed949a", "3f0f5992-67fd-4ce9-a510-7679870d6271"], # Pin Headers (male), JST
devcat="4a4e3c72-94fb-45f9-a6d8-122d2af16fb1", # Pin Headers (male)
version="0.1",
version="0.2",
footprint_spec=FootprintSpecification(
pad_width=0.6,
pad_height=1.55,
Expand All @@ -729,6 +738,7 @@ def generate_jst(
pad_first_y_center=4 + (1.55 / 2),
),
available_circuits=[2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 20],
suction_cap_variant_available=False,
device_naming_pattern="SM{}B-SRSS-TB",
create_date=create_date,
reverse_pad_order=True,
Expand All @@ -745,7 +755,7 @@ def generate_jst(
generated_by="", # leave empty, not used yet
pkgcats=["e4d3a6bf-af32-48a2-b427-5e794bed949a", "3f0f5992-67fd-4ce9-a510-7679870d6271"], # Pin Headers (male), JST
devcat="4a4e3c72-94fb-45f9-a6d8-122d2af16fb1", # Pin Headers (male)
version="0.1",
version="0.2",
footprint_spec=FootprintSpecification(
pad_width=0.6,
pad_height=1.55,
Expand All @@ -764,6 +774,7 @@ def generate_jst(
pad_first_y_center=2.65 + (1.55 / 2),
),
available_circuits=[2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
suction_cap_variant_available=True, # see https://github.com/LibrePCB/librepcb-parts-generator/pull/127#issuecomment-2079003507
device_naming_pattern="BM{}B-SRSS-TB",
create_date=create_date,
reverse_pad_order=False,
Expand Down
Loading
Loading