main
John Lauer
Preserve adopted board30 and validated resistor library candidates with native-render dependency
7fa0c9c
"""Native CLI still renders for candidate review, not a live-view/video substitute."""
from pathlib import Path
import subprocess,json,sys
R=Path(__file__).resolve().parents[1];O=R/'checkpoints/bourns-land-review-v2';remote='C:/Users/john/adom-projects/adom-custom-electronic-load/review/bourns-land-candidate'
def call(v,a,label):
p=subprocess.run(['adom-bridge','--target','AdomLapper','--ai-thread','adom-custom-load',v,json.dumps(a)],capture_output=True,text=True);j=json.loads(p.stdout);(O/(label+'.json')).write_text(json.dumps(j,indent=2));assert p.returncode==0 and j.get('success',True) and not j.get('error') and j.get('exitCode',0)==0,str(j)[:1000];return j
cli=call('kicad_status',{},'render-native-status')['install']['kicadCli']
for name,extra in [('top',[]),('bottom',['--side','bottom']),('oblique',['--rotate','325,0,25'])]:
if len(sys.argv)>1 and name not in sys.argv[1:]:continue
out=remote+'/native-'+name+'.png'
call('shell_execute',{'command':'"'+cli+'"','args':['pcb','render','--width','3600','--height','3200','--quality','high','--output',out,*extra,remote+'/bourns-land-candidate.kicad_pcb'],'timeoutSeconds':120,'reason':'Native renderer still-image inspection of isolated resistor land-pattern candidate; live viewport remains unqualified'},'render-'+name)
call('pull_file',{'filePaths':[out],'saveTo':str(O)},'render-pull-'+name)
print(name,flush=True)