class_drc_item.cpp 4.93 KB
Newer Older
dickelbeck's avatar
dickelbeck committed
1
/*
2
 * This program source code file is part of KiCad, a free EDA CAD application.
dickelbeck's avatar
dickelbeck committed
3 4
 *
 * Copyright (C) 2007 Dick Hollenbeck, dick@softplc.com
5
 * Copyright (C) 2015 KiCad Developers, see change_log.txt for contributors.
dickelbeck's avatar
dickelbeck committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, you may find one here:
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * or you may search the http://www.gnu.org website for the version 2 license,
 * or you may write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 */

25

26 27 28
/*************************************************/
/* class_drc_item.cpp - DRC_ITEM class functions */
/*************************************************/
29 30
#include <fctsys.h>
#include <common.h>
31

32 33 34
#include <pcbnew.h>
#include <drc_stuff.h>
#include <class_drc_item.h>
35
#include <base_units.h>
36

37 38 39 40 41 42

wxString DRC_ITEM::GetErrorText() const
{
    switch( m_ErrorCode )
    {
    case DRCE_UNCONNECTED_PADS:
43
        return wxString( _( "Unconnected pads" ) );
44
    case DRCE_TRACK_NEAR_THROUGH_HOLE:
45
        return wxString( _( "Track near thru-hole" ) );
46
    case DRCE_TRACK_NEAR_PAD:
47
        return wxString( _( "Track near pad" ) );
48
    case DRCE_TRACK_NEAR_VIA:
49
        return wxString( _( "Track near via" ) );
50
    case DRCE_VIA_NEAR_VIA:
51
        return wxString( _( "Via near via" ) );
52
    case DRCE_VIA_NEAR_TRACK:
53
        return wxString( _( "Via near track" ) );
54 55 56 57
    case DRCE_TRACK_ENDS1:
    case DRCE_TRACK_ENDS2:
    case DRCE_TRACK_ENDS3:
    case DRCE_TRACK_ENDS4:
58
    case DRCE_ENDS_PROBLEM1:
59 60 61 62
    case DRCE_ENDS_PROBLEM2:
    case DRCE_ENDS_PROBLEM3:
    case DRCE_ENDS_PROBLEM4:
    case DRCE_ENDS_PROBLEM5:
63
        return wxString( _( "Two track ends too close" ) );
64
    case DRCE_TRACK_SEGMENTS_TOO_CLOSE:
65
        return wxString( _( "Two parallel track segments too close" ) );
66
    case DRCE_TRACKS_CROSSING:
67
        return wxString( _( "Tracks crossing" ) );
68
    case DRCE_PAD_NEAR_PAD1:
69
        return wxString( _( "Pad near pad" ) );
70
    case DRCE_VIA_HOLE_BIGGER:
71
        return wxString( _( "Via hole > diameter" ) );
72
    case DRCE_MICRO_VIA_INCORRECT_LAYER_PAIR:
73
        return wxString( _( "Micro Via: incorrect layer pairs (not adjacent)" ) );
74
    case COPPERAREA_INSIDE_COPPERAREA:
75
        return wxString( _( "Copper area inside copper area" ) );
76
    case COPPERAREA_CLOSE_TO_COPPERAREA:
77
        return wxString( _( "Copper areas intersect or are too close" ) );
78 79 80 81

    case DRCE_SUSPICIOUS_NET_FOR_ZONE_OUTLINE:
        return wxString( _( "Copper area belongs a net which has no pads. This is strange" ) );

82
    case DRCE_HOLE_NEAR_PAD:
83
        return wxString( _( "Hole near pad" ) );
84
    case DRCE_HOLE_NEAR_TRACK:
85
        return wxString( _( "Hole near track" ) );
86
    case DRCE_TOO_SMALL_TRACK_WIDTH:
87
        return wxString( _( "Too small track width" ) );
88
    case DRCE_TOO_SMALL_VIA:
89
        return wxString( _( "Too small via size" ) );
90
    case DRCE_TOO_SMALL_MICROVIA:
91
        return wxString( _( "Too small micro via size" ) );
92

93 94
    // use &lt; since this is text ultimately embedded in HTML
    case DRCE_NETCLASS_TRACKWIDTH:
95
        return wxString( _( "NetClass Track Width &lt; global limit" ) );
96
    case DRCE_NETCLASS_CLEARANCE:
97
        return wxString( _( "NetClass Clearance &lt; global limit" ) );
98
    case DRCE_NETCLASS_VIASIZE:
99
        return wxString( _( "NetClass Via Dia &lt; global limit" ) );
100
    case DRCE_NETCLASS_VIADRILLSIZE:
101
        return wxString( _( "NetClass Via Drill &lt; global limit" ) );
102
    case DRCE_NETCLASS_uVIASIZE:
103
        return wxString( _( "NetClass uVia Dia &lt; global limit" ) );
104
    case DRCE_NETCLASS_uVIADRILLSIZE:
105
        return wxString( _( "NetClass uVia Drill &lt; global limit" ) );
106

107
    case DRCE_VIA_INSIDE_KEEPOUT:
108
        return wxString( _( "Via inside a keepout area" ) );
109 110

    case DRCE_TRACK_INSIDE_KEEPOUT:
111
        return wxString( _( "Track inside a keepout area" ) );
112 113

    case DRCE_PAD_INSIDE_KEEPOUT:
114
        return wxString( _( "Pad inside a keepout area" ) );
115

116
    case DRCE_VIA_INSIDE_TEXT:
117
        return wxString( _( "Via inside a text" ) );
118 119

    case DRCE_TRACK_INSIDE_TEXT:
120
        return wxString( _( "Track inside a text" ) );
121 122

    case DRCE_PAD_INSIDE_TEXT:
123
        return wxString( _( "Pad inside a text" ) );
124

125
    default:
126
        return wxString::Format( wxT( "Unknown DRC error code %d" ), m_ErrorCode );
127 128 129 130 131 132 133 134
    }
}


wxString DRC_ITEM::ShowCoord( const wxPoint& aPos )
{
    wxString ret;

135
    ret << aPos;
136 137
    return ret;
}