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.

810 lines
26 KiB

14 years ago
14 years ago
14 years ago
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-2019 Jean-Pierre Charras, jp.charras at wanadoo.fr
  5. * Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
  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
  18. * along with this program; if not, you may find one here:
  19. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  20. * or you may search the http://www.gnu.org website for the version 2 license,
  21. * or you may write to the Free Software Foundation, Inc.,
  22. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  23. */
  24. #ifndef BOARD_DESIGN_SETTINGS_H_
  25. #define BOARD_DESIGN_SETTINGS_H_
  26. #include <memory>
  27. #include <netclass.h>
  28. #include <project/net_settings.h>
  29. #include <board_stackup_manager/board_stackup.h>
  30. #include <drc/drc_engine.h>
  31. #include <lset.h>
  32. #include <settings/nested_settings.h>
  33. #include <widgets/ui_common.h>
  34. #include <zone_settings.h>
  35. #include <teardrop/teardrop_parameters.h>
  36. #include <router/pns_meander.h>
  37. #define DEFAULT_SILK_LINE_WIDTH 0.1
  38. #define DEFAULT_COPPER_LINE_WIDTH 0.2
  39. #define DEFAULT_EDGE_WIDTH 0.05
  40. #define DEFAULT_COURTYARD_WIDTH 0.05
  41. #define DEFAULT_LINE_WIDTH 0.10
  42. #define DEFAULT_SILK_TEXT_SIZE 1.0
  43. #define DEFAULT_COPPER_TEXT_SIZE 1.5
  44. #define DEFAULT_TEXT_SIZE 1.0
  45. #define DEFAULT_SILK_TEXT_WIDTH 0.1
  46. #define DEFAULT_COPPER_TEXT_WIDTH 0.30
  47. #define DEFAULT_TEXT_WIDTH 0.15
  48. #define DEFAULT_DIMENSION_ARROW_LENGTH 50 // mils, for legacy purposes
  49. #define DEFAULT_DIMENSION_EXTENSION_OFFSET 0.5
  50. // Board thickness, mainly for 3D view:
  51. #define DEFAULT_BOARD_THICKNESS_MM 1.6
  52. #define DEFAULT_PCB_EDGE_THICKNESS 0.15
  53. // soldermask to pad clearance. The default is 0 because usually board houses
  54. // create a clearance depending on their fab process: mask material, color, price, etc.
  55. #define DEFAULT_SOLDERMASK_EXPANSION 0.0
  56. #define DEFAULT_SOLDERMASK_TO_COPPER_CLEARANCE 0.0
  57. #define DEFAULT_SOLDERMASK_MIN_WIDTH 0.0
  58. #define DEFAULT_SOLDERPASTE_CLEARANCE 0.0
  59. #define DEFAULT_SOLDERPASTE_RATIO 0.0
  60. #define DEFAULT_CUSTOMTRACKWIDTH 0.2
  61. #define DEFAULT_CUSTOMDPAIRWIDTH 0.125
  62. #define DEFAULT_CUSTOMDPAIRGAP 0.18
  63. #define DEFAULT_CUSTOMDPAIRVIAGAP 0.18
  64. #define DEFAULT_MEANDER_SPACING 0.6
  65. #define DEFAULT_DP_MEANDER_SPACING 1.0
  66. #define DEFAULT_MINCLEARANCE 0.0 // overall min clearance
  67. #define DEFAULT_MINCONNECTION 0.0 // overall min connection width
  68. #define DEFAULT_TRACKMINWIDTH 0.0 // track width min value
  69. #define DEFAULT_VIASMINSIZE 0.5 // vias (not micro vias) min diameter
  70. #define DEFAULT_MINTHROUGHDRILL 0.3 // through holes (not micro vias) min drill diameter
  71. #define DEFAULT_MICROVIASMINSIZE 0.2 // micro vias (not vias) min diameter
  72. #define DEFAULT_MICROVIASMINDRILL 0.1 // micro vias (not vias) min drill diameter
  73. #define DEFAULT_HOLETOHOLEMIN 0.25 // minimum web thickness between two drilled holes
  74. #define DEFAULT_HOLECLEARANCE 0.25 // copper-to-hole clearance (from IPC level A)
  75. #define DEFAULT_COPPEREDGECLEARANCE 0.5 // clearance between copper items and edge cuts
  76. #define LEGACY_COPPEREDGECLEARANCE -0.01 // A flag to indicate the legacy method (based
  77. // on edge cut line thicknesses) should be used.
  78. #define DEFAULT_SILKCLEARANCE 0.0
  79. #define DEFAULT_MINRESOLVEDSPOKES 2 // Fewer resolved spokes indicates a starved thermal
  80. #define MINIMUM_ERROR_SIZE_MM 0.001 // For arc approximation
  81. #define MAXIMUM_ERROR_SIZE_MM 0.1 // For arc approximation
  82. // Min/max values used in dialogs to validate settings
  83. #define MINIMUM_LINE_WIDTH_MM 0.005 // minimal line width entered in a dialog
  84. #define MAXIMUM_LINE_WIDTH_MM 100.0 // max line width entered in a dialog
  85. // Default pad properies
  86. #define DEFAULT_PAD_WIDTH_MM 2.54 // master pad width
  87. #define DEFAULT_PAD_HEIGTH_MM 1.27 // master pad heigth
  88. #define DEFAULT_PAD_DRILL_DIAMETER_MM 0.8 // master pad drill diameter for PTH
  89. #define DEFAULT_PAD_REACT_RADIUS 15 // master pad corner radius in percent
  90. /**
  91. * Container to handle a stock of specific vias each with unique diameter and drill sizes
  92. * in the #BOARD class.
  93. */
  94. struct VIA_DIMENSION
  95. {
  96. int m_Diameter; // <= 0 means use Netclass via diameter
  97. int m_Drill; // <= 0 means use Netclass via drill
  98. VIA_DIMENSION()
  99. {
  100. m_Diameter = 0;
  101. m_Drill = 0;
  102. }
  103. VIA_DIMENSION( int aDiameter, int aDrill )
  104. {
  105. m_Diameter = aDiameter;
  106. m_Drill = aDrill;
  107. }
  108. bool operator==( const VIA_DIMENSION& aOther ) const
  109. {
  110. return ( m_Diameter == aOther.m_Diameter ) && ( m_Drill == aOther.m_Drill );
  111. }
  112. bool operator!=( const VIA_DIMENSION& aOther ) const { return !operator==( aOther ); }
  113. bool operator<( const VIA_DIMENSION& aOther ) const
  114. {
  115. if( m_Diameter != aOther.m_Diameter )
  116. return m_Diameter < aOther.m_Diameter;
  117. return m_Drill < aOther.m_Drill;
  118. }
  119. };
  120. /**
  121. * Container to handle a stock of specific differential pairs each with unique track width,
  122. * gap and via gap.
  123. */
  124. struct DIFF_PAIR_DIMENSION
  125. {
  126. int m_Width; // <= 0 means use Netclass differential pair width
  127. int m_Gap; // <= 0 means use Netclass differential pair gap
  128. int m_ViaGap; // <= 0 means use Netclass differential pair via gap
  129. DIFF_PAIR_DIMENSION()
  130. {
  131. m_Width = 0;
  132. m_Gap = 0;
  133. m_ViaGap = 0;
  134. }
  135. DIFF_PAIR_DIMENSION( int aWidth, int aGap, int aViaGap )
  136. {
  137. m_Width = aWidth;
  138. m_Gap = aGap;
  139. m_ViaGap = aViaGap;
  140. }
  141. bool operator==( const DIFF_PAIR_DIMENSION& aOther ) const
  142. {
  143. return ( m_Width == aOther.m_Width )
  144. && ( m_Gap == aOther.m_Gap )
  145. && ( m_ViaGap == aOther.m_ViaGap );
  146. }
  147. bool operator!=( const DIFF_PAIR_DIMENSION& aOther ) const { return !operator==( aOther ); }
  148. bool operator<( const DIFF_PAIR_DIMENSION& aOther ) const
  149. {
  150. if( m_Width != aOther.m_Width )
  151. return m_Width < aOther.m_Width;
  152. if( m_Gap != aOther.m_Gap )
  153. return m_Gap < aOther.m_Gap;
  154. return m_ViaGap < aOther.m_ViaGap;
  155. }
  156. };
  157. enum
  158. {
  159. LAYER_CLASS_SILK = 0,
  160. LAYER_CLASS_COPPER,
  161. LAYER_CLASS_EDGES,
  162. LAYER_CLASS_COURTYARD,
  163. LAYER_CLASS_FAB,
  164. LAYER_CLASS_OTHERS,
  165. LAYER_CLASS_COUNT
  166. };
  167. struct TEXT_ITEM_INFO
  168. {
  169. wxString m_Text;
  170. bool m_Visible;
  171. int m_Layer;
  172. TEXT_ITEM_INFO( const wxString& aText, bool aVisible, int aLayer )
  173. {
  174. m_Text = aText;
  175. m_Visible = aVisible;
  176. m_Layer = aLayer;
  177. }
  178. bool operator==( const TEXT_ITEM_INFO& aOther ) const
  179. {
  180. return m_Text.IsSameAs( aOther.m_Text )
  181. && ( m_Visible == aOther.m_Visible )
  182. && ( m_Layer == aOther.m_Layer );
  183. }
  184. };
  185. // forward declaration from class_track.h
  186. enum class VIATYPE : int;
  187. // forward declarations from dimension.h
  188. enum class DIM_UNITS_FORMAT : int;
  189. enum class DIM_TEXT_POSITION : int;
  190. enum class DIM_UNITS_MODE : int;
  191. enum class DIM_PRECISION : int;
  192. class PAD;
  193. /**
  194. * Container for design settings for a #BOARD object.
  195. */
  196. class BOARD_DESIGN_SETTINGS : public NESTED_SETTINGS
  197. {
  198. public:
  199. BOARD_DESIGN_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath );
  200. virtual ~BOARD_DESIGN_SETTINGS();
  201. bool operator==( const BOARD_DESIGN_SETTINGS& aOther ) const;
  202. bool operator!=( const BOARD_DESIGN_SETTINGS& aOther ) const
  203. {
  204. return !operator==( aOther );
  205. }
  206. BOARD_DESIGN_SETTINGS( const BOARD_DESIGN_SETTINGS& aOther);
  207. BOARD_DESIGN_SETTINGS& operator=( const BOARD_DESIGN_SETTINGS& aOther );
  208. bool LoadFromFile( const wxString& aDirectory = "" ) override;
  209. BOARD_STACKUP& GetStackupDescriptor() { return m_stackup; }
  210. const BOARD_STACKUP& GetStackupDescriptor() const { return m_stackup; }
  211. TEARDROP_PARAMETERS_LIST* GetTeadropParamsList()
  212. {
  213. return &m_TeardropParamsList;
  214. }
  215. SEVERITY GetSeverity( int aDRCErrorCode );
  216. /**
  217. * Return true if the DRC error code's severity is SEVERITY_IGNORE.
  218. */
  219. bool Ignore( int aDRCErrorCode );
  220. ZONE_SETTINGS& GetDefaultZoneSettings()
  221. {
  222. return m_defaultZoneSettings;
  223. }
  224. void SetDefaultZoneSettings( const ZONE_SETTINGS& aSettings )
  225. {
  226. m_defaultZoneSettings = aSettings;
  227. }
  228. /**
  229. * @return the current net class name.
  230. */
  231. inline const wxString& GetCurrentNetClassName() const
  232. {
  233. return m_currentNetClassName;
  234. }
  235. /**
  236. * Return true if netclass values should be used to obtain appropriate track width.
  237. */
  238. inline bool UseNetClassTrack() const
  239. {
  240. return ( m_trackWidthIndex == 0 && !m_useCustomTrackVia );
  241. }
  242. /**
  243. * Return true if netclass values should be used to obtain appropriate via size.
  244. */
  245. inline bool UseNetClassVia() const
  246. {
  247. return ( m_viaSizeIndex == 0 && !m_useCustomTrackVia );
  248. }
  249. /**
  250. * Return true if netclass values should be used to obtain appropriate diff pair dimensions.
  251. */
  252. inline bool UseNetClassDiffPair() const
  253. {
  254. return ( m_diffPairIndex == 0 && !m_useCustomDiffPair );
  255. }
  256. /**
  257. * @return the biggest clearance value found in NetClasses list.
  258. */
  259. int GetBiggestClearanceValue() const;
  260. /**
  261. * @return the smallest clearance value found in NetClasses list.
  262. */
  263. int GetSmallestClearanceValue() const;
  264. /**
  265. * @return the current track width list index.
  266. */
  267. inline unsigned GetTrackWidthIndex() const { return m_trackWidthIndex; }
  268. /**
  269. * Set the current track width list index to \a aIndex.
  270. *
  271. * @param aIndex is the track width list index.
  272. */
  273. void SetTrackWidthIndex( unsigned aIndex );
  274. /**
  275. * @return the current track width according to the selected options
  276. * ( using the default netclass value or a preset/custom value )
  277. * the default netclass is always in m_TrackWidthList[0]
  278. */
  279. int GetCurrentTrackWidth() const;
  280. /**
  281. * Sets custom width for track (i.e. not available in netclasses or preset list).
  282. *
  283. * To have it returned with GetCurrentTrackWidth() you need to enable custom track &
  284. * via sizes with #UseCustomTrackViaSize().
  285. *
  286. * @param aWidth is the new track width.
  287. */
  288. inline void SetCustomTrackWidth( int aWidth )
  289. {
  290. m_customTrackWidth = aWidth;
  291. }
  292. /**
  293. * @return Current custom width for a track.
  294. */
  295. inline int GetCustomTrackWidth() const
  296. {
  297. return m_customTrackWidth;
  298. }
  299. /**
  300. * @return the current via size list index.
  301. */
  302. inline unsigned GetViaSizeIndex() const
  303. {
  304. return m_viaSizeIndex;
  305. }
  306. /**
  307. * Set the current via size list index to \a aIndex.
  308. *
  309. * @param aIndex is the via size list index.
  310. */
  311. void SetViaSizeIndex( unsigned aIndex );
  312. /**
  313. * @return the current via size, according to the selected options
  314. * ( using the default netclass value or a preset/custom value )
  315. * the default netclass is always in m_TrackWidthList[0]
  316. */
  317. int GetCurrentViaSize() const;
  318. /**
  319. * Set custom size for via diameter (i.e. not available in netclasses or preset list).
  320. *
  321. * To have it returned with GetCurrentViaSize() you need to enable custom track & via sizes
  322. * with #UseCustomTrackViaSize().
  323. *
  324. * @param aSize is the new drill diameter.
  325. */
  326. inline void SetCustomViaSize( int aSize )
  327. {
  328. m_customViaSize.m_Diameter = aSize;
  329. }
  330. /**
  331. * @return Current custom size for the via diameter.
  332. */
  333. inline int GetCustomViaSize() const
  334. {
  335. return m_customViaSize.m_Diameter;
  336. }
  337. /**
  338. * @return the current via size, according to the selected options
  339. * ( using the default netclass value or a preset/custom value )
  340. * the default netclass is always in m_TrackWidthList[0].
  341. */
  342. int GetCurrentViaDrill() const;
  343. /**
  344. * Sets custom size for via drill (i.e. not available in netclasses or preset list).
  345. *
  346. * To have it returned with GetCurrentViaDrill() you need to enable custom track & via
  347. * sizes with #UseCustomTrackViaSize().
  348. *
  349. * @param aDrill is the new drill size.
  350. */
  351. inline void SetCustomViaDrill( int aDrill )
  352. {
  353. m_customViaSize.m_Drill = aDrill;
  354. }
  355. /**
  356. * @return Current custom size for the via drill.
  357. */
  358. inline int GetCustomViaDrill() const
  359. {
  360. return m_customViaSize.m_Drill;
  361. }
  362. /**
  363. * Enables/disables custom track/via size settings.
  364. *
  365. * If enabled, values set with #SetCustomTrackWidth(), #SetCustomViaSize(),
  366. * and #SetCustomViaDrill() are used for newly created tracks and vias.
  367. *
  368. * @param aEnabled decides if custom settings should be used for new tracks/vias.
  369. */
  370. inline void UseCustomTrackViaSize( bool aEnabled )
  371. {
  372. m_useCustomTrackVia = aEnabled;
  373. }
  374. /**
  375. * @return True if custom sizes of tracks & vias are enabled, false otherwise.
  376. */
  377. inline bool UseCustomTrackViaSize() const
  378. {
  379. return m_useCustomTrackVia;
  380. }
  381. /**
  382. * @return the current diff pair dimension list index.
  383. */
  384. inline unsigned GetDiffPairIndex() const { return m_diffPairIndex; }
  385. /**
  386. * @param aIndex is the diff pair dimensions list index to set.
  387. */
  388. void SetDiffPairIndex( unsigned aIndex );
  389. /**
  390. * Sets custom track width for differential pairs (i.e. not available in netclasses or
  391. * preset list).
  392. *
  393. * @param aDrill is the new track wdith.
  394. */
  395. inline void SetCustomDiffPairWidth( int aWidth )
  396. {
  397. m_customDiffPair.m_Width = aWidth;
  398. }
  399. /**
  400. * @return Current custom track width for differential pairs.
  401. */
  402. inline int GetCustomDiffPairWidth()
  403. {
  404. return m_customDiffPair.m_Width;
  405. }
  406. /**
  407. * Sets custom gap for differential pairs (i.e. not available in netclasses or preset
  408. * list).
  409. * @param aGap is the new gap.
  410. */
  411. inline void SetCustomDiffPairGap( int aGap )
  412. {
  413. m_customDiffPair.m_Gap = aGap;
  414. }
  415. /**
  416. * Function GetCustomDiffPairGap
  417. * @return Current custom gap width for differential pairs.
  418. */
  419. inline int GetCustomDiffPairGap()
  420. {
  421. return m_customDiffPair.m_Gap;
  422. }
  423. /**
  424. * Sets custom via gap for differential pairs (i.e. not available in netclasses or
  425. * preset list).
  426. *
  427. * @param aGap is the new gap. Specify 0 to use the DiffPairGap for vias as well.
  428. */
  429. inline void SetCustomDiffPairViaGap( int aGap )
  430. {
  431. m_customDiffPair.m_ViaGap = aGap;
  432. }
  433. /**
  434. * @return Current custom via gap width for differential pairs.
  435. */
  436. inline int GetCustomDiffPairViaGap()
  437. {
  438. return m_customDiffPair.m_ViaGap > 0 ? m_customDiffPair.m_ViaGap : m_customDiffPair.m_Gap;
  439. }
  440. /**
  441. * Enables/disables custom differential pair dimensions.
  442. *
  443. * @param aEnabled decides if custom settings should be used for new differential pairs.
  444. */
  445. inline void UseCustomDiffPairDimensions( bool aEnabled )
  446. {
  447. m_useCustomDiffPair = aEnabled;
  448. }
  449. /**
  450. * @return True if custom sizes of diff pairs are enabled, false otherwise.
  451. */
  452. inline bool UseCustomDiffPairDimensions() const
  453. {
  454. return m_useCustomDiffPair;
  455. }
  456. /**
  457. * @return the current diff pair track width, according to the selected options
  458. * ( using the default netclass value or a preset/custom value )
  459. */
  460. int GetCurrentDiffPairWidth() const;
  461. /**
  462. * @return the current diff pair gap, according to the selected options
  463. * ( using the default netclass value or a preset/custom value )
  464. */
  465. int GetCurrentDiffPairGap() const;
  466. /**
  467. * @return the current diff pair via gap, according to the selected options
  468. * ( using the default netclass value or a preset/custom value )
  469. * the default netclass is always in m_DiffPairDimensionsList[0].
  470. */
  471. int GetCurrentDiffPairViaGap() const;
  472. /**
  473. * Return a bit-mask of all the layers that are enabled.
  474. *
  475. * @return the enabled layers in bit-mapped form.
  476. */
  477. inline LSET GetEnabledLayers() const
  478. {
  479. return m_enabledLayers;
  480. }
  481. /**
  482. * Change the bit-mask of enabled layers to \a aMask.
  483. *
  484. * @param aMask = The new bit-mask of enabled layers.
  485. */
  486. void SetEnabledLayers( LSET aMask );
  487. /**
  488. * Test whether a given layer \a aLayerId is enabled.
  489. *
  490. * @param aLayerId The layer to be tested.
  491. * @return true if the layer is enabled.
  492. */
  493. inline bool IsLayerEnabled( PCB_LAYER_ID aLayerId ) const
  494. {
  495. if( aLayerId >= 0 && aLayerId < PCB_LAYER_ID_COUNT )
  496. return m_enabledLayers[aLayerId];
  497. return false;
  498. }
  499. /**
  500. * @return the number of enabled copper layers.
  501. */
  502. inline int GetCopperLayerCount() const
  503. {
  504. return m_copperLayerCount;
  505. }
  506. /**
  507. * Set the copper layer count to \a aNewLayerCount.
  508. *
  509. * @param aNewLayerCount The new number of enabled copper layers.
  510. */
  511. void SetCopperLayerCount( int aNewLayerCount );
  512. /**
  513. * The full thickness of the board including copper and masks.
  514. * @return
  515. */
  516. inline int GetBoardThickness() const { return m_boardThickness; }
  517. inline void SetBoardThickness( int aThickness ) { m_boardThickness = aThickness; }
  518. /*
  519. * Return an epsilon which accounts for rounding errors, etc.
  520. *
  521. * While currently an advanced cfg, going through this API allows us to easily change
  522. * it to board-specific if so desired.
  523. */
  524. int GetDRCEpsilon() const;
  525. /**
  526. * Pad & via drills are finish size.
  527. *
  528. * Adding the hole plating thickness gives you the actual hole size.
  529. */
  530. int GetHolePlatingThickness() const;
  531. /**
  532. * Return the default graphic segment thickness from the layer class for the given layer.
  533. */
  534. int GetLineThickness( PCB_LAYER_ID aLayer ) const;
  535. /**
  536. * Return the default text size from the layer class for the given layer.
  537. */
  538. VECTOR2I GetTextSize( PCB_LAYER_ID aLayer ) const;
  539. /**
  540. * Return the default text thickness from the layer class for the given layer.
  541. */
  542. int GetTextThickness( PCB_LAYER_ID aLayer ) const;
  543. bool GetTextItalic( PCB_LAYER_ID aLayer ) const;
  544. bool GetTextUpright( PCB_LAYER_ID aLayer ) const;
  545. int GetLayerClass( PCB_LAYER_ID aLayer ) const;
  546. void SetAuxOrigin( const VECTOR2I& aOrigin ) { m_auxOrigin = aOrigin; }
  547. const VECTOR2I& GetAuxOrigin() { return m_auxOrigin; }
  548. void SetGridOrigin( const VECTOR2I& aOrigin ) { m_gridOrigin = aOrigin; }
  549. const VECTOR2I& GetGridOrigin() { return m_gridOrigin; }
  550. void SetDefaultMasterPad();
  551. private:
  552. void initFromOther( const BOARD_DESIGN_SETTINGS& aOther );
  553. bool migrateSchema0to1();
  554. public:
  555. // Note: the first value in each dimensions list is the current netclass value
  556. std::vector<int> m_TrackWidthList;
  557. std::vector<VIA_DIMENSION> m_ViasDimensionsList;
  558. std::vector<DIFF_PAIR_DIMENSION> m_DiffPairDimensionsList;
  559. /** The parameters of teardrops for the different teardrop targets (via/pad, track end)
  560. * 3 set of parameters always exist: for round shapes, for rect shapes, for track ends
  561. */
  562. TEARDROP_PARAMETERS_LIST m_TeardropParamsList;
  563. PNS::MEANDER_SETTINGS m_SingleTrackMeanderSettings;
  564. PNS::MEANDER_SETTINGS m_DiffPairMeanderSettings;
  565. PNS::MEANDER_SETTINGS m_SkewMeanderSettings;
  566. VIATYPE m_CurrentViaType; ///< (VIA_BLIND_BURIED, VIA_THROUGH, VIA_MICROVIA)
  567. bool m_UseConnectedTrackWidth; // use width of existing track when creating a new,
  568. // connected track
  569. bool m_TempOverrideTrackWidth; // use selected track width temporarily even when
  570. // using connected track width
  571. int m_MinClearance; // overall min clearance
  572. int m_MinConn; // overall min connection width
  573. int m_TrackMinWidth; // overall min track width
  574. int m_ViasMinAnnularWidth; // overall minimum width of the via copper ring
  575. int m_ViasMinSize; // overall vias (not micro vias) min diameter
  576. int m_MinThroughDrill; // through hole (not micro vias) min drill diameter
  577. int m_MicroViasMinSize; // micro vias min diameter
  578. int m_MicroViasMinDrill; // micro vias min drill diameter
  579. int m_CopperEdgeClearance;
  580. int m_HoleClearance; // Hole to copper clearance
  581. int m_HoleToHoleMin; // Min width of web between two drilled holes
  582. int m_SilkClearance; // Min dist between two silk items
  583. int m_MinResolvedSpokes; // Min spoke count to not be a starved thermal
  584. int m_MinSilkTextHeight; // Min text height for silkscreen layers
  585. int m_MinSilkTextThickness; // Min text thickness for silkscreen layers
  586. std::shared_ptr<DRC_ENGINE> m_DRCEngine;
  587. std::map<int, SEVERITY> m_DRCSeverities; // Map from DRCErrorCode to SEVERITY
  588. std::set<wxString> m_DrcExclusions; // Serialized excluded DRC markers
  589. std::map<wxString, wxString> m_DrcExclusionComments; // Map from serialization to comment
  590. // When smoothing the zone's outline there's the question of external fillets (that is, those
  591. // applied to concave corners). While it seems safer to never have copper extend outside the
  592. // zone outline, 5.1.x and prior did indeed fill them so we leave the mode available.
  593. bool m_ZoneKeepExternalFillets;
  594. // Maximum error allowed when approximating circles and arcs to segments
  595. int m_MaxError;
  596. // Global mask margins:
  597. int m_SolderMaskExpansion; // Solder mask inflation around the pad or via
  598. int m_SolderMaskMinWidth; // Solder mask min width (2 areas closer than this
  599. // width are merged)
  600. int m_SolderMaskToCopperClearance; // Min distance allowed from copper to a mask
  601. // aperture of another net
  602. int m_SolderPasteMargin; // Solder paste margin absolute value
  603. double m_SolderPasteMarginRatio; // Solder mask margin ratio value of pad size
  604. // The final margin is the sum of these 2 values
  605. bool m_AllowSoldermaskBridgesInFPs;
  606. bool m_TentViasFront; // The default tenting option if not overridden on an
  607. bool m_TentViasBack; // individual via
  608. std::shared_ptr<NET_SETTINGS> m_NetSettings;
  609. // Variables used in footprint editing (default value in item/footprint creation)
  610. std::vector<TEXT_ITEM_INFO> m_DefaultFPTextItems;
  611. // Arrays of default values for the various layer classes.
  612. int m_LineThickness[ LAYER_CLASS_COUNT ];
  613. VECTOR2I m_TextSize[LAYER_CLASS_COUNT];
  614. int m_TextThickness[ LAYER_CLASS_COUNT ];
  615. bool m_TextItalic[ LAYER_CLASS_COUNT ];
  616. bool m_TextUpright[ LAYER_CLASS_COUNT ];
  617. // Default values for dimension objects
  618. DIM_UNITS_MODE m_DimensionUnitsMode;
  619. DIM_PRECISION m_DimensionPrecision; ///< Number of digits after the decimal
  620. DIM_UNITS_FORMAT m_DimensionUnitsFormat;
  621. bool m_DimensionSuppressZeroes;
  622. DIM_TEXT_POSITION m_DimensionTextPosition;
  623. bool m_DimensionKeepTextAligned;
  624. int m_DimensionArrowLength;
  625. int m_DimensionExtensionOffset;
  626. bool m_StyleFPFields;
  627. bool m_StyleFPText;
  628. bool m_StyleFPShapes;
  629. // Miscellaneous
  630. std::unique_ptr<PAD> m_Pad_Master; // A dummy pad to store all default parameters
  631. // when importing values or creating a new pad
  632. // Set to true if the board has a stackup management.
  633. // If not set a default basic stackup will be used to generate the gbrjob file.
  634. // Could be removed later, or at least always set to true
  635. bool m_HasStackup;
  636. /// Enable inclusion of stackup height in track length measurements and length tuning
  637. bool m_UseHeightForLengthCalcs;
  638. private:
  639. VECTOR2I m_auxOrigin; ///< origin for plot exports
  640. VECTOR2I m_gridOrigin; ///< origin for grid offsets
  641. // Indices into the trackWidth, viaSizes and diffPairDimensions lists.
  642. // The 0 index is always the current netclass value(s)
  643. unsigned m_trackWidthIndex;
  644. unsigned m_viaSizeIndex;
  645. unsigned m_diffPairIndex;
  646. // Custom values for track/via sizes (specified via dialog instead of netclass or lists)
  647. bool m_useCustomTrackVia;
  648. int m_customTrackWidth;
  649. VIA_DIMENSION m_customViaSize;
  650. // Custom values for differential pairs (specified via dialog instead of netclass/lists)
  651. bool m_useCustomDiffPair;
  652. DIFF_PAIR_DIMENSION m_customDiffPair;
  653. int m_copperLayerCount; ///< Number of copper layers for this design
  654. LSET m_enabledLayers; ///< Bit-mask for layer enabling
  655. int m_boardThickness; ///< Board thickness for 3D viewer
  656. /// Current net class name used to display netclass info.
  657. /// This is also the last used netclass after starting a track.
  658. wxString m_currentNetClassName;
  659. /** the description of layers stackup, for board fabrication
  660. * only physical layers are in layers stackup.
  661. * It includes not only layers enabled for the board edition, but also dielectric layers
  662. */
  663. BOARD_STACKUP m_stackup;
  664. /// The default settings that will be used for new zones
  665. ZONE_SETTINGS m_defaultZoneSettings;
  666. };
  667. #endif // BOARD_DESIGN_SETTINGS_H_