Skip to content

Commit

Permalink
Add connectivity issue test and dialog, refactor net_pairs(),
Browse files Browse the repository at this point in the history
  • Loading branch information
MitjaNemec committed Feb 19, 2023
1 parent 4df401e commit 7c2bfd5
Show file tree
Hide file tree
Showing 6 changed files with 499 additions and 97 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ replicate_layout_fp_text
/KiCad_2ndTestProject_v1
/krivospitsky_issue
error_dialog_GUI.py
conn_issue_GUI.py
33 changes: 33 additions & 0 deletions action_replicate_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,25 @@
from .error_dialog_GUI import ErrorDialogGUI
from .replicate_layout import Replicator
from .replicate_layout import Settings
from .conn_issue_GUI import ConnIssueGUI


class ConnIssueDialog(ConnIssueGUI):
def SetSizeHints(self, sz1, sz2):
# DO NOTHING
pass

def __init__(self, parent, replicator):
super(ConnIssueDialog, self).__init__(parent)

self.list.InsertColumn(0, 'Footprint', width=100)
self.list.InsertColumn(1, 'Pad', width=100)

index = 0
for issue in replicator.connectivity_issues:
self.list.InsertItem(index, issue[0])
self.list.SetItem(index, 1, issue[1])
index = index + 1


class ErrorDialog(ErrorDialogGUI):
Expand Down Expand Up @@ -202,6 +221,20 @@ def on_ok(self, event):
settings, remove_duplicates)

self.logger.info("Replication complete")

if self.replicator.connectivity_issues:
self.logger.info("Letting the user know there are some issues with replicated design")
report_string = ""
for item in self.replicator.connectivity_issues:
report_string = report_string + f"Footprint {item[0]}, pad {item[1]}\n"
self.logger.info(f"Looks like the design has an exotic connectivity that is not supported by the "
f"plugin\n "
f"Make sure that you check the connectivity around:\n" + report_string)
# show dialog
issue_dlg = ConnIssueDialog(self, self.replicator)
issue_dlg.ShowModal()
issue_dlg.Destroy()

# clear highlight on all footprints on selected level
self.replicator.highlight_clear_level(self.hl_fps, self.hl_items)
self.hl_fps = []
Expand Down
Loading

0 comments on commit 7c2bfd5

Please sign in to comment.