abse/smartwatch-flex-top-only
Three-panel flex smartwatch with two parallel R3.9 bends, all components flat-top, low-profile JST connector harnesses, split heartbeat optical windows and screw-retained PCB mounting. Modeled 39 × 50.5 × 14.5mm prototype; 100% routing, zero native DRC and shorts. Hardware qualification pending.
- Version
- 0.2.20
- License
- unset
- Stars
- 0
scripts/apply-warning-metadata.py
from pathlib import Path
r=Path(__file__).resolve().parent.parent
# Use native physical component classes; preserve every imported footprint/CAD.
for file,tag,extra in [
('imports/BSS138.tsx','mosfet','channelType="n" mosfetMode="enhancement"'),
('imports/LESD5Z5_0CT1G.tsx','diode',''),
('imports/JstAch2.tsx','connector',''),
('components/esp32/B3U_3000P.tsx','pushbutton',''),
('components/esp32/KMR221GLFS.tsx','pushbutton','')]:
p=r/file;s=p.read_text();s=s.replace('<chip','<'+tag+' '+extra).replace('</chip>','</'+tag+'>')
if tag=='mosfet':s=s.replace(' pinLabels={pinLabels}\n','') # explicit supplier-symbol ports retain G1/S2/D3
if tag=='diode':s=s.replace(' pinLabels={pinLabels}', ' pinLabels={pinLabels} pinAttributes={{pin1:{isPassive:true},pin2:{isPassive:true}}}')
p.write_text(s)
p=r/'components/esp32/ESP32_S3.tsx';s=p.read_text().replace(' pin55: {requiresPower: true},',' pin57: {requiresGround: true},\n pin55: {requiresPower: true},');p.write_text(s)
p=r/'esp32-s3-board.tsx';s=p.read_text().replace('const DisplayFpc=(props:any)=><chip','const DisplayFpc=(props:any)=><connector');s=s.replace('</footprint>} {...props}/>\n// Same copper', '</footprint>} {...props}/>\n// Same copper')
# Numeric references follow native conventions without changing locations/order.
s=s.replace('name={p.name} resistance="0"','name={p.name===\'L4\'?\'R60\':p.name} resistance="0"')
s=s.replace('<PrintedReceiverCoil name="LRX"','<PrintedReceiverCoil name="L6"')
p.write_text(s)
p=r/'components/BoardPads.tsx';s=p.read_text().replace('<chip','<connector');s=s.replace("export const ProbePad = (props:ChipProps<{pin1:['PAD']}>) => <connector", "export const ProbePad = (props:ChipProps<{pin1:['PAD']}>) => <testpoint footprintVariant=\"pad\" padDiameter={.9}");s=s.replace(' pinLabels={{pin1:[\'PAD\']}}\n','')
# Copper-only interfaces have no package body. Reserve 0.127mm beyond lands.
s=s.replace("<smtpad portHints={['pin2']} pcbX={1.05} pcbY={0} width={1.3} height={1.6} shape=\"rect\" />", "<smtpad portHints={['pin2']} pcbX={1.05} pcbY={0} width={1.3} height={1.6} shape=\"rect\" />\n <courtyardrect width={3.654} height={1.854}/>")
s=s.replace("<smtpad portHints={['pin2']} pcbX={2} pcbY={0} width={2} height={2} shape=\"rect\" />", "<smtpad portHints={['pin2']} pcbX={2} pcbY={0} width={2} height={2} shape=\"rect\" />\n <courtyardrect width={6.254} height={2.254}/>")
s=s.replace('shape="circle" /></footprint>', 'shape="circle" /><courtyardcircle radius={.577}/></footprint>');p.write_text(s)
p=r/'components/PrintedReceiverCoil.tsx';s=p.read_text().replace('export const UartServicePads=(props:any)=><chip','export const UartServicePads=(props:any)=><connector');s=s.replace("footprint={<footprint>{[1,2,3,4,5]", "footprint={<footprint insertionDirection=\"from_above\"><courtyardrect width={1.254} height={4.554}/>{[1,2,3,4,5]")
# Printed winding is a PCB copper feature. Courtyard encloses its complete copper.
s=s.replace(' <WindingCopper/>',' <courtyardrect width={23.354} height={18.254}/>\n <WindingCopper/>');p.write_text(s)
for file in ['scripts/copper-model.mjs','scripts/prepare-external-shorts-check.mjs']:
p=r/file;p.write_text(p.read_text().replace("e.name==='LRX'","['LRX','L6'].includes(e.name)"))