aboutsummaryrefslogtreecommitdiff
path: root/src/ee/kicad
diff options
context:
space:
mode:
Diffstat (limited to 'src/ee/kicad')
-rw-r--r--src/ee/kicad/functions.py25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/ee/kicad/functions.py b/src/ee/kicad/functions.py
index a2f9f80..b8ad7f5 100644
--- a/src/ee/kicad/functions.py
+++ b/src/ee/kicad/functions.py
@@ -1,8 +1,8 @@
import re
-
import ee.kicad.model
import ee.kicad.sch_fact_types as kicad_ft
+from ee import EeVal
from ee.kicad import sch_fact_types
from ee.part import Part
from ee.part import common_fact_types
@@ -80,11 +80,26 @@ def fix_value_strategy(**kwargs):
symbol_name = part.facts.get_value(sch_fact_types.symbol_name)
- if ref_type in ("D", "R", "L", "C") and v == symbol_name:
- part.remove_fact(uris.make_fact_key("value"))
+ # if ref_type in ("D", "R", "L", "C") and v == symbol_name:
+ # part.remove_fact(uris.make_fact_key("value"))
+
+ if ref_type == "R":
+ ee_value = EeVal.try_parse(v)
+ if ee_value:
+ part.facts.add(common_fact_types.resistance, str(ee_value.value))
+
+ if ref_type == "C":
+ ee_value = EeVal.try_parse(v)
+ if ee_value:
+ part.facts.add(common_fact_types.capacitance, str(ee_value.value))
+
+ if ref_type == "L":
+ ee_value = EeVal.try_parse(v)
+ if ee_value:
+ part.facts.add(common_fact_types.inductance, str(ee_value.value))
- if ref_type == "Q" and v == symbol_name and re.match("^Q_[NP]MOS_[DSG]{3}$", symbol_name):
- part.remove_fact(uris.make_fact_key("value"))
+ # if ref_type == "Q" and v == symbol_name and re.match("^Q_[NP]MOS_[DSG]{3}$", symbol_name):
+ # part.remove_fact(uris.make_fact_key("value"))
return part