project
12 V to 5 V / 1 A Buck Molecule (TPS54202)
Public Unreviewedby John Lauer
An independently designed 12 V to 5 V, 1 A synchronous buck molecule (TI TPS54202), with calculations, ngspice and PSpice simulation, KiCad 10 schematic and board, and the board laid out and analysed with adom-aiflow.
← Commit history
tools/kicad-cli-remotedeleted−63@@ -1,63 +0,0 @@-#!/usr/bin/env bash-# kicad-cli-remote: a native KiCad 10 `kicad-cli` for a container that has none, run on a desktop-# through Adom Bridge. Implements what adom-aiflow needs (ADOM_AIFLOW_KICAD_CLI):-# kicad-cli-remote --version-# kicad-cli-remote pcb drc --format json --output <report.json> <board.kicad_pcb>-# The board travels with its sibling .kicad_pro / .kicad_dru so project rules are kept.-# Env: KICAD_REMOTE_TARGET (default ConfRoomROG), KICAD_REMOTE_CLI (native kicad-cli path on it),-# KICAD_REMOTE_THREAD (ai-thread name for the bridge; default kicad-cli-remote).-set -euo pipefail-T="${KICAD_REMOTE_TARGET:-ConfRoomROG}"-TH="${KICAD_REMOTE_THREAD:-kicad-cli-remote}"-# The desktop's native kicad-cli: KICAD_REMOTE_CLI, else what the KiCad bridge reports (install.kicadCli).-CLI="${KICAD_REMOTE_CLI:-}"--if [[ "${1:-}" == "--version" ]]; then echo "kicad-cli-remote -> $T (native KiCad via Adom Bridge)"; exit 0; fi-[[ "${1:-}" == "pcb" && "${2:-}" == "drc" ]] || { echo "kicad-cli-remote: only 'pcb drc' and '--version' are supported" >&2; exit 2; }-shift 2-if [[ " $* " == *" --help "* || " $* " == *" -h "* ]]; then- echo "Usage: kicad-cli-remote pcb drc [--format json] [--output FILE] [--refill-zones] [--severity-all] INPUT_FILE"- echo " --refill-zones Refill zones before running DRC (passed to the desktop's native KiCad)"- exit 0-fi-fmt=json; out=""; board=""; extra=()-while [[ $# -gt 0 ]]; do- case "$1" in- --format) fmt="$2"; shift 2;;- --output|-o) out="$2"; shift 2;;- --refill-zones|--severity-all|--severity-error|--severity-warning|--all-track-errors) extra+=("$1"); shift;;- --*) shift;;- *) board="$1"; shift;;- esac-done-[[ -f "$board" && -n "$out" ]] || { echo "kicad-cli-remote: need --output and an existing board" >&2; exit 2; }-if [[ -z "$CLI" ]]; then- CLI=$(adom-bridge --target "$T" kicad_status '{"reason":"find the native kicad-cli for an aiflow DRC"}' --ai-thread "$TH" | python3 -c 'import sys,json;d=json.load(sys.stdin);print((d.get("install") or {}).get("kicadCli",""))')- [[ -n "$CLI" ]] || { echo "kicad-cli-remote: no KiCad found on $T (set KICAD_REMOTE_CLI)" >&2; exit 2; }-fi-# A temp folder on the desktop: KICAD_REMOTE_TMP, else the desktop's %TEMP%.-RTMP="${KICAD_REMOTE_TMP:-}"-if [[ -z "$RTMP" ]]; then- RTMP=$(adom-bridge --target "$T" shell_execute '{"command":"echo %TEMP%","reason":"temp folder for an aiflow DRC"}' --ai-thread "$TH" | python3 -c 'import sys,json;print(json.load(sys.stdin).get("stdout","").strip().replace(chr(92),"/"))')-fi-job="aiflow-drc-$(date +%s)-$$"-dest="$RTMP/$job"-base="$(basename "$board" .kicad_pcb)"-files=("$(readlink -f "$board")")-for ext in kicad_pro kicad_dru; do f="${board%.kicad_pcb}.$ext"; [[ -f "$f" ]] && files+=("$(readlink -f "$f")"); done-args=$(python3 -c 'import json,sys;print(json.dumps({"filePaths":sys.argv[2:],"dest":sys.argv[1],"reason":"offline KiCad DRC for adom-aiflow (native kicad-cli on the desktop)"}))' "$dest" "${files[@]}")-adom-bridge --target "$T" send_files "$args" --ai-thread "$TH" >/dev/null-winboard="$dest/$base.kicad_pcb"; winrep="$dest/$base.drc.$fmt"-cmd=$(python3 -c 'import json,sys;cli,b,r,f=sys.argv[1:5];x=" ".join(sys.argv[5:]);c=f"\"{cli}\" pcb drc {x} --format {f} --output \"{r}\" \"{b}\"";print(json.dumps({"command":c.replace("/","\\"),"timeoutSeconds":240,"reason":"offline KiCad DRC for adom-aiflow"}))' "$CLI" "$winboard" "$winrep" "$fmt" "${extra[@]}")-res=$(adom-bridge --target "$T" shell_execute "$cmd" --ai-thread "$TH")-tmp="$(mktemp -d)"-adom-bridge --target "$T" pull_file "$(python3 -c 'import json,sys;print(json.dumps({"filePaths":[sys.argv[1]],"saveTo":sys.argv[2],"reason":"bring the DRC report back"}))' "$winrep" "$tmp")" --ai-thread "$TH" >/dev/null-if [[ -f "$tmp/$base.drc.$fmt" ]]; then- mv "$tmp/$base.drc.$fmt" "$out"- adom-bridge --target "$T" shell_execute "$(python3 -c 'import json,sys;print(json.dumps({"command":"rmdir /s /q \""+sys.argv[1].replace("/","\\")+"\"","reason":"clean up the DRC temp folder"}))' "$dest")" --ai-thread "$TH" >/dev/null || true- rmdir "$tmp" 2>/dev/null || true- exit 0-fi-echo "kicad-cli-remote: no report came back" >&2-echo "$res" | python3 -c 'import sys,json;d=json.load(sys.stdin);print(d.get("stdout","")[-800:],d.get("stderr","")[-800:])' >&2 || true-exit 1