2008-12-14 19:45:05 +00:00
|
|
|
/*************************************************/
|
|
|
|
/* classe EQUIPOT: Class to handle info on nets */
|
|
|
|
/*************************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-23 04:28:46 +00:00
|
|
|
class EQUIPOT : public BOARD_ITEM
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-10-13 06:18:44 +00:00
|
|
|
private:
|
2008-12-14 19:45:05 +00:00
|
|
|
int m_NetCode; // this is a number equivalent to the net name
|
|
|
|
// Used for fast comparisons in rastnest and DRC computations.
|
|
|
|
wxString m_Netname; // Full net name like /mysheet/mysubsheet/vout used by eeschema
|
|
|
|
wxString m_ShortNetname; // short net name, like vout from /mysheet/mysubsheet/vout
|
2007-10-13 06:18:44 +00:00
|
|
|
|
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
public:
|
2007-08-09 01:41:30 +00:00
|
|
|
int status; // no route, hight light...
|
2008-12-14 19:45:05 +00:00
|
|
|
int m_NbNodes; // Pads count for this net
|
|
|
|
int m_NbLink; // Ratsnets count for this net
|
|
|
|
int m_NbNoconn; // Ratsnets remaining to route count
|
2007-08-09 01:41:30 +00:00
|
|
|
int m_Masque_Layer; // couches interdites (bit 0 = layer 0...)
|
|
|
|
int m_Masque_Plan; // couches mises en plan de cuivre
|
|
|
|
int m_ForceWidth; // specific width (O = default width)
|
|
|
|
LISTE_PAD* m_PadzoneStart; // pointeur sur debut de liste pads du net
|
|
|
|
LISTE_PAD* m_PadzoneEnd; // pointeur sur fin de liste pads du net
|
|
|
|
CHEVELU* m_RatsnestStart; // pointeur sur debut de liste ratsnests du net
|
|
|
|
CHEVELU* m_RatsnestEnd; // pointeur sur fin de liste ratsnests du net
|
|
|
|
|
2008-12-04 04:28:11 +00:00
|
|
|
EQUIPOT( BOARD_ITEM* aParent );
|
2007-08-23 04:28:46 +00:00
|
|
|
~EQUIPOT();
|
2007-08-09 01:41:30 +00:00
|
|
|
|
2008-11-24 06:53:43 +00:00
|
|
|
EQUIPOT* Next() const { return (EQUIPOT*) Pnext; }
|
|
|
|
EQUIPOT* Back() const { return (EQUIPOT*) Pback; }
|
2007-12-01 03:42:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function GetPosition
|
|
|
|
* returns the position of this object.
|
2008-04-01 06:07:00 +00:00
|
|
|
* @return wxPoint& - The position of this object, non-const so it
|
2007-12-01 03:42:52 +00:00
|
|
|
* can be changed
|
|
|
|
* A dummy to satisfy pure virtual BOARD::GetPosition()
|
|
|
|
*/
|
|
|
|
wxPoint& GetPosition();
|
2008-04-01 06:07:00 +00:00
|
|
|
|
2007-08-09 01:41:30 +00:00
|
|
|
/* Readind and writing data on files */
|
2008-12-14 19:45:05 +00:00
|
|
|
int ReadDescr( FILE* File, int* LineNum );
|
2007-08-09 01:41:30 +00:00
|
|
|
|
2007-10-30 21:30:58 +00:00
|
|
|
/**
|
|
|
|
* Function Save
|
2007-10-31 14:14:21 +00:00
|
|
|
* writes the data structures for this object out to a FILE in "*.brd" format.
|
2007-10-30 21:30:58 +00:00
|
|
|
* @param aFile The FILE to write to.
|
|
|
|
* @return bool - true if success writing else false.
|
2008-04-01 06:07:00 +00:00
|
|
|
*/
|
2007-10-30 21:30:58 +00:00
|
|
|
bool Save( FILE* aFile ) const;
|
2008-04-01 06:07:00 +00:00
|
|
|
|
|
|
|
|
2008-12-14 19:45:05 +00:00
|
|
|
/** function Draw
|
|
|
|
* @todo we actually could show a NET, simply show all the tracks and pads or net name on pad and vias
|
|
|
|
*/
|
2008-04-01 06:07:00 +00:00
|
|
|
void Draw( WinEDA_DrawPanel* panel, wxDC* DC,
|
2008-12-14 19:45:05 +00:00
|
|
|
int aDrawMode, const wxPoint& offset = ZeroOffset );
|
2008-04-01 06:07:00 +00:00
|
|
|
|
|
|
|
|
2007-10-13 06:18:44 +00:00
|
|
|
/**
|
|
|
|
* Function GetNet
|
|
|
|
* @return int - the netcode
|
|
|
|
*/
|
|
|
|
int GetNet() const { return m_NetCode; }
|
|
|
|
void SetNet( int aNetCode ) { m_NetCode = aNetCode; }
|
2008-04-01 06:07:00 +00:00
|
|
|
|
2008-12-14 19:45:05 +00:00
|
|
|
/**
|
|
|
|
* Function GetNetname
|
|
|
|
* @return const wxString * , a pointer to the full netname
|
|
|
|
*/
|
|
|
|
wxString GetNetname() const { return m_Netname; }
|
|
|
|
/**
|
|
|
|
* Function GetShortNetname
|
|
|
|
* @return const wxString * , a pointer to the short netname
|
|
|
|
*/
|
|
|
|
wxString GetShortNetname() const { return m_ShortNetname; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function SetNetname
|
|
|
|
* @param const wxString : the new netname
|
|
|
|
*/
|
|
|
|
void SetNetname( const wxString & aNetname );
|
|
|
|
|
2008-04-01 06:07:00 +00:00
|
|
|
|
2007-08-09 01:41:30 +00:00
|
|
|
/**
|
|
|
|
* Function GetClass
|
|
|
|
* returns the class name.
|
|
|
|
* @return wxString
|
|
|
|
*/
|
|
|
|
wxString GetClass() const
|
|
|
|
{
|
|
|
|
return wxT("NET");
|
|
|
|
}
|
|
|
|
|
2008-04-01 06:07:00 +00:00
|
|
|
|
2007-09-13 11:28:58 +00:00
|
|
|
#if defined(DEBUG)
|
2007-08-09 01:41:30 +00:00
|
|
|
/**
|
|
|
|
* Function Show
|
|
|
|
* is used to output the object tree, currently for debugging only.
|
2008-04-01 06:07:00 +00:00
|
|
|
* @param nestLevel An aid to prettier tree indenting, and is the level
|
2007-08-09 01:41:30 +00:00
|
|
|
* of nesting of this object within the overall tree.
|
|
|
|
* @param os The ostream& to output to.
|
|
|
|
*/
|
|
|
|
virtual void Show( int nestLevel, std::ostream& os );
|
|
|
|
#endif
|
2008-04-01 06:07:00 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
};
|
2007-12-29 19:15:58 +00:00
|
|
|
|