Commit 45cdad8b authored by CHARRAS's avatar CHARRAS

changes in track connectivity computation

parent 28b17187
...@@ -4,6 +4,24 @@ Started 2007-June-11 ...@@ -4,6 +4,24 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. 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> 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 ...@@ -49,9 +49,9 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
if ( (pad->m_Masque_Layer & ALL_CU_LAYERS) == ALL_CU_LAYERS ) if ( (pad->m_Masque_Layer & ALL_CU_LAYERS) == ALL_CU_LAYERS )
text << _("all copper layers"); text << _("all copper layers");
else if( (pad->m_Masque_Layer & CUIVRE_LAYER) == CUIVRE_LAYER ) 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 ) else if( (pad->m_Masque_Layer & CMP_LAYER) == CMP_LAYER )
text << _("cmp layers"); text << _("cmp layer");
else text << _("???"); else text << _("???");
text << _( ") of " ) << ( (MODULE*) GetParent() )->GetReference(); text << _( ") of " ) << ( (MODULE*) GetParent() )->GetReference();
break; break;
......
...@@ -7,41 +7,43 @@ ...@@ -7,41 +7,43 @@
#include "base_struct.h" #include "base_struct.h"
/* Type des Vias (shape)*/
/* Forme des Vias ( parametre .shape ) */ // Via attributes (m_Shape parmeter)
#define VIA_NORMALE 3 /* type via : traversante (throught via) */ #define THROUGH_VIA 3 /* Always a through hole via */
#define VIA_ENTERREE 2 /* type via : enterree ou aveugle (blind via) */ #define BURIED_VIA 2 /* this via can be on internal layers */
#define VIA_BORGNE 1 /* type via : borgne ou demi-traversante (buried via) */ #define BLIND_VIA 1 /* this via which connect from internal layers to an external layer */
#define VIA_NOT_DEFINED 0 /* reserved */ #define NOT_DEFINED_VIA 0 /* reserved (unused) */
#define SQUARE_VIA 0x80000000 /* Flag pour forme carree */ #define SQUARE_VIA_SHAPE 0x80000000 /* Flag pour forme carree */
#define VIA_NORMALE THROUGH_VIA
#define VIA_ENTERREE BURIED_VIA
#define VIA_BORGNE BLIND_VIA
/***/ /***/
class TRACK : public BOARD_ITEM class TRACK : public BOARD_ITEM
{ {
public: public:
int m_Width; // 0 = line, > 0 = tracks, bus ... int m_Width; // 0 = line, > 0 = tracks, bus ...
wxPoint m_Start; // Line start point wxPoint m_Start; // Line start point
wxPoint m_End; // Line end point wxPoint m_End; // Line end point
int m_Shape; // vias: shape and type, Track = shape.. int m_Shape; // vias: shape and type, Track = shape..
int m_Drill; // for vias: via drill (- 1 for default value) int m_Drill; // for vias: via drill (- 1 for default value)
BOARD_ITEM* start; // pointers to a connected item (pad or track) BOARD_ITEM* start; // pointers to a connected item (pad or track)
BOARD_ITEM* end; BOARD_ITEM* end;
// chain = 0 indique une connexion non encore traitee // chain = 0 indique une connexion non encore traitee
int m_Param; // Auxiliary variable ( used in some computations ) int m_Param; // Auxiliary variable ( used in some computations )
protected: protected:
int m_NetCode; // Net number int m_NetCode; // Net number
int m_Sous_Netcode; /* In rastnest routines : for the current net, int m_Sous_Netcode; /* In rastnest routines : for the current net,
* block number (number common to the current connected items found) */ * block number (number common to the current connected items found) */
TRACK( const TRACK& track ); // protected so Copy() is used instead. TRACK( const TRACK& track ); // protected so Copy() is used instead.
public: public:
TRACK( BOARD_ITEM* StructFather, KICAD_T idtype = TYPETRACK ); TRACK( BOARD_ITEM* StructFather, KICAD_T idtype = TYPETRACK );
...@@ -49,14 +51,14 @@ public: ...@@ -49,14 +51,14 @@ public:
* Function Copy * Function Copy
* will copy this object whether it is a TRACK or a SEGVIA returning * will copy this object whether it is a TRACK or a SEGVIA returning
* the corresponding type. * the corresponding type.
* @return - TRACK*, SEGVIA*, or SEGZONE*, declared as the least common * @return - TRACK*, SEGVIA*, or SEGZONE*, declared as the least common
* demoninator: TRACK * demoninator: TRACK
*/ */
TRACK* Copy() const; TRACK* Copy() const;
TRACK* Next() const { return (TRACK*) Pnext; } TRACK* Next() const { return (TRACK*) Pnext; }
TRACK* Back() const { return (TRACK*) Pback; } TRACK* Back() const { return (TRACK*) Pback; }
/* supprime du chainage la structure Struct */ /* supprime du chainage la structure Struct */
...@@ -80,8 +82,8 @@ public: ...@@ -80,8 +82,8 @@ public:
TRACK* GetBestInsertPoint( BOARD* Pcb ); TRACK* GetBestInsertPoint( BOARD* Pcb );
/* Copie d'un Element d'une chaine de n elements /* 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 /* Recherche du debut du net
* ( les elements sont classes par net_code croissant ) */ * ( les elements sont classes par net_code croissant ) */
...@@ -105,15 +107,15 @@ public: ...@@ -105,15 +107,15 @@ public:
int GetSubNet() const { return m_Sous_Netcode; } int GetSubNet() const { return m_Sous_Netcode; }
void SetSubNet( int aSubNetCode ) { m_Sous_Netcode = aSubNetCode; } void SetSubNet( int aSubNetCode ) { m_Sous_Netcode = aSubNetCode; }
/** /**
* Function GetLength * Function GetLength
* returns the length of the track using the hypotenuse calculation. * returns the length of the track using the hypotenuse calculation.
* @return double - the length of the track * @return double - the length of the track
*/ */
double GetLength() const; double GetLength() const;
/* Display on screen: */ /* Display on screen: */
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode ); void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode );
...@@ -122,57 +124,57 @@ public: ...@@ -122,57 +124,57 @@ public:
/** /**
* Function ReturnMaskLayer * Function ReturnMaskLayer
* returns a "layer mask", which is a bitmap of all layers on which the * returns a "layer mask", which is a bitmap of all layers on which the
* TRACK segment or SEGVIA physically resides. * TRACK segment or SEGVIA physically resides.
* @return int - a layer mask, see pcbstruct.h's CUIVRE_LAYER, etc. * @return int - a layer mask, see pcbstruct.h's CUIVRE_LAYER, etc.
*/ */
int ReturnMaskLayer(); int ReturnMaskLayer();
int IsPointOnEnds( const wxPoint& point, int min_dist = 0 ); int IsPointOnEnds( const wxPoint& point, int min_dist = 0 );
bool IsNull(); // return TRUE if segment lenght = 0 bool IsNull(); // return TRUE if segment lenght = 0
/** /**
* Function Display_Infos * Function Display_Infos
* has knowledge about the frame and how and where to put status information * has knowledge about the frame and how and where to put status information
* about this object into the frame's message panel. * about this object into the frame's message panel.
* Is virtual from EDA_BaseStruct. * Is virtual from EDA_BaseStruct.
* @param frame A WinEDA_DrawFrame in which to print status information. * @param frame A WinEDA_DrawFrame in which to print status information.
*/ */
void Display_Infos( WinEDA_DrawFrame* frame ); void Display_Infos( WinEDA_DrawFrame* frame );
/** /**
* Function ShowWidth * Function ShowWidth
* returns the width of the track in displayable user units. * returns the width of the track in displayable user units.
*/ */
wxString ShowWidth(); wxString ShowWidth();
/** /**
* Function Visit * Function Visit
* is re-implemented here because TRACKs and SEGVIAs are in the same list * is re-implemented here because TRACKs and SEGVIAs are in the same list
* within BOARD. If that were not true, then we could inherit the * within BOARD. If that were not true, then we could inherit the
* version from EDA_BaseStruct. This one does not iterate through scanTypes * version from EDA_BaseStruct. This one does not iterate through scanTypes
* but only looks at the first item in the list. * but only looks at the first item in the list.
* @param inspector An INSPECTOR instance to use in the inspection. * @param inspector An INSPECTOR instance to use in the inspection.
* @param testData Arbitrary data used by the inspector. * @param testData Arbitrary data used by the inspector.
* @param scanTypes Which KICAD_T types are of interest and the order * @param scanTypes Which KICAD_T types are of interest and the order
* is significant too, terminated by EOT. * is significant too, terminated by EOT.
* @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan, * @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan,
* else SCAN_CONTINUE, and determined by the inspector. * else SCAN_CONTINUE, and determined by the inspector.
*/ */
SEARCH_RESULT Visit( INSPECTOR* inspector, const void* testData, SEARCH_RESULT Visit( INSPECTOR* inspector, const void* testData,
const KICAD_T scanTypes[] ); const KICAD_T scanTypes[] );
/** /**
* Function HitTest * Function HitTest
* tests if the given wxPoint is within the bounds of this object. * tests if the given wxPoint is within the bounds of this object.
* @param refPos A wxPoint to test * @param refPos A wxPoint to test
* @return bool - true if a hit, else false * @return bool - true if a hit, else false
*/ */
bool HitTest( const wxPoint& refPos ); bool HitTest( const wxPoint& refPos );
/** /**
* Function GetClass * Function GetClass
...@@ -181,20 +183,22 @@ public: ...@@ -181,20 +183,22 @@ public:
*/ */
wxString GetClass() const wxString GetClass() const
{ {
return wxT("TRACK"); return wxT( "TRACK" );
} }
#if defined(DEBUG) #if defined (DEBUG)
/** /**
* Function Show * Function Show
* is used to output the object tree, currently for debugging only. * is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level * @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree. * of nesting of this object within the overall tree.
* @param os The ostream& to output to. * @param os The ostream& to output to.
*/ */
void Show( int nestLevel, std::ostream& os ); void Show( int nestLevel, std::ostream& os );
#endif
#endif
}; };
...@@ -202,7 +206,7 @@ class SEGZONE : public TRACK ...@@ -202,7 +206,7 @@ class SEGZONE : public TRACK
{ {
public: public:
SEGZONE( BOARD_ITEM* StructFather ); SEGZONE( BOARD_ITEM* StructFather );
/** /**
* Function GetClass * Function GetClass
* returns the class name. * returns the class name.
...@@ -210,11 +214,11 @@ public: ...@@ -210,11 +214,11 @@ public:
*/ */
wxString GetClass() const wxString GetClass() const
{ {
return wxT("ZONE"); return wxT( "ZONE" );
} }
SEGZONE* Next() const { return (SEGZONE*) Pnext; }
SEGZONE* Next() const { return (SEGZONE*) Pnext; }
}; };
...@@ -227,21 +231,21 @@ public: ...@@ -227,21 +231,21 @@ public:
TRACK( source ) TRACK( source )
{ {
} }
/** /**
* Function IsOnLayer * Function IsOnLayer
* tests to see if this object is on the given layer. Is virtual * tests to see if this object is on the given layer. Is virtual
* from BOARD_ITEM. Tests the starting and ending range of layers for the * from BOARD_ITEM. Tests the starting and ending range of layers for the
* via. * via.
* @param aLayer The layer to test for. * @param aLayer The layer to test for.
* @return bool - true if on given layer, else false. * @return bool - true if on given layer, else false.
*/ */
bool IsOnLayer( int aLayer ) const; bool IsOnLayer( int aLayer ) const;
void SetLayerPair( int top_layer, int bottom_layer ); void SetLayerPair( int top_layer, int bottom_layer );
void ReturnLayerPair( int* top_layer, int* bottom_layer ) const; void ReturnLayerPair( int* top_layer, int* bottom_layer ) const;
/** /**
* Function GetClass * Function GetClass
* returns the class name. * returns the class name.
...@@ -249,21 +253,22 @@ public: ...@@ -249,21 +253,22 @@ public:
*/ */
wxString GetClass() const wxString GetClass() const
{ {
return wxT("VIA"); return wxT( "VIA" );
} }
#if defined(DEBUG) #if defined (DEBUG)
/** /**
* Function Show * Function Show
* is used to output the object tree, currently for debugging only. * is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level * @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree. * of nesting of this object within the overall tree.
* @param os The ostream& to output to. * @param os The ostream& to output to.
*/ */
void Show( int nestLevel, std::ostream& os ); void Show( int nestLevel, std::ostream& os );
#endif
#endif
}; };
......
...@@ -413,5 +413,5 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse ) ...@@ -413,5 +413,5 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
} }
SetToolbars(); SetToolbars();
Affiche_Status_Box(); /* Affichage des coord curseur */ Affiche_Status_Box(); /* Display new cursor coordinates */
} }
...@@ -172,33 +172,12 @@ int WinEDA_BasePcbFrame::ReadListeSegmentDescr( wxDC* DC, FILE* File, ...@@ -172,33 +172,12 @@ int WinEDA_BasePcbFrame::ReadListeSegmentDescr( wxDC* DC, FILE* File,
PtSegm->m_Width = width; 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 ) if( makeType == TYPEVIA )
{ {
int b_layer = (layer >> 4) & 15; // a THROUGH HOLE VIA always connects all layers
int t_layer = layer & 15; if ( shape == THROUGH_VIA )
if( ( ( b_layer == COPPER_LAYER_N ) && ( t_layer == CMP_N ) ) layer = (COPPER_LAYER_N << 4) + 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;
}
}
PtSegm->m_Shape = shape; PtSegm->m_Shape = shape;
if( arg_count < 7 ) if( arg_count < 7 )
...@@ -221,11 +200,11 @@ int WinEDA_BasePcbFrame::ReadListeSegmentDescr( wxDC* DC, FILE* File, ...@@ -221,11 +200,11 @@ int WinEDA_BasePcbFrame::ReadListeSegmentDescr( wxDC* DC, FILE* File,
{ {
case TYPETRACK: case TYPETRACK:
case TYPEVIA: case TYPEVIA:
DisplayActivity( PerCent, wxT( "Tracks:" ) ); DisplayActivity( PerCent, _( "Tracks:" ) );
break; break;
case TYPEZONE: case TYPEZONE:
DisplayActivity( PerCent, wxT( "Zones:" ) ); DisplayActivity( PerCent, _( "Zones:" ) );
break; break;
} }
#endif #endif
......
...@@ -663,6 +663,21 @@ TEXTE_MODULE* LocateTexteModule( BOARD* Pcb, MODULE** PtModule, int typeloc ) ...@@ -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* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base,
TRACK* pt_lim, int extr ) TRACK* pt_lim, int extr )
...@@ -686,6 +701,7 @@ TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base, ...@@ -686,6 +701,7 @@ TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base,
int Reflayer; int Reflayer;
wxPoint pos_ref; wxPoint pos_ref;
int ii; int ii;
int min_dist;
if( extr == START ) if( extr == START )
pos_ref = PtRefSegm->m_Start; pos_ref = PtRefSegm->m_Start;
...@@ -708,13 +724,16 @@ TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base, ...@@ -708,13 +724,16 @@ TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base,
goto suite; goto suite;
if( PtSegmN == PtRefSegm ) if( PtSegmN == PtRefSegm )
goto suite; 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 */ { /* Test des couches */
if( Reflayer & PtSegmN->ReturnMaskLayer() ) if( Reflayer & PtSegmN->ReturnMaskLayer() )
return PtSegmN; return PtSegmN;
} }
if( pos_ref == PtSegmN->m_End ) if( Dist(pos_ref, PtSegmN->m_End) < min_dist )
{ /* Test des couches */ { /* Test des couches */
if( Reflayer & PtSegmN->ReturnMaskLayer() ) if( Reflayer & PtSegmN->ReturnMaskLayer() )
return PtSegmN; return PtSegmN;
...@@ -732,13 +751,16 @@ suite: ...@@ -732,13 +751,16 @@ suite:
goto suite1; goto suite1;
if( PtSegmB == PtRefSegm ) if( PtSegmB == PtRefSegm )
goto suite1; 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 */ { /* Test des couches */
if( Reflayer & PtSegmB->ReturnMaskLayer() ) if( Reflayer & PtSegmB->ReturnMaskLayer() )
return PtSegmB; return PtSegmB;
} }
if( pos_ref == PtSegmB->m_End ) if( Dist(pos_ref, PtSegmB->m_End) < min_dist )
{ /* Test des couches */ { /* Test des couches */
if( Reflayer & PtSegmB->ReturnMaskLayer() ) if( Reflayer & PtSegmB->ReturnMaskLayer() )
return PtSegmB; return PtSegmB;
...@@ -769,13 +791,16 @@ suite1: ...@@ -769,13 +791,16 @@ suite1:
continue; 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 */ { /* Test des couches */
if( Reflayer & PtSegmN->ReturnMaskLayer() ) if( Reflayer & PtSegmN->ReturnMaskLayer() )
return PtSegmN; return PtSegmN;
} }
if( pos_ref == PtSegmN->m_End ) if( Dist(pos_ref, PtSegmN->m_End) < min_dist )
{ /* Test des couches */ { /* Test des couches */
if( Reflayer & PtSegmN->ReturnMaskLayer() ) if( Reflayer & PtSegmN->ReturnMaskLayer() )
return PtSegmN; return PtSegmN;
......
...@@ -30,8 +30,7 @@ ...@@ -30,8 +30,7 @@
void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
/*************************************************************************/ /*************************************************************************/
/* Traite les commandes declenche par le bouton gauche de la souris, /* Handle the left click in footprint editor
* quand un outil est deja selectionn
*/ */
{ {
BOARD_ITEM* DrawStruct = GetCurItem(); BOARD_ITEM* DrawStruct = GetCurItem();
...@@ -39,7 +38,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -39,7 +38,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
DrawPanel->CursorOff( DC ); DrawPanel->CursorOff( DC );
if( m_ID_current_state == 0 ) 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() ) switch( DrawStruct->Type() )
{ {
...@@ -75,7 +74,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -75,7 +74,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
DrawStruct = GetCurItem(); DrawStruct = GetCurItem();
if( !DrawStruct || (DrawStruct->m_Flags == 0) ) if( !DrawStruct || (DrawStruct->m_Flags == 0) )
{ {
DrawStruct = (BOARD_ITEM*) ModeditLocateAndDisplay(); DrawStruct = ModeditLocateAndDisplay();
SetCurItem( DrawStruct ); SetCurItem( DrawStruct );
} }
...@@ -177,9 +176,9 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos, ...@@ -177,9 +176,9 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos,
wxMenu* PopMenu ) wxMenu* PopMenu )
/*********************************************************************/ /*********************************************************************/
/* Prepare le menu PullUp affich par un click sur le bouton droit /* Handle the right click in the footprint editor:
* de la souris. * Create the pull up menu
* Ce menu est ensuite complt par la liste des commandes de ZOOM * After this menu is built, the standart ZOOM menu is added
*/ */
{ {
BOARD_ITEM* DrawStruct = GetCurItem(); BOARD_ITEM* DrawStruct = GetCurItem();
...@@ -376,9 +375,8 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos, ...@@ -376,9 +375,8 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos,
void WinEDA_ModuleEditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) void WinEDA_ModuleEditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
/****************************************************************************/ /****************************************************************************/
/* Appel sur un double click: /* Handle the double click in the footprin editor:
* pour un lment editable (textes, composant): * If the double clicked item is editable: call the corresponding editor.
* appel de l'editeur correspondant.
*/ */
{ {
BOARD_ITEM* DrawStruct = GetCurItem(); BOARD_ITEM* DrawStruct = GetCurItem();
...@@ -392,13 +390,13 @@ void WinEDA_ModuleEditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -392,13 +390,13 @@ void WinEDA_ModuleEditFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
case 0: case 0:
if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) ) if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) )
{ {
DrawStruct = PcbGeneralLocateAndDisplay(); DrawStruct = ModeditLocateAndDisplay();
} }
if( (DrawStruct == NULL) || (DrawStruct->m_Flags != 0) ) if( (DrawStruct == NULL) || (DrawStruct->m_Flags != 0) )
break; break;
// Element localis // Item found
SetCurItem( DrawStruct ); SetCurItem( DrawStruct );
switch( DrawStruct->Type() ) switch( DrawStruct->Type() )
......
...@@ -33,7 +33,7 @@ static bool DisplayRastnestInProgress; // Enable the display of the ratsnes ...@@ -33,7 +33,7 @@ static bool DisplayRastnestInProgress; // Enable the display of the ratsnes
* Build_Board_Ratsnest( wxDC* DC ) Create this rastnest * Build_Board_Ratsnest( wxDC* DC ) Create this rastnest
* for each net: * for each net:
* First: * 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 for a pad without link.
* search its nearest pad * search its nearest pad
* link these 2 pads (i.e. create a ratsnest item) * 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