From bfc6e07481602f672287f2e0457504a722dc7215 Mon Sep 17 00:00:00 2001 From: SET Date: Thu, 13 Aug 2020 12:58:21 -0300 Subject: [PATCH] Avoid to apply RLC sorting to "RL*" components. Also apply it to "RV*" and "RT*" --- kiplot/bom/bom.py | 6 +++++- kiplot/bom/units.py | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/kiplot/bom/bom.py b/kiplot/bom/bom.py index 5bf69eda..65abcb81 100644 --- a/kiplot/bom/bom.py +++ b/kiplot/bom/bom.py @@ -35,6 +35,10 @@ DNC = { "no change": 1, "fixed": 1 } +# RV == Resistor Variable +# RN == Resistor 'N'(Pack) +# RT == Thermistor +RLC_PREFIX = {'R': 1, 'L': 1, 'C': 1, 'RV': 1, 'RN': 1, 'RT': 1} def compare_value(c1, c2, cfg): @@ -310,7 +314,7 @@ def test_reg_include(cfg, c): def get_value_sort(comp): """ Try to better sort R, L and C components """ pref = comp.ref_prefix - if pref in 'RLC' or pref == 'RV': + if pref in RLC_PREFIX: res = comp_match(comp.value) if res: value, mult, unit = res diff --git a/kiplot/bom/units.py b/kiplot/bom/units.py index 7fa9e82c..4e65409b 100644 --- a/kiplot/bom/units.py +++ b/kiplot/bom/units.py @@ -98,7 +98,6 @@ def comp_match(component): """ original = component - logger.debug(component) # Convert the decimal point from the current locale to a '.' global decimal_point if not decimal_point: