55 Commits

Author SHA1 Message Date
KV
1809f73d58 Simplify colorbar using the same technique as html_image()
Moving common code into html_colorbar() helper function.
2020-10-14 22:37:20 +02:00
kvid
4782da47c9
Add optional image to connectors and cables (#153)
This image, with an optional caption below, is displayed in the lower 
section of the connector/cable node in the diagram - just above the 
notes if present.

This solves the basic part of issue #27, and is a continuation of 
PR #137 that was closed due to changes in the base branch.
2020-10-14 16:08:16 +02:00
Daniel Rojas
e3fb39f5ae Add whitespace to GraphViz HTML for readability 2020-08-13 17:21:42 +02:00
Daniel Rojas
94faec536e Rebuild GV HTML generation using lists
Simplify code

remove superfluous temporary variables `pinlist`, `wirerow`

Add suggested changes
2020-08-13 17:21:42 +02:00
Daniel Rojas
af196dfd8c Improve line break handling 2020-08-13 17:21:42 +02:00
Daniel Rojas
102c7d6113 Simplify code and rename variables
Improve code based on review

Suggestions by @kvid
2020-08-13 17:21:42 +02:00
Daniel Rojas
43f85aedb2 Add color attribute to cables 2020-08-13 17:21:42 +02:00
Daniel Rojas
2639c77360 Refactor cable GraphViz HTML generation
to match the one for connectors.
2020-08-13 17:21:42 +02:00
Daniel Rojas
23c17e66bf Change wire padding behavior
Addresses #131
2020-07-27 22:40:59 +02:00
KV
1815a13cd6 Make each shield wire uniform and allow cable.shield color
As the spline shield wires were rendered as tinned wires with
black borders, and the shield wires in cable nodes were rendered
as a single (bottom) border, they didn't fit well together.

Each shield wire is now rendered equally along the spline sections
and in cable nodes. If cable.shield is true, they are rendered as
thin black wires in the same way as before multi-colors were
introduced. The new feature is that cable.shield is allowed to
contain a two-letter color code to specify a colored shield wire
with black borders.

The shield wire thickness is not increased, even if the cable has
some multi-colored wires that makes all other wires to increase.

This fixes bug #125.
2020-07-27 20:11:47 +02:00
Tyler Ward
b9a4783b6f
Shorten BOM field names (#121)
- Shorten `part_number` to `pn`
- Shorten `manufacturer_part_number` to `mpn`
- Show `manufacturer` and `mpn` in a single cell of the node
- Replace `manufacturer` with `'MPN'`within the node if no manufacturer is specified.
- Rearrange order of P/N fields within node
  `{pn} | {manufacturer}: {mpn}`
2020-07-26 16:50:11 +02:00
Daniel Rojas
a1881eb49d Rename connector attributes (#77)
Rename `pinnumbers` to `pins`.
Rename `pinout` to `pinlabels`.
2020-07-21 22:01:10 +02:00
Daniel Rojas
b028e7a22b
Fix node rendering for cables with hidden name and/or no visible attributes (#104)
Closes #69.
2020-07-20 14:24:39 +02:00
Jason
a418005c2e
Fix superscript 2 in HTML output (#95)
Change `<sup></sup>` to `&sup2;`
2020-07-20 13:19:04 +02:00
Daniel Rojas
831b423c03 Eliminate ferrule category, unify connectors (#78) 2020-07-20 08:21:54 +02:00
Daniel Rojas
8cba79334c Disable color padding for cables with no multicolor wires 2020-07-19 19:03:07 +02:00
Daniel Rojas
3732597ded Fine-tune multicolor wire PR
- Remove modified background color -> should be discusses as a separate feature
- Render shields as thin tinned wire with black border, safer for b&w priting than single light-gray line
- Remove PE as color definition, since it is not, and should be called with GNYE
- Clean up minor things
2020-07-19 19:03:07 +02:00
Andrew Katz
ea948a247f Change colors as per #17 review 2020-07-19 19:03:07 +02:00
Andrew Katz
fecf27165f Fix unicode issue for windows (force an encoding) 2020-07-19 19:03:07 +02:00
Andrew Katz
b147aa0eb1 Finish adding multicolor support 2020-07-19 18:59:34 +02:00
KV
1c0c13bb52 Add DOCTYPE declaration in HTML output 2020-07-18 13:18:31 +02:00
KV
b5ac632da9 Remove XML and DOCTYPE declarations from embedded SVG 2020-07-18 13:18:31 +02:00
Daniel Rojas
11baf0f507 Move part number info directly below designator
(to be consistent with the changes proposed in #11)
2020-07-15 20:06:31 +02:00
Daniel Rojas
6c7d700a1f Remove obsolete nesting function, fine-tune table generating behavior 2020-07-15 20:06:31 +02:00
Daniel Rojas
7e54c7aaef Refactor connector GraphViz code generation (#66) 2020-07-15 20:04:58 +02:00
Jason
12d3002af8
Add type hinting (#92) 2020-07-15 19:30:23 +02:00
Jason R. Jones
9de33b49bd Make file output more consistently behaved. 2020-07-13 19:58:23 +02:00
Tyler Ward
8b69e9a8a8
Add ability to include aditional BOM lines (#80) 2020-07-13 18:23:23 +02:00
Jason
3eed9681da
Remove unused parameter, fix default parameter (#76) 2020-07-12 08:21:28 +02:00
Daniel Rojas
9e11051cac Simplify connector loop code 2020-07-11 11:53:29 +02:00
Daniel Rojas
8f5b1aaf16 Allow using connector pin names to define connections
Pin names from pinout list can now be used in addition to pin numbers when defining connections, provided the identifier is unambiguous.
Closes #71.
2020-07-09 19:21:53 +02:00
Daniel Rojas
e1e665583f Outsource nested HTML table creation to helper function 2020-07-05 20:36:02 +02:00
Daniel Rojas
0252476248 Fix bug in bundle wire BOM generation 2020-07-05 20:10:38 +02:00
Daniel Rojas
501303cbee Implement line break parsing for ferrules 2020-07-05 19:54:14 +02:00
Daniel Rojas
c2fa1d09e7 Merge changes to ferrule code generation 2020-07-05 19:46:20 +02:00
Daniel Rojas
54f114e592 Refactor ferrule GraphViz code generation
Cleaner code, better graphical output, more flexible (splices look as good as ferrules)
2020-07-05 19:07:59 +02:00
Daniel Rojas
46ed2418b4 Remove any newlines in fields for BOM generation 2020-07-05 18:06:57 +02:00
Daniel Rojas
d4ac4da651 Implement line break parsing for some fields
Implemented in `type`, `subtype`, `notes` fields
2020-07-05 17:41:18 +02:00
kvid
4e9933f01d
Simplify BOM code (#62)
* Remove bundle grouping as it is not needed for the wire grouping

Grouping the bundles has no purpose, as the same
wires can be collected by just looping all bundles.

* Allow one common value or list of values for each wire

Allow one common value when they are equal for all wires,
or a list of values to allow each wire a different value.

* Fix the minor issues commented by the owner

The owner review comments can be seen here:
https://github.com/formatc1702/WireViz/pull/62

* Make grouping code more pythonic
2020-07-05 16:52:10 +02:00
Daniel Rojas
de1e45f72b Fix bug in refactoring of #55, add SVG output option 2020-07-05 12:24:51 +02:00
Jason
ebf1e5a6f2
Add ability to export PNG data directly to other programs. (#55) 2020-07-04 17:03:04 +02:00
Daniel Rojas
b2387378c3 Make parts of BOM code more pythonic 2020-07-04 13:55:37 +02:00
Daniel Rojas
84c10e2c1a Clean up code 2020-07-04 13:55:37 +02:00
Daniel Rojas
407a9235b7 Simplify and fix bug in BOM generation 2020-07-04 13:55:37 +02:00
Daniel Rojas
4796c7cc97 Fix bug of non-bundle wires appearing in BOM 2020-07-02 19:45:28 +02:00
Daniel Rojas
16929687d3 Fine-tune cable appearance
Add hack to make manufacturer / part number row have vertical separators, to be visually consistent with connectors.

In the future, connectors will have to be modified to be HTML tables instead of GraphViz record nodes, in order to support colored bands for the connector, or individual pins (#53). When this is implemented, a cleaner solution should be found for both connectors and cables.
2020-07-02 19:16:56 +02:00
Daniel Rojas
94731cdf81 Fix post-merge bugs 2020-07-02 18:56:17 +02:00
Daniel Rojas
5fbe3e6b7e Merge branch 'feature/part-number' into dev
# Conflicts:
#	src/wireviz/Harness.py
2020-07-02 08:26:58 +02:00
KV
6f91b65128 Support named type of cables (or wires in a bundle)
Add cable type to diagram and BOM entries.
2020-07-02 07:44:17 +02:00
KV
c9895bd282 Move the cable category filtering before BOM grouping
Simplify the grouping loop slightly, by moving the filtering out.

The category of bundle entries is allways the same and is therefore
not needed for grouping.

The BOM output is unchanged by this change. It is verified using:
      python build_examples.py
      git diff ../../{examples,tutorial}/*.tsv
2020-07-02 07:44:17 +02:00