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.

162 lines
5.4 KiB

14 years ago
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
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-2012 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 <class_drawpanel.h>
  31. #include <drc.h>
  32. #include <class_marker_pcb.h>
  33. #include <class_board.h>
  34. #include <dialog_drc_base.h>
  35. #include <dialog_drclistbox.h>
  36. #include <widgets/unit_binder.h>
  37. // forward declarations
  38. class DRCLISTBOX;
  39. class BOARD_DESIGN_SETTINGS;
  40. //end forward declarations
  41. /*!
  42. * DrcDialog class declaration
  43. */
  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 UpdateDisplayedCounts();
  59. private:
  60. /**
  61. * Function writeReport
  62. * outputs the MARKER items and unconnecte DRC_ITEMs with commentary to an
  63. * 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. /**
  69. * filenames can be entered by name.
  70. * @return a good report filename (with .rpt extension) (a full filename)
  71. * from m_CreateRptCtrl
  72. */
  73. const wxString makeValidFileNameReport();
  74. void InitValues( );
  75. void DisplayDRCValues( );
  76. void SetDrcParmeters( );
  77. /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX_RPT_FILE
  78. void OnReportCheckBoxClicked( wxCommandEvent& event ) override;
  79. /// wxEVT_COMMAND_TEXT_UPDATED event handler for m_RptFilenameCtrl
  80. void OnReportFilenameEdited( wxCommandEvent &event ) override;
  81. /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_BROWSE_RPT_FILE
  82. void OnButtonBrowseRptFileClick( wxCommandEvent& event ) override;
  83. /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_STARTDRC
  84. void OnStartdrcClick( wxCommandEvent& event ) override;
  85. /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_LIST_UNCONNECTED
  86. void OnListUnconnectedClick( wxCommandEvent& event ) override;
  87. /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ALL
  88. void OnDeleteAllClick( wxCommandEvent& event ) override;
  89. /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ONE
  90. void OnDeleteOneClick( wxCommandEvent& event ) override;
  91. /// wxEVT_LEFT_DCLICK event handler for ID_CLEARANCE_LIST
  92. void OnLeftDClickClearance( wxMouseEvent& event ) override;
  93. /// wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST
  94. void OnRightUpClearance( wxMouseEvent& event ) override;
  95. /// wxEVT_LEFT_DCLICK event handler for ID_UNCONNECTED_LIST
  96. void OnLeftDClickUnconnected( wxMouseEvent& event ) override;
  97. /// wxEVT_RIGHT_UP event handler for ID_UNCONNECTED_LIST
  98. void OnRightUpUnconnected( wxMouseEvent& event ) override;
  99. /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
  100. void OnCancelClick( wxCommandEvent& event ) override;
  101. /// handler for activate event, updating data which can be modified outside the dialog
  102. /// (DRC parameters)
  103. void OnActivateDlg( wxActivateEvent& event ) override;
  104. void OnMarkerSelectionEvent( wxCommandEvent& event ) override;
  105. void OnUnconnectedSelectionEvent( wxCommandEvent& event ) override;
  106. void OnChangingMarkerList( wxNotebookEvent& event ) override;
  107. void DelDRCMarkers();
  108. void RedrawDrawPanel();
  109. /// Run the SELECTION_TOOL's disambiguation menu to highlight the two BOARD_ITEMs
  110. /// in the DRC_ITEM.
  111. void doSelectionMenu( const DRC_ITEM* aItem );
  112. BOARD* m_currentBoard; // the board currently on test
  113. DRC* m_tester;
  114. PCB_EDIT_FRAME* m_brdEditor;
  115. wxConfigBase* m_config;
  116. wxString m_markersTitleTemplate;
  117. wxString m_unconnectedTitleTemplate;
  118. UNIT_BINDER m_trackMinWidth;
  119. UNIT_BINDER m_viaMinSize;
  120. UNIT_BINDER m_uviaMinSize;
  121. };
  122. #endif // _DIALOG_DRC_H_