Commit fe284db0 authored by raburton's avatar raburton

set eol-style native on new files

parent bffa0689
This diff is collapsed.
/*************************************************/ /*************************************************/
/* class_drc_item.cpp - DRC_ITEM class functions */ /* class_drc_item.cpp - DRC_ITEM class functions */
/*************************************************/ /*************************************************/
#include "fctsys.h" #include "fctsys.h"
#include "common.h" #include "common.h"
#include "pcbnew.h" #include "pcbnew.h"
wxString DRC_ITEM::GetErrorText() const wxString DRC_ITEM::GetErrorText() const
{ {
switch( m_ErrorCode ) switch( m_ErrorCode )
{ {
// case DRCE_: not assigned yet // case DRCE_: not assigned yet
case DRCE_UNCONNECTED_PADS: case DRCE_UNCONNECTED_PADS:
return wxString( _("Unconnected pads") ); return wxString( _("Unconnected pads") );
case DRCE_TRACK_NEAR_THROUGH_HOLE: case DRCE_TRACK_NEAR_THROUGH_HOLE:
return wxString( _("Track near thru-hole") ); return wxString( _("Track near thru-hole") );
case DRCE_TRACK_NEAR_PAD: case DRCE_TRACK_NEAR_PAD:
return wxString( _("Track near pad") ); return wxString( _("Track near pad") );
case DRCE_TRACK_NEAR_VIA: case DRCE_TRACK_NEAR_VIA:
return wxString( _("Track near via") ); return wxString( _("Track near via") );
case DRCE_VIA_NEAR_VIA: case DRCE_VIA_NEAR_VIA:
return wxString( _("Via near via") ); return wxString( _("Via near via") );
case DRCE_VIA_NEAR_TRACK: case DRCE_VIA_NEAR_TRACK:
return wxString( _("Via near track") ); return wxString( _("Via near track") );
case DRCE_TRACK_ENDS1: case DRCE_TRACK_ENDS1:
case DRCE_TRACK_ENDS2: case DRCE_TRACK_ENDS2:
case DRCE_TRACK_ENDS3: case DRCE_TRACK_ENDS3:
case DRCE_TRACK_ENDS4: case DRCE_TRACK_ENDS4:
case DRCE_ENDS_PROBLEM1: case DRCE_ENDS_PROBLEM1:
case DRCE_ENDS_PROBLEM2: case DRCE_ENDS_PROBLEM2:
case DRCE_ENDS_PROBLEM3: case DRCE_ENDS_PROBLEM3:
case DRCE_ENDS_PROBLEM4: case DRCE_ENDS_PROBLEM4:
case DRCE_ENDS_PROBLEM5: case DRCE_ENDS_PROBLEM5:
return wxString( _("Two track ends") ); return wxString( _("Two track ends") );
case DRCE_TRACK_UNKNOWN1: case DRCE_TRACK_UNKNOWN1:
return wxString( _("This looks bad") ); ///< @todo check source code and change this comment return wxString( _("This looks bad") ); ///< @todo check source code and change this comment
case DRCE_TRACKS_CROSSING: case DRCE_TRACKS_CROSSING:
return wxString( _("Tracks crossing") ); return wxString( _("Tracks crossing") );
case DRCE_PAD_NEAR_PAD1: case DRCE_PAD_NEAR_PAD1:
return wxString( _("Pad near pad") ); return wxString( _("Pad near pad") );
case DRCE_VIA_HOLE_BIGGER: case DRCE_VIA_HOLE_BIGGER:
return wxString( _("Via hole > diameter")); return wxString( _("Via hole > diameter"));
default: default:
return wxString( wxT("PROGRAM BUG, PLEASE LEAVE THE ROOM.") ); return wxString( wxT("PROGRAM BUG, PLEASE LEAVE THE ROOM.") );
} }
} }
wxString DRC_ITEM::ShowCoord( const wxPoint& aPos ) wxString DRC_ITEM::ShowCoord( const wxPoint& aPos )
{ {
wxString temp; wxString temp;
wxString ret; wxString ret;
ret << wxT("@(") << valeur_param( aPos.x, temp ); ret << wxT("@(") << valeur_param( aPos.x, temp );
ret << wxT(",") << valeur_param( aPos.y, temp ); ret << wxT(",") << valeur_param( aPos.y, temp );
ret << wxT(")"); ret << wxT(")");
return ret; return ret;
} }
/**********************************/ /**********************************/
/* classes to handle copper zones */ /* classes to handle copper zones */
/**********************************/ /**********************************/
#include "fctsys.h" #include "fctsys.h"
#include "wxstruct.h" #include "wxstruct.h"
#include "gr_basic.h" #include "gr_basic.h"
#include "common.h" #include "common.h"
#include "pcbnew.h" #include "pcbnew.h"
/************************/ /************************/
/* class ZONE_CONTAINER */ /* class ZONE_CONTAINER */
/************************/ /************************/
ZONE_CONTAINER::ZONE_CONTAINER (BOARD * parent): ZONE_CONTAINER::ZONE_CONTAINER (BOARD * parent):
BOARD_ITEM (parent, TYPEZONE_CONTAINER) BOARD_ITEM (parent, TYPEZONE_CONTAINER)
{ {
m_NetCode = -1; // Net number for fast comparisons m_NetCode = -1; // Net number for fast comparisons
} }
ZONE_CONTAINER::~ZONE_CONTAINER() ZONE_CONTAINER::~ZONE_CONTAINER()
{ {
} }
bool ZONE_CONTAINER::Save( FILE* aFile ) const bool ZONE_CONTAINER::Save( FILE* aFile ) const
{ {
return true; return true;
} }
/**********************/ /**********************/
/* Class EDGE_ZONE */ /* Class EDGE_ZONE */
/**********************/ /**********************/
/* Constructor */ /* Constructor */
EDGE_ZONE::EDGE_ZONE( BOARD_ITEM* parent ) : EDGE_ZONE::EDGE_ZONE( BOARD_ITEM* parent ) :
DRAWSEGMENT( parent, TYPEEDGEZONE ) DRAWSEGMENT( parent, TYPEEDGEZONE )
{ {
m_Width = 2; // a minimum for visibility, while dragging m_Width = 2; // a minimum for visibility, while dragging
} }
/* Destructor */ /* Destructor */
EDGE_ZONE:: ~EDGE_ZONE() EDGE_ZONE:: ~EDGE_ZONE()
{ {
} }
bool EDGE_ZONE::Save( FILE* aFile ) const bool EDGE_ZONE::Save( FILE* aFile ) const
{ {
if( GetState( DELETED ) ) if( GetState( DELETED ) )
return true; return true;
int ret = fprintf( aFile, "ZE %d %d %d %d %d %lX %X\n", int ret = fprintf( aFile, "ZE %d %d %d %d %d %lX %X\n",
m_Start.x, m_Start.y, m_Start.x, m_Start.y,
m_End.x, m_End.y, m_End.x, m_End.y,
m_Angle, m_Angle,
m_TimeStamp, m_TimeStamp,
ReturnStatus() ReturnStatus()
); );
return (ret > 14 ); return (ret > 14 );
} }
/**********************************/ /**********************************/
/* classes to handle copper zones */ /* classes to handle copper zones */
/**********************************/ /**********************************/
#ifndef CLASS_ZONE_H #ifndef CLASS_ZONE_H
#define CLASS_ZONE_H #define CLASS_ZONE_H
/************************/ /************************/
/* class ZONE_CONTAINER */ /* class ZONE_CONTAINER */
/************************/ /************************/
/* handle a list of polygons delimiting a copper zone /* handle a list of polygons delimiting a copper zone
* a zone is described by a main polygon, a time stamp, a layer and a net name. * a zone is described by a main polygon, a time stamp, a layer and a net name.
* others polygons inside this main polygon are holes. * others polygons inside this main polygon are holes.
*/ */
class ZONE_CONTAINER : public BOARD_ITEM // Not sure BOARD_ITEM is better than EDA_BaseStruct class ZONE_CONTAINER : public BOARD_ITEM // Not sure BOARD_ITEM is better than EDA_BaseStruct
{ {
public: public:
wxString m_Netname; /* Net Name */ wxString m_Netname; /* Net Name */
private: private:
int m_NetCode; // Net number for fast comparisons int m_NetCode; // Net number for fast comparisons
public: public:
ZONE_CONTAINER(BOARD * parent); ZONE_CONTAINER(BOARD * parent);
~ZONE_CONTAINER(); ~ZONE_CONTAINER();
bool Save( FILE* aFile ) const; bool Save( FILE* aFile ) const;
}; };
/*******************/ /*******************/
/* class EDGE_ZONE */ /* class EDGE_ZONE */
/*******************/ /*******************/
class EDGE_ZONE : public DRAWSEGMENT class EDGE_ZONE : public DRAWSEGMENT
{ {
public: public:
EDGE_ZONE( BOARD_ITEM* StructFather ); EDGE_ZONE( BOARD_ITEM* StructFather );
EDGE_ZONE( const EDGE_ZONE& edgezone ); EDGE_ZONE( const EDGE_ZONE& edgezone );
~EDGE_ZONE(); ~EDGE_ZONE();
EDGE_ZONE* Next() { return (EDGE_ZONE*) Pnext; } EDGE_ZONE* Next() { return (EDGE_ZONE*) Pnext; }
EDGE_ZONE* Back() { return (EDGE_ZONE*) Pback; } EDGE_ZONE* Back() { return (EDGE_ZONE*) Pback; }
/** /**
* Function Save * Function Save
* writes the data structures for this object out to a FILE in "*.brd" format. * writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to. * @param aFile The FILE to write to.
* @return bool - true if success writing else false. * @return bool - true if success writing else false.
*/ */
bool Save( FILE* aFile ) const; bool Save( FILE* aFile ) const;
}; };
#endif // #ifndef CLASS_ZONE_H #endif // #ifndef CLASS_ZONE_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment