2011-10-07 14:41:30 +00:00
|
|
|
/**
|
|
|
|
* @file general.h
|
|
|
|
*/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2008-02-26 01:07:38 +00:00
|
|
|
#ifndef _GENERAL_H_
|
|
|
|
#define _GENERAL_H_
|
|
|
|
|
2010-10-08 20:40:57 +00:00
|
|
|
#include <wx/string.h>
|
|
|
|
#include <wx/gdicmn.h>
|
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <block_commande.h>
|
|
|
|
#include <class_netlist_object.h>
|
2010-10-08 20:40:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
class SCH_ITEM;
|
|
|
|
class SCH_SHEET;
|
2010-11-10 15:30:12 +00:00
|
|
|
class TRANSFORM;
|
|
|
|
|
2007-05-06 16:03:28 +00:00
|
|
|
|
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
|
|
|
|
2010-06-10 18:43:12 +00:00
|
|
|
// Define the char buffer size used to read library files
|
|
|
|
#define LINE_BUFFER_LEN_LARGE 8000
|
|
|
|
#define LINE_BUFFER_LEN 1024
|
|
|
|
|
2008-09-19 08:19:15 +00:00
|
|
|
#define MAX_PIN_INFO 10
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2010-11-10 15:30:12 +00:00
|
|
|
#define TXTMARGE 10 // Offset in mils for placement of labels and pin numbers.
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
#define HIGHLIGHT_COLOR WHITE
|
|
|
|
|
|
|
|
//#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
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
extern wxString g_DefaultSchematicFileName;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
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,
|
2010-12-02 21:41:56 +00:00
|
|
|
LAYER_GRID,
|
2008-09-19 08:19:15 +00:00
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
MAX_LAYER /* Maximum layers */
|
2008-09-19 08:19:15 +00:00
|
|
|
} LayerNumber;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-11-04 20:46:53 +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;
|
|
|
|
|
|
|
|
|
2010-11-10 15:30:12 +00:00
|
|
|
/* Rotation, mirror of graphic items in components bodies are handled by a
|
|
|
|
* transform matrix. The default matix is useful to draw lib entries with
|
|
|
|
* a defualt matix ( no rotation, no mirror but Y axis is bottom to top, and
|
|
|
|
* Y draw axis is to to bottom so we must have a default matix that reverses
|
|
|
|
* the Y coordinate and keeps the X coordiate
|
|
|
|
*/
|
|
|
|
extern TRANSFORM DefaultTransform;
|
|
|
|
|
|
|
|
#define MIN_BUSLINES_THICKNESS 12 // min bus lines and entries thickness
|
|
|
|
|
|
|
|
#define MAX_LAYERS 44
|
|
|
|
|
|
|
|
class LayerStruct
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
char LayerNames[MAX_LAYERS + 1][8];
|
|
|
|
int LayerColor[MAX_LAYERS + 1];
|
|
|
|
char LayerStatus[MAX_LAYERS + 1];
|
|
|
|
int NumberOfLayers;
|
|
|
|
int CurrentLayer;
|
|
|
|
int CurrentWidth;
|
|
|
|
int CommonColor;
|
|
|
|
int Flags;
|
|
|
|
};
|
|
|
|
|
2011-04-05 14:46:51 +00:00
|
|
|
extern wxSize g_RepeatStep;
|
|
|
|
extern int g_RepeatDeltaLabel;
|
2008-09-19 08:19:15 +00:00
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
// Management options.
|
2011-04-05 14:46:51 +00:00
|
|
|
extern bool g_HVLines;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
extern struct EESchemaVariables g_EESchemaVar;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-04-05 20:49:15 +00:00
|
|
|
extern int g_DefaultTextLabelSize;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
struct HPGL_Pen_Descr_Struct
|
|
|
|
{
|
2009-11-04 20:46:53 +00:00
|
|
|
int m_Pen_Num; /* Pen number */
|
|
|
|
int m_Pen_Speed; /* Pen speed in cm/s */
|
2008-09-19 08:19:15 +00:00
|
|
|
int m_Pen_Diam; /* Pen diameter in mils */
|
2007-05-06 16:03:28 +00:00
|
|
|
};
|
2009-04-05 20:49:15 +00:00
|
|
|
extern HPGL_Pen_Descr_Struct g_HPGL_Pen_Descr;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-06-02 07:26:49 +00:00
|
|
|
/* First and main (root) screen */
|
2009-11-04 20:46:53 +00:00
|
|
|
extern SCH_SHEET* g_RootSheet;
|
2007-05-06 16:03:28 +00:00
|
|
|
|
2009-06-02 07:26:49 +00:00
|
|
|
extern wxString g_NetCmpExtBuffer;
|
2009-09-04 18:57:37 +00:00
|
|
|
|
|
|
|
extern const wxString SymbolFileExtension;
|
|
|
|
extern const wxString SymbolFileWildcard;
|
2009-04-05 20:49:15 +00:00
|
|
|
|
|
|
|
extern const wxString CompLibFileExtension;
|
|
|
|
extern const wxString CompLibFileWildcard;
|
|
|
|
|
2011-10-15 13:25:57 +00:00
|
|
|
extern const wxString g_SchematicBackupFileExtension;
|
|
|
|
|
2009-11-04 20:46:53 +00:00
|
|
|
extern LayerStruct g_LayerDescr;
|
2009-04-05 20:49:15 +00:00
|
|
|
|
2012-04-05 18:27:56 +00:00
|
|
|
/// True to prevent displacing pins, when they are at the same position.
|
|
|
|
extern bool g_EditPinByPinIsOn;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Default line (in Eeschema units) thickness used to draw/plot items having a
|
|
|
|
* default thickness line value (i.e. = 0 ).
|
|
|
|
* 0 = single pixel line width.
|
|
|
|
*/
|
|
|
|
extern int g_DrawDefaultLineThickness;
|
|
|
|
|
|
|
|
|
|
|
|
/// Color to draw selected items
|
2009-04-05 20:49:15 +00:00
|
|
|
extern int g_ItemSelectetColor;
|
2009-06-02 07:26:49 +00:00
|
|
|
|
2012-04-05 18:27:56 +00:00
|
|
|
/// Color to draw items flagged invisible, in libedit (they are invisible in Eeschema
|
2009-04-05 20:49:15 +00:00
|
|
|
extern int g_InvisibleItemColor;
|
2008-09-13 18:59:57 +00:00
|
|
|
|
2010-12-31 19:47:39 +00:00
|
|
|
/* Global Variables */
|
|
|
|
|
|
|
|
extern NETLIST_OBJECT_LIST g_NetObjectslist;
|
|
|
|
|
2011-10-07 14:41:30 +00:00
|
|
|
extern bool g_OptNetListUseNames; /* true to use names rather than
|
2010-12-31 19:47:39 +00:00
|
|
|
* net numbers. SPICE netlist only
|
|
|
|
*/
|
|
|
|
|
2008-02-26 01:07:38 +00:00
|
|
|
#endif // _GENERAL_H_
|