From 612c014c700cced0a460d9e61b09aab74652e1c4 Mon Sep 17 00:00:00 2001 From: MitjaNemec Date: Sun, 19 Mar 2023 12:35:56 +0100 Subject: [PATCH] import V7 fixes (net pair code, GUI text corrections --- error_dialog_GUI.fbp | 2 +- replicate_layout.py | 27 ++++++++++++++++++++++----- version.txt | 2 +- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/error_dialog_GUI.fbp b/error_dialog_GUI.fbp index 49764de..0081f5d 100644 --- a/error_dialog_GUI.fbp +++ b/error_dialog_GUI.fbp @@ -93,7 +93,7 @@ 0 0 wxID_ANY - Fatal error when restoring layout. You can raise an issue on GiHub page. + "Please attach the save_restore_layout.log which you should find in the project folder. + Fatal error when replicating layout. You can raise an issue on GiHub page. + "Please attach the save_restore_layout.log which you should find in the project folder. 0 0 diff --git a/replicate_layout.py b/replicate_layout.py index b4614c9..1207ba5 100644 --- a/replicate_layout.py +++ b/replicate_layout.py @@ -200,11 +200,19 @@ def parse_schematic_files(self, filename, dict_of_sheets): path = contents[j].replace("(uuid ", '').rstrip(")").upper().strip() sheet_id = path.replace('00000000-0000-0000-0000-0000', '') if "(property \"Sheet name\"" in contents[j] or "(property \"Sheetname\"" in contents[j]: - sheetname = contents[j].replace("(property \"Sheet name\"", '').split("(")[0].replace("\"", "").strip() - sn_found = True + if "(property \"Sheet name\"" in contents[j]: + sheetname = contents[j].replace("(property \"Sheet name\"", '').split("(")[0].replace("\"", "").strip() + sn_found = True + if "(property \"Sheetname\"" in contents[j]: + sheetname = contents[j].replace("(property \"Sheetname\"", '').split("(")[0].replace("\"", "").strip() + sn_found = True if "(property \"Sheet file\"" in contents[j] or "(property \"Sheetfile\"" in contents[j]: - sheetfile = contents[j].replace("(property \"Sheet file\"", '').split("(")[0].replace("\"", "").strip() - sf_found = True + if "(property \"Sheet file\"" in contents[j]: + sheetfile = contents[j].replace("(property \"Sheet file\"", '').split("(")[0].replace("\"", "").strip() + sf_found = True + if "(property \"Sheetfile\"" in contents[j]: + sheetfile = contents[j].replace("(property \"Sheetfile\"", '').split("(")[0].replace("\"", "").strip() + sf_found = True # properly handle property not found if not sn_found or not sf_found: logger.info(f'Did not found sheetfile and/or sheetname properties in the schematic file ' @@ -692,10 +700,19 @@ def get_net_pairs(self, sheet): if (src_net_depth == 1) and (dst_net_depth == 1): net_pairs.append(net_pair) continue - # if there is no clear match, check how well they match + # try to handle exotic cases if (src_net_depth == dst_net_depth or net_delta_depth == fp_delta_depth) and src_net_path[-1] == dst_net_path[-1]: net_pairs.append(net_pair) continue + if (src_net_depth == dst_net_depth) and (src_net_path[0:-1] == dst_net_path[0:-1]): + net_pairs.append(net_pair) + continue + shorter_lenght = min(src_net_depth, dst_net_depth) + if (net_delta_depth == fp_delta_depth) and (src_net_path[-shorter_lenght:-1] == dst_net_path[-shorter_lenght:-1]): + net_pairs.append(net_pair) + continue + # if I didn't find proper pair, append it to list for reporting + logger.info(f"Cannot pair src net: {src_net_path} and dst net: {dst_net_path}") connectivity_issues.append((fp_pair[1].ref, pad_nr)) if connectivity_issues: """ diff --git a/version.txt b/version.txt index d5e98f7..785cda8 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.3.2 \ No newline at end of file +1.3.3 \ No newline at end of file