使用Cadsoft Eagle支持开放硬件开发的简单脚本
eagle_automation的Python项目详细描述
鹰自动化
python的eagle自动化(PEA)提供了一个更类似于unix的 Cadsoft Eagle电子设计包的脚本化接口。它 是为了让开放硬件开发更方便 任何习惯于开源程序的人 软件项目(例如使用源代码管理工具和单步 构建)。
此存储库当前包含以下内容:
- pea diff
- 用于原理图、电路板布局和库的命令行差异工具 它与git difftool兼容。用于原理图和电路板 布局,显示视觉差异。对于库,文本 显示库元素的比较。
- pea export
- 一种将统一的命令行接口公开给 不同的方式鹰提供出口艺术品。目前 支持将eagle文件导出为gerber、pdf和png格式, 生成excellon drill文件和pick&place所需的文件 机器。
- pea drill
- 从.dri生成.drl文件,而不需要任何烦人的对话框。
- pea bom
- 生成包含完整组件列表的.json文件
- skel/Makefile
- 一个示例makefile,演示如何制作和组装 一个项目的文档可以用gnu自动生成 制造。
安装
使用pypi,请执行:
% pip install eagle_automation
使用源,运行:
% python setup.py install % git config --global --add difftool.eaglediff.cmd 'pea diff $LOCAL $REMOTE'
注意,这些脚本仅使用Eagle≥5.11.0(和7.2)进行了测试
用法
您可以在skel/子目录中找到一个Makefile,它显示了 可以使用make from自动生成项目文档 .sch和.brd文件。
显示尚未提交的设计差异:
% git difftool -t eaglediff
显示两个标记版本之间的差异:
% git difftool -t eaglediff v1.0..v2.0
请注意,在使用这些工具时,Eagle窗口会闪烁 工具。他们那样做的时候尽量不要碰任何东西。
另外,如果鹰的行为不止一个例子 运行:它可能偶尔会在脚本中间停止或抛出 随机错误对话框。因为这个软件的封闭性 对此无能为力。如果你觉得不舒服,考虑一下 切换到免费的eda工具。
开发
安装buildoutpip install zc.buildout并运行:
% buildout % bin/pea --help
从源头上。
然后可以运行python setup.py develop来安装全局 实例链接到当前源。或python setup.py install到 按旧的方式安装。
配置
这些工具区分“导出层”(例如层名称 用于pea export命令行)和“eagle layers”(层名称 它们出现在Eagle用户界面中)。通常一个导出层 对应于一个遮罩,由一个或多个鹰层组成。
例如,topcopper导出层默认包含Top, Pads和Vias鹰层。
配置文件提供导出层和eagle之间的映射 图层和其他一些可调整的设置。默认配置为 由setup.py安装。它应该适用于最简单的一个-或者 双层板。
如果你想调整一些东西,你可以放你自己的 配置文件到以下位置之一。以后的设置 位置优先于以前的位置:
/etc/eagle_automation.conf $HOME/.config/eagle_automation.conf $HOME/.eagle_automation.conf ./eagle_automation.conf ./.eagle_automation.conf
您可以使用skel/eagle_automation.conf文件作为模板。
您可以在命令行中指定配置选项,方法是 key=value在pea命令之后:
pea -c EAGLE=/usr/local/bin/eagle export example.sch bom example-bom.json
您也可以以同样的方式提供配置文件(仅 限制:配置文件不应包含字符 =,否则将被解释为键/值设置)。
例如:
pea -c ../config/pea.conf export example.sch bom example-bom.json
已知问题
导出到PDF US时ingpea export,默认打印设置为 使用。要设置它们,请转到“文件”->;“打印设置”,进行更改,然后退出 这样就可以保存设置了。
贡献者
Copyright (C) 2014 Tomaz Solc <tomaz.solc@tablix.org> Copyright (C) 2015 Bernard Pratz <guyzmo+github@m0g.net>
许可证
Eagle automation, set of commandline tools for use with CadSoft Eagle Copyright (C) 2014 Tomaz Solc <tomaz.solc@tablix.org> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.