2008-09-19 08:19:15 +00:00
|
|
|
/***************************************/
|
|
|
|
/* GENERAL.H : declarations communes */
|
|
|
|
/***************************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-02-26 01:07:38 +00:00
|
|
|
#ifndef _GENERAL_H_
|
|
|
|
#define _GENERAL_H_
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
#ifndef eda_global
|
|
|
|
#define eda_global extern
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define us unsigned short
|
|
|
|
#define uc unsigned char
|
|
|
|
#define ul unsigned long
|
|
|
|
|
|
|
|
/* Entete des fichiers schematique */
|
2008-02-12 22:34:40 +00:00
|
|
|
#define EESCHEMA_VERSION 2
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
#define SCHEMATIC_HEAD_STRING "Schematic File Version"
|
2008-09-19 08:19:15 +00:00
|
|
|
#define EESCHEMA_FILE_STAMP "EESchema"
|
|
|
|
#define NULL_STRING "_NONAME_"
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-09-19 08:19:15 +00:00
|
|
|
#define MAX_PIN_INFO 10
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-09-19 08:19:15 +00:00
|
|
|
#define TXTMARGE 10 /* Decalage (en 1/1000") des textes places
|
|
|
|
* sur fils ( labels, num pins ) */
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
#define HIGHLIGHT_COLOR WHITE
|
|
|
|
|
|
|
|
|
|
|
|
/* Used for EDA_BaseStruct, .m_Select member */
|
|
|
|
#define IS_SELECTED 1
|
|
|
|
|
|
|
|
#define TEXT_NO_VISIBLE 1
|
|
|
|
|
|
|
|
|
|
|
|
//#define GR_DEFAULT_DRAWMODE GR_COPY
|
|
|
|
#define GR_DEFAULT_DRAWMODE GR_COPY
|
|
|
|
|
2008-03-27 21:02:42 +00:00
|
|
|
#define DANGLING_SYMBOL_SIZE 12
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
/* Message de presentation */
|
2008-09-19 08:19:15 +00:00
|
|
|
extern wxString g_Main_Title;
|
2007-05-06 16:03:28 +00:00
|
|
|
eda_global wxString g_DefaultSchematicFileName
|
|
|
|
#ifdef MAIN
|
2008-09-19 08:19:15 +00:00
|
|
|
( wxT( "noname.sch" ) )
|
2007-05-06 16:03:28 +00:00
|
|
|
#endif
|
|
|
|
;
|
|
|
|
|
|
|
|
/* Masque de recherche pour localisation d'objets a editer */
|
2008-09-19 08:19:15 +00:00
|
|
|
#define LIBITEM 1
|
|
|
|
#define WIREITEM 2
|
|
|
|
#define BUSITEM 4
|
|
|
|
#define RACCORDITEM 4
|
|
|
|
#define JUNCTIONITEM 0x10
|
|
|
|
#define DRAWITEM 0x20
|
|
|
|
#define TEXTITEM 0x40
|
|
|
|
#define LABELITEM 0x80
|
|
|
|
#define SHEETITEM 0x100
|
|
|
|
#define MARKERITEM 0x200
|
|
|
|
#define NOCONNECTITEM 0x400
|
|
|
|
#define SEARCH_PINITEM 0x800
|
|
|
|
#define SHEETLABELITEM 0x1000
|
|
|
|
#define FIELDCMPITEM 0x2000
|
2007-05-06 16:03:28 +00:00
|
|
|
#define EXCLUDE_WIRE_BUS_ENDPOINTS 0x4000
|
2008-09-19 08:19:15 +00:00
|
|
|
#define WIRE_BUS_ENDPOINTS_ONLY 0x8000
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-09-19 08:19:15 +00:00
|
|
|
#define SEARCHALL LIBITEM | WIREITEM | BUSITEM | RACCORDITEM | JUNCTIONITEM \
|
|
|
|
| DRAWITEM | TEXTITEM | LABELITEM | SHEETITEM | MARKERITEM \
|
|
|
|
| NOCONNECTITEM | SEARCH_PINITEM | SHEETLABELITEM
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
/* Numero des couches de travail */
|
|
|
|
typedef enum {
|
2008-09-19 08:19:15 +00:00
|
|
|
LAYER_WIRE,
|
|
|
|
LAYER_BUS,
|
|
|
|
LAYER_JUNCTION,
|
|
|
|
LAYER_LOCLABEL,
|
|
|
|
LAYER_GLOBLABEL,
|
|
|
|
LAYER_HIERLABEL,
|
|
|
|
LAYER_PINFUN,
|
|
|
|
LAYER_PINNUM,
|
|
|
|
LAYER_PINNAM,
|
|
|
|
LAYER_REFERENCEPART,
|
|
|
|
LAYER_VALUEPART,
|
|
|
|
LAYER_FIELDS,
|
|
|
|
LAYER_DEVICE,
|
|
|
|
LAYER_NOTES,
|
|
|
|
LAYER_NETNAM,
|
|
|
|
LAYER_PIN,
|
|
|
|
LAYER_SHEET,
|
|
|
|
LAYER_SHEETNAME,
|
|
|
|
LAYER_SHEETFILENAME,
|
|
|
|
LAYER_SHEETLABEL,
|
|
|
|
LAYER_NOCONNECT,
|
|
|
|
LAYER_ERC_WARN,
|
|
|
|
LAYER_ERC_ERR,
|
|
|
|
LAYER_DEVICE_BACKGROUND,
|
|
|
|
|
|
|
|
MAX_LAYER /* Nombre de couches */
|
|
|
|
} LayerNumber;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
typedef enum {
|
2008-09-19 08:19:15 +00:00
|
|
|
FILE_SAVE_AS,
|
|
|
|
FILE_SAVE_NEW
|
2007-05-06 16:03:28 +00:00
|
|
|
} FileSaveType;
|
|
|
|
|
|
|
|
|
|
|
|
/* variables generales */
|
2008-09-19 08:19:15 +00:00
|
|
|
eda_global wxArrayString g_LibName_List; // library list (short filenames) to load
|
|
|
|
eda_global LibraryStruct* g_LibraryList; // All part libs are saved here.
|
|
|
|
|
|
|
|
eda_global int g_NetFormat; /* Numero de reference du type de netliste */
|
|
|
|
eda_global int g_OptNetListUseNames; /* TRUE pour utiliser les noms de net plutot que
|
|
|
|
* les numeros (netlist PSPICE seulement) */
|
|
|
|
eda_global int g_BGColor; /* couleur fond d'ecran (normalement blanc) */
|
|
|
|
eda_global SCH_ITEM* g_ItemToRepeat; /* pointeur sur la derniere structure
|
|
|
|
* dessinee pouvant etre dupliquee par la commande
|
|
|
|
* Repeat ( NULL si aucune struct existe ) */
|
|
|
|
eda_global wxSize g_RepeatStep;
|
|
|
|
eda_global int g_RepeatDeltaLabel;
|
|
|
|
|
|
|
|
eda_global SCH_ITEM* g_ItemToUndoCopy; /* copy of last modified schematic item
|
|
|
|
* before it is modified (used for undo managing to restore old values ) */
|
|
|
|
|
|
|
|
eda_global bool g_LastSearchIsMarker; // True if last seach is a marker serach
|
|
|
|
// False for a schematic item search
|
|
|
|
// Used for hotkey next search
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
/* Block operation (copy, paste) */
|
2008-09-19 08:19:15 +00:00
|
|
|
eda_global SCH_ITEM* g_BlockSaveDataList; // List of items to paste (Created by Block Save)
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
// Gestion d'options
|
2008-09-19 08:19:15 +00:00
|
|
|
eda_global int g_ShowAllPins;
|
|
|
|
eda_global int g_ShowGrid; // Bool: display grid
|
2007-05-06 16:03:28 +00:00
|
|
|
#ifdef MAIN
|
2008-09-19 08:19:15 +00:00
|
|
|
wxSize g_User_Grid( 50, 50 );
|
|
|
|
int g_HVLines = 1; // Bool: force H or V directions (Wires, Bus ..)
|
2007-05-06 16:03:28 +00:00
|
|
|
#else
|
2008-09-19 08:19:15 +00:00
|
|
|
extern wxSize g_User_Grid;
|
|
|
|
extern int g_HVLines;
|
2007-05-06 16:03:28 +00:00
|
|
|
#endif
|
|
|
|
|
2008-09-19 08:19:15 +00:00
|
|
|
eda_global int g_PlotPSColorOpt; // True = plot postcript color (see plotps.cpp)
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
2008-09-19 08:19:15 +00:00
|
|
|
// Gestion de diverses variables, options... devant etre memorisees mais
|
2007-05-06 16:03:28 +00:00
|
|
|
// Remises a 0 lors d'un rechargement de projetc
|
|
|
|
struct EESchemaVariables
|
|
|
|
{
|
2008-09-19 08:19:15 +00:00
|
|
|
int NbErrorErc;
|
|
|
|
int NbWarningErc;
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
eda_global struct EESchemaVariables g_EESchemaVar;
|
|
|
|
|
2007-05-28 18:09:49 +00:00
|
|
|
/* Variables globales pour Libview */
|
2008-09-19 08:19:15 +00:00
|
|
|
eda_global wxString g_CurrentViewLibraryName; /* nom de la librairie en cours d'examen */
|
|
|
|
eda_global wxString g_CurrentViewComponentName; /* nom du le composant en cours d'examen */
|
|
|
|
eda_global int g_ViewConvert; /* Vue normal / convert */
|
|
|
|
eda_global int g_ViewUnit; /* part a afficher (A, B ..) */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-05-28 18:09:49 +00:00
|
|
|
/* Variables globales pour Schematic Edit */
|
2008-09-19 08:19:15 +00:00
|
|
|
eda_global int g_DefaultTextLabelSize
|
2007-05-28 18:09:49 +00:00
|
|
|
#ifdef MAIN
|
|
|
|
= DEFAULT_SIZE_TEXT
|
|
|
|
#endif
|
|
|
|
;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2007-05-28 18:09:49 +00:00
|
|
|
/* Variables globales pour LibEdit */
|
2007-05-06 16:03:28 +00:00
|
|
|
eda_global int g_LastTextSize
|
|
|
|
#ifdef MAIN
|
|
|
|
= DEFAULT_SIZE_TEXT
|
|
|
|
#endif
|
|
|
|
;
|
|
|
|
eda_global int g_LastTextOrient
|
|
|
|
#ifdef MAIN
|
|
|
|
= TEXT_ORIENT_HORIZ
|
|
|
|
#endif
|
|
|
|
;
|
|
|
|
|
|
|
|
eda_global bool g_FlDrawSpecificUnit
|
|
|
|
#ifdef MAIN
|
|
|
|
= FALSE
|
|
|
|
#endif
|
|
|
|
;
|
|
|
|
eda_global bool g_FlDrawSpecificConvert
|
|
|
|
#ifdef MAIN
|
|
|
|
= TRUE
|
|
|
|
#endif
|
|
|
|
;
|
|
|
|
|
2008-09-19 08:19:15 +00:00
|
|
|
/********************************************************/
|
|
|
|
/* Description des structures des parametres principaux */
|
|
|
|
/********************************************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-09-19 08:19:15 +00:00
|
|
|
/* Gestion des trace sur table tracante */
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-09-19 08:19:15 +00:00
|
|
|
eda_global int g_PlotFormat; /* flag = TYPE_HPGL, TYPE_PS... */
|
|
|
|
eda_global int g_PlotMargin; /* Marge pour traces du cartouche */
|
|
|
|
eda_global float g_PlotScaleX, g_PlotScaleY; /* coeff d'echelle de trace en unites table tracante */
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* For HPGL plotting: Pen caract : */
|
|
|
|
struct HPGL_Pen_Descr_Struct
|
|
|
|
{
|
2008-09-19 08:19:15 +00:00
|
|
|
int m_Pen_Num; /* num de plume a charger */
|
|
|
|
int m_Pen_Speed; /* vitesse en cm/s */
|
|
|
|
int m_Pen_Diam; /* Pen diameter in mils */
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
|
|
|
eda_global HPGL_Pen_Descr_Struct g_HPGL_Pen_Descr;
|
|
|
|
|
|
|
|
/* Ecrans usuels */
|
2008-09-19 08:19:15 +00:00
|
|
|
|
2008-02-12 21:12:46 +00:00
|
|
|
//eda_global SCH_SCREEN * ScreenSch;
|
2008-04-14 19:22:48 +00:00
|
|
|
eda_global DrawSheetStruct* g_RootSheet;
|
2008-09-19 08:19:15 +00:00
|
|
|
eda_global SCH_SCREEN* g_ScreenLib;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-09-19 08:19:15 +00:00
|
|
|
/*************************************/
|
|
|
|
/* Gestion de recherche des elements */
|
|
|
|
/*************************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
/* valeur de flag indicant si le pointeur de reference pour une localisation
|
2008-09-19 08:19:15 +00:00
|
|
|
* est le curseur sur grille ou le curseur a deplacement fin hors grille */
|
|
|
|
#define CURSEUR_ON_GRILLE 0
|
2007-05-06 16:03:28 +00:00
|
|
|
#define CURSEUR_OFF_GRILLE 1
|
|
|
|
|
|
|
|
/* Gestion des librairies schematiques */
|
2008-09-19 08:19:15 +00:00
|
|
|
eda_global wxString g_NetNameBuffer;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
#ifdef MAIN
|
2008-09-19 08:19:15 +00:00
|
|
|
wxString g_NetCmpExtBuffer( wxT( ".cmp" ) );
|
|
|
|
wxString g_SymbolExtBuffer( wxT( ".sym" ) );
|
|
|
|
wxString g_NetExtBuffer( wxT( ".net" ) );
|
|
|
|
wxString g_SchExtBuffer( wxT( ".sch" ) );
|
|
|
|
wxString g_LibExtBuffer( wxT( ".lib" ) );
|
2007-05-06 16:03:28 +00:00
|
|
|
#else
|
2008-09-19 08:19:15 +00:00
|
|
|
eda_global wxString g_NetCmpExtBuffer;
|
|
|
|
eda_global wxString g_SymbolExtBuffer;
|
|
|
|
eda_global wxString g_NetExtBuffer;
|
|
|
|
eda_global wxString g_SchExtBuffer;
|
|
|
|
eda_global wxString g_LibExtBuffer;
|
2007-05-06 16:03:28 +00:00
|
|
|
#endif
|
|
|
|
|
2008-09-19 08:19:15 +00:00
|
|
|
eda_global wxString g_SimulatorCommandLine; // ligne de commande pour l'appel au simulateur (gnucap, spice..)
|
|
|
|
eda_global wxString g_NetListerCommandLine; // ligne de commande pour l'appel au simulateur (gnucap, spice..)
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-09-19 08:19:15 +00:00
|
|
|
eda_global LayerStruct g_LayerDescr; /* couleurs des couches */
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-09-19 08:19:15 +00:00
|
|
|
eda_global bool g_EditPinByPinIsOn /* bool: TRUE si edition des pins pin a pin au lieu */
|
|
|
|
#ifdef MAIN /* de l'edition simultanee des pins de meme coordonnees */
|
|
|
|
= FALSE
|
2007-05-06 16:03:28 +00:00
|
|
|
#endif
|
|
|
|
;
|
|
|
|
|
2008-09-19 08:19:15 +00:00
|
|
|
eda_global int g_LibSymbolDefaultLineWidth; /* default line width (in EESCHEMA units) used when creating a new graphic item in libedit : 0 = default */
|
|
|
|
eda_global int g_DrawMinimunLineWidth; /* Minimum line (in EESCHEMA units) width used to draw items on screen; 0 = single pixel line width */
|
|
|
|
eda_global int g_PlotPSMinimunLineWidth; /* Minimum line (in EESCHEMA units) width used to Plot items , postscript format */
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-09-19 08:19:15 +00:00
|
|
|
eda_global int g_ItemSelectetColor // Color to draw selected items
|
2008-09-13 18:59:57 +00:00
|
|
|
#ifdef MAIN
|
2008-09-19 08:19:15 +00:00
|
|
|
= BROWN
|
2008-09-13 18:59:57 +00:00
|
|
|
#endif
|
|
|
|
;
|
|
|
|
|
2008-09-19 08:19:15 +00:00
|
|
|
eda_global int g_InvisibleItemColor // Color to draw items flagged invisible, in libedit (they are insisible in eeschema
|
|
|
|
#ifdef MAIN
|
|
|
|
= DARKGRAY
|
|
|
|
#endif
|
|
|
|
;
|
2008-09-13 18:59:57 +00:00
|
|
|
|
2007-05-28 18:09:49 +00:00
|
|
|
/* Config keys */
|
2008-09-19 08:19:15 +00:00
|
|
|
#define MINI_DRAW_LINE_WIDTH_KEY wxT( "MinimunDrawLineWidth" )
|
|
|
|
#define MINI_PLOTPS_LINE_WIDTH_KEY wxT( "MinimunPlotPSLineWidth" )
|
2008-02-26 01:07:38 +00:00
|
|
|
|
|
|
|
#endif // _GENERAL_H_
|