master
John Lauer Add native thermal-pour expansion experiment, finite-difference comparison and recording scripts 33c4ac5 1mo ago
import sys,json,shutil
from pathlib import Path
P=Path(__file__).resolve().parent;sys.path.insert(0,str(P.parent/'thermal'));from crr import call,execute
D='bq25792-thermal-expansion-live';T=P/'recording';T.mkdir(exist_ok=True)
f=T/(D+'.brd');shutil.copy2(P.parent/'thermal/recording-02/bq25792-astra-thermal-routed.brd',f)
r=call('send_files',{'filePaths':[str(f)],'dest':'C:/Users/john/AppData/Local/Temp/adom-thermal-expansion','reason':'Prepare a separate live copper-expansion demonstration preserving video ten'});assert r.get('success'),r
r=call('fusion_open_board',{'filePath':r['destinationPaths'][0]});assert r.get('success'),r
r=execute(D,"app.executeTextCommand('Electron.run RATSNEST; DISPLAY NONE; DISPLAY 16 17 18 20; WINDOW (-1mm -1mm) (52mm 28mm); SHOW VAC1;')\nresult=handle(app,{'expectDocument':target.name},'routing_state')")
(T/'initial-state.json').write_text(json.dumps(r,indent=2));assert (r['segmentCount'],r['viaCount'],r['pourCount'],r['airwireCount'])==(576,89,8,0)
w=call('desktop_list_windows',{})['windows'];T.joinpath('windows.json').write_text(json.dumps(w,indent=2));main=next(x for x in w if x.get('image')=='Fusion360.exe' and x.get('owner')==0)
r=call('desktop_screenshot_window',{'hwnd':main['hwnd'],'resizeMax':1600});T.joinpath('screen.json').write_text(json.dumps(r));print({k:v for k,v in r.items() if k not in ['image','data','output']})