From 9eba62ef1d6b4896de693976116f69a9692332d9 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 20 May 2019 15:27:38 +0200 Subject: ee: o Adding FactType as a smaller wrapper around the fact uri. o Adding ee.part.Facts, used as Part.facts o Renaming 'type' uri to 'ee-component-type'. kicad-make-bom: Removing strategy functionality, replaced with part-apply-function. Moving default strategy contents into ee.kicad.functions. --- src/ee/__init__.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/ee/__init__.py') diff --git a/src/ee/__init__.py b/src/ee/__init__.py index 93c73f7..2ba113e 100644 --- a/src/ee/__init__.py +++ b/src/ee/__init__.py @@ -8,6 +8,11 @@ from ee.formatting import eng_str __all__ = [ "EeException", "EeVal", + "EeValType", + "resistance_type", + "capacitance_type", + "inductance_type", + "power_type", ] @@ -15,6 +20,18 @@ class EeException(Exception): pass +class EeValType(object): + def __init__(self, symbol, alternate_symbols): + self.symbol = symbol + self.alternate_symbols = alternate_symbols + + +resistance_type = EeValType("\u2126", ["ohm"]) +capacitance_type = EeValType("F", []) +inductance_type = EeValType("H", []) +power_type = EeValType("W", []) + + @total_ordering class EeVal(object): units = ['F', @@ -102,4 +119,3 @@ class EeVal(object): def __float__(self): return self._value * math.pow(10, self._exp) - -- cgit v1.2.3