Skip to content

Commit

Permalink
Solve the wx frame handle issue
Browse files Browse the repository at this point in the history
  • Loading branch information
MitjaNemec committed Feb 9, 2022
1 parent 53a37ae commit 1ff11b6
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ metadata_package.json
metadata.json
replicate_layout_test_project
replicate_layout_fp_text
/replicate_issue_2
6 changes: 5 additions & 1 deletion action_replicate_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def defaults(self):

def Run(self):
# grab PCB editor frame
self.frame = wx.FindWindowById(pcbnew.ID_V_TOOLBAR).GetParent()
self.frame = wx.FindWindowByName("PcbFrame")

# load board
board = pcbnew.GetBoard()
Expand Down Expand Up @@ -321,6 +321,7 @@ def Run(self):
# prepare the replicator
logger.info("Preparing replicator with " + src_anchor_fp_reference + " as a reference")

# TODO return if replication is not possible at all
try:
replicator = Replicator(board)
except LookupError as exception:
Expand Down Expand Up @@ -367,6 +368,7 @@ def Run(self):
# show dialog
logger.info("Showing dialog")
dlg = ReplicateLayoutDialog(self.frame, replicator, src_anchor_fp_reference, logger)
dlg.CenterOnParent()

# find position of right toolbar
toolbar_pos = self.frame.FindWindowById(pcbnew.ID_V_TOOLBAR).GetScreenPosition()
Expand All @@ -380,3 +382,5 @@ def Run(self):
dlg.SetPosition(dialog_position)

dlg.Show()


14 changes: 14 additions & 0 deletions metadata_source.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,20 @@
"windows"
]
},
{
"version": "1.0.2",
"status": "stable",
"kicad_version": "6.0",
"download_url": "https://github.com/MitjaNemec/ReplicateLayout/releases/download/1.0.2/ReplicateLayout-1.0.2-pcm.zip",
"download_sha256": "2c87066c7348842f32d4ca3208c1f6b33416d6ee1882a23744649cc0afb18546",
"download_size": 26702,
"install_size": 89002,
"platforms": [
"linux",
"macos",
"windows"
]
},
{
"version": "VERSION",
"status": "stable",
Expand Down
1 change: 1 addition & 0 deletions replicate_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def __init__(self, board, update_func=update_progress):
ref=fp.GetReference())
self.footprints.append(fp_tuple)
pass
# TODO check if there is any other footprint fit same ID as anchor footprint

def replicate_layout(self, src_anchor_fp, level, dst_sheets,
containing, remove, tracks, zones, text, drawings, rm_duplicates, rep_locked, by_group):
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.2
1.0.3

0 comments on commit 1ff11b6

Please sign in to comment.