Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process KiCad output #16

Open
stif opened this issue Dec 16, 2019 · 2 comments · May be fixed by #63
Open

Process KiCad output #16

stif opened this issue Dec 16, 2019 · 2 comments · May be fixed by #63
Assignees
Labels
enhancement New feature or request

Comments

@stif
Copy link

stif commented Dec 16, 2019

It would be great if you could process the KiCad Output so it is more useful to KiCad Users:

  • Copy *.kicad_mod files into seperate folder
  • *.mod files are not needed for recent KiCad Versions as far as i know
  • concat all *.lib files together
  • concat all *.dcm files together

I wrote a small bash script for the necessary steps, but i dont know how to do it in rust:

#!/bin/bash

LIBRARY="LibraryLoader.lib"
DOCLIB="LibraryLoader.dcm"
FOOTPRINT_FOLDER="LibraryLoader.pretty"

#Add static Lines at beginning of Library and Doclib File
echo 'EESchema-LIBRARY Version 2.3' > ${LIBRARY}
echo '#encoding utf-8' >> ${LIBRARY}
echo 'EESchema-DOCLIB  Version 2.0' > ${DOCLIB}

echo Footprint Folder: ${FOOTPRINT_FOLDER}

if [ ! -d ${FOOTPRINT_FOLDER} ]; then
mkdir ${FOOTPRINT_FOLDER}
fi

for d in *; do
  if [ -d ${d} ]; then # test if it is a directory or file
  	if [ ${d} != ${FOOTPRINT_FOLDER} ]; then # skip Footprint Folder itself
      echo processing $d ...
      # copy footprint to footprint folder
      cp -av ${d}/*.kicad_mod ${FOOTPRINT_FOLDER} 
      # concat all chars between DEF and ENDDEF to Library file
      cat ${d}/*.lib | sed -e '1h;2,$H;$!d;g' -re 's/.*(DEF.*ENDDEF).*/\1/g' >> ${LIBRARY}
      # concat all chars between $CMP and ENDCMP to Doclib file
      cat ${d}/*.dcm | sed -e '1h;2,$H;$!d;g' -re 's/.*(\$CMP.*ENDCMP).*/\1/g' >> ${DOCLIB}
    fi
  fi
done
@olback olback self-assigned this Dec 17, 2019
@olback olback added the enhancement New feature or request label Dec 17, 2019
@CaptainMaso CaptainMaso linked a pull request May 12, 2021 that will close this issue
@olback
Copy link
Owner

olback commented Oct 18, 2023

Is this fixed by #93?

@stif
Copy link
Author

stif commented Oct 19, 2023

I don't know, i cannot build it:

docker run --volume=$(pwd):/home/circleci/project olback/rust-gtk-linux cargo build --release
    Updating crates.io index
 Downloading crates ...
  Downloaded powerfmt v0.2.0
....
  Downloaded inout v0.1.3
error: package `gdk-pixbuf-sys v0.18.0` cannot be built because it requires rustc 1.70 or newer, while the currently active rustc version is 1.61.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants