Merge branch 'dev'

This commit is contained in:
Daniel Rojas 2020-06-28 23:01:45 +02:00
commit 8326ddd462
2 changed files with 16 additions and 16 deletions

View File

@ -26,9 +26,9 @@ _Note_: WireViz is not designed to represent the complete wiring of a system. It
## Installation
WireWiz requires the ```graphviz``` package as well as it's python bindings. Graphviz itself is installed using your regular package manager, e.g. ```apt-get install graphviz```. The Graphviz python bindings are automatically installed as dependencies by the install script.
WireWiz requires GraphViz to be installed in order to work. See the [GraphViz download page](https://graphviz.org/download/) for OS-specific instructions.
Installation of the WireWiz package and its python dependencies can be done using pip after cloning the repository:
Installation of the WireWiz package and its Python dependencies can be done using pip after cloning the repository:
```
git clone <repo url>
@ -38,14 +38,6 @@ pip3 install -e .
## Examples
### (re)building the example projects
If you would like to rebuild all of the included demos, examples and tutorials, use the ```build_examples.py``` script:
```cd src/wireviz
./build_examples.py
```
### Demo 01
[WireViz input file](examples/demo01.yml):
@ -96,6 +88,14 @@ Output file:
See the [tutorial page](tutorial/readme.md) for sample code,
as well as the [example gallery](examples/readme.md) to see more of what WireViz can do.
### (Re-)Building the example projects
If you would like to rebuild all of the included demos, examples and tutorials, use the ```build_examples.py``` script:
```cd src/wireviz
./build_examples.py
```
## Usage
```
@ -114,11 +114,13 @@ mywire.html HTML page with wiring diagram and BOM embedded
## Status
This is very much a [work in progress](TODO). Source code, API, syntax and functionality may change wildly at any time.
This is very much a [work in progress](https://github.com/formatc1702/WireViz/projects/1). Source code, API, syntax and functionality may change wildly at any time.
## Requirements
Developed and tested using Python 3.7; might not work with older Python versions. Ubuntu 18.04 LTS users in particular may need to separately install Python 3.7 or above, as that comes with Python 3.6 as the included system Python install.
Developed and tested using Python 3.7; might not work with older Python versions.
Ubuntu 18.04 LTS users in particular may need to separately install Python 3.7 or above, as that comes with Python 3.6 as the included system Python install.
## License

View File

@ -287,15 +287,13 @@ class Harness:
for bundle in items.values():
# add each wire from each bundle to the wirelist
for color in bundle.colors:
wirelist.append({'gauge': shared.gauge, 'gauge_unit': shared.gauge_unit, 'length': shared.length, 'color': color, 'designators': list(items.keys())})
wirelist.append({'gauge': shared.gauge, 'gauge_unit': shared.gauge_unit, 'length': shared.length, 'color': color, 'designator': bundle.name})
# join similar wires from all the bundles to a single BOM item
types = Counter([(v['gauge'], v['gauge_unit'], v['color']) for v in wirelist])
for type in types:
items = [v for v in wirelist if (v['gauge'], v['gauge_unit'], v['color']) == type]
shared = items[0]
designators = [i['designators'] for i in items]
# flatten nested list
designators = [item for sublist in designators for item in sublist] # https://stackoverflow.com/a/952952
designators = [i['designator'] for i in items]
# remove duplicates
designators = list(dict.fromkeys(designators))
designators.sort()