Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReplicateLayout creating namesake groups. #60

Open
SiTLOOMS opened this issue Jun 22, 2023 · 0 comments
Open

ReplicateLayout creating namesake groups. #60

SiTLOOMS opened this issue Jun 22, 2023 · 0 comments

Comments

@SiTLOOMS
Copy link
Contributor

SiTLOOMS commented Jun 22, 2023

ReplicateLayout creating namesake groups and dividing destination sheets' items by groups when "Group layouts" is chosen and destination footprint is already member of "proper" group.

https://github.com/MitjaNemec/ReplicateLayout/blob/62278e94812c5ef6d706d1a8ecc9758a4381b591/replicate_layout.py#LL897C11-L897C11

Tried to add GetName() to dst_fp.fp.GetParentGroup().

                if settings.group_footprints:
                    if (dst_fp.fp.GetParentGroup() is not None):
                        if dst_fp.fp.GetParentGroup().GetName() != self.dst_groups[st_index].GetName():
                            self.dst_groups[st_index].AddItem(dst_fp.fp)
                    else:
                        self.dst_groups[st_index].AddItem(dst_fp.fp)

While ReplicateLayout leaves footprint in it's "proper" group, it creates new group and adds another items of this sheet into this new group.
In result there are two (may be more after several replications I think) groups with same names. And replicated sheet's items are placed in different groups.
(3) in ReplicateLayout dir.

I suppose footprint may be added into new group if this footprint is a member of a "proper" group already.
In this case if there is no extra items in old group, footprint will be moved to new group and old group will be automatically removed from board (there wont be any "empty" group in .kicad_pcb file). And whole replicated sheet will be in one group.
(3-1) in ReplicateLayout dir.

If there is extra items in group this items will be leaved in old group, replicated items will be added into new group and there will be two namesake groups with different identifiers. But whole sheet will be in one group.
(3-a) in ReplicateLayout dir.

In this way there will be just

                if settings.group_footprints:
                    self.dst_groups[st_index].AddItem(dst_fp.fp)

at 897 .

grouping-test.zip

Sorry if I'm doing it the wrong way, but I do not know where I really should write such things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant