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

Temporary fix a crash I created in rev 5427, when erasing all modules on a...

Temporary fix a crash I created in rev 5427, when erasing all modules on a board and read the netlist. Will be fully fixed later.
Very minor fixes: remove duplicate #define in vrml_v2_modelparser.cpp, and "undo" a very minor change I made in class_board.cpp when I tried to fix a Pcbnew crash.
parent f4d5e349
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -87,9 +87,6 @@ void VRML2_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3
    glm::vec3 matPos( GetMaster()->m_MatPosition.x, GetMaster()->m_MatPosition.y,
            GetMaster()->m_MatPosition.z );


#define SCALE_3D_CONV ( (IU_PER_MILS * 1000.0f) / UNITS3D_TO_UNITSPCB )

    glTranslatef( matPos.x * SCALE_3D_CONV, matPos.y * SCALE_3D_CONV, matPos.z * SCALE_3D_CONV );

    glRotatef( -matRot.z, 0.0f, 0.0f, 1.0f );
+3 −4
Original line number Diff line number Diff line
@@ -2204,7 +2204,6 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
    wxString       msg;
    D_PAD*         pad;
    MODULE*        footprint;
    COMPONENT_NET  net;

    if( !IsEmpty() )
    {
@@ -2400,11 +2399,11 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
        // At this point, the component footprint is updated.  Now update the nets.
        for( pad = footprint->Pads();  pad;  pad = pad->Next() )
        {
            net = component->GetNet( pad->GetPadName() );
            COMPONENT_NET net = component->GetNet( pad->GetPadName() );

            if( !net.IsValid() )                // Footprint pad had no net.
            {
                if( aReporter && aReporter->ReportAll() )
                if( aReporter && aReporter->ReportAll() && !pad->GetNetname().IsEmpty() )
                {
                    msg.Printf( _( "Clearing component \"%s:%s\" pin \"%s\" net name.\n" ),
                                GetChars( footprint->GetReference() ),
@@ -2581,7 +2580,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
            // Explore all pins/pads in component
            for( unsigned jj = 0; jj < component->GetNetCount(); jj++ )
            {
                net = component->GetNet( jj );
                COMPONENT_NET net = component->GetNet( jj );
                padname = net.GetPinName();

                if( footprint->FindPadByName( padname ) )
+3 −1
Original line number Diff line number Diff line
@@ -333,9 +333,11 @@ MODULE* PCB_BASE_FRAME::loadFootprint( const FPID& aFootprintId )
    MODULE* module = fptbl->FootprintLoadWithOptionalNickname( aFootprintId );

    // Clear all references to any net info, to be sure there is no broken links
    // to any netinfo list (This should be the case, but...)
    // to any netinfo list (should be not needed, but...)
#if 0   // FIXME : currently crashes Pcbnew. should not.
    for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
        pad->SetNetCode( NETINFO_LIST::FORCE_ORPHANED );
#endif

    return module;
}