Bug fix in class_hierarchy_sheet.cpp.
This commit is contained in:
parent
6719900ef9
commit
66080848cc
|
@ -5,6 +5,18 @@ Please add newer entries at the top, list the date and your name with
|
|||
email address.
|
||||
|
||||
|
||||
2007-aug-08 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
|
||||
================================================================================
|
||||
+ eeschema
|
||||
bug in class_hierarchy_sheet.cpp.
|
||||
|
||||
+ pcbnew
|
||||
small change in block commands:
|
||||
rastnest was updated for each footprint, while moving footprints.
|
||||
Now it is updated at the end of changes.
|
||||
enhancements in block.cpp and connect.cpp
|
||||
|
||||
|
||||
2007-Aug-07 UPDATE Dick Hollenbeck <dick@softplc.com>
|
||||
================================================================================
|
||||
+ pcbnew & common
|
||||
|
|
|
@ -390,7 +390,7 @@ void EDA_TextStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
|
|||
* offset = Offset de trace (usuellement (0,0)
|
||||
* color = couleur du texte
|
||||
* draw_mode = GR_OR, GR_XOR.., -1 si mode courant.
|
||||
* display_mose = FILAIRE, FILLED ou SKETCH
|
||||
* display_mode = FILAIRE, FILLED ou SKETCH
|
||||
* anchor_color = couleur de l'ancre ( -1 si pas d'ancre ).
|
||||
*/
|
||||
{
|
||||
|
|
|
@ -236,7 +236,7 @@ void DrawSheetLabelStruct::Draw(WinEDA_DrawPanel * panel,wxDC * DC, const wxPoin
|
|||
int side, txtcolor;
|
||||
int posx , tposx, posy, size2;
|
||||
wxSize size;
|
||||
int NbSegm, coord[12];
|
||||
int NbSegm, coord[20];
|
||||
int LineWidth = g_DrawMinimunLineWidth;
|
||||
|
||||
if( Color >= 0 ) txtcolor = Color;
|
||||
|
|
|
@ -309,7 +309,7 @@ typedef enum {
|
|||
#define SKETCH 2
|
||||
|
||||
|
||||
#define DEFAULT_SIZE_TEXT 60 /* Hauteur (en 1/000" par defaut des textes */
|
||||
#define DEFAULT_SIZE_TEXT 60 /* default text height (in mils or 1/1000") */
|
||||
|
||||
/* classe de gestion des textes (labels, textes composants ..)
|
||||
* (Non utilisee seule) */
|
||||
|
|
|
@ -428,12 +428,12 @@ int masque_layer;
|
|||
|
||||
/* Effacement des modules */
|
||||
if ( Block_Include_Modules )
|
||||
{
|
||||
{
|
||||
MODULE * module;
|
||||
Affiche_Message( _("Delete Footprints") ) ;
|
||||
module = m_Pcb->m_Modules;
|
||||
for ( ; module != NULL; module = (MODULE*) NextS)
|
||||
{
|
||||
{
|
||||
NextS = module->Pnext;
|
||||
if( IsModuleInBox(GetScreen()->BlockLocate, module) == NULL ) continue;
|
||||
/* le module est ici bon a etre efface */
|
||||
|
@ -441,8 +441,8 @@ int masque_layer;
|
|||
module->Draw(DrawPanel, DC, wxPoint(0,0),GR_XOR) ;
|
||||
DeleteStructure(module);
|
||||
m_Pcb->m_Status_Pcb = 0 ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Effacement des Pistes */
|
||||
if( Block_Include_Tracks )
|
||||
|
@ -535,6 +535,7 @@ int masque_layer;
|
|||
|
||||
/* Rafraichissement de l'ecran : */
|
||||
RedrawActiveWindow(DC, TRUE);
|
||||
if ( g_Show_Ratsnest ) Compile_Ratsnest( DC, TRUE );
|
||||
}
|
||||
|
||||
|
||||
|
@ -565,12 +566,13 @@ int Nx, Ny, centerX, centerY; /* centre de rotation de l'ensemble des elements
|
|||
|
||||
/* Rotation des modules */
|
||||
if ( Block_Include_Modules )
|
||||
{
|
||||
{
|
||||
Affiche_Message( _("Footprint rotation") );
|
||||
bool Show_Ratsnest_tmp = g_Show_Ratsnest; g_Show_Ratsnest = false;
|
||||
int Angle_Rot_Module = 900;
|
||||
module = m_Pcb->m_Modules;
|
||||
for ( ; module != NULL; module = (MODULE*) module->Pnext)
|
||||
{
|
||||
{
|
||||
if( IsModuleInBox(GetScreen()->BlockLocate, module) == NULL ) continue;
|
||||
/* le module est ici bon a etre modifie */
|
||||
m_Pcb->m_Status_Pcb = 0 ;
|
||||
|
@ -587,10 +589,11 @@ int Nx, Ny, centerX, centerY; /* centre de rotation de l'ensemble des elements
|
|||
/* Rotation du module autour de son ancre */
|
||||
Rotate_Module(DC, module, Angle_Rot_Module, TRUE);
|
||||
|
||||
}
|
||||
}
|
||||
/* regeneration des valeurs originelles */
|
||||
GetScreen()->m_Curseur = oldpos;
|
||||
}
|
||||
g_Show_Ratsnest = Show_Ratsnest_tmp;
|
||||
}
|
||||
|
||||
/* Deplacement des Segments de piste */
|
||||
if(Block_Include_Tracks )
|
||||
|
@ -722,6 +725,7 @@ int Nx, Ny, centerX, centerY; /* centre de rotation de l'ensemble des elements
|
|||
}
|
||||
}
|
||||
RedrawActiveWindow(DC, TRUE) ;
|
||||
if ( g_Show_Ratsnest ) Compile_Ratsnest( DC, TRUE );
|
||||
}
|
||||
|
||||
|
||||
|
@ -755,11 +759,12 @@ int Ny, centerY; /* position de l'axe d'inversion de l'ensemble des elements */
|
|||
|
||||
/* Inversion des modules */
|
||||
if ( Block_Include_Modules )
|
||||
{
|
||||
{
|
||||
bool Show_Ratsnest_tmp = g_Show_Ratsnest; g_Show_Ratsnest = false;
|
||||
Affiche_Message( _("Footprint mirroring") );
|
||||
module = m_Pcb->m_Modules;
|
||||
for ( ; module != NULL; module = (MODULE*) module->Pnext)
|
||||
{
|
||||
{
|
||||
if( IsModuleInBox(GetScreen()->BlockLocate, module) == NULL ) continue;
|
||||
/* le module est ici bon a etre efface */
|
||||
m_Pcb->m_Status_Pcb = 0 ;
|
||||
|
@ -778,8 +783,9 @@ int Ny, centerY; /* position de l'axe d'inversion de l'ensemble des elements */
|
|||
|
||||
/* regeneration des valeurs originelles */
|
||||
GetScreen()->m_Curseur = memo;
|
||||
}
|
||||
}
|
||||
g_Show_Ratsnest = Show_Ratsnest_tmp;
|
||||
}
|
||||
|
||||
/* Deplacement des Segments de piste */
|
||||
if(Block_Include_Tracks )
|
||||
|
@ -927,6 +933,7 @@ int Ny, centerY; /* position de l'axe d'inversion de l'ensemble des elements */
|
|||
}
|
||||
}
|
||||
RedrawActiveWindow(DC, TRUE) ;
|
||||
if ( g_Show_Ratsnest ) Compile_Ratsnest( DC, TRUE );
|
||||
}
|
||||
|
||||
|
||||
|
@ -935,7 +942,7 @@ int Ny, centerY; /* position de l'axe d'inversion de l'ensemble des elements */
|
|||
void WinEDA_BasePcbFrame::Block_Move(wxDC * DC)
|
||||
/************************************************/
|
||||
/*
|
||||
routine de deplacement des elements du block deja selectionne
|
||||
Function to move items withing the selected block
|
||||
*/
|
||||
{
|
||||
MODULE * module;
|
||||
|
@ -956,13 +963,14 @@ wxPoint oldpos;
|
|||
|
||||
/* Deplacement des modules */
|
||||
if ( Block_Include_Modules )
|
||||
{
|
||||
{
|
||||
bool Show_Ratsnest_tmp = g_Show_Ratsnest; g_Show_Ratsnest = false;
|
||||
Affiche_Message( _("Move footprints") );
|
||||
module = m_Pcb->m_Modules;
|
||||
oldpos = GetScreen()->m_Curseur;
|
||||
|
||||
for ( ; module != NULL; module = (MODULE*) module->Pnext)
|
||||
{
|
||||
{
|
||||
if( IsModuleInBox(GetScreen()->BlockLocate, module) == NULL ) continue;
|
||||
/* le module est ici bon a etre deplace */
|
||||
m_Pcb->m_Status_Pcb = 0 ;
|
||||
|
@ -974,9 +982,10 @@ wxPoint oldpos;
|
|||
GetScreen()->m_Curseur.x = module->m_Pos.x + GetScreen()->BlockLocate.m_MoveVector.x;
|
||||
GetScreen()->m_Curseur.y = module->m_Pos.y + GetScreen()->BlockLocate.m_MoveVector.y;
|
||||
Place_Module(module, DC);
|
||||
}
|
||||
GetScreen()->m_Curseur = oldpos;
|
||||
}
|
||||
GetScreen()->m_Curseur = oldpos;
|
||||
g_Show_Ratsnest = Show_Ratsnest_tmp;
|
||||
}
|
||||
|
||||
/* calcul du vecteur de deplacement pour les deplacements suivants */
|
||||
deltaX = GetScreen()->BlockLocate.m_MoveVector.x ;
|
||||
|
@ -984,24 +993,24 @@ wxPoint oldpos;
|
|||
|
||||
/* Deplacement des Segments de piste */
|
||||
if(Block_Include_Tracks )
|
||||
{
|
||||
{
|
||||
TRACK * track;
|
||||
|
||||
Affiche_Message( _("Move tracks") );
|
||||
track = m_Pcb->m_Track;
|
||||
while( track )
|
||||
{
|
||||
{
|
||||
if( IsSegmentInBox(GetScreen()->BlockLocate, track ) )
|
||||
{ /* la piste est ici bonne a etre deplacee */
|
||||
{ /* la piste est ici bonne a etre deplacee */
|
||||
m_Pcb->m_Status_Pcb = 0 ;
|
||||
track->Draw(DrawPanel, DC, GR_XOR) ; // effacement
|
||||
track->m_Start.x += deltaX ; track->m_Start.y += deltaY ;
|
||||
track->m_End.x += deltaX ; track->m_End.y += deltaY ;
|
||||
track->Draw(DrawPanel, DC, GR_OR) ; // reaffichage
|
||||
}
|
||||
track = (TRACK*) track->Pnext;
|
||||
}
|
||||
track = (TRACK*) track->Pnext;
|
||||
}
|
||||
}
|
||||
|
||||
/* Deplacement des Segments de Zone */
|
||||
if( Block_Include_Zones )
|
||||
|
@ -1100,6 +1109,7 @@ wxPoint oldpos;
|
|||
}
|
||||
}
|
||||
DrawPanel->Refresh(TRUE);;
|
||||
if ( g_Show_Ratsnest ) Compile_Ratsnest( DC, TRUE );
|
||||
}
|
||||
|
||||
|
||||
|
@ -1129,6 +1139,7 @@ wxPoint oldpos;
|
|||
/* Module copy */
|
||||
if ( Block_Include_Modules )
|
||||
{
|
||||
bool Show_Ratsnest_tmp = g_Show_Ratsnest; g_Show_Ratsnest = false;
|
||||
Affiche_Message( _("Module copy") );
|
||||
module = m_Pcb->m_Modules;
|
||||
oldpos = GetScreen()->m_Curseur;
|
||||
|
@ -1154,6 +1165,7 @@ wxPoint oldpos;
|
|||
Place_Module(new_module, DC);
|
||||
}
|
||||
GetScreen()->m_Curseur = oldpos;
|
||||
g_Show_Ratsnest = Show_Ratsnest_tmp;
|
||||
}
|
||||
|
||||
/* calcul du vecteur de deplacement pour les deplacements suivants */
|
||||
|
|
|
@ -43,35 +43,35 @@ D_PAD * pt_pad;
|
|||
|
||||
if( old_val == new_val) return(0) ;
|
||||
|
||||
if(old_val < new_val) EXCHG(old_val,new_val) ;
|
||||
if( (old_val > 0) && (old_val < new_val) ) EXCHG(old_val,new_val) ;
|
||||
|
||||
pt_conn = pt_start_conn;
|
||||
for ( ; pt_conn != NULL; pt_conn= (TRACK*) pt_conn->Pnext)
|
||||
{
|
||||
{
|
||||
if( pt_conn->m_Sous_Netcode != old_val)
|
||||
{
|
||||
{
|
||||
if(pt_conn == pt_end_conn) break;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
nb_change++;
|
||||
pt_conn->m_Sous_Netcode = new_val ;
|
||||
|
||||
if( pt_conn->start && ( pt_conn->start->m_StructType == TYPEPAD) )
|
||||
{
|
||||
{
|
||||
pt_pad = (D_PAD*)(pt_conn->start);
|
||||
if(pt_pad->m_physical_connexion == old_val)
|
||||
pt_pad->m_physical_connexion = pt_conn->m_Sous_Netcode;
|
||||
}
|
||||
}
|
||||
|
||||
if( pt_conn->end && (pt_conn->end->m_StructType == TYPEPAD) )
|
||||
{
|
||||
{
|
||||
pt_pad = (D_PAD*)(pt_conn->end);
|
||||
if(pt_pad->m_physical_connexion == old_val)
|
||||
pt_pad->m_physical_connexion = pt_conn->m_Sous_Netcode;
|
||||
}
|
||||
if(pt_conn == pt_end_conn) break;
|
||||
}
|
||||
if(pt_conn == pt_end_conn) break;
|
||||
}
|
||||
return(nb_change);
|
||||
}
|
||||
|
||||
|
@ -551,7 +551,7 @@ char new_passe_request = 1, flag;
|
|||
LISTE_PAD * pt_mem;
|
||||
EDA_BaseStruct * PtStruct;
|
||||
int masque_layer;
|
||||
|
||||
wxString msg;
|
||||
|
||||
if( m_Pcb->m_NbPads == 0 ) return;
|
||||
a_color = CYAN;
|
||||
|
@ -573,10 +573,10 @@ int masque_layer;
|
|||
/* Raz des flags particuliers des segments de piste */
|
||||
pt_piste = m_Pcb->m_Track;
|
||||
for ( ; pt_piste != NULL; pt_piste = (TRACK*) pt_piste->Pnext)
|
||||
{
|
||||
{
|
||||
pt_piste->SetState(BUSY|EDIT|BEGIN_ONPAD|END_ONPAD, OFF);
|
||||
pt_piste->m_NetCode = 0;
|
||||
}
|
||||
}
|
||||
|
||||
pt_piste = m_Pcb->m_Track;
|
||||
for ( ; pt_piste != NULL; pt_piste = (TRACK*) pt_piste->Pnext)
|
||||
|
@ -615,60 +615,85 @@ int masque_layer;
|
|||
if(affiche)
|
||||
Affiche_1_Parametre(this, POS_AFF_CHREF,wxEmptyString, wxT("Conn Segm"), a_color);
|
||||
|
||||
for ( pt_piste = m_Pcb->m_Track; pt_piste != NULL; pt_piste = (TRACK*) pt_piste->Pnext)
|
||||
{
|
||||
for ( pt_piste = m_Pcb->m_Track; pt_piste != NULL; pt_piste = pt_piste->Next())
|
||||
{
|
||||
if ( pt_piste->start == NULL )
|
||||
{
|
||||
pt_piste->start = Locate_Piste_Connectee(pt_piste,
|
||||
m_Pcb->m_Track,NULL,START);
|
||||
}
|
||||
{
|
||||
pt_piste->start = Locate_Piste_Connectee(pt_piste, m_Pcb->m_Track,NULL,START);
|
||||
}
|
||||
|
||||
if ( pt_piste->end == NULL )
|
||||
{
|
||||
pt_piste->end = Locate_Piste_Connectee(pt_piste,
|
||||
m_Pcb->m_Track,NULL,END);
|
||||
}
|
||||
{
|
||||
pt_piste->end = Locate_Piste_Connectee(pt_piste, m_Pcb->m_Track,NULL,END);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
// Reattribution des net_code //
|
||||
////////////////////////////////
|
||||
|
||||
a_color = YELLOW;
|
||||
if(affiche)
|
||||
Affiche_1_Parametre(this, POS_AFF_CHREF,wxEmptyString, wxT("Net->Segm"),a_color);
|
||||
|
||||
while(new_passe_request)
|
||||
{
|
||||
{
|
||||
bool reset_flag = FALSE;
|
||||
new_passe_request = 0;
|
||||
if(affiche)
|
||||
{
|
||||
msg.Printf( wxT("Net->Segm pass %d "), new_passe_request+1);
|
||||
Affiche_1_Parametre(this, POS_AFF_CHREF,wxEmptyString, msg, a_color);
|
||||
}
|
||||
|
||||
for ( pt_piste = m_Pcb->m_Track; pt_piste != NULL;
|
||||
pt_piste = (TRACK*) pt_piste->Pnext)
|
||||
/* look for vias which could be connect many tracks */
|
||||
for ( TRACK * via = m_Pcb->m_Track; via != NULL; via = via->Next() )
|
||||
{
|
||||
if ( via->m_StructType != TYPEVIA ) continue;
|
||||
if ( via->m_NetCode > 0 ) continue; // Netcode already known
|
||||
// Lock for a connection to a track with a known netcode
|
||||
pt_next = m_Pcb->m_Track;
|
||||
while ( (pt_next = Locate_Piste_Connectee(via, pt_next, NULL,START)) != NULL )
|
||||
{
|
||||
if (pt_next->m_NetCode )
|
||||
{
|
||||
via->m_NetCode = pt_next->m_NetCode;
|
||||
break;
|
||||
}
|
||||
pt_next->SetState(BUSY, ON);
|
||||
reset_flag = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if ( reset_flag ) for ( pt_piste = m_Pcb->m_Track; pt_piste != NULL; pt_piste = pt_piste->Next())
|
||||
{
|
||||
pt_piste->SetState(BUSY, OFF);
|
||||
}
|
||||
|
||||
for ( pt_piste = m_Pcb->m_Track; pt_piste != NULL; pt_piste = pt_piste->Next())
|
||||
{
|
||||
/* Traitement du point de debut */
|
||||
PtStruct = (EDA_BaseStruct*)pt_piste->start;
|
||||
if( PtStruct && (PtStruct->m_StructType != TYPEPAD) )
|
||||
{ // start sur piste
|
||||
{ // Begin on an other track segment
|
||||
pt_next = (TRACK*)PtStruct;
|
||||
if(pt_piste->m_NetCode)
|
||||
{
|
||||
{
|
||||
if(pt_next->m_NetCode == 0)
|
||||
{
|
||||
{
|
||||
new_passe_request = 1;
|
||||
pt_next->m_NetCode = pt_piste->m_NetCode;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if(pt_next->m_NetCode != 0)
|
||||
{
|
||||
pt_piste->m_NetCode = pt_next->m_NetCode;
|
||||
new_passe_request = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if(pt_next->m_NetCode != 0)
|
||||
{
|
||||
pt_piste->m_NetCode = pt_next->m_NetCode;
|
||||
new_passe_request = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Localisation du point de fin */
|
||||
PtStruct = pt_piste->end;
|
||||
if( PtStruct &&(PtStruct->m_StructType != TYPEPAD) )
|
||||
|
@ -694,9 +719,8 @@ int masque_layer;
|
|||
}
|
||||
}
|
||||
|
||||
if( affiche ) Affiche_1_Parametre(this, -1,wxEmptyString, wxT("Reorder "),a_color);
|
||||
|
||||
/* Reclassemment des pistes par numero de net: */
|
||||
if( affiche ) Affiche_1_Parametre(this, -1,wxEmptyString, wxT("Reorder "),a_color);
|
||||
RebuildTrackChain(m_Pcb);
|
||||
|
||||
if( affiche ) Affiche_1_Parametre(this, -1,wxEmptyString, wxT(" "),a_color);
|
||||
|
|
Loading…
Reference in New Issue