gauravmm / HierarchicalPcb

MIT License
32 stars 6 forks source link

fails to replicate first layout #2

Closed huegene closed 7 months ago

huegene commented 1 year ago

Hi, when I use this plugin, the first instance of the schematic is notplaced/replicated in the layout and remains untouched (not placed and not routed) the subsequent layouts are recognised and placed and routed

huegene commented 1 year ago

I traced the error to the DlgHPCBRun.init() for what ever reason the first addition of anitem fails. reassigning the parent item during the first run seems to fix the problem item: wx.TreeListItem = self.treeApplyTo.AppendItem( parent=parent_item, text=row_text, data=sheet ) if (self.treeApplyTo.GetCount()==0): parent_item: wx.TreeListItem = ( sheet.parent.list_ref or self.treeApplyTo.GetRootItem() ) item: wx.TreeListItem = self.treeApplyTo.AppendItem( parent=parent_item, text=row_text, data=sheet )

gauravmm commented 1 year ago

Huh, that's really odd. Could you please share a minimum PCB that exhibits this problem?

Thanks!

gauravmm commented 12 months ago

Hey, I messed with this a little bit and I couldn't replicate it. If you can send me a minimal PCB that exhibits this problem, please let me know and I'll reopen the issue.

hrueger commented 8 months ago

Hi @gauravmm, I've just managed to run into this. Here you can find a reproduction project: first-layout-does-not-replicate.zip

Just open the testhira.kicad_pcb file and see for yourself. Thanks in advance!

I'm using the feature-kicad8 branch with kicad version 8.0.0.

gauravmm commented 8 months ago

Hey, thanks! I'll take a peek at this over the weekend.

hrueger commented 8 months ago

@gauravmm thanks! We've tried @huegene's fix and it works fine. We just don't understand why ;-)

OfficialDyray commented 7 months ago

I've run into this problem aswell. One thing I figured out is if you edit the .heirpcb.json and manual change the first uuid's checked to true, it starts replicating again. This also points to a GUI issue with showing the first entry.

  "sheet": {
    "": {
      "checked": false
    },
    "/37288e56-ec97-4563-8d14-ca8a67be2c8f": {
      "checked": true <-------------------------------- //CHANGED THIS TO TRUE
    },
    "/b5fc7067-d6a0-4ae8-afd1-af302add3973": {
      "checked": true
    },
    "/c8933244-f192-49b4-aa2a-eddd57cad00a": {
      "checked": true
    }
  }
hrueger commented 7 months ago

Interestingly, using this commit (sorts the list correctly) it works just fine without @huegene's fix....

gauravmm commented 7 months ago

Thanks for looking into this! I'll adopt @hrueger's fix and then close this.

hrueger commented 7 months ago

You might rather look into @OfficialDyray as his pr is probably probably the real fix and not just a workaround like @huegene's changes.

gauravmm commented 7 months ago

I looked at it a little and I concur. Closing this and merging that.