pixalynx/pixal-gps

These files define two separate printed circuit boards: a small, two-layer battery cartridge with protection circuitry and contact pads for a pouch cell, and a larger, two-layer wireless charging dock featuring USB-C input, a resonant coil, and wireless power transmission components.

Version
0.1.2
License
unset
Stars
0

simulator/scripts/sync-hardware.py

"""Snapshot existing Circuit JSON geometry without rebuilding or modifying the designs."""
import json,hashlib,pathlib
root=pathlib.Path(__file__).resolve().parents[2];out={}; hashes={}
for name in ['tracker','battery-pack','dock']:
 p=root/'dist'/name/'circuit.json';raw=p.read_bytes();d=json.loads(raw);hashes[str(p.relative_to(root))]=hashlib.sha256(raw).hexdigest()
 types=['pcb_board','pcb_component','source_component','pcb_smtpad','pcb_trace','pcb_via','pcb_hole','pcb_plated_hole','pcb_silkscreen_text','pcb_silkscreen_path']
 out[name]=[x for x in d if x['type'] in types]
(root/'simulator/src/hardware.json').write_text(json.dumps(out,separators=(',',':')))
for p in [*root.glob('*.tsx'),*root.glob('parts/*.tsx'),*root.glob('lib/*'),*root.glob('routing/*.json')]:
 if p.is_file():hashes[str(p.relative_to(root))]=hashlib.sha256(p.read_bytes()).hexdigest()
(root/'simulator/source-hashes.json').write_text(json.dumps(hashes,indent=2)+'\n')
print('Saved geometry for all three boards and',len(hashes),'source hashes.')