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.

143 lines
4.6 KiB

14 years ago
14 years ago
18 years ago
18 years ago
++PCBNew * Removed Pcb_Frame argument from BOARD() constructor, since it precludes having a BOARD being edited by more than one editor, it was a bad design. And this meant removing m_PcbFrame from BOARD. * removed BOARD::SetWindowFrame(), and BOARD::m_PcbFrame * Removed the global BOARD_DESIGN_SETTINGS which was in class_board.cpp * added BOARD_DESIGN_SETTINGS to the BOARD class, a full instance * a couple dialogs now only change BOARD_DESIGN_SETTINGS when OK is pressed, such as dialog_mask_clearance, dialog_drc, etc. * Removed common/pcbcommon.cpp's int g_CurrentVersionPCB = 1 and replaced it with build_version.h's #define BOARD_FILE_VERSION, although there may be a better place for this constant. * Made the public functions in PARAM_CFG_ARRAY be type const. void SaveParam(..) const and void ReadParam(..) const * PARAM_CFG_BASE now has virtual destructor since we have various way of destroying the derived class and boost::ptr_vector must be told about this. * Pass const PARAM_CFG_ARRAY& instead of PARAM_CFG_ARRAY so that we can use an automatic PARAM_CFG_ARRAY which is on the stack.\ * PCB_EDIT_FRAME::GetProjectFileParameters() may no longer cache the array, since it has to access the current BOARD and the BOARD can change. Remember BOARD_DESIGN_SETTINGS are now in the BOARD. * Made the m_BoundingBox member private, this was a brutally hard task, and indicative of the lack of commitment to accessors and object oriented design on the part of KiCad developers. We must do better. Added BOARD::GetBoundingBox, SetBoundingBox(), ComputeBoundingBox(). * Added PCB_BASE_FRAME::GetBoardBoundingBox() which calls BOARD::ComputeBoundingBox()
14 years ago
18 years ago
18 years ago
18 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-2020 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 <fctsys.h>
  29. #include <pcbnew.h>
  30. #include <drc/drc.h>
  31. #include <class_marker_pcb.h>
  32. #include <class_board.h>
  33. #include <dialog_drc_base.h>
  34. #include <widgets/unit_binder.h>
  35. // forward declarations
  36. class DRC_ITEMS_PROVIDER;
  37. class BOARD_DESIGN_SETTINGS;
  38. class DRC_TREE_MODEL;
  39. //end forward declarations
  40. /*!
  41. * DrcDialog class declaration
  42. */
  43. #define DIALOG_DRC_WINDOW_NAME "DialogDrcWindowName"
  44. class DIALOG_DRC_CONTROL: public DIALOG_DRC_CONTROL_BASE
  45. {
  46. public:
  47. BOARD_DESIGN_SETTINGS m_BrdSettings;
  48. /// Constructors
  49. DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent );
  50. ~DIALOG_DRC_CONTROL();
  51. /**
  52. * Enable/disable the report file creation
  53. * @param aEnable = true to ask for creation
  54. * @param aFileName = the filename or the report file
  55. */
  56. void SetRptSettings( bool aEnable, const wxString& aFileName );
  57. void GetRptSettings( bool* aEnable, wxString& aFileName );
  58. void SetMarkersProvider( DRC_ITEMS_PROVIDER* aProvider );
  59. void SetUnconnectedProvider( DRC_ITEMS_PROVIDER* aProvider );
  60. void SetFootprintsProvider( DRC_ITEMS_PROVIDER* aProvider );
  61. void UpdateDisplayedCounts();
  62. private:
  63. /**
  64. * Function writeReport
  65. * outputs the MARKER items and unconnecte DRC_ITEMs with commentary to an
  66. * open text file.
  67. * @param aFullFileName The text filename to write the report to.
  68. * @return true if OK, false on error
  69. */
  70. bool writeReport( const wxString& aFullFileName );
  71. /**
  72. * filenames can be entered by name.
  73. * @return a good report filename (with .rpt extension) (a full filename)
  74. * from m_CreateRptCtrl
  75. */
  76. const wxString makeValidFileNameReport();
  77. void InitValues( );
  78. void DisplayDRCValues( );
  79. void SetDRCParameters( );
  80. void OnReportCheckBoxClicked( wxCommandEvent& event ) override;
  81. void OnReportFilenameEdited( wxCommandEvent &event ) override;
  82. void OnButtonBrowseRptFileClick( wxCommandEvent& event ) override;
  83. void OnRunDRCClick( wxCommandEvent& event ) override;
  84. void OnDeleteAllClick( wxCommandEvent& event ) override;
  85. void OnDeleteOneClick( wxCommandEvent& event ) override;
  86. void OnDRCItemSelected( wxDataViewEvent& event ) override;
  87. void OnDClick( wxDataViewCtrl* ctrl, wxMouseEvent& event );
  88. void OnMarkerDClick( wxMouseEvent& event ) override;
  89. void OnLeftDClickUnconnected( wxMouseEvent& event ) override;
  90. void OnLeftDClickFootprints( wxMouseEvent& event ) override;
  91. void OnCancelClick( wxCommandEvent& event ) override;
  92. /// handler for activate event, updating data which can be modified outside the dialog
  93. /// (DRC parameters)
  94. void OnActivateDlg( wxActivateEvent& event ) override;
  95. void OnChangingNotebookPage( wxNotebookEvent& event ) override;
  96. void DelDRCMarkers();
  97. void RedrawDrawPanel();
  98. BOARD* m_currentBoard; // the board currently on test
  99. DRC* m_tester;
  100. PCB_EDIT_FRAME* m_brdEditor;
  101. wxString m_markersTitleTemplate;
  102. wxString m_unconnectedTitleTemplate;
  103. wxString m_footprintsTitleTemplate;
  104. UNIT_BINDER m_trackMinWidth;
  105. UNIT_BINDER m_viaMinSize;
  106. UNIT_BINDER m_uviaMinSize;
  107. DRC_TREE_MODEL* m_markerTreeModel;
  108. DRC_TREE_MODEL* m_unconnectedTreeModel;
  109. DRC_TREE_MODEL* m_footprintsTreeModel;
  110. };
  111. #endif // _DIALOG_DRC_H_