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.

145 lines
5.0 KiB

13 years ago
13 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2011 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
  5. * Copyright (C) 2009 Dick Hollenbeck, dick@softplc.com
  6. * Copyright (C) 2004-2022 KiCad Developers, see AUTHORS.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 _DIALOG_DRC_H_
  26. #define _DIALOG_DRC_H_
  27. #include <wx/htmllbox.h>
  28. #include <rc_item.h>
  29. #include <pcb_marker.h>
  30. #include <board.h>
  31. #include <dialog_drc_base.h>
  32. #include <widgets/progress_reporter_base.h>
  33. class BOARD_DESIGN_SETTINGS;
  34. #define DIALOG_DRC_WINDOW_NAME wxT( "DialogDrcWindowName" )
  35. class
  36. DIALOG_DRC: public DIALOG_DRC_BASE, PROGRESS_REPORTER_BASE
  37. {
  38. public:
  39. /// Constructors
  40. DIALOG_DRC( PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent );
  41. ~DIALOG_DRC();
  42. /**
  43. * Called after running DRC. It's main function is prevent showing potentially-false-0
  44. * counts before DRC has been run.
  45. */
  46. void SetDrcRun() { m_drcRun = true; }
  47. /**
  48. * Called after running Footprint Tests. It's main function is to update the Footprint
  49. * Warnings tab title.
  50. */
  51. void SetFootprintTestsRun() { m_footprintTestsRun = true; }
  52. /**
  53. * Rebuild the contents of the violation tabs based on the current markers and severties.
  54. */
  55. void UpdateData();
  56. void PrevMarker();
  57. void NextMarker();
  58. void SelectMarker( const PCB_MARKER* aMarker );
  59. void ExcludeMarker();
  60. private:
  61. /**
  62. * Function writeReport
  63. * outputs the MARKER items with commentary to an open text file.
  64. * @param aFullFileName The text filename to write the report to.
  65. * @return true if OK, false on error
  66. */
  67. bool writeReport( const wxString& aFullFileName );
  68. void syncCheckboxes();
  69. void updateDisplayedCounts();
  70. void OnDRCItemSelected( wxDataViewEvent& aEvent ) override;
  71. void OnDRCItemDClick( wxDataViewEvent& aEvent ) override;
  72. void OnDRCItemRClick( wxDataViewEvent& aEvent ) override;
  73. void OnEditViolationSeverities( wxHyperlinkEvent& aEvent ) override;
  74. void OnSeverity( wxCommandEvent& aEvent ) override;
  75. void OnSaveReport( wxCommandEvent& aEvent ) override;
  76. void OnDeleteOneClick( wxCommandEvent& aEvent ) override;
  77. void OnDeleteAllClick( wxCommandEvent& aEvent ) override;
  78. void OnRunDRCClick( wxCommandEvent& aEvent ) override;
  79. void OnErrorLinkClicked( wxHtmlLinkEvent& event ) override;
  80. // These require special handling while the DRC tests are running.
  81. void OnCancelClick( wxCommandEvent& aEvent ) override;
  82. void OnClose( wxCloseEvent& event ) override;
  83. // Updates data which can be modified outside the dialog.
  84. void OnActivateDlg( wxActivateEvent& aEvent ) override;
  85. void OnChangingNotebookPage( wxNotebookEvent& aEvent ) override;
  86. void centerMarkerIdleHandler( wxIdleEvent& aEvent );
  87. void deleteAllMarkers( bool aIncludeExclusions );
  88. void refreshEditor();
  89. // PROGRESS_REPORTER calls
  90. bool updateUI() override;
  91. void AdvancePhase( const wxString& aMessage ) override;
  92. BOARD_DESIGN_SETTINGS& bds() { return m_currentBoard->GetDesignSettings(); }
  93. BOARD* m_currentBoard; // the board currently on test
  94. PCB_EDIT_FRAME* m_frame;
  95. bool m_running;
  96. bool m_drcRun;
  97. bool m_footprintTestsRun;
  98. wxString m_markersTitleTemplate;
  99. wxString m_unconnectedTitleTemplate;
  100. wxString m_footprintsTitleTemplate;
  101. wxString m_ignoredTitleTemplate;
  102. std::shared_ptr<RC_ITEMS_PROVIDER> m_markersProvider;
  103. std::shared_ptr<RC_ITEMS_PROVIDER> m_ratsnestProvider;
  104. std::shared_ptr<RC_ITEMS_PROVIDER> m_fpWarningsProvider;
  105. RC_TREE_MODEL* m_markersTreeModel; // wx reference-counted ptr
  106. RC_TREE_MODEL* m_unconnectedTreeModel; // wx reference-counted ptr
  107. RC_TREE_MODEL* m_fpWarningsTreeModel; // wx reference-counted ptr
  108. const PCB_MARKER* m_centerMarkerOnIdle;
  109. int m_severities; // A mask of SEVERITY flags
  110. };
  111. #endif // _DIALOG_DRC_H_