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.

147 lines
4.0 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2009 Jean-Pierre Charras, jp.charras at wanadoo.fr
  5. * Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
  6. * Copyright (C) 2009-2023 KiCad Developers, see change_log.txt for contributors.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version 2
  11. * of the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, you may find one here:
  20. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  21. * or you may search the http://www.gnu.org website for the version 2 license,
  22. * or you may write to the Free Software Foundation, Inc.,
  23. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  24. */
  25. #ifndef _ERC_H
  26. #define _ERC_H
  27. #include <erc_settings.h>
  28. class NETLIST_OBJECT;
  29. class NETLIST_OBJECT_LIST;
  30. class SCH_SHEET_LIST;
  31. class SCHEMATIC;
  32. class DS_PROXY_VIEW_ITEM;
  33. class SCH_EDIT_FRAME;
  34. class PROGRESS_REPORTER;
  35. extern const wxString CommentERC_H[];
  36. extern const wxString CommentERC_V[];
  37. class ERC_TESTER
  38. {
  39. public:
  40. ERC_TESTER( SCHEMATIC* aSchematic ) :
  41. m_schematic( aSchematic )
  42. {
  43. }
  44. /**
  45. * Inside a given sheet, one cannot have sheets with duplicate names (file
  46. * names can be duplicated).
  47. *
  48. * @return the error count
  49. * @param aCreateMarker: true = create error markers in schematic,
  50. * false = calculate error count only
  51. */
  52. int TestDuplicateSheetNames( bool aCreateMarker );
  53. /**
  54. * Check for any unresolved text variable references.
  55. */
  56. void TestTextVars( DS_PROXY_VIEW_ITEM* aDrawingSheet );
  57. /**
  58. * Check that there are no conflicting bus alias definitions in the schematic.
  59. *
  60. * (for example, two hierarchical sub-sheets contain different definitions for
  61. * the same bus alias)
  62. *
  63. * @return the error count
  64. */
  65. int TestConflictingBusAliases();
  66. /**
  67. * Test if all units of each multiunit symbol have the same footprint assigned.
  68. * @return The error count.
  69. */
  70. int TestMultiunitFootprints();
  71. /**
  72. * In KiCad 5 and earlier, you could connect stuff up to pins with NC electrical type.
  73. * In KiCad 6, this no longer results in those pins joining the net, so we need to warn about it
  74. * @return the error count
  75. */
  76. int TestNoConnectPins();
  77. /**
  78. * Checks the full netlist against the pin-to-pin connectivity requirements
  79. * @return the error count
  80. */
  81. int TestPinToPin();
  82. /**
  83. * Checks if shared pins on multi-unit symbols have been connected to different nets
  84. * @return the error count
  85. */
  86. int TestMultUnitPinConflicts();
  87. /**
  88. * Checks for labels that differ only in capitalization
  89. * @return the error count
  90. */
  91. int TestSimilarLabels();
  92. /**
  93. * Test symbols for changed library symbols and broken symbol library links.
  94. * @return the number of issues found
  95. */
  96. int TestLibSymbolIssues();
  97. /**
  98. * Test pins and wire ends for being off grid.
  99. * @return the error count
  100. */
  101. int TestOffGridEndpoints();
  102. /**
  103. * Test SPICE models for various issues.
  104. */
  105. int TestSimModelIssues();
  106. /**
  107. * Test for uninstantiated units of multi unit symbols
  108. */
  109. int TestMissingUnits();
  110. /**
  111. * Tests for netclasses that are referenced but not defined.
  112. * @return
  113. */
  114. int TestMissingNetclasses();
  115. void RunTests( DS_PROXY_VIEW_ITEM* aDrawingSheet, SCH_EDIT_FRAME* aEditFrame,
  116. PROGRESS_REPORTER* aProgressReporter );
  117. private:
  118. SCHEMATIC* m_schematic;
  119. };
  120. #endif // _ERC_H