75 Commits

Author SHA1 Message Date
Tyler Ward
abcccbd360 Move calculation of qty_multiplier into wv_helper 2020-10-19 00:27:16 +01:00
Tyler Ward
7c67a9e004 Implement suggested code cleanup
Moved aditional components from dicts to a new dataclass
Update dict get refrences to class members
Simplify Connector and Cable bom generation (deduplication is now
handled with the additional components)
Other small sugested cleanups
2020-10-19 00:26:25 +01:00
Tyler Ward
c6c54b0c4e Add Bom referenced parts lists for aditional components
Bom generation has been refactored to add an ID field and remove
duplicates. This is used to lookup adidiontal components and a lookup
reference and short description is now included in the graph rather than
the full details.
2020-10-19 00:24:19 +01:00
Tyler Ward
3e1e9b7e6d remove bom designators for connector extras with show_name=false
This matches the behaviour of the connectors themselves
2020-10-19 00:23:51 +01:00
Tyler Ward
038938cc27 Fix bugs from the the error handling additions. 2020-10-19 00:23:51 +01:00
Tyler Ward
0e929fe85a Reformat aditional component rendering in conector and cable nodes 2020-10-19 00:23:49 +01:00
Tyler Ward
22e6fb5c35 Fix conector additions to multiply quantity rather than replace it 2020-10-19 00:22:53 +01:00
Tyler Ward
e852df5fd0 Fix bad check for pn being set 2020-10-19 00:22:53 +01:00
Tyler Ward
668ee0aa9e Fix wrong designation in bom for cable additions 2020-10-19 00:22:53 +01:00
Tyler Ward
bb37b37d28 Split qty into multiple fields
There is now a numberic field 'qty' and a multiplier field 
'qty_multiplier'
2020-10-19 00:22:53 +01:00
Tyler Ward
94d6fc9015 Add units to graph output 2020-10-19 00:22:53 +01:00
Tyler Ward
1a8942abaa Add support for cables to have extra components 2020-10-19 00:22:49 +01:00
Tyler Ward
9a1bc20ace Add extra components to connector nodes in graph 2020-10-19 00:21:29 +01:00
Tyler Ward
6680e5597b Clean up construction of connectors_extra list 2020-10-19 00:19:09 +01:00
Tyler Ward
064fbc617d Add support for connectioncount as a qty option 2020-10-19 00:19:09 +01:00
Tyler Ward
84c9db6a8a Add connector aditional bom components 2020-10-19 00:19:09 +01:00
Tyler Ward
389e48035d Add bom ignore option for cables and connectors 2020-10-19 00:19:09 +01:00
KV
fb17eae7a6 Avoid errors from HTML validator
The https://validator.w3.org/ reported Errors:
The align attribute on the th/td element is obsolete. Use CSS instead.

By replacing align="X" attributes with text-align:X; CSS equivalent,
the validator now completes without any errors or warnings.

This solves the remaining issues from #97.
2020-10-16 22:02:15 +02:00
KV
7dcd1a7eeb Define application name and URL only once
The application name and URL was defined several places in the code,
and the name was not written exactly the same everywhere.

By using the same constants everywhere, consistency is obtained.
2020-10-16 22:02:15 +02:00
KV
b00040cdd9 Add version number to output files with meta info
Tag the .gv and .html output files with generator and version number.
2020-10-16 22:02:15 +02:00
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