Add support for units to wire lengths. Part 2

Will also be editing harness.py to add the support as well as defaulting units to meters if unpopulated.
This commit is contained in:
William Sutton 2020-08-28 18:02:14 -04:00 committed by GitHub
parent df90d8326a
commit 67a25e390b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,6 +88,7 @@ class Cable:
gauge_unit: Optional[str] = None
show_equiv: bool = False
length: float = 0
lengthunit: Optional[str] = None
color: Optional[str] = None
wirecount: Optional[int] = None
shield: bool = False
@ -119,6 +120,9 @@ class Cable:
self.connections = []
if self.lengthunit is None: #Default wire length units to meters if left undeclared
self.lengthunit = 'm'
if self.wirecount: # number of wires explicitly defined
if self.colors: # use custom color palette (partly or looped if needed)
pass