You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
3.3 KiB

18 years ago
  1. /*
  2. * This program source code file is part of KICAD, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2007 Dick Hollenbeck, dick@softplc.com
  5. * Copyright (C) 2007 Kicad Developers, see change_log.txt for contributors.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version 2
  10. * of the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, you may find one here:
  19. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  20. * or you may search the http://www.gnu.org website for the version 2 license,
  21. * or you may write to the Free Software Foundation, Inc.,
  22. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  23. */
  24. /*************************************************/
  25. /* class_drc_item.cpp - DRC_ITEM class functions */
  26. /*************************************************/
  27. #include "fctsys.h"
  28. #include "common.h"
  29. #include "pcbnew.h"
  30. wxString DRC_ITEM::GetErrorText() const
  31. {
  32. switch( m_ErrorCode )
  33. {
  34. case DRCE_UNCONNECTED_PADS:
  35. return wxString( _("Unconnected pads") );
  36. case DRCE_TRACK_NEAR_THROUGH_HOLE:
  37. return wxString( _("Track near thru-hole") );
  38. case DRCE_TRACK_NEAR_PAD:
  39. return wxString( _("Track near pad") );
  40. case DRCE_TRACK_NEAR_VIA:
  41. return wxString( _("Track near via") );
  42. case DRCE_VIA_NEAR_VIA:
  43. return wxString( _("Via near via") );
  44. case DRCE_VIA_NEAR_TRACK:
  45. return wxString( _("Via near track") );
  46. case DRCE_TRACK_ENDS1:
  47. case DRCE_TRACK_ENDS2:
  48. case DRCE_TRACK_ENDS3:
  49. case DRCE_TRACK_ENDS4:
  50. case DRCE_ENDS_PROBLEM1:
  51. case DRCE_ENDS_PROBLEM2:
  52. case DRCE_ENDS_PROBLEM3:
  53. case DRCE_ENDS_PROBLEM4:
  54. case DRCE_ENDS_PROBLEM5:
  55. return wxString( _("Two track ends") );
  56. case DRCE_TRACK_UNKNOWN1:
  57. return wxString( _("This looks bad") ); ///< @todo check source code and change this comment
  58. case DRCE_TRACKS_CROSSING:
  59. return wxString( _("Tracks crossing") );
  60. case DRCE_PAD_NEAR_PAD1:
  61. return wxString( _("Pad near pad") );
  62. case DRCE_VIA_HOLE_BIGGER:
  63. return wxString( _("Via hole > diameter"));
  64. case DRCE_MICRO_VIA_INCORRECT_LAYER_PAIR:
  65. return wxString( _("Micro Via: incorrect layer pairs (not adjacent)"));
  66. case COPPERAREA_INSIDE_COPPERAREA:
  67. return wxString( _("Copper area inside copper area"));
  68. case COPPERAREA_CLOSE_TO_COPPERAREA:
  69. return wxString( _("Copper areas intersect or are too close"));
  70. case DRCE_NON_EXISTANT_NET_FOR_ZONE_OUTLINE:
  71. return wxString( _("Copper area has a non existent net name"));
  72. default:
  73. return wxString( wxT("PROGRAM BUG, PLEASE LEAVE THE ROOM.") );
  74. }
  75. }
  76. wxString DRC_ITEM::ShowCoord( const wxPoint& aPos )
  77. {
  78. wxString temp;
  79. wxString ret;
  80. ret << wxT("@ (") << valeur_param( aPos.x, temp );
  81. ret << wxT(",") << valeur_param( aPos.y, temp );
  82. ret << wxT(")");
  83. return ret;
  84. }