From 8486b35d2c5c478ed7da45d482d9e0e99b798c19 Mon Sep 17 00:00:00 2001 From: Walter Smith Date: Sun, 10 Nov 2024 12:22:16 -0800 Subject: [PATCH] Improve default search string Don't search for the existing LCSC value -- if I'm searching, that's presumably the only part I don't want! Tweak the search string to make it easier to find passives quickly. --- mainwindow.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mainwindow.py b/mainwindow.py index 79322aa..1b979cf 100644 --- a/mainwindow.py +++ b/mainwindow.py @@ -812,10 +812,13 @@ def select_part(self, *_): ref = self.partlist_data_model.get_reference(item) lcsc = self.partlist_data_model.get_lcsc(item) value = self.partlist_data_model.get_value(item) - if lcsc != "": - selection[ref] = lcsc - else: - selection[ref] = value + footprint = self.partlist_data_model.get_footprint(item) + if ref.startswith("R"): + value += "Ω" + m = re.search(r"_(\d+)_\d+Metric", footprint) + if m: + value += f" {m.group(1)}" + selection[ref] = value PartSelectorDialog(self, selection).ShowModal() def check_order_number(self):