Close

KiCAD Library Import

A project log for MeowCAD

An online free and open source electronic design tool that runs in your browser. See it live at https://meowcad.com

abetuskabetusk 08/16/2015 at 07:070 Comments

KiCAD Library Import

You can import KiCAD libraries to MeowCAD for use in your projects. These imports are local to your account. Navigating to your 'Portfolio' page and hitting the 'Import' page, you can then select which KiCAD library files you want to import.

The interface is still a bit rough but functional.

Behind The Scenes

The import process is a bit convoluted but works as follows:

* There is a Python CGI script that stores the uploaded file(s) into a staging directory

* Add an a message to the 'importq' Redis array and create a new Redis object with the appropriate library information.

* The "background" process 'libmod_import_d.py' scans the 'importq' for new entries and when it finds them, processes them.

* After 'libmod_import_d.py' processes the imports, it creates a file in a queue directory.

* The "background" process "libmod_snap_d.py' scans the queue directory for new files and when it finds them, starts processing them and creating picture snapshots of each.

The idea is to decouple each step as much as possible. The upload should just dump the files into a directory without blocking the client or web server. Once the files are there, the conversion from KiCAD to JSON can happen. Once the JSON conversion has happened, then the library element .PNG snapshots can be created.

All code can be seen on the www.meowcad.com GitHub repo.

Discussions