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.

82 lines
2.8 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2018 CERN
  5. * @author Jon Evans <jon@craftyjon.com>
  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 along
  18. * with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #ifndef _ERC_SETTINGS_H
  21. #define _ERC_SETTINGS_H
  22. /**
  23. * Container for ERC settings
  24. *
  25. * Currently only stores flags about checks to run, but could later be expanded
  26. * to contain the matrix of electrical pin types.
  27. */
  28. class ERC_SETTINGS
  29. {
  30. public:
  31. void LoadDefaults()
  32. {
  33. write_erc_file = false;
  34. check_similar_labels = true;
  35. check_unique_global_labels = true;
  36. check_bus_driver_conflicts = true;
  37. check_bus_entry_conflicts = true;
  38. check_bus_to_bus_conflicts = true;
  39. check_bus_to_net_conflicts = true;
  40. }
  41. bool operator==( const ERC_SETTINGS& other ) const
  42. {
  43. return ( other.write_erc_file == write_erc_file &&
  44. other.check_similar_labels == check_similar_labels &&
  45. other.check_unique_global_labels == check_unique_global_labels &&
  46. other.check_bus_driver_conflicts == check_bus_driver_conflicts &&
  47. other.check_bus_entry_conflicts == check_bus_entry_conflicts &&
  48. other.check_bus_to_bus_conflicts == check_bus_to_bus_conflicts &&
  49. other.check_bus_to_net_conflicts == check_bus_to_net_conflicts );
  50. }
  51. bool operator!=( const ERC_SETTINGS& other ) const
  52. {
  53. return !( other == *this );
  54. }
  55. /// If true, write ERC results to a file
  56. bool write_erc_file;
  57. /// If true, check each sheet for labels that differ only by letter case
  58. bool check_similar_labels;
  59. /// If true, check to ensure that each global label apperas more than once
  60. bool check_unique_global_labels;
  61. /// If true, check that buses don't have conflicting drivers
  62. bool check_bus_driver_conflicts;
  63. /// If true, check that wires connecting to buses actually exist in the bus
  64. bool check_bus_entry_conflicts;
  65. /// If true, check that bus-to-bus connections share at least one member
  66. bool check_bus_to_bus_conflicts;
  67. /// If true, check that bus wires don't graphically connect to net objects (or vice versa)
  68. bool check_bus_to_net_conflicts;
  69. };
  70. #endif