MitjaNemec / ReplicateLayout

GNU General Public License v2.0
90 stars 12 forks source link

Fix getting "false positive" items from namesake groups #59

Open SiTLOOMS opened 1 year ago

SiTLOOMS commented 1 year ago

This should fix the issue when there is a group with the same name as the source group and "Replicate group only" feature is used so this will replicate redundant items..

There is no restriction in KiCad for namesake groups. But each group must be an individual entity. Comparing items' parent groups by its' entity should prevent from confusion source group with other namesake groups.

It may produce such a mess at https://github.com/MitjaNemec/ReplicateLayout/blob/62278e94812c5ef6d706d1a8ecc9758a4381b591/replicate_layout.py#L1305 but I cant figure out how to handle it properly, because "group name" will no longer make any sense I think but <Swig Object of type 'PCB_GROUP *' at 0xXXXXXXXXXXXXXXXX> may be "unreadable".

I think it should be done for filter_items_by_group and filter_footprints_by_group also. But I did not find it used anywhere.

SiTLOOMS commented 1 year ago

Replication result with .GetName() (2) in ReplicateLayout dir. Replication result with .this (2-a) in ReplicateLayout dir. group-filtering-test.zip

MitjaNemec commented 1 year ago

Just letting you know that I am currently low on available time, so this will have to wait a bit. Thanks for understanding.