34 Commits

Author SHA1 Message Date
Daniel Rojas
ea05519a24 Remove unused code 2020-11-15 08:57:25 +01:00
Daniel Rojas
ef9f36f1b0 Component generation seems to work 2020-11-15 08:57:25 +01:00
Daniel Rojas
a50c7794c5 WIP: first working example of new . notation 2020-11-15 08:57:25 +01:00
Daniel Rojas
4e74aa2a9c Remove unused check_designators() function 2020-11-15 08:57:25 +01: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
KV
7df8a4b7cf Add command line options to show version number
Add -V command line option (and --version as an alias) to
both wireviz.py and build_examples.py that show version number.

Move the version number from setup.py into __init__.py to access
the same version number specification from all files needing it.

This solves part 4 of issue #167.
2020-10-11 13:37:34 +02:00
KV
c4957f1475 Comment out unimplemented command line option
It seems, that the current implementation ignores --generate-bom,
and that parser.add_argument() code line is therefore commented
out until it gets implemented to avoid any confusion.

This solves part 1 of issue #167.
2020-10-11 13:37:34 +02:00
Daniel Rojas
831b423c03 Eliminate ferrule category, unify connectors (#78) 2020-07-20 08:21:54 +02:00
Andrew Katz
fecf27165f Fix unicode issue for windows (force an encoding) 2020-07-19 19:03:07 +02:00
Jason
12d3002af8
Add type hinting (#92) 2020-07-15 19:30:23 +02:00
Jason
34cd9c2612
Match parse() return tuple order to input tuple order (#89)
Fixes #88.
2020-07-15 08:07:15 +02:00
Jason
c8dc697845
Add ability for parse() to return the Harness instance (#87) 2020-07-14 22:01:00 +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
cf6d3676c4 Ensure items in a connection set alternate between connectors and cables 2020-07-11 11:31:02 +02:00
Daniel Rojas
b4791900f2 Make connecting components together easier and more flexible
Closes #67.

- Allow defining arbitrarily long lists of alternating connectors and cables in a connection set.
- Start work towards removing 'ferrules' as special case, merging them with normal connectors
- Stramline auto-generation of simple, one pin connectors (ferrules, wire splices, ...)
2020-07-10 18:53:32 +02:00
Daniel Rojas
de1e45f72b Fix bug in refactoring of #55, add SVG output option 2020-07-05 12:24:51 +02:00
Daniel Rojas
144c99e021 Refactor #55 2020-07-04 17:16:00 +02:00
Jason
ebf1e5a6f2
Add ability to export PNG data directly to other programs. (#55) 2020-07-04 17:03:04 +02:00
Tyler Ward
c200f66009 Merged in refactoring changes from upstream 2020-07-02 00:50:48 +01:00
Tyler Ward
9c5ea06ca2 Added spaces after MPN: and IPN: 2020-07-01 23:47:49 +01:00
Tyler Ward
f67235e326 Added diagram support for part numbers on ferrules 2020-07-01 23:45:35 +01:00
Tyler Ward
1ec9ca4f81 Improved part number support
Added internal part number and manufacturer fields
Added support for wire part numbers in a bundle
Moved part number information to seperate row in table
2020-07-01 23:17:20 +01:00
Daniel Rojas
c42b33b38d Address FIXMEs and fine-tune merge of #39 2020-06-29 12:35:40 +02:00
Gabe R
82b173f2ce Refactor and clean up code (#39)
* Format all files using autopep8 to add basic PEP8 conformity.
* Add Exception types to bare excepts to prevent catching `ctrl+c`
* Remove some unnecessary assignment to dummy variables before returning
* Add `Optional` to type hints that can be `NoneType`
* Change a number of single-letter variables to more descriptive names
* Replace string.format() use with Python's f-strings, as they tends to be cleaner, and provide a performance boost.
  * One multiline string was left as string.format() as I do not believe f-strings support multiline
  * Some of the string.format() instances had unused/ignored arguments. I left them out of the f-strings, but I marked those cases with a comments that begins `# FIXME:`
* Rename variables that were shadowding python standard functions (specifically `format->fmt`, `input->inp`, `type->maintype`)
  * Some instances of `type` were not changed, as it breaks the yaml parsing. Needs to be looked into.
* Move classes in `wireviz.py` to two new files `DataClasses.py` and `Harness.py`.

Co-authored-by: Daniel Rojas <github@danielrojas.net>
2020-06-29 11:57:03 +02:00
Tyler Ward
92b6b21895 Added ability to set part numbers 2020-06-28 22:11:05 +01:00
Tyler Ward
a3728f52ce
Fix for Designators apearing across all colours of wires of a guage. (#37)
The wirelist for the bom now has individual designators added. this also 
alows for the removal of designator list merging later.
2020-06-28 22:58:24 +02:00
Florian Pigorsch
eb65be39dc Fix some typos: budnle, conector, separetely 2020-06-28 14:55:09 +02:00
Daniel Rojas
7060c38f07 Add parse_file() function and use it in build_examples.py 2020-06-28 12:28:13 +02:00
Andreas Nordin
1f06c6017c refactor: rename 'input' -> 'yaml_data'
'input' overloads a python built-in name. Refactor to avoid this.
2020-06-28 10:52:08 +02:00
Andreas Nordin
f14a07fe95 feature: add --prepend-file option
- Allow prepending a separate YAML file for e.g. including common
  template definitions. This is accomodated by a new commandline option,
  --prepend-file, which takes a path to a YAML file. This is prepended
  to the regular input as-is.

- Refactor file loading to accomodate the above. This includes moving
  relevant parts to main() and instead supplying parse () with a string
  representation of the YAML data. Also add early file existance checks
  and bail out if any of the inputs are inaccessible or nonexistant.
2020-06-28 10:51:49 +02:00
Andreas Nordin
9af391ff9d clean up imports, cmdline handling
Order imports properly. Fix path when running script directly from repo
rather than as an installed package. Refactor command line handling.
2020-06-28 10:47:15 +02:00
Andreas Nordin
5514fd4244 refactor dependencies and installation
There are hard copies of the graphviz and pyyaml dependencies included
in the repo. Remove these.

Sort out installation and dependency handling by writing a functional
setup.py script. Rename top level documentation. Refactor wireviz.py
slightly to allow it to run as an installed script.

# Conflicts:
#	src/batch.py
#	src/wireviz/batch.py
#	src/wireviz/build_examples.py
2020-06-28 10:46:24 +02:00
Daniel Rojas
dfb184c1a4 Move source from src/ to src/wireviz/
in preparation for merge of refactor brancb
2020-06-28 10:39:11 +02:00