2007-08-24 15:10:46 +00:00
|
|
|
/********************************************/
|
|
|
|
/* Definitions for the EESchema program: */
|
|
|
|
/********************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#ifndef PROGRAM_H
|
|
|
|
#define PROGRAM_H
|
|
|
|
|
|
|
|
#ifndef eda_global
|
|
|
|
#define eda_global extern
|
|
|
|
#endif
|
|
|
|
|
2008-04-14 19:22:48 +00:00
|
|
|
#include "wxEeschemaStruct.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
#include "macros.h"
|
|
|
|
#include "base_struct.h"
|
2008-04-14 19:22:48 +00:00
|
|
|
#include "sch_item_struct.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#include "component_class.h"
|
|
|
|
#include "class_screen.h"
|
2008-04-12 18:39:20 +00:00
|
|
|
#include "class_drawsheet.h"
|
2008-02-20 19:37:17 +00:00
|
|
|
#include "class_text-label.h"
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-24 15:10:46 +00:00
|
|
|
#define DRAWJUNCTION_SIZE 16 /* Rayon du symbole connexion */
|
|
|
|
#define DRAWMARKER_SIZE 16 /* Rayon du symbole marqueur */
|
|
|
|
#define DRAWNOCONNECT_SIZE 48 /* Rayon du symbole No Connexion */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#define HIGHLIGHT_COLOR WHITE
|
|
|
|
|
|
|
|
|
|
|
|
#define TEXT_NO_VISIBLE 1
|
|
|
|
|
|
|
|
/* flags pour BUS ENTRY (bus to bus ou wire to bus */
|
|
|
|
#define WIRE_TO_BUS 0
|
2007-08-24 15:10:46 +00:00
|
|
|
#define BUS_TO_BUS 1
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
2007-08-24 15:10:46 +00:00
|
|
|
typedef enum { /* Type des Marqueurs */
|
|
|
|
MARQ_UNSPEC,
|
|
|
|
MARQ_ERC,
|
|
|
|
MARQ_PCB,
|
|
|
|
MARQ_SIMUL,
|
|
|
|
MARQ_NMAX /* Derniere valeur: fin de tableau */
|
2007-06-05 12:10:51 +00:00
|
|
|
} TypeMarker;
|
|
|
|
|
|
|
|
/* Messages correspondants aux types des marqueurs */
|
|
|
|
#ifdef MAIN
|
2007-08-24 15:10:46 +00:00
|
|
|
const wxChar* NameMarqueurType[] =
|
|
|
|
{
|
|
|
|
wxT( "" ),
|
|
|
|
wxT( "ERC" ),
|
|
|
|
wxT( "PCB" ),
|
|
|
|
wxT( "SIMUL" ),
|
|
|
|
wxT( "?????" )
|
|
|
|
};
|
2007-06-05 12:10:51 +00:00
|
|
|
#else
|
2007-08-24 15:10:46 +00:00
|
|
|
extern const wxChar* NameMarqueurType[];
|
2007-06-05 12:10:51 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* Forward declarations */
|
|
|
|
class DrawSheetStruct;
|
|
|
|
|
2007-08-24 15:10:46 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class EDA_DrawLineStruct
|
|
|
|
* is a segment decription base class to describe items which have 2 end
|
|
|
|
* points (track, wire, draw line ...)
|
|
|
|
*/
|
2008-04-14 19:22:48 +00:00
|
|
|
class EDA_DrawLineStruct : public SCH_ITEM
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
int m_Width; // 0 = line, > 0 = tracks, bus ...
|
|
|
|
wxPoint m_Start; // Line start point
|
|
|
|
wxPoint m_End; // Line end point
|
|
|
|
|
|
|
|
bool m_StartIsDangling;
|
|
|
|
bool m_EndIsDangling; // TRUE si Start ou End not connected (wires, tracks...)
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
public:
|
2007-09-13 11:28:58 +00:00
|
|
|
EDA_DrawLineStruct( const wxPoint& pos, int layer );
|
2007-09-01 12:00:30 +00:00
|
|
|
~EDA_DrawLineStruct() { }
|
2008-03-13 05:04:59 +00:00
|
|
|
|
2007-09-13 11:28:58 +00:00
|
|
|
virtual wxString GetClass() const
|
|
|
|
{
|
2007-09-20 21:06:49 +00:00
|
|
|
return wxT( "EDA_DrawLine" );
|
2007-09-13 11:28:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-08-24 15:10:46 +00:00
|
|
|
bool IsOneEndPointAt( const wxPoint& pos );
|
2007-09-01 12:00:30 +00:00
|
|
|
EDA_DrawLineStruct* GenCopy();
|
2007-08-24 15:10:46 +00:00
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
bool IsNull()
|
2007-08-24 15:10:46 +00:00
|
|
|
{
|
|
|
|
return m_Start == m_End;
|
|
|
|
}
|
|
|
|
|
2008-03-15 04:18:32 +00:00
|
|
|
EDA_Rect GetBoundingBox();
|
2008-03-13 05:04:59 +00:00
|
|
|
|
2007-08-24 15:10:46 +00:00
|
|
|
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode,
|
|
|
|
int Color = -1 );
|
2008-03-13 05:04:59 +00:00
|
|
|
|
2008-04-15 19:38:19 +00:00
|
|
|
/**
|
|
|
|
* Function Save
|
|
|
|
* writes the data structures for this object out to a FILE in "*.brd" format.
|
|
|
|
* @param aFile The FILE to write to.
|
|
|
|
* @return bool - true if success writing else false.
|
|
|
|
*/
|
|
|
|
bool Save( FILE* aFile ) const;
|
|
|
|
|
2008-03-13 05:04:59 +00:00
|
|
|
#if defined(DEBUG)
|
2007-09-20 21:06:49 +00:00
|
|
|
/**
|
|
|
|
* Function Show
|
|
|
|
* is used to output the object tree, currently for debugging only.
|
2008-03-13 05:04:59 +00:00
|
|
|
* @param nestLevel An aid to prettier tree indenting, and is the level
|
2007-09-20 21:06:49 +00:00
|
|
|
* of nesting of this object within the overall tree.
|
|
|
|
* @param os The ostream& to output to.
|
|
|
|
*/
|
|
|
|
void Show( int nestLevel, std::ostream& os );
|
2008-03-13 05:04:59 +00:00
|
|
|
#endif
|
2007-06-05 12:10:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-04-14 19:22:48 +00:00
|
|
|
class DrawMarkerStruct : public SCH_ITEM /* marqueurs */
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
wxPoint m_Pos; /* XY coordinates of marker. */
|
|
|
|
TypeMarker m_Type;
|
|
|
|
int m_MarkFlags; // complements d'information
|
|
|
|
wxString m_Comment; /* Texte (commentaireassocie eventuel */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
public:
|
2007-09-13 11:28:58 +00:00
|
|
|
DrawMarkerStruct( const wxPoint& pos, const wxString& text );
|
2007-09-01 12:00:30 +00:00
|
|
|
~DrawMarkerStruct();
|
2007-09-13 11:28:58 +00:00
|
|
|
virtual wxString GetClass() const
|
|
|
|
{
|
2007-09-20 21:06:49 +00:00
|
|
|
return wxT( "DrawMarker" );
|
2007-09-13 11:28:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
DrawMarkerStruct* GenCopy();
|
|
|
|
wxString GetComment();
|
2007-08-24 15:10:46 +00:00
|
|
|
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
|
|
|
|
int draw_mode, int Color = -1 );
|
2008-04-15 19:38:19 +00:00
|
|
|
/**
|
|
|
|
* Function Save
|
|
|
|
* writes the data structures for this object out to a FILE in "*.brd" format.
|
|
|
|
* @param aFile The FILE to write to.
|
|
|
|
* @return bool - true if success writing else false.
|
|
|
|
*/
|
|
|
|
bool Save( FILE* aFile ) const;
|
|
|
|
|
2008-03-13 05:04:59 +00:00
|
|
|
#if defined(DEBUG)
|
2007-09-20 21:06:49 +00:00
|
|
|
/**
|
|
|
|
* Function Show
|
|
|
|
* is used to output the object tree, currently for debugging only.
|
2008-03-13 05:04:59 +00:00
|
|
|
* @param nestLevel An aid to prettier tree indenting, and is the level
|
2007-09-20 21:06:49 +00:00
|
|
|
* of nesting of this object within the overall tree.
|
|
|
|
* @param os The ostream& to output to.
|
|
|
|
*/
|
|
|
|
void Show( int nestLevel, std::ostream& os );
|
2008-03-13 05:04:59 +00:00
|
|
|
#endif
|
2007-06-05 12:10:51 +00:00
|
|
|
};
|
|
|
|
|
2007-08-24 15:10:46 +00:00
|
|
|
|
2008-04-14 19:22:48 +00:00
|
|
|
class DrawNoConnectStruct : public SCH_ITEM /* Symboles de non connexion */
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
wxPoint m_Pos; /* XY coordinates of NoConnect. */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
public:
|
2007-09-13 11:28:58 +00:00
|
|
|
DrawNoConnectStruct( const wxPoint& pos );
|
2007-09-01 12:00:30 +00:00
|
|
|
~DrawNoConnectStruct() { }
|
2007-09-13 11:28:58 +00:00
|
|
|
virtual wxString GetClass() const
|
|
|
|
{
|
2007-09-20 21:06:49 +00:00
|
|
|
return wxT( "DrawNoConnect" );
|
2007-09-13 11:28:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
DrawNoConnectStruct* GenCopy();
|
2007-08-24 15:10:46 +00:00
|
|
|
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
|
|
|
|
int draw_mode, int Color = -1 );
|
2008-04-15 19:38:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Save
|
|
|
|
* writes the data structures for this object out to a FILE in "*.brd" format.
|
|
|
|
* @param aFile The FILE to write to.
|
|
|
|
* @return bool - true if success writing else false.
|
|
|
|
*/
|
|
|
|
bool Save( FILE* aFile ) const;
|
|
|
|
|
2008-03-30 11:57:40 +00:00
|
|
|
EDA_Rect GetBoundingBox();
|
2007-06-05 12:10:51 +00:00
|
|
|
};
|
|
|
|
|
2007-08-24 15:10:46 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class DrawBusEntryStruct
|
2007-09-13 11:28:58 +00:00
|
|
|
* Struct de descr 1 raccord a 45 degres de BUS ou WIRE
|
2007-08-24 15:10:46 +00:00
|
|
|
*/
|
2008-04-14 19:22:48 +00:00
|
|
|
class DrawBusEntryStruct : public SCH_ITEM
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
int m_Width;
|
|
|
|
wxPoint m_Pos;
|
|
|
|
wxSize m_Size;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
public:
|
2007-09-13 11:28:58 +00:00
|
|
|
DrawBusEntryStruct( const wxPoint& pos, int shape, int id );
|
2007-09-01 12:00:30 +00:00
|
|
|
~DrawBusEntryStruct() { }
|
2008-03-13 05:04:59 +00:00
|
|
|
|
2007-09-13 11:28:58 +00:00
|
|
|
virtual wxString GetClass() const
|
|
|
|
{
|
2007-09-20 21:06:49 +00:00
|
|
|
return wxT( "DrawBusEntry" );
|
2007-09-13 11:28:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
DrawBusEntryStruct* GenCopy();
|
2008-04-15 19:38:19 +00:00
|
|
|
wxPoint m_End() const ; // retourne la coord de fin du raccord
|
2007-08-24 15:10:46 +00:00
|
|
|
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
|
|
|
|
int draw_mode, int Color = -1 );
|
2008-04-15 19:38:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Save
|
|
|
|
* writes the data structures for this object out to a FILE in "*.brd" format.
|
|
|
|
* @param aFile The FILE to write to.
|
|
|
|
* @return bool - true if success writing else false.
|
|
|
|
*/
|
|
|
|
bool Save( FILE* aFile ) const;
|
|
|
|
|
2008-03-30 11:57:40 +00:00
|
|
|
EDA_Rect GetBoundingBox();
|
2007-06-05 12:10:51 +00:00
|
|
|
};
|
|
|
|
|
2008-04-14 19:22:48 +00:00
|
|
|
class DrawPolylineStruct : public SCH_ITEM /* Polyligne (serie de segments) */
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
int m_Width;
|
|
|
|
int m_NumOfPoints; /* Number of XY pairs in Points array. */
|
|
|
|
int* m_Points; /* XY pairs that forms the polyline. */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
DrawPolylineStruct( int layer );
|
2007-09-01 12:00:30 +00:00
|
|
|
~DrawPolylineStruct();
|
2008-03-13 05:04:59 +00:00
|
|
|
|
2007-09-13 11:28:58 +00:00
|
|
|
virtual wxString GetClass() const
|
|
|
|
{
|
2007-09-20 21:06:49 +00:00
|
|
|
return wxT( "DrawPolyline" );
|
2007-09-13 11:28:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
DrawPolylineStruct* GenCopy();
|
2007-08-24 15:10:46 +00:00
|
|
|
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
|
|
|
|
int draw_mode, int Color = -1 );
|
2008-04-15 19:38:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Save
|
|
|
|
* writes the data structures for this object out to a FILE in "*.brd" format.
|
|
|
|
* @param aFile The FILE to write to.
|
|
|
|
* @return bool - true if success writing else false.
|
|
|
|
*/
|
|
|
|
bool Save( FILE* aFile ) const;
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
};
|
|
|
|
|
2008-04-14 19:22:48 +00:00
|
|
|
class DrawJunctionStruct : public SCH_ITEM
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
wxPoint m_Pos; /* XY coordinates of connection. */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
public:
|
2007-09-13 11:28:58 +00:00
|
|
|
DrawJunctionStruct( const wxPoint& pos );
|
2007-09-01 12:00:30 +00:00
|
|
|
~DrawJunctionStruct() { }
|
2008-03-13 05:04:59 +00:00
|
|
|
|
2007-09-13 11:28:58 +00:00
|
|
|
virtual wxString GetClass() const
|
|
|
|
{
|
2007-09-20 21:06:49 +00:00
|
|
|
return wxT( "DrawJunction" );
|
2007-09-13 11:28:58 +00:00
|
|
|
}
|
|
|
|
|
2008-03-15 04:18:32 +00:00
|
|
|
EDA_Rect GetBoundingBox();
|
2007-09-13 11:28:58 +00:00
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
DrawJunctionStruct* GenCopy();
|
2007-08-24 15:10:46 +00:00
|
|
|
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
|
|
|
|
int draw_mode, int Color = -1 );
|
2008-04-15 19:38:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function Save
|
|
|
|
* writes the data structures for this object out to a FILE in "*.brd" format.
|
|
|
|
* @param aFile The FILE to write to.
|
|
|
|
* @return bool - true if success writing else false.
|
|
|
|
*/
|
|
|
|
bool Save( FILE* aFile ) const;
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
};
|
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#define MAX_LAYERS 44
|
|
|
|
class LayerStruct
|
|
|
|
{
|
|
|
|
public:
|
2007-08-24 15:10:46 +00:00
|
|
|
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;
|
2007-06-05 12:10:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* PROGRAM_H */
|