main
John Lauer
Correct R7 clamp fault power on board27; publish exact resistor assets, simulations and forming-study evidence without…
11c16d0
"""Show an isolated library-review board for recording, without replacing the project board."""
from pathlib import Path
import json,subprocess,zipfile,base64,shutil
root=Path(__file__).resolve().parents[1];out=root/'checkpoints/q1-formed-review';remote='C:/Users/john/adom-projects/adom-custom-electronic-load/review/q1-formed-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);d=json.loads(p.stdout);(out/(label+'.json')).write_text(json.dumps(d,indent=2)+'\n');assert p.returncode==0 and d.get('success',d.get('ok',True)) and not d.get('errors') and d.get('exitCode',0)==0,d;return d
# Candidate already contains all selected models.
zpath=out/'viewer-inputs.zip'
with zipfile.ZipFile(zpath,'w',zipfile.ZIP_DEFLATED) as z:
for p in [out/'q1-formed-candidate.kicad_pcb',out/'q1-formed-candidate.kicad_pro',out/'q1-formed-candidate.kicad_dru',out/'fp-lib-table']+list((out/'lib').rglob('*.kicad_mod'))+list((out/'3d').glob('*.step')):z.write(p,p.relative_to(out))
call('send_files',{'filePaths':[str(zpath)],'dest':remote+'/','reason':'Prepare isolated library candidate for requested engineering video'},'viewer-send')
script=f"$ErrorActionPreference='Stop'\nExpand-Archive -LiteralPath '{remote}/viewer-inputs.zip' -DestinationPath '{remote}' -Force\n"
call('run_script',{'interpreter':'powershell','scriptB64':base64.b64encode(script.encode()).decode(),'reason':'Unpack task-owned review assets without changing project board'},'viewer-unpack')
r=call('kicad_open_board',{'filePath':remote+'/q1-formed-candidate.kicad_pcb','foreground':False},'viewer-open');print(json.dumps({k:v for k,v in r.items() if k!='output'})[:4200])