2007-08-06 20:26:59 +00:00
|
|
|
|
/**********************************/
|
|
|
|
|
/* class_pad.h : Pads description */
|
|
|
|
|
/**********************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
class Pcb3D_GLCanvas;
|
|
|
|
|
|
|
|
|
|
/* forme des pastilles : (parametre .forme) */
|
2007-08-06 20:26:59 +00:00
|
|
|
|
#define CIRCLE 1
|
|
|
|
|
#define RECT 2
|
|
|
|
|
#define OVALE 3
|
|
|
|
|
#define TRAPEZE 4 // trapeze: traversante ou surfacique
|
|
|
|
|
#define SPECIAL_PAD 5 // description libre
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
/* Attributs des PADS */
|
2007-08-06 20:26:59 +00:00
|
|
|
|
#define STANDARD 0 // pad classique
|
|
|
|
|
#define SMD 1 // surfacique, generation d'un masque d'empatement
|
|
|
|
|
#define CONN 2 // surfacique, peut etre dore
|
|
|
|
|
#define P_HOLE 3 // trou simple, utile sur pad stack
|
|
|
|
|
#define MECA 4 // PAD "mecanique" (fixation, zone cuivre...)
|
|
|
|
|
#define PAD_STACK 0x80 // bit 7 de .attrib (flag)
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
/* Definition type Structure d'un pad */
|
2007-08-23 04:28:46 +00:00
|
|
|
|
class D_PAD : public BOARD_ITEM
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
2007-08-06 20:26:59 +00:00
|
|
|
|
union
|
|
|
|
|
{
|
|
|
|
|
unsigned long m_NumPadName;
|
|
|
|
|
char m_Padname[4]; /* nom (numero) de la pastille (assimilable a un long)*/
|
|
|
|
|
};
|
|
|
|
|
|
2007-08-08 03:50:44 +00:00
|
|
|
|
wxString m_Netname; /* Net Name */
|
2007-08-06 20:26:59 +00:00
|
|
|
|
|
2007-08-08 03:50:44 +00:00
|
|
|
|
int m_Masque_Layer; // (Bit a Bit :1= cuivre, 15= cmp,
|
|
|
|
|
// 2..14 = interne
|
|
|
|
|
// 16 .. 31 = couches non cuivre
|
2007-08-06 20:26:59 +00:00
|
|
|
|
|
|
|
|
|
int m_PadShape; // forme CERCLE, RECT, OVALE, TRAPEZE ou libre
|
|
|
|
|
int m_DrillShape; // forme CERCLE, OVAL
|
|
|
|
|
|
|
|
|
|
wxPoint m_Pos; // Position de reference du pad
|
|
|
|
|
|
|
|
|
|
wxSize m_Drill; // Drill diam (drill shape = CIRCLE) or drill size(shape = OVAL)
|
|
|
|
|
// for drill shape = CIRCLE, drill diam = m_Drill.x
|
|
|
|
|
|
|
|
|
|
wxSize m_Offset; // Offset de la forme (pastilles excentrees)
|
|
|
|
|
wxSize m_Size; // Dimensions X et Y ( si orient 0 x = axe X
|
|
|
|
|
// y = axe Y
|
|
|
|
|
|
|
|
|
|
wxSize m_DeltaSize; // delta sur formes rectangle -> trapezes
|
|
|
|
|
|
|
|
|
|
wxPoint m_Pos0; // Coord relatives a l'ancre du pad en orientation 0
|
|
|
|
|
|
|
|
|
|
int m_Rayon; // rayon du cercle exinscrit du pad
|
|
|
|
|
int m_Attribut; // NORMAL, SMD, CONN, Bit 7 = STACK
|
|
|
|
|
int m_Orient; // en 1/10 degres
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-06 20:26:59 +00:00
|
|
|
|
int m_NetCode; /* Numero de net pour comparaisons rapides */
|
|
|
|
|
int m_logical_connexion; // variable utilisee lors du calcul du chevelu:
|
|
|
|
|
// contient de numero de block pour une connexion type ratsnet
|
|
|
|
|
|
|
|
|
|
int m_physical_connexion; // variable utilisee lors du calcul de la connexit<69>
|
|
|
|
|
// contient de numero de block pour une connexion type piste
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
public:
|
2007-08-06 20:26:59 +00:00
|
|
|
|
D_PAD( MODULE* parent );
|
|
|
|
|
D_PAD( D_PAD* pad );
|
|
|
|
|
~D_PAD( void );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-06 20:26:59 +00:00
|
|
|
|
void Copy( D_PAD* source );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-06 20:26:59 +00:00
|
|
|
|
D_PAD* Next( void ) { return (D_PAD*) Pnext; }
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-06 20:26:59 +00:00
|
|
|
|
/* supprime du chainage la structure Struct */
|
|
|
|
|
void UnLink( void );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-07 06:21:19 +00:00
|
|
|
|
/* Reading and writing data on files */
|
2007-08-06 20:26:59 +00:00
|
|
|
|
int ReadDescr( FILE* File, int* LineNum = NULL );
|
|
|
|
|
int WriteDescr( FILE* File );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-06 20:26:59 +00:00
|
|
|
|
/* drawing functions */
|
|
|
|
|
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode );
|
|
|
|
|
void Draw3D( Pcb3D_GLCanvas* glcanvas );
|
|
|
|
|
|
|
|
|
|
// autres
|
2007-08-07 06:21:19 +00:00
|
|
|
|
void SetPadName( const wxString& name ); // Change pad name
|
2007-08-06 20:26:59 +00:00
|
|
|
|
wxString ReturnStringPadName( void ); // Return pad name as string in a wxString
|
|
|
|
|
void ReturnStringPadName( wxString& text ); // Return pad name as string in a buffer
|
|
|
|
|
void ComputeRayon( void ); // met a jour m_Rayon, rayon du cercle exinscrit
|
|
|
|
|
const wxPoint ReturnShapePos( void ); // retourne la position
|
|
|
|
|
|
2007-08-20 19:33:15 +00:00
|
|
|
|
/**
|
|
|
|
|
* Function Display_Infos
|
|
|
|
|
* has knowledge about the frame and how and where to put status information
|
|
|
|
|
* about this object into the frame's message panel.
|
|
|
|
|
* Is virtual from EDA_BaseStruct.
|
|
|
|
|
* @param frame A WinEDA_BasePcbFrame in which to print status information.
|
|
|
|
|
*/
|
|
|
|
|
void Display_Infos( WinEDA_DrawFrame* frame );
|
2007-08-08 03:50:44 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Function HitTest
|
|
|
|
|
* tests if the given wxPoint is within the bounds of this object.
|
|
|
|
|
* @param refPos A wxPoint to test
|
|
|
|
|
* @return bool - true if a hit, else false
|
|
|
|
|
*/
|
|
|
|
|
bool HitTest( const wxPoint& refPos );
|
|
|
|
|
|
2007-08-07 06:21:19 +00:00
|
|
|
|
#if defined(DEBUG)
|
|
|
|
|
/**
|
|
|
|
|
* Function GetClass
|
|
|
|
|
* returns the class name.
|
|
|
|
|
* @return wxString
|
|
|
|
|
*/
|
|
|
|
|
virtual wxString GetClass() const
|
|
|
|
|
{
|
|
|
|
|
return wxT( "PAD" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Function Show
|
|
|
|
|
* is used to output the object tree, currently for debugging only.
|
|
|
|
|
* @param nestLevel An aid to prettier tree indenting, and is the level
|
|
|
|
|
* of nesting of this object within the overall tree.
|
|
|
|
|
* @param os The ostream& to output to.
|
|
|
|
|
*/
|
|
|
|
|
virtual void Show( int nestLevel, std::ostream& os );
|
|
|
|
|
#endif
|
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef class D_PAD * LISTE_PAD;
|