Commit e6274f70 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

BOARD::Add(): fix an issue for tracks: parent not set (could be an issue only...

BOARD::Add(): fix an issue for tracks: parent not set (could be an issue only in python scripts, because the parent is set by the constructor)
*.i : fix coding style issues.
python method: add BOARD_ITEM Duplicate, which is a wrapper to Clone(). ( defined as Cast_to_BOARD_ITEM(selt.Clone()).Cast() )
update some .py examples.
parent 7c747c1a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -663,6 +663,7 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, int aControl )
        TRACK* insertAid;
        insertAid = ( (TRACK*) aBoardItem )->GetBestInsertPoint( this );
        m_Track.Insert( (TRACK*) aBoardItem, insertAid );
        aBoardItem->SetParent( this );
        break;

    case PCB_ZONE_T:
+2 −1
Original line number Diff line number Diff line
@@ -804,7 +804,8 @@ void ZONE_CONTAINER::Copy( ZONE_CONTAINER* src )
    SetTimeStamp( src->m_TimeStamp );
    m_Poly->RemoveAllContours();
    m_Poly->Copy( src->m_Poly );                // copy outlines
    m_CornerSelection  = -1;                    // For corner moving, corner index to drag, or -1 if no selection
    m_CornerSelection  = -1;                    // For corner moving, corner index to drag,
                                                // or -1 if no selection
    m_ZoneClearance    = src->m_ZoneClearance;  // clearance value
    m_ZoneMinThickness = src->m_ZoneMinThickness;
    m_FillMode = src->m_FillMode;               // Filling mode (segments/polygons)
+30 −31
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@
    def GetDrawings(self):            return self.m_Drawings
    def GetTracks(self):              return self.m_Track
    def GetFullRatsnest(self):        return self.m_FullRatsnest
    def GetZones(self):               return self.m_ZoneDescriptorList

    def Save(self,filename):
        return SaveBoard(filename,self,IO_MGR.KICAD)
+51 −41
Original line number Diff line number Diff line
@@ -81,5 +81,15 @@
            return self.Cast_to_ZONE_CONTAINER()
        else:
            return None


    def Duplicate(self):

        ct = self.GetClass()

        if ct=="BOARD":
            return None
        else:
            return Cast_to_BOARD_ITEM(self.Clone()).Cast()
    }
}
+21 −21
Original line number Diff line number Diff line
@@ -55,12 +55,12 @@ print "track w cnt:",len(pcb.GetTrackWidthList())
print "via s cnt:",len(pcb.GetViasDimensionsList())

print ""
print "LIST ZONES:"
print "LIST ZONES:", pcb.GetAreaCount()

for idx in range(0, pcb.GetAreaCount()):
    zone=pcb.GetArea(idx)
    print "zone:", idx, "priority:", zone.GetPriority(), "netname", zone.GetNetname()

print ""
print "NetClasses:", pcb.GetNetClasses().GetCount()
print "NetClasses:", pcb.GetNetClasses().GetCount(),
Loading