Merge branch 'dev'
This commit is contained in:
commit
8326ddd462
26
README.md
26
README.md
@ -26,9 +26,9 @@ _Note_: WireViz is not designed to represent the complete wiring of a system. It
|
|||||||
|
|
||||||
## Installation
|
## 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>
|
git clone <repo url>
|
||||||
@ -38,14 +38,6 @@ pip3 install -e .
|
|||||||
|
|
||||||
## Examples
|
## 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
|
### Demo 01
|
||||||
|
|
||||||
[WireViz input file](examples/demo01.yml):
|
[WireViz input file](examples/demo01.yml):
|
||||||
@ -96,6 +88,14 @@ Output file:
|
|||||||
See the [tutorial page](tutorial/readme.md) for sample code,
|
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.
|
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
|
## Usage
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -114,11 +114,13 @@ mywire.html HTML page with wiring diagram and BOM embedded
|
|||||||
|
|
||||||
## Status
|
## 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
|
## 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
|
## License
|
||||||
|
|
||||||
|
|||||||
@ -287,15 +287,13 @@ class Harness:
|
|||||||
for bundle in items.values():
|
for bundle in items.values():
|
||||||
# add each wire from each bundle to the wirelist
|
# add each wire from each bundle to the wirelist
|
||||||
for color in bundle.colors:
|
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
|
# 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])
|
types = Counter([(v['gauge'], v['gauge_unit'], v['color']) for v in wirelist])
|
||||||
for type in types:
|
for type in types:
|
||||||
items = [v for v in wirelist if (v['gauge'], v['gauge_unit'], v['color']) == type]
|
items = [v for v in wirelist if (v['gauge'], v['gauge_unit'], v['color']) == type]
|
||||||
shared = items[0]
|
shared = items[0]
|
||||||
designators = [i['designators'] for i in items]
|
designators = [i['designator'] for i in items]
|
||||||
# flatten nested list
|
|
||||||
designators = [item for sublist in designators for item in sublist] # https://stackoverflow.com/a/952952
|
|
||||||
# remove duplicates
|
# remove duplicates
|
||||||
designators = list(dict.fromkeys(designators))
|
designators = list(dict.fromkeys(designators))
|
||||||
designators.sort()
|
designators.sort()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user