2007-06-05 12:10:51 +00:00
|
|
|
|
/****************************************************************/
|
|
|
|
|
/* Headers fo library definition and lib component definitions */
|
|
|
|
|
/****************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef LIBCMP_H
|
|
|
|
|
#define LIBCMP_H
|
|
|
|
|
|
|
|
|
|
#ifndef eda_global
|
|
|
|
|
#define eda_global extern
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "priorque.h"
|
|
|
|
|
|
|
|
|
|
#define LIB_VERSION_MAJOR 2
|
|
|
|
|
#define LIB_VERSION_MINOR 3
|
2007-08-24 15:10:46 +00:00
|
|
|
|
#define LIBFILE_IDENT "EESchema-LIBRARY Version" /* Must be at the lib file start. */
|
|
|
|
|
#define DOCFILE_IDENT "EESchema-DOCLIB Version 2.0" /* Must be at the doc file start. */
|
|
|
|
|
#define DOC_EXT wxT( ".dcm" ) /* extension des fichiers de documentation */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-24 15:10:46 +00:00
|
|
|
|
#define TARGET_PIN_DIAM 12 /* Diam cercle des extremites des pins */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-24 15:10:46 +00:00
|
|
|
|
#define DEFAULT_TEXT_SIZE 50 /* Default size for field texts */
|
|
|
|
|
#define PART_NAME_LEN 15 /* Maximum length of part name. */
|
|
|
|
|
#define PREFIX_NAME_LEN 5 /* Maximum length of prefix (IC, R, SW etc.). */
|
|
|
|
|
#define PIN_WIDTH 100 /* Width between 2 pins in internal units. */
|
|
|
|
|
#define PIN_LENGTH 300 /* Default Length of each pin to be drawn. */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-24 15:10:46 +00:00
|
|
|
|
#define INVERT_PIN_RADIUS 35 /* Radius of inverted pin circle. */
|
|
|
|
|
#define CLOCK_PIN_DIM 40 /* Dim of clock pin symbol. */
|
|
|
|
|
#define IEEE_SYMBOL_PIN_DIM 40 /* Dim of special pin symbol. */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-24 15:10:46 +00:00
|
|
|
|
#define NO_FILL 0 // Poly, Squar, Circle, Arc = option No Fill
|
|
|
|
|
#define FILLED_SHAPE 1 // Poly, Squar, Circle, Arc = option Fill with current color
|
|
|
|
|
#define FILLED_WITH_BG_BODYCOLOR 2 // Poly, Squar, Circle, Arc = option Fill
|
2007-09-13 11:28:58 +00:00
|
|
|
|
// with background body color
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
//Offsets used in editing library component, for handle aliad dats
|
2007-08-24 15:10:46 +00:00
|
|
|
|
#define ALIAS_NAME 0
|
|
|
|
|
#define ALIAS_DOC 1
|
|
|
|
|
#define ALIAS_KEYWORD 2
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#define ALIAS_DOC_FILENAME 3
|
2007-08-24 15:10:46 +00:00
|
|
|
|
#define ALIAS_NEXT 4
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
2007-08-24 15:10:46 +00:00
|
|
|
|
LOCATE_COMPONENT_ARC_DRAW_TYPE = 1,
|
|
|
|
|
LOCATE_COMPONENT_CIRCLE_DRAW_TYPE = 2,
|
|
|
|
|
LOCATE_COMPONENT_GRAPHIC_TEXT_DRAW_TYPE = 4,
|
|
|
|
|
LOCATE_COMPONENT_RECT_DRAW_TYPE = 8,
|
|
|
|
|
LOCATE_LINE_DRAW_TYPE = 0x10,
|
|
|
|
|
LOCATE_COMPONENT_POLYLINE_DRAW_TYPE = 0x20,
|
|
|
|
|
LOCATE_COMPONENT_LINE_DRAW_TYPE = 0x40
|
2007-06-05 12:10:51 +00:00
|
|
|
|
} LocateDrawStructType;
|
|
|
|
|
|
|
|
|
|
#define LOCATE_ALL_DRAW_ITEM 0xFFFFFFFF
|
|
|
|
|
|
|
|
|
|
/* flags utilises dans FindLibPart() : */
|
2007-08-24 15:10:46 +00:00
|
|
|
|
#define FIND_ROOT 0 /* indique la recherche du composant racine si
|
|
|
|
|
* meme si le composant specifie est un alias */
|
|
|
|
|
#define FIND_ALIAS 1 /* indique la recherche du composant specifie
|
|
|
|
|
* (alias ou racine) */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
/* definition des types des structures d'elements de librairie */
|
|
|
|
|
typedef enum {
|
2007-08-24 15:10:46 +00:00
|
|
|
|
ROOT, /* Structure est a standard EDA_LibComponentStruct */
|
|
|
|
|
ALIAS /* Structure is an alias */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
} LibrEntryType;
|
|
|
|
|
|
|
|
|
|
/* valeur du membre .m_Options */
|
|
|
|
|
typedef enum {
|
2007-08-24 15:10:46 +00:00
|
|
|
|
ENTRY_NORMAL, // Libentry is standard
|
|
|
|
|
ENTRY_POWER // Libentry is a power symbol
|
2007-06-05 12:10:51 +00:00
|
|
|
|
} LibrEntryOptions;
|
|
|
|
|
|
|
|
|
|
/* Definitions des Pins */
|
|
|
|
|
|
2007-08-24 15:10:46 +00:00
|
|
|
|
typedef enum { /* Type des Pins. si modif: modifier tableau des mgs suivant */
|
|
|
|
|
PIN_INPUT,
|
|
|
|
|
PIN_OUTPUT,
|
|
|
|
|
PIN_BIDI,
|
|
|
|
|
PIN_TRISTATE,
|
|
|
|
|
PIN_PASSIVE,
|
|
|
|
|
PIN_UNSPECIFIED,
|
|
|
|
|
PIN_POWER_IN,
|
|
|
|
|
PIN_POWER_OUT,
|
|
|
|
|
PIN_OPENCOLLECTOR,
|
|
|
|
|
PIN_OPENEMITTER,
|
|
|
|
|
PIN_NC, /* No connect */
|
|
|
|
|
PIN_NMAX /* Valeur limite ( utilisee comme limite de tableaux) */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
} ElectricPinType;
|
|
|
|
|
|
|
|
|
|
/* Messages d'affichage du type electrique */
|
2007-08-24 15:10:46 +00:00
|
|
|
|
eda_global wxChar* MsgPinElectricType[]
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#ifdef MAIN
|
2007-08-24 15:10:46 +00:00
|
|
|
|
= {
|
|
|
|
|
wxT( "input" ),
|
|
|
|
|
wxT( "output" ),
|
|
|
|
|
wxT( "BiDi" ),
|
|
|
|
|
wxT( "3state" ),
|
|
|
|
|
wxT( "passive" ),
|
|
|
|
|
wxT( "unspc" ),
|
|
|
|
|
wxT( "power_in" ),
|
|
|
|
|
wxT( "power_out" ),
|
|
|
|
|
wxT( "openCol" ),
|
|
|
|
|
wxT( "openEm" ),
|
|
|
|
|
wxT( "?????" )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#endif
|
2007-08-24 15:10:46 +00:00
|
|
|
|
;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
/* Autres bits: bits du membre .Flag des Pins */
|
2007-08-24 15:10:46 +00:00
|
|
|
|
#define PINNOTDRAW 1 /* si 1: pin invisible */
|
|
|
|
|
|
|
|
|
|
typedef enum { /* Forme des Pins */
|
|
|
|
|
NONE = 0,
|
|
|
|
|
INVERT = 1,
|
|
|
|
|
CLOCK = 2,
|
|
|
|
|
LOWLEVEL_IN = 4,
|
|
|
|
|
LOWLEVEL_OUT = 8
|
|
|
|
|
} DrawPinShape;
|
|
|
|
|
|
|
|
|
|
typedef enum { /* Orientation des Pins */
|
|
|
|
|
PIN_RIGHT = 'R',
|
|
|
|
|
PIN_LEFT = 'L',
|
|
|
|
|
PIN_UP = 'U',
|
|
|
|
|
PIN_DOWN = 'D',
|
|
|
|
|
} DrawPinOrient;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
/*************************************/
|
|
|
|
|
/* Classe representant une librairie */
|
|
|
|
|
/*************************************/
|
|
|
|
|
|
|
|
|
|
class LibraryStruct
|
|
|
|
|
{
|
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
|
int m_Type; /* type indicator */
|
|
|
|
|
wxString m_Name; /* Name of library loaded. */
|
|
|
|
|
wxString m_FullFileName; /* Full File Name (with path) of library loaded. */
|
|
|
|
|
wxString m_Header; /* first line of library loaded. */
|
|
|
|
|
int m_NumOfParts; /* Number of parts this library has. */
|
|
|
|
|
PriorQue* m_Entries; /* Parts themselves are saved here. */
|
|
|
|
|
LibraryStruct* m_Pnext; /* Point on next lib in chain. */
|
|
|
|
|
int m_Modified; /* flag indicateur d'edition */
|
|
|
|
|
int m_Size; // Size in bytes (for statistics)
|
|
|
|
|
unsigned long m_TimeStamp; // Signature temporelle
|
|
|
|
|
int m_Flags; // variable used in some functions
|
|
|
|
|
bool m_IsLibCache; // False for the "standard" libraries,
|
2007-09-13 11:28:58 +00:00
|
|
|
|
// True for the library cache
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
public:
|
2007-09-13 11:28:58 +00:00
|
|
|
|
LibraryStruct( int type, const wxString& name, const wxString& fullname );
|
2007-08-24 15:10:46 +00:00
|
|
|
|
~LibraryStruct();
|
|
|
|
|
bool WriteHeader( FILE* file );
|
|
|
|
|
bool ReadHeader( FILE* file, int* LineNum );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************/
|
|
|
|
|
/* Classes representant les el<65>ments d'un composant d'une libraire */
|
|
|
|
|
/*******************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* class LibEDA_BaseStruct : Basic class for items used in a library component
|
2007-08-24 15:10:46 +00:00
|
|
|
|
* (graphic shapes, texts, fields, pins)
|
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
class LibEDA_BaseStruct : public EDA_BaseStruct
|
|
|
|
|
{
|
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
|
int m_Unit; /* Unit identification (for multi part per parkage)
|
|
|
|
|
* 0 if the item is common to all units */
|
|
|
|
|
int m_Convert; /* Shape identification (for parts which have a convert shape)
|
|
|
|
|
* 0 if the item is common to all shapes */
|
|
|
|
|
wxPoint m_Pos; /* Position or centre (Arc and Circle) or start point (segments) */
|
|
|
|
|
int m_Width; /* Width of draw lines */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
public:
|
2007-09-01 12:00:30 +00:00
|
|
|
|
LibEDA_BaseStruct* Next()
|
2007-08-24 15:10:46 +00:00
|
|
|
|
{
|
|
|
|
|
return (LibEDA_BaseStruct*) Pnext;
|
|
|
|
|
}
|
2007-09-13 11:28:58 +00:00
|
|
|
|
|
|
|
|
|
|
2007-08-24 15:10:46 +00:00
|
|
|
|
LibEDA_BaseStruct( KICAD_T struct_type );
|
2007-09-01 12:00:30 +00:00
|
|
|
|
virtual ~LibEDA_BaseStruct() { }
|
2007-08-24 15:10:46 +00:00
|
|
|
|
void Display_Infos_DrawEntry( WinEDA_DrawFrame* frame );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class LibDrawPin : public LibEDA_BaseStruct
|
|
|
|
|
{
|
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
|
int m_PinLen; /* Pin lenght */
|
|
|
|
|
int m_Orient; /* Pin orientation (Up, Down, Left, Right) */
|
|
|
|
|
int m_PinShape; /* Bitwise ORed: Pin shape (see enum DrawPinShape) */
|
|
|
|
|
int m_PinType; /* Electrical pin properties */
|
|
|
|
|
int m_Attributs; /* bit 0 != 0: pin invisible */
|
|
|
|
|
long m_PinNum; /* Pin number: 4 Ascii code like "12" or "anod" or "G6"
|
|
|
|
|
* "12" is really "12\0\0"*/
|
|
|
|
|
wxString m_PinName;
|
2007-09-13 11:28:58 +00:00
|
|
|
|
int m_PinNumSize, m_PinNameSize; /* Pin num and Pin name sizes */
|
2007-08-24 15:10:46 +00:00
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
// short m_PinNumWidth, m_PinNameWidth; /* (Unused) Pin num and Pin name text width */
|
|
|
|
|
|
|
|
|
|
public:
|
2007-09-01 12:00:30 +00:00
|
|
|
|
LibDrawPin();
|
|
|
|
|
~LibDrawPin() { }
|
2007-09-13 11:28:58 +00:00
|
|
|
|
virtual wxString GetClass() const
|
|
|
|
|
{
|
|
|
|
|
return wxT( "LibDrawPin" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
|
LibDrawPin* GenCopy();
|
2007-08-24 15:10:46 +00:00
|
|
|
|
bool WriteDescr( FILE* File );
|
|
|
|
|
void Display_Infos( WinEDA_DrawFrame* frame );
|
2007-09-01 12:00:30 +00:00
|
|
|
|
wxPoint ReturnPinEndPoint();
|
2007-09-13 11:28:58 +00:00
|
|
|
|
|
|
|
|
|
int ReturnPinDrawOrient( int TransMat[2][2] );
|
2007-08-24 15:10:46 +00:00
|
|
|
|
void ReturnPinStringNum( wxString& buffer );
|
|
|
|
|
void SetPinNumFromString( wxString& buffer );
|
|
|
|
|
void DrawPinSymbol( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& pin_pos,
|
|
|
|
|
int orient,
|
|
|
|
|
int DrawMode, int Color = -1 );
|
|
|
|
|
|
|
|
|
|
void DrawPinTexts( WinEDA_DrawPanel* panel, wxDC* DC,
|
|
|
|
|
wxPoint& pin_pos, int orient,
|
|
|
|
|
int TextInside, bool DrawPinNum, bool DrawPinName,
|
|
|
|
|
int Color, int DrawMode );
|
|
|
|
|
void PlotPinTexts( wxPoint& pin_pos, int orient,
|
|
|
|
|
int TextInside, bool DrawPinNum, bool DrawPinName );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2007-08-24 15:10:46 +00:00
|
|
|
|
class LibDrawArc : public LibEDA_BaseStruct
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
|
int m_Rayon;
|
|
|
|
|
int m_Fill;
|
|
|
|
|
int t1, t2; /* position des 2 extremites de l'arc en 0,1 degres */
|
|
|
|
|
wxPoint m_ArcStart, m_ArcEnd; /* position des 2 extremites de l'arc en coord reelles*/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
public:
|
2007-09-01 12:00:30 +00:00
|
|
|
|
LibDrawArc();
|
|
|
|
|
~LibDrawArc() { }
|
2007-09-13 11:28:58 +00:00
|
|
|
|
virtual wxString GetClass() const
|
|
|
|
|
{
|
|
|
|
|
return wxT( "LibDrawArc" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
|
LibDrawArc* GenCopy();
|
2007-08-24 15:10:46 +00:00
|
|
|
|
bool WriteDescr( FILE* File );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
2007-08-24 15:10:46 +00:00
|
|
|
|
class LibDrawCircle : public LibEDA_BaseStruct
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
|
int m_Rayon;
|
|
|
|
|
int m_Fill;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
public:
|
2007-09-01 12:00:30 +00:00
|
|
|
|
LibDrawCircle();
|
|
|
|
|
~LibDrawCircle() { }
|
2007-09-13 11:28:58 +00:00
|
|
|
|
virtual wxString GetClass() const
|
|
|
|
|
{
|
|
|
|
|
return wxT( "LibDrawCircle" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
|
LibDrawCircle* GenCopy();
|
2007-08-24 15:10:46 +00:00
|
|
|
|
bool WriteDescr( FILE* File );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
2007-08-24 15:10:46 +00:00
|
|
|
|
class LibDrawText : public LibEDA_BaseStruct
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
|
int m_Horiz;
|
|
|
|
|
wxSize m_Size;
|
|
|
|
|
int m_Type;
|
|
|
|
|
wxString m_Text;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
public:
|
2007-09-01 12:00:30 +00:00
|
|
|
|
LibDrawText();
|
|
|
|
|
~LibDrawText() { }
|
2007-09-13 11:28:58 +00:00
|
|
|
|
virtual wxString GetClass() const
|
|
|
|
|
{
|
|
|
|
|
return wxT( "LibDrawText" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
|
LibDrawText* GenCopy();
|
2007-08-24 15:10:46 +00:00
|
|
|
|
bool WriteDescr( FILE* File );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
2007-08-24 15:10:46 +00:00
|
|
|
|
class LibDrawSquare : public LibEDA_BaseStruct
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
|
wxPoint m_End;
|
|
|
|
|
int m_Fill;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
public:
|
2007-09-01 12:00:30 +00:00
|
|
|
|
LibDrawSquare();
|
|
|
|
|
~LibDrawSquare() { }
|
2007-09-13 11:28:58 +00:00
|
|
|
|
virtual wxString GetClass() const
|
|
|
|
|
{
|
|
|
|
|
return wxT( "LibDrawSquare" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
|
LibDrawSquare* GenCopy();
|
2007-08-24 15:10:46 +00:00
|
|
|
|
bool WriteDescr( FILE* File );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
2007-08-24 15:10:46 +00:00
|
|
|
|
class LibDrawSegment : public LibEDA_BaseStruct
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
|
wxPoint m_End;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
public:
|
2007-09-01 12:00:30 +00:00
|
|
|
|
LibDrawSegment();
|
|
|
|
|
~LibDrawSegment() { }
|
2007-09-13 11:28:58 +00:00
|
|
|
|
virtual wxString GetClass() const
|
|
|
|
|
{
|
|
|
|
|
return wxT( "LibDrawSegment" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
|
LibDrawSegment* GenCopy();
|
2007-08-24 15:10:46 +00:00
|
|
|
|
bool WriteDescr( FILE* File );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class LibDrawPolyline : public LibEDA_BaseStruct
|
|
|
|
|
{
|
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
|
int n, * PolyList;
|
|
|
|
|
int m_Fill;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
public:
|
2007-09-01 12:00:30 +00:00
|
|
|
|
LibDrawPolyline();
|
2007-09-13 11:28:58 +00:00
|
|
|
|
~LibDrawPolyline()
|
|
|
|
|
{
|
2007-08-24 15:10:46 +00:00
|
|
|
|
if( PolyList )
|
|
|
|
|
free( PolyList );
|
|
|
|
|
}
|
2007-09-13 11:28:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virtual wxString GetClass() const
|
|
|
|
|
{
|
|
|
|
|
return wxT( "LibDrawPolyline" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
|
LibDrawPolyline* GenCopy();
|
2007-08-24 15:10:46 +00:00
|
|
|
|
void AddPoint( const wxPoint& point );
|
|
|
|
|
bool WriteDescr( FILE* File );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* Fields identiques aux fields des composants, pouvant etre predefinis en lib
|
2007-08-24 15:10:46 +00:00
|
|
|
|
* 2 Fields sont toujours presents : Prefix (U, IC..) et Name (74LS00..)*/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
class LibDrawField : public LibEDA_BaseStruct
|
|
|
|
|
{
|
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
|
int m_FieldId; // 0 a 11
|
2007-09-13 11:28:58 +00:00
|
|
|
|
// 0 = Name; 1 = Valeur; 2 .. 11 other fields
|
2007-08-24 15:10:46 +00:00
|
|
|
|
wxPoint m_Pos;
|
|
|
|
|
wxSize m_Size;
|
|
|
|
|
int m_Orient; /* Orientation */
|
2007-09-13 11:28:58 +00:00
|
|
|
|
int m_Attributs; /* Attributes (Non visible ...) */
|
|
|
|
|
int m_HJustify, m_VJustify; /* Horiz an Vert Texte Justifications */
|
2007-08-24 15:10:46 +00:00
|
|
|
|
wxString m_Text; /* Field Data */
|
|
|
|
|
wxString m_Name; /* Field Name */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
|
LibDrawField( int idfield = 2 );
|
2007-09-01 12:00:30 +00:00
|
|
|
|
~LibDrawField();
|
2007-09-13 11:28:58 +00:00
|
|
|
|
virtual wxString GetClass() const
|
|
|
|
|
{
|
|
|
|
|
return wxT( "LibDrawField" );
|
|
|
|
|
}
|
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
|
LibDrawField* GenCopy();
|
2007-08-24 15:10:46 +00:00
|
|
|
|
void Copy( LibDrawField* Target );
|
|
|
|
|
bool WriteDescr( FILE* File );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2007-09-13 11:28:58 +00:00
|
|
|
|
/* basic class to describe components in libraries (true component or alias), non used directly */
|
2007-08-24 15:10:46 +00:00
|
|
|
|
class LibCmpEntry : public EDA_BaseStruct
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
|
LibrEntryType Type; /* Type = ROOT;
|
|
|
|
|
* = ALIAS pour struct LibraryAliasType */
|
|
|
|
|
LibDrawField m_Name; // name (74LS00 ..) in lib ( = VALUE )
|
2007-09-13 11:28:58 +00:00
|
|
|
|
wxString m_Doc; /* documentation for info */
|
|
|
|
|
wxString m_KeyWord; /* keyword list (used to select a group of components by keyword) */
|
|
|
|
|
wxString m_DocFile; /* Associed doc filename */
|
2007-08-24 15:10:46 +00:00
|
|
|
|
LibrEntryOptions m_Options; // special features (i.e. Entry is a POWER)
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
public:
|
2007-09-13 11:28:58 +00:00
|
|
|
|
LibCmpEntry( LibrEntryType CmpType, const wxChar* CmpName );
|
2007-09-01 12:00:30 +00:00
|
|
|
|
virtual ~LibCmpEntry();
|
2007-09-13 11:28:58 +00:00
|
|
|
|
virtual wxString GetClass() const
|
|
|
|
|
{
|
|
|
|
|
return wxT( "LibCmpEntry" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-24 15:10:46 +00:00
|
|
|
|
bool WriteDescr( FILE* File );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
2007-09-13 11:28:58 +00:00
|
|
|
|
class EDA_LibComponentStruct : public LibCmpEntry /* usual component in lib */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
|
LibDrawField m_Prefix; /* Prefix ( U, IC ... ) = REFERENCE */
|
|
|
|
|
wxArrayString m_AliasList; /* ALIAS list for the component */
|
|
|
|
|
wxArrayString m_FootprintList; /* list of suitable footprint names for the component (wildcard names accepted)*/
|
|
|
|
|
int m_UnitCount; /* Units (or sections) per package */
|
|
|
|
|
bool m_UnitSelectionLocked; // True if units are differents and their selection is locked
|
2007-09-13 11:28:58 +00:00
|
|
|
|
// (i.e. if part A cannot be automatically changed in part B
|
|
|
|
|
int m_TextInside; /* if 0: pin name drawn on the pin itself
|
|
|
|
|
* if > 0 pin name drawn inside the component,
|
|
|
|
|
* with a distance of m_TextInside in mils */
|
2007-08-24 15:10:46 +00:00
|
|
|
|
bool m_DrawPinNum;
|
|
|
|
|
bool m_DrawPinName;
|
2007-09-13 11:28:58 +00:00
|
|
|
|
LibDrawField* Fields; /* Auxiliairy Field list (id = 2 a 11) */
|
|
|
|
|
LibEDA_BaseStruct* m_Drawings; /* How to draw this part */
|
|
|
|
|
long m_LastDate; // Last change Date
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
public:
|
2007-09-13 11:28:58 +00:00
|
|
|
|
virtual wxString GetClass() const
|
|
|
|
|
{
|
|
|
|
|
return wxT( "EDA_LibComponentStruct" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EDA_LibComponentStruct( const wxChar* CmpName );
|
|
|
|
|
EDA_Rect GetBoundaryBox( int Unit, int Convert ); /* return Box around the part. */
|
2007-08-24 15:10:46 +00:00
|
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
|
~EDA_LibComponentStruct();
|
|
|
|
|
void SortDrawItems();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
2007-09-13 11:28:58 +00:00
|
|
|
|
class EDA_LibCmpAliasStruct : public LibCmpEntry /* alias of an usual component in lib (root component) */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
2007-09-13 11:28:58 +00:00
|
|
|
|
wxString m_RootName; /* Root component Part name */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
public:
|
2007-09-13 11:28:58 +00:00
|
|
|
|
EDA_LibCmpAliasStruct( const wxChar* CmpName, const wxChar* CmpRootName );
|
2007-09-01 12:00:30 +00:00
|
|
|
|
~EDA_LibCmpAliasStruct();
|
2007-09-13 11:28:58 +00:00
|
|
|
|
virtual wxString GetClass() const
|
|
|
|
|
{
|
|
|
|
|
return wxT( "EDA_LibCmpAliasStruct" );
|
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* Variables */
|
2007-09-13 11:28:58 +00:00
|
|
|
|
extern LibraryStruct* LibraryList; /* All part libs are saved here. */
|
|
|
|
|
|
|
|
|
|
/* Variables used by LibEdit */
|
|
|
|
|
eda_global LibEDA_BaseStruct* LibItemToRepeat; /* pointeur sur l'<27>l<EFBFBD>ment que l'on
|
|
|
|
|
* peut r<EFBFBD>p<EFBFBD>ter (Pin..;) */
|
|
|
|
|
eda_global LibraryStruct* CurrentLib; /* Current opened library */
|
|
|
|
|
eda_global EDA_LibComponentStruct* CurrentLibEntry; /* Current component */
|
|
|
|
|
eda_global LibEDA_BaseStruct* CurrentDrawItem; /* current edited item */
|
|
|
|
|
|
|
|
|
|
eda_global wxString CurrentAliasName; // Current selected alias (for components which have aliases)
|
|
|
|
|
eda_global bool g_AsDeMorgan; // True if the current component has a "De Morgan" representation
|
|
|
|
|
eda_global int CurrentUnit // Current selected part
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#ifdef MAIN
|
2007-08-24 15:10:46 +00:00
|
|
|
|
= 1
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#endif
|
|
|
|
|
;
|
2007-09-13 11:28:58 +00:00
|
|
|
|
eda_global int CurrentConvert /* Convert = 1 .. 255 */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#ifdef MAIN
|
2007-08-24 15:10:46 +00:00
|
|
|
|
= 1
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#endif
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
2007-08-24 15:10:46 +00:00
|
|
|
|
eda_global wxString FindLibName; /* nom de la librairie ou a ete trouve le
|
|
|
|
|
* dernier composant recherche par FindLibPart() */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
#endif // LIBCMP_H
|