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/measure-pcb-style.py
from pathlib import Path
import hashlib,json,os,subprocess
root=Path(__file__).resolve().parent.parent;o=root/'reports/electrical-fixes'
env=dict(os.environ,NODE_USE_ENV_PROXY='1',PATH='/workspace/.cloud-tools/node_modules/.bin:'+os.environ['PATH'],XDG_CONFIG_HOME='/workspace/.cloud-tools/config',XDG_CACHE_HOME='/workspace/.cache',XDG_STATE_HOME='/workspace/.cloud-tools/state')
with (o/'pcb-style-analysis.json').open('w') as out,(o/'pcb-style-stderr.log').open('w') as err:
p=subprocess.run(['/workspace/.cloud-tools/node_modules/.bin/bun','scripts/check-cli-complete.mjs','check','pcb-style','dist/index/circuit.json','--json','--svg','reports/electrical-fixes/pcb-style.svg'],cwd=root,env=env,stdout=out,stderr=err)
raw=(o/'pcb-style-analysis.json').read_text();a=json.loads(raw[raw.index('{'):]);counts={}
for item in a['issues']:counts[item['lineItemType']]=counts.get(item['lineItemType'],0)+1
(o/'pcb-style.log').write_text(raw+(o/'pcb-style-stderr.log').read_text());sha=lambda path:hashlib.sha256((root/path).read_bytes()).hexdigest()
x={'status':'MEASURED','command':'tsci check pcb-style dist/index/circuit.json --json','exitCode':p.returncode,'styleCheckPassed':p.returncode==0,'styleFindings':len(a['issues']),'styleCategories':counts,'routeCacheSha256':sha('routing/final/cache.json'),'nativeCircuitSha256':sha('dist/index/circuit.json'),'log':'reports/electrical-fixes/pcb-style.log','logSha256':sha('reports/electrical-fixes/pcb-style.log'),'issues':a['issues']}
(o/'pcb-style.json').write_text(json.dumps(x,indent=2)+'\n');print({k:v for k,v in x.items() if k!='issues'});assert p.returncode in [0,1]