From dd7530da716c431eb7586545dc205ba92d5ac28c Mon Sep 17 00:00:00 2001 From: Fredrik Thulin Date: Mon, 25 Sep 2017 10:58:58 +0200 Subject: integration of scripts --- convert.sh | 6 +++++- fix-layer-4.py | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/convert.sh b/convert.sh index 350843c..7bc1a4f 100755 --- a/convert.sh +++ b/convert.sh @@ -63,7 +63,6 @@ for l in 2 5; do sed -i -e "s/${l} In${l}.Cu signal/${l} In${l}.Cu mixed/g" "Cryptech Alpha.kicad_pcb" done - # Sheet number fixups. This hides all the hierarchical sub-sheets from the project view. num_sheets=$(ls Cryptech\ Alpha.sch rev02*sch | wc -l) num=1 @@ -72,6 +71,11 @@ ls Cryptech\ Alpha.sch rev02*sch | while read file; do num=$[$num + 1] done +# Make a copy used as input file in fix-layer-4.py +cp "Cryptech Alpha.kicad_pcb" "convert.kicad_pcb" +../fix-layer-4.py "convert.kicad_pcb" "Cryptech Alpha.kicad_pcb" + + echo "" echo "Done. The leftovers from conversion is in ${altiumdir}, and you can start KiCad like this:" echo "" diff --git a/fix-layer-4.py b/fix-layer-4.py index 59f7a1f..78f851c 100755 --- a/fix-layer-4.py +++ b/fix-layer-4.py @@ -9,7 +9,7 @@ lines had to be removed and zone clearances adjusted to create the same result. Compare with - $ gerbv 'Cryptech Alpha-In4.Cu.gbr' CrypTech.GP3 + $ gerbv 'rev03-KiCad/GerberOutput/Cryptech Alpha-In4.Cu.gbr' /path/to/CrypTech.GP3 """ @@ -103,7 +103,10 @@ def main(in_fn='rev03-KiCad/convert.kicad_pcb', out_fn='rev03-KiCad/Cryptech Alp if __name__ == '__main__': try: - res = main() + if len(sys.argv) != 3: + sys.stderr.write('Syntax: fix-layer-4.py infile.kicad_pcb outfile.kicad_pcb\n') + sys.exit(1) + res = main(sys.argv[1], sys.argv[2]) if res: sys.exit(0) sys.exit(1) -- cgit v1.2.3