summaryrefslogtreecommitdiff
path: root/README
blob: 78446214e9afad64219b37ff5903156d15141303 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
eeshow - Eeschema schematics renderer and viewer
================================================

Eeshow is a collection of programs to render schematics made by KiCad
Eeschema to FIG, PDF, Postscript, EPS, or PNG, and to generate graphical
differences between different versions of schematics sheets. It can
work in plain files but it can also retrieve design files directly
from a git repository. Furthermore, eeshow has an interactive mode for
viewing schematics and differences.

This work is distributed under the terms of the GNU GENERAL PUBLIC
LICENSE, Version 2:

  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 2 of the License, or
  (at your option) any later version.

For your convenience, a copy of the complete license has been included
in the file COPYING.GPLv2.

The file page_layout_default_description.cpp is from KiCad and is covered
by the same license.


Prerequisites
-------------

libcairo2-dev
libgit2-dev
libgtk-3-dev
transfig
imagemagick

E.g., on Ubuntu and Debian:

sudo apt-get install libgtk-3-dev libcairo2-dev libgit2-dev transfig \
  imagemagick

On Fedora:

sudo dnf install gtk3-devel cairo-devel libgit2-devel transfig ImageMagick


Furthermore, the xsel command-line utility is required for copy & paste.

To build, simply run
make

To install, run as root (e.g., with sudo)
make install


Development status
------------------

Eeshow is still incomplete. It should generally be usable, but still has
many limitations, especially in the following areas:

- not all details are rendered, e.g., pin attributes such as "clock input"

- rendering isn't always exactly the same as in KiCad, e.g., text size may
  differ significantly

- interactive use is not streamlined yet, e.g., revision selection

- there may be unknown bugs

More details on pending items can be found in the file TODO.


Non-interactive rendering
=========================

Eeshow can be invoked from the command line to render KiCad schematics
to FIG, PDF, and PNG.


Invocation
----------

The general form of invocation for rendering is as follows:

eeplot -o output [options] file.pro [file.sch]

or

eeplot -o output [options] [-1] [-e] file.lib ... file.sch

The option -o is always required. The filename extension selects the
output driver, and can be overridden with the type: prefix. If selecting
standard output the type prefix is always required, e.g., png:-

If using PDF, the option -1 can be used (after "eeshow") to process only
one sheet, not recursing into sub-sheets. -e enables the rendering of
additional information, e.g., pin types.

For PDF and PNG, the option -s scale can be used to control the size of
the output.

Examples:

eeplot -s 2 -o test.png test.lib test.sch

eeplot -o neo900.pdf  neo900.lib kicad-libs/components/powered.lib neo900.sch

eeplot -o neo900-sheet04.pdf neo900.pro neo900_SS_4.sch

More details on the above example can be found in the file DEMO.


Revision access
---------------

If the files are stored in a git repository, a revisions can be selected
by prefixing file names with the commit ID, e.g.,

eeplot -o old.png -s neo900.lib kicad-libs/components/powered.lib \
  6a9f71:neo900_SS_5.sch \

Revision selection propagates to dependent files, unless explicitly
overridden. E.g., the above example selects also revision 6a9f71 of
neo900.lib.


Using the component library cache
---------------------------------

Eeschema copies all components it uses to a file named <project>-cache.lib
When operating on files, this library can be used as a convenient
alternative to listing all the libraries that contributed content.

However, when using eeshow with a revision history, the library cache
should only be used if it is also kept in the repository. Otherwise,
library changes in older revisions may get unnoticed.


Overriding the sheet date (experimental)
----------------------------------------

Eeplot can override the sheet date when using the experimental option
-d string  The specified string then replaces the date on all sheets.
Example:

eeplot -d "`git log -1 --format='%ai' -s .`" neo900.pro -o neo900.pdf

The date string can also contain the following date formatting options:

  %t	insert the current time
  %s	insert the modification time of the sheet file, or the author
	date of the commit containing the latest change to the sheet
	file
  %S	like %s, but use the date of the most recently modified sheet
	that is part of the plot
  %i	parse the date string in the sheet
  %u	insert the date previously obtained with %i

Example:

eeplot -d "%s" ...

All the above formatting options accept a format argument in the form
%{format}x where "format" is a strftime-type string (or stfptime, in
the case of %i) and "x" is the format character. Closing curly braces
can be escaped with %}.

If no format is specified, eeplot uses "%F" for %i (example: 2016-10-28)
and "%F %T %z" for all other options (example: 2016-10-28 17:36:17 -0300).

If %i fails to parse the date string, %u produces an empty string.
An alternative can be selected with the ! prefix for the format
character, which only expands the format if there is no user-provided
date. Example:

eeplot -d "%i%{%D}u%{%D}!s" HEAD:neo900.pro -o neo900.pdf

The HEAD: in the above example makes eeplot retrieve the schematics
from git. Without this prefix, it would use files (and thus the time
they were checked out our locally modified, and not the time they were
changed in the repository).

Date support is still experimental and the syntax may change in future
versions of eeplot.


Non-interactive differences
===========================

Eeshow can render two versions of a sheet to a bitmap and then compare them
pixel by pixel, highlighting areas where differences are found. The output
is written to a PNG file.


Invocation
----------

The general form of invocation for rendering is as follows:

eediff [options] file.pro file.pro

or

eediff [options] file.lib ... file.sch file.lib ... file.sch

The usual options and revision selection can be used here as well.

Example:

LIBS="neo900.lib kicad-libs/components/powered.lib"
eediff -o diff.png -s 2 $LIBS  6a9f71:neo900_SS_5.sch \
  $LIBS neo900_SS_5.sch


GUI mode
========

GUI mode allows exploration of schematics and the comparison of different
git revisions. Compared to eeschema, eeshow currently offers the following
additional features:

- access to the git revision history with visual differences between
  versions.

- on hover, global labels show on which other sheets the label is used.
  Clicking on a name jumps to that sheet.

- fast sheet change with PgUp/PgDn


Invocation
----------

The basic invocation of GUI mode is as follows:

eeshow file.pro

or

eeshow file.lib ... file.sch

If file.sch is in a git repository, eeshow automatically loads the
revision history. The depth of the history can be limited with the
option -N number-of-commits

Examples:

eeshow -N 30 neo900.lib kicad-libs/components/powered.lib neo900.sch

eeshow `sed -n '/pcbnew/q;/^LibName[0-9]*=/{s///;s/$/.lib/p;};d' anelok.pro` \
  anelok.sch


Mouse function in GUI mode
--------------------------

Eeshow uses only the left and middle mouse button (both are equivalent)
and the scroll wheel.

Hover			show additional details on revisions, sheets, global
			labels, index
Click			jump to sheet (on sub-sheet, sheet stack, global
			label hover box, index), open index page, open history,
			select revision
Click and drag		pan sheet, scroll history
Scroll wheel		zoom in or out; scroll through history


Key functions in GUI mode
-------------------------

+ or =			zoom in
-			zoom out
*			fit to window
Home			go to the top sheet
Delete or Backspace	go to the next higher sheet in hierarchy
PgUp			go to the previous sheet in sequence
PgDn			go to the next sheet in sequence
Up or Down		invoke the revision history (WIP)
Tab			toggle between old and new revision
Esc			cancel current action (exit history, close pop-up,
			de-highlight glabel, close help)
E			show/hide extra information (pin types)
F			toggle showing footprints, even if invisible
Shift + R		idem, for component references
Shift+D			toggle between "diff" and experimental "delta" mode
H			show/hide help window
V			if hovering on commit, show/hide commit viewer
T			toggle performance timer
D			when comparing revisions, show difference (default)
N			show newer sheet
O			show older sheet
Q			quit the viewer


Providing documentation
-----------------------

Eeshow can display documentation of components, such as data sheets.
To provide such documentation, create a file consisting of records of
the following form:

component_reference
tag (will be displayed by eeshow)
url (will be passed to the external viewer)

Records are separated by one or more blank lines. The file may contain
comment lines, which begin with a hash sign (#). Comment lines are
ignored and do not act as record separators (unless accompanied by one
or more empty lines).

Example:

U201
Data sheet
http://www.nxp.com/documents/data_sheet/IP4220CZ6.pdf

P201A
Data sheet
http://www.molex.com/pdm_docs/sd/475900001_sd.pdf

To make eeshow use the documentation database, specify the name of the
file with the -d option.

Eeshow will also look for the documentation field (F 3) in schematics
sheets, and use its content.

Note: this feature is experimental. The documentation database is not
versioned and its format is likely to change.


Viewing documentation
---------------------

When hovering over a component, a pop-up with the component reference and
the corresponding documentation items (if any) appears. Clicking on a
documentation entry invokes an external viewer.

In the above example, hovering over the U201 component would produce a
pop-up with

U201
Data sheet

and clicking on "Data sheet" would invoke the viewer with the argument
"http://www.nxp.com/documents/data_sheet/IP4220CZ6.pdf"

Eeshow invokes the program named in the environment variable EESHOW_VIEWER.
If EESHOW_VIEWER is not set, it uses xdg-open.


Caching PDF documentation
-------------------------

A caching wrapper for PDF document viewers is provided as "eeshow-viewer".
To use it with eeshow,

EESHOW_VIEWER=eeshow-viewer
export EESHOW_VIEWER

Data sheets are cached in the directory $HOME/.eeshow-viewer-cache
This can be overridden with the environment variable EESHOW_VIEWER_CACHE.

Create the cache directory either with "mkdir", or run
eeshow-viewer -m

The viewer launched by eeshow-viewer is determined as follows:
- the value of EESHOW_PDF_VIEWER
- if not set, the value of PDF_VIEWER
- if not set, xdg-open

With xpdf or evince, eeshow-viewer supports the URL#page syntax for PDF
documents.