Further minor tweaks/typo corrections to README.md

This commit is contained in:
John Pateman 2020-03-03 17:21:45 +00:00
parent 26abe5ae8b
commit f2d7b6c3ed
2 changed files with 12 additions and 90 deletions

View File

@ -1,22 +1,25 @@
# KiCad-Diff
This is a python program with a Tk inteface for comparing KiCad PCB revisions.
The diffing strategy has been changed for this version and SVGs are generated directly rather than doing renderings in ImageMagick as in previous versions. This has made the rendering possible for all layers in a few seconds (compared to 20-60s+ depending on resolution and number of layers selected in previous version).
The diffing strategy has been changed for this version and SVGs are generated directly rather than doing renderings in ImageMagick as in previous versions. This has made the rendering possible for all layers in a few seconds (compared to 20-60s+ depending on resolution and number of layers selected in previous version). The SVG images are layered together with a different feColorMatrix filter applied to each diff. This highlights areas where features have been added or removed.
The output is presented as a gallery of images of each layer. Each layer pair can be compared and the combined view highlights clearly where the layers differ from each other.
Was originaly a bash script, this newer GUI version has been rewritten in Python3 and supports Git, SVN and Fossil as SCM tools. I have also removed many of the dependencies.
The diff output can be scrolled and zoomed in and out for closer inspection. The pair of 'before and after' views will also pan and zoom together. I have looked at linking all thre windows together but this makes for a very confusing and unsatisfactory effect.
There is an additional 'Text Diff' which is helpful for identifying specif areas which have changed.
This was originaly written as a bash script, this newer GUI version has been rewritten in Python3 and supports Git, SVN and Fossil as SCM tools. I have also removed many of the dependencies.
**Instructions**
* Check that the paths to your SCM tools are correct (lines 39-45). You do not need to install all of these but if you do not have, e.g. SVN, make sure that you set svnProg=''.
* Install 'plotPCB2.py' in /usr/local/bin (or adjust path in lines 45 to suit). This program actually generates the SVG files.
* Run the main script and select a pair of versions in a source controlled repository from the GUI.
* Check that the paths to your SCM tools are correct (lines 39-45). You do not need to install all of these but if you do not have one, e.g. SVN, make sure that you set svnProg='' etc.
* Install 'plotPCB2.py' in /usr/local/bin (or adjust path in lines 45 to suit) This needs to be executable. This program actually generates the necessary SVG files.
* Run the main script and select a pair of versions in a source controlled repository from the GUI. The GUI should show which SCM is in use.
* The terminal should give you some useful information on progress. Please include a copy of this if you have any issues.
* Hit Ctrl + C to terminate the webserver.
The script should build a series of svg files and display the diff in a webpage. YIf a web page doesn't open automatically, navigate to "http://127.0.0.1:9090/web/index.html" to view the output. You can adjust the port used (9090 by default) if this conflicts with your existing set-up.
The script should build a series of svg files and display the diff in a webpage. If a web page doesn't open automatically, navigate to "http://127.0.0.1:9090/web/index.html" to view the output. You can adjust the port used (9090 by default) if this conflicts with your existing set-up.
***Plans***
@ -24,8 +27,9 @@ Was originaly a bash script, this newer GUI version has been rewritten in Python
2. Place all template text/css text in external files.
3. Improve display of artifacts in diff choice window.
4. Consider changing GUI elements to wxPython.
5. Adjustfor three pane output to have white outer border & pan-zoom control, not filter colour.
5. Adjust for three pane output to have white outer border & pan-zoom control, not filter colour.
6. Improve three pane output layout, perhaps with diff tree on LHS and not underneath.
7. Consider adding 'Preferences' for this program.
***Screenshots***

View File

@ -1,82 +0,0 @@
#!/Applications/KiCad/kicad.app/Contents/Frameworks/Python.framework/Versions/Current/bin/python
'''
Kicad plot pcb file.
Plot variety of svg files in plot directory as well as pdf of double size
assembly guide
'''
import sys
sys.path.insert(0, "/Applications/Kicad/kicad.app/Contents/Frameworks/python/site-packages/")
import pcbnew
from pcbnew import *
# Load board and initialize plot controller
boardName = sys.argv[1]
filePath = sys.argv[2]
board = LoadBoard(boardName)
pctl = pcbnew.PLOT_CONTROLLER(board)
popt = pctl.GetPlotOptions()
plotDir = filePath
popt.SetOutputDirectory(plotDir)
popt.SetPlotFrameRef(False)
popt.SetLineWidth(pcbnew.FromMM(0.15))
popt.SetAutoScale(False)
popt.SetScale(2)
popt.SetMirror(False)
popt.SetUseGerberAttributes(True)
popt.SetExcludeEdgeLayer(False)
popt.SetUseAuxOrigin(False)
#popt.SetUseAuxOrigin(True)
pctl.SetColorMode(True)
# Assembly guide PDF
#popt.SetScale(2)
#pctl.SetLayer(pcbnew.F_SilkS)
#pctl.OpenPlotfile("Silk", pcbnew.PLOT_FORMAT_PDF, "Assembly guide")
#pctl.PlotLayer()
#popt.SetScale(1)
layers = [
("F_Cu", pcbnew.F_Cu, "Top layer"),
("B_Cu", pcbnew.B_Cu, "Bottom layer"),
("B_Paste", pcbnew.B_Paste, "Paste bottom"),
("F_Paste", pcbnew.F_Paste, "Paste top"),
("F_SilkS", pcbnew.F_SilkS, "Silk top"),
("B_SilkS", pcbnew.B_SilkS, "Silk top"),
("B_Mask", pcbnew.B_Mask, "Mask bottom"),
("F_Mask", pcbnew.F_Mask, "Mask top"),
("Edge_Cuts", pcbnew.Edge_Cuts, "Edges"),
("Margin", pcbnew.Margin, "Margin"),
("In1_Cu", pcbnew.In1_Cu, "Inner1"),
("In2_Cu", pcbnew.In2_Cu, "Inner2"),
("Dwgs_User", pcbnew.Dwgs_User, "Dwgs_User"),
("Cmts_User", pcbnew.Cmts_User, "Comments_User"),
("Eco1_User", pcbnew.Eco1_User, "ECO1"),
("Eco2_User", pcbnew.Eco2_User, "ECO2"),
("B_Fab", pcbnew.B_Fab, "Fab bottom"),
("F_Fab", pcbnew.F_Fab, "Fab top"),
("B_Adhes", pcbnew.B_Adhes, "Adhesive bottom"),
("F_Adhes", pcbnew.F_Adhes, "Adhesive top"),
("B_CrtYd", pcbnew.B_CrtYd, "Courtyard bottom"),
("F_CrtYd", pcbnew.F_CrtYd, "Courtyard top"),
]
# Parse layers - not certain how to get vias
# popt.SetColor(COLOR4D(0.050, 0.050, 0.050, 0.1))
# Ideally would set colour of layer with the 'SetColor' method which was
# previously described with colour names
# e.g.popt.SetColor(YELLOW)
# this does not work. COLOR4D doesn't cause an error but also doesn't work.
# Nor does setting an integer work.
for layer_info in layers:
pctl.SetLayer(layer_info[1])
pctl.OpenPlotfile(layer_info[0], pcbnew.PLOT_FORMAT_SVG, layer_info[2])
pctl.PlotLayer()
# At the end you have to close the last plot, otherwise you don't know when
# the object will be recycled!
pctl.ClosePlot()