2007-08-04 04:40:07 +00:00
|
|
|
|
/**************************************/
|
|
|
|
|
/* PCBNEW.H : d<>larations communes */
|
|
|
|
|
/**************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#ifndef PCBNEW_H
|
|
|
|
|
#define PCBNEW_H
|
|
|
|
|
|
|
|
|
|
#ifndef eda_global
|
|
|
|
|
#define eda_global extern
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "pcbstruct.h"
|
|
|
|
|
#include "macros.h"
|
|
|
|
|
|
2007-08-04 04:40:07 +00:00
|
|
|
|
#define U_PCB (PCB_INTERNAL_UNIT / EESCHEMA_INTERNAL_UNIT)
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
/* valeur de flag indicant si le pointeur de reference pour une localisation
|
2007-08-08 03:50:44 +00:00
|
|
|
|
* est le curseur sur grille ou le curseur a deplacement fin hors grille */
|
2007-08-04 04:40:07 +00:00
|
|
|
|
#define CURSEUR_ON_GRILLE (0 << 0)
|
|
|
|
|
#define CURSEUR_OFF_GRILLE (1 << 0)
|
2007-06-25 08:05:45 +00:00
|
|
|
|
|
2007-08-04 04:40:07 +00:00
|
|
|
|
#define IGNORE_LOCKED (1 << 1) ///< if module is locked, do not select for single module operation
|
|
|
|
|
#define MATCH_LAYER (1 << 2) ///< if module not on current layer, do not select
|
|
|
|
|
#define VISIBLE_ONLY (1 << 3) ///< if module not on a visible layer, do not select
|
2007-06-15 16:08:55 +00:00
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-04 04:40:07 +00:00
|
|
|
|
#define START 0 /* ctes parametre dans les routines de localisation */
|
|
|
|
|
#define END 1
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
#define DIM_ANCRE_MODULE 3 /* dim du symbole de l'ancre (centre) des modules */
|
2007-08-04 04:40:07 +00:00
|
|
|
|
#define DIM_ANCRE_TEXTE 2 /* dim du symbole de l'ancre (centre) des textes */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
/* Gestion du Menu Zoom */
|
2007-08-04 04:40:07 +00:00
|
|
|
|
#define ZOOM_PLUS -1
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#define ZOOM_MOINS -2
|
2007-08-04 04:40:07 +00:00
|
|
|
|
#define ZOOM_AUTO -3
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#define ZOOM_CENTER -4
|
|
|
|
|
#define ZOOM_REDRAW -5
|
|
|
|
|
|
|
|
|
|
/* Definition des cas ou l'on force l'affichage en SKETCH (membre .flags) */
|
|
|
|
|
#define FORCE_SKETCH (DRAG | EDIT )
|
|
|
|
|
|
|
|
|
|
/* Constantes pour options lecture fichier PCB */
|
2007-08-04 04:40:07 +00:00
|
|
|
|
#define APPEND_PCB 1 /* pour ajout d'un nouveau circuit */
|
|
|
|
|
#define NEWPCB 0 /* pour chargement normal */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
|
2007-08-04 04:40:07 +00:00
|
|
|
|
eda_global wxArrayString g_LibName_List; // library list to load
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-08 03:50:44 +00:00
|
|
|
|
eda_global wxSize g_GridList[]
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#ifdef MAIN
|
2007-08-04 04:40:07 +00:00
|
|
|
|
= {
|
|
|
|
|
wxSize( 1000, 1000 ), wxSize( 500, 500 ), wxSize( 250, 250 ), wxSize( 200, 200 ),
|
|
|
|
|
wxSize( 100, 100 ), wxSize( 50, 50 ), wxSize( 25, 25 ), wxSize( 20, 20 ),
|
|
|
|
|
wxSize( 10, 10 ), wxSize( 5, 5 ), wxSize( 2, 2 ), wxSize( 1, 1 ),
|
|
|
|
|
wxSize( -1, -1 ), wxSize( 0, 0 )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
}
|
2007-08-04 04:40:07 +00:00
|
|
|
|
|
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#endif
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
#define UNDELETE_STACK_SIZE 10
|
2007-08-08 03:50:44 +00:00
|
|
|
|
eda_global EDA_BaseStruct* g_UnDeleteStack[UNDELETE_STACK_SIZE]; // Liste des elements supprimes
|
2007-08-04 04:40:07 +00:00
|
|
|
|
eda_global int g_UnDeleteStackPtr;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-04 04:40:07 +00:00
|
|
|
|
eda_global bool g_ShowGrid
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#ifdef MAIN
|
|
|
|
|
= TRUE
|
|
|
|
|
#endif
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
/* Look up Table for conversion one layer number -> one bit layer mask: */
|
|
|
|
|
eda_global int g_TabOneLayerMask[LAYER_COUNT]
|
|
|
|
|
#if defined MAIN
|
2007-08-04 04:40:07 +00:00
|
|
|
|
= {
|
|
|
|
|
0x00000001, 0x00000002, 0x00000004, 0x00000008,
|
|
|
|
|
0x00000010, 0x00000020, 0x00000040, 0x00000080,
|
|
|
|
|
0x00000100, 0x00000200, 0x00000400, 0x00000800,
|
|
|
|
|
0x00001000, 0x00002000, 0x00004000, 0x00008000,
|
|
|
|
|
0x00010000, 0x00020000, 0x00040000, 0x00080000,
|
|
|
|
|
0x00100000, 0x00200000, 0x00400000, 0x00800000,
|
|
|
|
|
0x01000000, 0x02000000, 0x04000000, 0x08000000,
|
|
|
|
|
0x10000000, 0x20000000, 0x40000000, 0x80000000
|
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#endif
|
2007-08-04 04:40:07 +00:00
|
|
|
|
;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
/* Look up Table for conversion copper layer count -> general copper layer mask: */
|
|
|
|
|
eda_global int g_TabAllCopperLayerMask[NB_COPPER_LAYERS]
|
|
|
|
|
#if defined MAIN
|
2007-08-04 04:40:07 +00:00
|
|
|
|
= {
|
|
|
|
|
0x0001, 0x8001, 0x8003, 0x8007,
|
|
|
|
|
0x800F, 0x801F, 0x803F, 0x807F,
|
|
|
|
|
0x80FF, 0x81FF, 0x83FF, 0x87FF,
|
|
|
|
|
0x8FFF, 0x9FFF, 0xCFFF, 0xFFFF
|
2007-06-05 12:10:51 +00:00
|
|
|
|
};
|
|
|
|
|
#endif
|
2007-08-04 04:40:07 +00:00
|
|
|
|
;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
/* variables */
|
|
|
|
|
|
|
|
|
|
extern wxString g_Main_Title;
|
|
|
|
|
|
|
|
|
|
eda_global bool Drc_On
|
|
|
|
|
#ifdef MAIN
|
|
|
|
|
= TRUE
|
|
|
|
|
#endif
|
|
|
|
|
;
|
2007-08-04 04:40:07 +00:00
|
|
|
|
eda_global bool g_AutoDeleteOldTrack /* autorise effacement automatique
|
|
|
|
|
* de l'ancienne piste lors des redessins de pistes */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#ifdef MAIN
|
|
|
|
|
= TRUE
|
|
|
|
|
#endif
|
|
|
|
|
;
|
|
|
|
|
eda_global bool g_No_Via_Route;
|
|
|
|
|
eda_global bool g_Drag_Pistes_On;
|
|
|
|
|
eda_global bool g_Show_Ratsnest;
|
|
|
|
|
eda_global bool g_Show_Module_Ratsnest;
|
|
|
|
|
eda_global bool g_Show_Pads_Module_in_Move
|
|
|
|
|
#ifdef MAIN
|
|
|
|
|
= TRUE
|
|
|
|
|
#endif
|
|
|
|
|
;
|
|
|
|
|
eda_global bool g_Raccord_45_Auto
|
|
|
|
|
#ifdef MAIN
|
|
|
|
|
= TRUE
|
|
|
|
|
#endif
|
|
|
|
|
;
|
|
|
|
|
eda_global bool g_ShowIsolDuringCreateTrack; /* .State controle l'affichage
|
2007-08-04 04:40:07 +00:00
|
|
|
|
* de l'isolation en trace de piste */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-04 04:40:07 +00:00
|
|
|
|
/**************************************************************/
|
|
|
|
|
/* Options d'affichages (remplissages des segments, textes..) */
|
|
|
|
|
/**************************************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
eda_global DISPLAY_OPTIONS DisplayOpt;
|
|
|
|
|
|
2007-08-08 03:50:44 +00:00
|
|
|
|
/**
|
|
|
|
|
* Function IsModuleLayerVisible
|
|
|
|
|
* expects either of the two layers on which a module can reside, and returns
|
|
|
|
|
* whether that layer is visible.
|
|
|
|
|
* @param layer One of the two allowed layers for modules: CMP_N or CUIVRE_N
|
|
|
|
|
* @return bool - true if the layer is visible, else false.
|
|
|
|
|
*/
|
|
|
|
|
bool inline IsModuleLayerVisible( int layer )
|
|
|
|
|
{
|
|
|
|
|
if( layer==CMP_N )
|
|
|
|
|
return DisplayOpt.Show_Modules_Cmp;
|
|
|
|
|
|
|
|
|
|
else if( layer==CUIVRE_N )
|
|
|
|
|
return DisplayOpt.Show_Modules_Cu;
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-08-04 04:40:07 +00:00
|
|
|
|
eda_global bool Track_45_Only; /* Flag pour limiter l'inclinaison
|
|
|
|
|
* pistes a 45 degres seulement */
|
|
|
|
|
eda_global bool Segments_45_Only;/* Flag pour limiter l'inclinaison
|
|
|
|
|
* edge pcb a 45 degres seulement */
|
|
|
|
|
eda_global wxString PcbExtBuffer
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#ifdef MAIN
|
2007-08-04 04:40:07 +00:00
|
|
|
|
( wxT( ".brd" ) )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#endif
|
|
|
|
|
;
|
2007-08-04 04:40:07 +00:00
|
|
|
|
eda_global wxString g_SaveFileName // File Name for periodic saving
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#ifdef MAIN
|
2007-08-04 04:40:07 +00:00
|
|
|
|
( wxT( "$savepcb" ) )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#endif
|
|
|
|
|
;
|
|
|
|
|
eda_global wxString NetNameBuffer;
|
|
|
|
|
eda_global wxString NetExtBuffer
|
|
|
|
|
#ifdef MAIN
|
2007-08-04 04:40:07 +00:00
|
|
|
|
( wxT( ".net" ) )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#endif
|
|
|
|
|
;
|
|
|
|
|
eda_global wxString NetCmpExtBuffer
|
|
|
|
|
#ifdef MAIN
|
2007-08-04 04:40:07 +00:00
|
|
|
|
( wxT( ".cmp" ) )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#endif
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
// Gestion de la liste des librairies
|
|
|
|
|
eda_global wxString LibExtBuffer
|
|
|
|
|
#ifdef MAIN
|
2007-08-04 04:40:07 +00:00
|
|
|
|
( wxT( ".mod" ) )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#endif
|
|
|
|
|
;
|
2007-08-04 04:40:07 +00:00
|
|
|
|
eda_global wxString g_Shapes3DExtBuffer // extension des fichiers de formes 3D
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#ifdef MAIN
|
2007-08-04 04:40:07 +00:00
|
|
|
|
( wxT( ".wrl" ) )
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#endif
|
|
|
|
|
;
|
|
|
|
|
|
2007-08-04 04:40:07 +00:00
|
|
|
|
eda_global int g_NetType; // for cvpcb: Net type identifier
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
eda_global int g_CurrentVersionPCB
|
|
|
|
|
#ifdef MAIN
|
|
|
|
|
= 1
|
|
|
|
|
#endif
|
|
|
|
|
;
|
|
|
|
|
|
2007-08-04 04:40:07 +00:00
|
|
|
|
#define BUFMEMSIZE 256000 /* taille du buffer de travail (en octets) */
|
|
|
|
|
eda_global char* buf_work; /* pointeur sur le buffer de travail */
|
|
|
|
|
eda_global char* adr_lowmem; /* adresse de base memoire de calcul disponible*/
|
|
|
|
|
eda_global char* adr_himem; /* adresse haute limite de la memoire disponible*/
|
|
|
|
|
eda_global char* adr_max; /* adresse haute maxi utilisee pour la memoire */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
|
2007-08-04 04:40:07 +00:00
|
|
|
|
/* variables g<>erales */
|
|
|
|
|
eda_global char cbuf[1024]; /* buffer de formatage texte */
|
|
|
|
|
eda_global BOARD* g_ModuleEditor_Pcb; /* Pointeur de l'entete pcb de l'editeur de module*/
|
|
|
|
|
eda_global int g_TimeOut; // Duree entre 2 sauvegardes automatiques
|
|
|
|
|
eda_global int g_SaveTime; // heure de la prochaine sauvegarde
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Variables generales d'empreintes */
|
2007-08-04 04:40:07 +00:00
|
|
|
|
extern int Angle_Rot_Module;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
eda_global wxSize ModuleTextSize; /* dim des textes sur Modules par defaut */
|
2007-08-04 04:40:07 +00:00
|
|
|
|
eda_global int ModuleTextWidth;
|
|
|
|
|
eda_global int ModuleSegmentWidth;
|
|
|
|
|
eda_global int Texte_Module_Type;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
|
2007-08-04 04:40:07 +00:00
|
|
|
|
/***********************/
|
|
|
|
|
/* pistes , vias , pads*/
|
|
|
|
|
/***********************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-04 04:40:07 +00:00
|
|
|
|
#define L_MIN_DESSIN 1 /* seuil de largeur des pistes pour trace autre que filaire */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
// Current designe settings:
|
|
|
|
|
eda_global class EDA_BoardDesignSettings g_DesignSettings;
|
|
|
|
|
|
|
|
|
|
// valeurs par defaut des caract. des pads
|
|
|
|
|
#ifndef GERBVIEW
|
|
|
|
|
#ifdef MAIN
|
2007-08-04 04:40:07 +00:00
|
|
|
|
D_PAD g_Pad_Master( (MODULE*) NULL );
|
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#else
|
|
|
|
|
extern D_PAD g_Pad_Master;
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
2007-08-04 04:40:07 +00:00
|
|
|
|
eda_global int Route_Layer_TOP;
|
|
|
|
|
eda_global int Route_Layer_BOTTOM; /* couches de routage actif */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-04 04:40:07 +00:00
|
|
|
|
eda_global int g_MaxLinksShowed; // determine le nombre max de links affich<63>
|
|
|
|
|
// en routage manuel
|
|
|
|
|
eda_global bool g_TwoSegmentTrackBuild // FALSE = 1 segment build, TRUE = 2 45 deg segm build
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#ifdef MAIN
|
|
|
|
|
= TRUE
|
|
|
|
|
#endif
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
/* How to handle magentic pad: feature to move the pcb cursor on a pad center */
|
|
|
|
|
enum MagneticPadOptionValues {
|
2007-08-04 04:40:07 +00:00
|
|
|
|
no_effect,
|
|
|
|
|
capture_cursor_in_track_tool,
|
|
|
|
|
capture_always
|
2007-06-05 12:10:51 +00:00
|
|
|
|
};
|
2007-08-04 04:40:07 +00:00
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
eda_global int g_MagneticPadOption
|
|
|
|
|
#ifdef MAIN
|
|
|
|
|
= capture_cursor_in_track_tool
|
|
|
|
|
#endif
|
|
|
|
|
;
|
|
|
|
|
eda_global bool g_HightLigt_Status;
|
2007-08-04 04:40:07 +00:00
|
|
|
|
eda_global int g_HightLigth_NetCode /* pour mise en surbrillance des pistes */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#ifdef MAIN
|
|
|
|
|
= -1
|
|
|
|
|
#endif
|
2007-08-04 04:40:07 +00:00
|
|
|
|
; /* net_code du net a mettre en surbrillance */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-04 04:40:07 +00:00
|
|
|
|
eda_global TRACK* g_CurrentTrackSegment; // pointeur sur le segment en cours de trace
|
|
|
|
|
eda_global TRACK* g_FirstTrackSegment; // pointeur sur le debut de la piste en cours
|
|
|
|
|
eda_global int g_TrackSegmentCount; // nombre de points deja traces
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
eda_global wxString g_ViaType_Name[4]
|
|
|
|
|
#if defined MAIN
|
2007-08-04 04:40:07 +00:00
|
|
|
|
= {
|
|
|
|
|
wxT( "???" ), // Unused
|
|
|
|
|
_( "Blind Via" ), // from inner layer to external layer (TOP or BOTTOM)
|
|
|
|
|
_( "Buried Via" ), // from inner to inner layer
|
|
|
|
|
_( "Standard Via" ) // Usual via (from TOP to BOTTOM layer)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#endif
|
|
|
|
|
;
|
2007-08-04 04:40:07 +00:00
|
|
|
|
eda_global int g_ViaHoleLastValue; // Last value for non default value via hole
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
/* Couleur de fond affichage de bas d'ecran */
|
|
|
|
|
eda_global int g_PcbGridColor;
|
|
|
|
|
|
|
|
|
|
/* couleurs des autres items des empreintes */
|
|
|
|
|
#if defined MAIN
|
2007-08-04 04:40:07 +00:00
|
|
|
|
int g_PadCMPColor = RED;
|
|
|
|
|
int g_PadCUColor = GREEN;
|
|
|
|
|
int g_AnchorColor = BLUE;
|
|
|
|
|
int g_ModuleTextCMPColor = LIGHTGRAY;
|
|
|
|
|
int g_ModuleTextCUColor = MAGENTA;
|
|
|
|
|
int g_ModuleTextNOVColor = DARKGRAY;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#else
|
2007-08-04 04:40:07 +00:00
|
|
|
|
eda_global int g_ModuleTextCMPColor;
|
|
|
|
|
eda_global int g_ModuleTextCUColor;
|
|
|
|
|
eda_global int g_ModuleTextNOVColor;
|
|
|
|
|
eda_global int g_AnchorColor;
|
|
|
|
|
eda_global int g_PadCUColor;
|
|
|
|
|
eda_global int g_PadCMPColor;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2007-08-04 04:40:07 +00:00
|
|
|
|
eda_global PCB_SCREEN* ScreenPcb; /* Ecran principal */
|
|
|
|
|
eda_global PCB_SCREEN* ScreenModule; /* Ecran de l'editeur de modules */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
|
2007-08-04 04:40:07 +00:00
|
|
|
|
/****************************************************/
|
|
|
|
|
/* Gestion du deplacement des modules et des pistes */
|
|
|
|
|
/****************************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
|
eda_global wxPoint g_Offset_Module; /* Offset de trace du modul en depl */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
/* Pad editing */
|
2007-08-04 04:40:07 +00:00
|
|
|
|
eda_global wxString g_Current_PadName; // Last used pad name (pad num)
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* PCBNEW_H */
|