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.

78 lines
3.0 KiB

++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
14 years ago
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2009 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
  5. * Copyright (C) 2009 Jean-Pierre Charras, jean-pierre.charras@inpg.fr
  6. * Copyright (C) 2009-2022 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. #include <netclass.h>
  26. #include <macros.h>
  27. #include <base_units.h>
  28. // This will get mapped to "kicad_default" in the specctra_export.
  29. const char NETCLASS::Default[] = "Default";
  30. // Initial values for netclass initialization
  31. const int DEFAULT_CLEARANCE = pcbIUScale.mmToIU( 0.2 ); // track to track and track to pads clearance
  32. const int DEFAULT_VIA_DIAMETER = pcbIUScale.mmToIU( 0.6 );
  33. const int DEFAULT_VIA_DRILL = pcbIUScale.mmToIU( 0.3 );
  34. const int DEFAULT_UVIA_DIAMETER = pcbIUScale.mmToIU( 0.3 );
  35. const int DEFAULT_UVIA_DRILL = pcbIUScale.mmToIU( 0.1 );
  36. const int DEFAULT_TRACK_WIDTH = pcbIUScale.mmToIU( 0.2 );
  37. const int DEFAULT_DIFF_PAIR_WIDTH = pcbIUScale.mmToIU( 0.2 );
  38. const int DEFAULT_DIFF_PAIR_GAP = pcbIUScale.mmToIU( 0.25 );
  39. const int DEFAULT_DIFF_PAIR_VIAGAP = pcbIUScale.mmToIU( 0.25 );
  40. const int DEFAULT_WIRE_WIDTH = schIUScale.MilsToIU( 6 );
  41. const int DEFAULT_BUS_WIDTH = schIUScale.MilsToIU( 12 );
  42. const int DEFAULT_LINE_STYLE = 0; // solid
  43. NETCLASS::NETCLASS( const wxString& aName ) :
  44. m_Name( aName ),
  45. m_PcbColor( KIGFX::COLOR4D::UNSPECIFIED )
  46. {
  47. // Default settings
  48. SetClearance( DEFAULT_CLEARANCE );
  49. SetViaDrill( DEFAULT_VIA_DRILL );
  50. SetuViaDrill( DEFAULT_UVIA_DRILL );
  51. // These defaults will be overwritten by SetParams,
  52. // from the board design parameters, later
  53. SetTrackWidth( DEFAULT_TRACK_WIDTH );
  54. SetViaDiameter( DEFAULT_VIA_DIAMETER );
  55. SetuViaDiameter( DEFAULT_UVIA_DIAMETER );
  56. SetDiffPairWidth( DEFAULT_DIFF_PAIR_WIDTH );
  57. SetDiffPairGap( DEFAULT_DIFF_PAIR_GAP );
  58. SetDiffPairViaGap( DEFAULT_DIFF_PAIR_VIAGAP );
  59. SetWireWidth( DEFAULT_WIRE_WIDTH );
  60. SetBusWidth( DEFAULT_BUS_WIDTH );
  61. SetSchematicColor( COLOR4D::UNSPECIFIED );
  62. SetLineStyle( DEFAULT_LINE_STYLE );
  63. }
  64. NETCLASS::~NETCLASS()
  65. {
  66. }