Commit 483359b3 authored by charras's avatar charras
Browse files

fixed a problem when loading a module from lib having some pads with an old netname

parent e8e6f1a7
Loading
Loading
Loading
Loading
+10 −25
Original line number Diff line number Diff line
@@ -573,14 +573,7 @@ void WinEDA_BasePcbFrame::Block_Delete( wxDC* DC )
    }

    DrawPanel->Refresh( TRUE );
    if( g_Show_Ratsnest )
    Compile_Ratsnest( DC, TRUE );
    else
    {
        m_Pcb->m_Status_Pcb = 0;        /* we need (later) a full ratnest computation */
        m_Pcb->Build_Pads_Full_List();
    }

}


@@ -740,7 +733,6 @@ void WinEDA_BasePcbFrame::Block_Rotate( wxDC* DC )
    }

    DrawPanel->Refresh( TRUE );
    if( g_Show_Ratsnest )
    Compile_Ratsnest( DC, TRUE );
}

@@ -928,7 +920,6 @@ void WinEDA_BasePcbFrame::Block_Invert( wxDC* DC )
    }

    DrawPanel->Refresh( TRUE );
    if( g_Show_Ratsnest )
    Compile_Ratsnest( DC, TRUE );
}

@@ -1074,7 +1065,6 @@ void WinEDA_BasePcbFrame::Block_Move( wxDC* DC )
    }

    DrawPanel->Refresh( TRUE );
    if( g_Show_Ratsnest )
    Compile_Ratsnest( DC, TRUE );
}

@@ -1125,7 +1115,7 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
            m_Pcb->m_Modules.PushFront( new_module );

            GetScreen()->m_Curseur = module->m_Pos + MoveVector;
            Place_Module( new_module, DC );
            Place_Module( new_module, NULL );
        }

        GetScreen()->m_Curseur = oldpos;
@@ -1150,8 +1140,6 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )

                new_track->m_Start += MoveVector;
                new_track->m_End += MoveVector;

                new_track->Draw( DrawPanel, DC, GR_OR ); // reaffichage
            }
            track = next_track;
        }
@@ -1170,8 +1158,6 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )

                new_segzone->m_Start += MoveVector;
                new_segzone->m_End   += MoveVector;

                new_segzone->Draw( DrawPanel, DC, GR_OR );
            }
        }

@@ -1185,7 +1171,6 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
                new_zone->m_TimeStamp = GetTimeStamp();
                new_zone->Move( MoveVector );
                m_Pcb->Add(new_zone);
                new_zone->Draw( DrawPanel, DC, GR_OR );
            }
        }
    }
@@ -1217,7 +1202,6 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )

                new_drawsegment->m_Start += MoveVector;
                new_drawsegment->m_End   += MoveVector;
                new_drawsegment->Draw( DrawPanel, DC, GR_OR );
            }
            break;

@@ -1237,7 +1221,6 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )

                /* Redessin du Texte */
                new_pcbtext->m_Pos += MoveVector;
                new_pcbtext->Draw( DrawPanel, DC, GR_OR );
            }
            break;

@@ -1256,7 +1239,6 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
                m_Pcb->Add( new_mire );

                new_mire->m_Pos += MoveVector;
                new_mire->Draw( DrawPanel, DC, GR_OR );
            }
            break;

@@ -1275,7 +1257,6 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
                m_Pcb->Add( new_cotation );

                new_cotation->Move( MoveVector );
                new_cotation->Draw( DrawPanel, DC, GR_OR );
            }
            break;

@@ -1283,4 +1264,8 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
            break;
        }
    }

    DrawPanel->Refresh( TRUE );
    Compile_Ratsnest( DC, TRUE );

}
+3 −0
Original line number Diff line number Diff line
@@ -229,6 +229,9 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, int aControl )
        else
            m_Modules.PushFront( (MODULE*) aBoardItem );
        aBoardItem->SetParent( this );
        // Because the list of pads has changed, reset the status
        // This indicate the list of pad and nets must be recalculated before use
        m_Status_Pcb = 0;
        break;

    case TYPE_COTATION:
+14 −11
Original line number Diff line number Diff line
@@ -14,6 +14,15 @@ class NETINFO_ITEM;


/* Class RATSNEST_ITEM: describes a ratsnest line: a straight line connecting 2 pads */
/*****************************/
/* flags for a RATSNEST_ITEM */
/*****************************/
#define CH_VISIBLE          1   /* affichage permanent demande */
#define CH_UNROUTABLE       2   /* non route par l'autorouteur */
#define CH_ROUTE_REQ        4   /* doit etre route par l'autorouteur */
#define CH_ACTIF            8   /* chevelu non encore rout */
#define LOCAL_RATSNEST_ITEM 0x8000    /* indique un chevelu reliant 2 pins d'un meme
                                       *  module pour le calcul des chevelus relatifs a 1 seul module */

class RATSNEST_ITEM
{
@@ -21,10 +30,13 @@ private:
    int    m_NetCode;   // netcode ( = 1.. n ,  0 is the value used for not connected items)

public:
    int    m_Status;        // etat: voir defines prcdents (CH_ ...)
    int    m_Status;        // State: see previous defines (CH_ ...)
    D_PAD* m_PadStart;      // pointer to the starting pad
    D_PAD* m_PadEnd;        // pointer to ending pad
    int    m_Lenght;        // lenght of the line
    int    m_Lenght;        // lenght of the line (temporary used in some calculations)

    /* constructor */
    RATSNEST_ITEM();

    /**
     * Function GetNet
@@ -176,15 +188,6 @@ public:
};


/*****************************/
/* flags for a RATSNEST_ITEM */
/*****************************/
#define CH_VISIBLE          1   /* affichage permanent demande */
#define CH_UNROUTABLE       2   /* non route par l'autorouteur */
#define CH_ROUTE_REQ        4   /* doit etre route par l'autorouteur */
#define CH_ACTIF            8   /* chevelu non encore rout */
#define LOCAL_RATSNEST_ITEM 0x8000    /* indique un chevelu reliant 2 pins d'un meme
                                       *  module pour le calcul des chevelus relatifs a 1 seul module */


/****************************************************************/
+24 −13
Original line number Diff line number Diff line
@@ -31,10 +31,10 @@ NETINFO_ITEM::~NETINFO_ITEM()
}



/*********************************************************/
int NETINFO_ITEM:: ReadDescr( FILE* File, int* LineNum )
/*********************************************************/

/* Routine de lecture de 1 descr Equipotentielle.
 *  retourne 0 si OK
 *          1 si lecture incomplete
@@ -73,6 +73,7 @@ int NETINFO_ITEM:: ReadDescr( FILE* File, int* LineNum )
/**************************************/
bool NETINFO_ITEM::Save( FILE* aFile ) const
/**************************************/

/** Note: the old name of class NETINFO_ITEM was EQUIPOT
 * so in Save (and read) functions, for compatibility, we use EQUIPOT as keyword
 */
@@ -95,6 +96,7 @@ out:
    return success;
}


/**
 * Function SetNetname
 * @param const wxString : the new netname
@@ -174,6 +176,16 @@ void NETINFO_ITEM::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const
/* class RATSNEST_ITEM */
/***********************/

RATSNEST_ITEM::RATSNEST_ITEM()
{
    m_NetCode  = 0;         // netcode ( = 1.. n ,  0 is the value used for not connected items)
    m_Status   = 0;         // state
    m_PadStart = NULL;      // pointer to the starting pad
    m_PadEnd   = NULL;      // pointer to ending pad
    m_Lenght   = 0;         // lenght of the line (temporary used in some calculations)
}


/** function Draw
 * Draws a line (a ratsnest) from the starting pad to the ending pad
 */
@@ -182,4 +194,3 @@ void RATSNEST_ITEM::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, cons
    GRLine( &panel->m_ClipBox, DC, m_PadStart->m_Pos - aOffset,
            m_PadEnd->m_Pos - aOffset, 0, g_DesignSettings.m_RatsnestColor );
}
+1 −1
Original line number Diff line number Diff line
@@ -92,9 +92,9 @@ void NETINFO_LIST::BuildListOfNets()
    /* Build the PAD list, sorted by net */
    m_Parent->Build_Pads_Full_List();

    int    netcode = 0;
    /* Build netnames list, and create a netcode for each netname */
    D_PAD* last_pad = NULL;
    int    netcode = 0;
    for( unsigned ii = 0; ii < m_Parent->m_Pads.size(); ii++ )
    {
        pad = m_Parent->m_Pads[ii];
Loading