Source code for jitxexamples.components.buttons.PTS810SJM250SMTRLFS

from jitx import PadMapping
from jitx.anchor import Anchor
from jitx.component import Component
from jitx.landpattern import Landpattern, Pad
from jitx.layerindex import Side
from jitx.net import Port
from jitx.shapes.composites import rectangle
from jitx.shapes.primitive import Arc, ArcPolyline, Polyline, Text
from jitx.feature import Finish, Paste, Silkscreen, Soldermask
from jitx.symbol import Direction, Pin, Symbol


[docs] class RectSMDPad(Pad): rect = rectangle(1.050013, 0.7) shape = rect layer = Paste(rect) layer = Soldermask(rect)
[docs] class C116501(Landpattern): p = { 1: RectSMDPad().at(-2.100076, 1.087948, on=Side.Top), 2: RectSMDPad().at(2.100076, 1.087948, on=Side.Top), 3: RectSMDPad().at(-2.100076, -1.061913, on=Side.Top), 4: RectSMDPad().at(2.100076, -1.061913, on=Side.Top), } ref_text = Silkscreen(Text(">REF", 1.0, Anchor.C).at(0.0, 3.536894)) value_text = Finish(Text(">VALUE", 1.0, Anchor.C).at(0.0, -3.536894)) ref_alt_text = Finish(Text("REF**", 1.0, Anchor.C).at(0.0, -5.536894)) silk_lines = [ Silkscreen(Polyline(0.254001, [(-0.508001, -1.002985), (0.508001, -1.002985)])), Silkscreen(Polyline(0.254001, [(-0.508001, 1.02902), (0.508001, 1.02902)])), Silkscreen(Polyline(0.254001, [(1.366421, 1.536894), (-1.366421, 1.536894)])), Silkscreen(Polyline(0.254001, [(2.199898, 0.556833), (2.199898, -0.530798)])), Silkscreen(Polyline(0.254001, [(-2.199898, 0.556833), (-2.199898, -0.530798)])), Silkscreen(Polyline(0.254001, [(-1.381102, -1.536894), (1.381102, -1.536894)])), ] silk_arcs = [ Silkscreen( ArcPolyline( 0.254001, [Arc((-0.508001, 0.0130179999999999), 1.016003, 90.0, -180.0)] ) ), Silkscreen( ArcPolyline( 0.254001, [ Arc( (2.54000061702092, 0.013018), 2.27184561702092, 206.565100611358, -53.1302012227158, ) ], ) ), Silkscreen( ArcPolyline( 0.059995, [Arc((-2.299975, 1.612967), 0.0299719999999999, 0.0, 360.0)] ) ), ]
# model = Model3D( # "../../3d-models/C116501.wrl", # position=(0, 0, 0), # scale=(1, 1, 1), # rotation=(0, 0, 0) # )
[docs] class PTS810SJM250SMTRLFS_Symbol(Symbol): pin_name_size = 0.6 pad_name_size = 0.6 p1 = Pin(at=(-2, -4), direction=Direction.Left, length=2) p2 = Pin(at=(2, -4), direction=Direction.Right, length=2) p3 = Pin(at=(-2, -6), direction=Direction.Left, length=2) p4 = Pin(at=(2, -6), direction=Direction.Right, length=2) ref_text = Text(">REF", 1.27, Anchor.C).at(0.0, 1.27) value_text = Text(">VALUE", 1.27, Anchor.C).at(0.0, -2.54) # Switch symbol lines switch_lines = [ Polyline(0.0, [(0, -6), (0, -5.4)]), # Vertical line Polyline(0.0, [(0, -5.4), (-0.5, -4.7)]), # Diagonal line Polyline(0.0, [(-2, -4), (2, -4)]), # Top horizontal line Polyline(0.0, [(-2, -6), (2, -6)]), # Bottom horizontal line Polyline(0.0, [(0, -4), (0, -4.6)]), # Center vertical line ]
[docs] class PTS810SJM250SMTRLFS(Component): """Reliable Microminiature Surface Mount Switch""" mpn = "PTS810SJM250SMTRLFS" reference_designator_prefix = "SW" # Tactile switch pins p1 = Port() # Pin 1 p2 = Port() # Pin 2 p3 = Port() # Pin 3 p4 = Port() # Pin 4 landpattern = C116501() symbol = PTS810SJM250SMTRLFS_Symbol() # Pin mappings based on the pin-properties from the original Stanza file mappings = [ PadMapping( { p1: [landpattern.p[1]], # Pin 1 to pad 1 p2: [landpattern.p[2]], # Pin 2 to pad 2 p3: [landpattern.p[3]], # Pin 3 to pad 3 p4: [landpattern.p[4]], # Pin 4 to pad 4 } ), ] # Property for datasheet URL datasheet = ( "https://datasheet.lcsc.com/lcsc/1811092141_C-K-PTS810SJM250SMTRLFS_C116501.pdf" )
Device: type[PTS810SJM250SMTRLFS] = PTS810SJM250SMTRLFS