UltimateHackingKeyboard / uhk60v1-electronics

The schematic and PCBs of the UHK 60 v1
GNU General Public License v3.0
167 stars 23 forks source link

Create automated system to compare kicad diffs #24

Closed spuder closed 8 years ago

spuder commented 8 years ago

When a new merge request is made. Use travis-ci to generate gerbers/pdf/png files and then use linux compare to generate a visual diff.

http://www.evilmadscientist.com/2011/improving-open-source-hardware-visual-diffs/

https://github.com/blairbonnett-mirrors/kicad/blob/master/demos/python_scripts_examples/plot_board.py

You can assign this to me as I'm currently working on it.

mondalaci commented 8 years ago

Awesome thought of automating this!

Just made you a collaborator of this repo with write access, and assigned this issue to you. Please let's not change the board files until the visual diff mechanism is in place. I'm very afraid of the board changes as I can't see them and they may result in broken boards which translate to huge problems / losses upon manufacturing the PCB.

Sorry for the delay regarding the other issues, I'll catch up later on.

Thank you so much!

spuder commented 8 years ago

Awesome thanks. I understand that you have plenty of other things to worry about right now. I have some manual diffs ready now, but I'm ok waiting to merge them until we have a more polished diff system in place.

spuder commented 8 years ago

I have a working implementation in this branch in my fork

https://github.com/spuder/electronics/tree/feature/wip_travis

It still has the following issues:

spuder commented 8 years ago

Stand by, i'll be pushing a script soon that uses vagrant and the kicad python api to make images showing diffs. Its as native as can be right now

spuder commented 8 years ago

I have opened merge request #27 It has a fairly polished collection of scripts that when run generate 14 pdf files, converts them to .png files, and then runs compare to show the changes

./scripts/generate-png-diff.sh

The script that generates the plots is located externally here:

https://gist.github.com/spuder/4a76e42f058ef7b467d9

It still could use some minor improvements, but it is good enough to see at a glance exactly what was changed.

It also has a travis config file, that runs these scripts.

Here is what happens if nothing has changed:

https://travis-ci.org/spuder/electronics/builds/98057604

Here is what it looks like when a change is made to a file ending in .kicad_pcb

https://travis-ci.org/spuder/electronics/builds/97929762

There are still two remaining tasks

I'll keep working on those, but I want to merge what I have now so that people can use these scripts without waiting.

Here are some samples of what happens when the kicad_file is edited. Here I intentionally moved the rj11 connector:

left-main-layout-1

left-main-assytop-1

mondalaci commented 8 years ago

I'm absolutely thrilled about this, thank you so much @spuder! Let me merge the relevant pull request real quick.

mondalaci commented 8 years ago

@timofonic Sure thing, everybody's welcome to hack the schematic! Let me know if you need any help.

spuder commented 8 years ago

Marking as done. Having travis upload the .png files to imgur and automatically posting links in the github comments wont have much use, since travis secrets are not persisted across forks. I won't automate that unless I there is a real need, and I figure out a way that works with forks.

I'll update the README instructing users to upload their diffs manually.

mondalaci commented 8 years ago

@spuder Thank you for your hard work, this looks excellent the way it is! The rest is only icing on the cake and certainly not urgent.

hoijui commented 4 years ago

As an alternative, you might want to have a look at the very powerful KiBot tool.