Commit 45cdad8b authored by CHARRAS's avatar CHARRAS

changes in track connectivity computation

parent 28b17187
......@@ -4,6 +4,24 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-Oct-13 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+ pcbnew:
remove a change for Read VIA because via attributes
(TROUGH VIA, BLIND VIA or BURIED VIA) are autorisations for layer connection,
and are not a real layer indicator.
If a via connect layers from copper to component, it can have a BURIED VIA attribute.
the meaning is for this via the layer pair can be changed for other layer pair
if after editing this via connect 2 tracks which are only int internal layers,
its layer pair can be changed.
If a via has a TROUGH VIA attribute, it connects ALL layers, whenever tracks
connected to it.
Note: curenty: only TROUGH VIA are handled.
Other types (BLIND VIA and BURIED VIA) are only experimental.
A **lot** of code is needed for a full support.
enhancements in connectivity computation
2007-Oct-15 UPDATE Geoff Harland <gharlandau@yahoo.com.au>
================================================================================
......
This diff is collapsed.
No preview for this file type
This diff is collapsed.
......@@ -49,9 +49,9 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
if ( (pad->m_Masque_Layer & ALL_CU_LAYERS) == ALL_CU_LAYERS )
text << _("all copper layers");
else if( (pad->m_Masque_Layer & CUIVRE_LAYER) == CUIVRE_LAYER )
text << _("copper layers");
text << _("copper layer");
else if( (pad->m_Masque_Layer & CMP_LAYER) == CMP_LAYER )
text << _("cmp layers");
text << _("cmp layer");
else text << _("???");
text << _( ") of " ) << ( (MODULE*) GetParent() )->GetReference();
break;
......
......@@ -7,15 +7,17 @@
#include "base_struct.h"
/* Type des Vias (shape)*/
/* Forme des Vias ( parametre .shape ) */
#define VIA_NORMALE 3 /* type via : traversante (throught via) */
#define VIA_ENTERREE 2 /* type via : enterree ou aveugle (blind via) */
#define VIA_BORGNE 1 /* type via : borgne ou demi-traversante (buried via) */
#define VIA_NOT_DEFINED 0 /* reserved */
#define SQUARE_VIA 0x80000000 /* Flag pour forme carree */
// Via attributes (m_Shape parmeter)
#define THROUGH_VIA 3 /* Always a through hole via */
#define BURIED_VIA 2 /* this via can be on internal layers */
#define BLIND_VIA 1 /* this via which connect from internal layers to an external layer */
#define NOT_DEFINED_VIA 0 /* reserved (unused) */
#define SQUARE_VIA_SHAPE 0x80000000 /* Flag pour forme carree */
#define VIA_NORMALE THROUGH_VIA
#define VIA_ENTERREE BURIED_VIA
#define VIA_BORGNE BLIND_VIA
/***/
......@@ -80,7 +82,7 @@ public:
TRACK* GetBestInsertPoint( BOARD* Pcb );
/* Copie d'un Element d'une chaine de n elements
TRACK* CopyList( int NbSegm = 1 ) const;
* TRACK* CopyList( int NbSegm = 1 ) const;
*/
/* Recherche du debut du net
......@@ -181,11 +183,12 @@ public:
*/
wxString GetClass() const
{
return wxT("TRACK");
return wxT( "TRACK" );
}
#if defined(DEBUG)
#if defined (DEBUG)
/**
* Function Show
* is used to output the object tree, currently for debugging only.
......@@ -194,6 +197,7 @@ public:
* @param os The ostream& to output to.
*/
void Show( int nestLevel, std::ostream& os );
#endif
};
......@@ -210,11 +214,11 @@ public:
*/
wxString GetClass() const
{
return wxT("ZONE");
return wxT( "ZONE" );
}
SEGZONE* Next() const { return (SEGZONE*) Pnext; }
SEGZONE* Next() const { return (SEGZONE*) Pnext; }
};
......@@ -249,11 +253,12 @@ public:
*/
wxString GetClass() const
{
return wxT("VIA");
return wxT( "VIA" );
}
#if defined(DEBUG)
#if defined (DEBUG)
/**
* Function Show
* is used to output the object tree, currently for debugging only.
......@@ -262,8 +267,8 @@ public:
* @param os The ostream& to output to.
*/
void Show( int nestLevel, std::ostream& os );
#endif
#endif
};
......
......@@ -413,5 +413,5 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
}
SetToolbars();
Affiche_Status_Box(); /* Affichage des coord curseur */
Affiche_Status_Box(); /* Display new cursor coordinates */
}
......@@ -172,32 +172,11 @@ int WinEDA_BasePcbFrame::ReadListeSegmentDescr( wxDC* DC, FILE* File,
PtSegm->m_Width = width;
// Before specifying the value for any new via's Shape property, check
// the values of its top_layer and bottom_layer properties, to determine
// what value should *really* be assigned to that property (as all
// versions of KiCad up until revision 335 (committed on 2007-Oct-13)
// could sometimes assign an inappropriate value to that property).
if( makeType == TYPEVIA )
{
int b_layer = (layer >> 4) & 15;
int t_layer = layer & 15;
if( ( ( b_layer == COPPER_LAYER_N ) && ( t_layer == CMP_N ) )
|| ( ( b_layer == CMP_N ) && ( t_layer == COPPER_LAYER_N ) ) )
{
// The via is really of a "standard" (through-hole) type
shape = VIA_NORMALE;
}
else if( ( b_layer == COPPER_LAYER_N ) || ( t_layer == CMP_N )
|| ( b_layer == CMP_N ) || ( t_layer == COPPER_LAYER_N ) )
{
// The via is really of a "blind" type
shape = VIA_BORGNE;
}
else
{
// The via is really of a "buried" type
shape = VIA_ENTERREE;
}
// a THROUGH HOLE VIA always connects all layers
if ( shape == THROUGH_VIA )
layer = (COPPER_LAYER_N << 4) + LAYER_CMP_N;
}
PtSegm->m_Shape = shape;
......@@ -221,11 +200,11 @@ int WinEDA_BasePcbFrame::ReadListeSegmentDescr( wxDC* DC, FILE* File,
{
case TYPETRACK:
case TYPEVIA:
DisplayActivity( PerCent, wxT( "Tracks:" ) );
DisplayActivity( PerCent, _( "Tracks:" ) );
break;
case TYPEZONE:
DisplayActivity( PerCent, wxT( "Zones:" ) );
DisplayActivity( PerCent, _( "Zones:" ) );
break;
}
#endif
......
......@@ -663,6 +663,21 @@ TEXTE_MODULE* LocateTexteModule( BOARD* Pcb, MODULE** PtModule, int typeloc )
}
/******************************************/
inline int Dist(wxPoint & p1, wxPoint & p2)
/******************************************/
/*
return the dist min between p1 and p2
*/
{
int dist;
dist = abs(p1.x - p2.x) + abs (p1.y - p2.y);
dist *= 7;
dist /= 10;
return dist;
}
/**************************************************************/
TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base,
TRACK* pt_lim, int extr )
......@@ -686,6 +701,7 @@ TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base,
int Reflayer;
wxPoint pos_ref;
int ii;
int min_dist;
if( extr == START )
pos_ref = PtRefSegm->m_Start;
......@@ -708,13 +724,16 @@ TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base,
goto suite;
if( PtSegmN == PtRefSegm )
goto suite;
if( pos_ref == PtSegmN->m_Start )
min_dist = (PtSegmN->m_Width + PtRefSegm->m_Width)/2;
if( Dist(pos_ref, PtSegmN->m_Start) < min_dist )
{ /* Test des couches */
if( Reflayer & PtSegmN->ReturnMaskLayer() )
return PtSegmN;
}
if( pos_ref == PtSegmN->m_End )
if( Dist(pos_ref, PtSegmN->m_End) < min_dist )
{ /* Test des couches */
if( Reflayer & PtSegmN->ReturnMaskLayer() )
return PtSegmN;
......@@ -732,13 +751,16 @@ suite:
goto suite1;
if( PtSegmB == PtRefSegm )
goto suite1;
if( pos_ref == PtSegmB->m_Start )
min_dist = (PtSegmB->m_Width + PtRefSegm->m_Width)/2;
if( Dist(pos_ref, PtSegmB->m_Start) < min_dist )
{ /* Test des couches */
if( Reflayer & PtSegmB->ReturnMaskLayer() )
return PtSegmB;
}
if( pos_ref == PtSegmB->m_End )
if( Dist(pos_ref, PtSegmB->m_End) < min_dist )
{ /* Test des couches */
if( Reflayer & PtSegmB->ReturnMaskLayer() )
return PtSegmB;
......@@ -769,13 +791,16 @@ suite1:
continue;
}
if( pos_ref == PtSegmN->m_Start )
min_dist = (PtSegmN->m_Width + PtRefSegm->m_Width)/2;
if( Dist(pos_ref,PtSegmN->m_Start) < min_dist )
{ /* Test des couches */
if( Reflayer & PtSegmN->ReturnMaskLayer() )
return PtSegmN;
}
if( pos_ref == PtSegmN->m_End )
if( Dist(pos_ref, PtSegmN->m_End) < min_dist )
{ /* Test des couches */
if( Reflayer & PtSegmN->ReturnMaskLayer() )
return PtSegmN;
......
......@@ -30,8 +30,7 @@
void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
/*************************************************************************/
/* Traite les commandes declenche par le bouton gauche de la souris,
* quand un outil est deja selectionn
/* Handle the left click in footprint editor
*/
{
BOARD_ITEM* DrawStruct = GetCurItem();
......@@ -39,7 +38,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
DrawPanel->CursorOff( DC );
if( m_ID_current_state == 0 )
{
if( DrawStruct && DrawStruct->m_Flags ) // Commande "POPUP" en cours
if( DrawStruct && DrawStruct->m_Flags ) // Command in progress
{
switch( DrawStruct->Type() )
{
......@@ -75,7 +74,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
DrawStruct = GetCurItem();
if( !DrawStruct || (DrawStruct->m_Flags == 0) )
{
DrawStruct = (BOARD_ITEM*) ModeditLocateAndDisplay();
DrawStruct = ModeditLocateAndDisplay();
SetCurItem( DrawStruct );
}
......@@ -177,9 +176,9 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos,
wxMenu* PopMenu )
/*********************************************************************/
/* Prepare le menu PullUp affich par un click sur le bouton droit
* de la souris.
* Ce menu est ensuite complt par la liste des commandes de ZOOM
/* Handle the right click in the footprint editor:
* Create the pull up menu
* After this menu is built, the standart ZOOM menu is added
*/
{
BOARD_ITEM* DrawStruct = GetCurItem();
......@@ -376,9 +375,8 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos,
void WinEDA_ModuleEditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
/****************************************************************************/
/* Appel sur un double click:
* pour un lment editable (textes, composant):
* appel de l'editeur correspondant.
/* Handle the double click in the footprin editor:
* If the double clicked item is editable: call the corresponding editor.
*/
{
BOARD_ITEM* DrawStruct = GetCurItem();
......@@ -392,13 +390,13 @@ void WinEDA_ModuleEditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
case 0:
if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) )
{
DrawStruct = PcbGeneralLocateAndDisplay();
DrawStruct = ModeditLocateAndDisplay();
}
if( (DrawStruct == NULL) || (DrawStruct->m_Flags != 0) )
break;
// Element localis
// Item found
SetCurItem( DrawStruct );
switch( DrawStruct->Type() )
......
......@@ -33,7 +33,7 @@ static bool DisplayRastnestInProgress; // Enable the display of the ratsnes
* Build_Board_Ratsnest( wxDC* DC ) Create this rastnest
* for each net:
* First:
* we create links (and therefore a logical block) between 2 pad. This is achieved by:
* we create a link (and therefore a logical block) between 2 pad. This is achieved by:
* search for a pad without link.
* search its nearest pad
* link these 2 pads (i.e. create a ratsnest item)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment