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.

766 lines
24 KiB

14 years ago
* KIWAY Milestone A): Make major modules into DLL/DSOs. ! The initial testing of this commit should be done using a Debug build so that all the wxASSERT()s are enabled. Also, be sure and keep enabled the USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it off is senseless anyways. If you want stable code, go back to a prior version, the one tagged with "stable". * Relocate all functionality out of the wxApp derivative into more finely targeted purposes: a) DLL/DSO specific b) PROJECT specific c) EXE or process specific d) configuration file specific data e) configuration file manipulations functions. All of this functionality was blended into an extremely large wxApp derivative and that was incompatible with the desire to support multiple concurrently loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects. An amazing amount of organization come from simply sorting each bit of functionality into the proper box. * Switch to wxConfigBase from wxConfig everywhere except instantiation. * Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD, PGM_SINGLE_TOP, * Remove "Return" prefix on many function names. * Remove obvious comments from CMakeLists.txt files, and from else() and endif()s. * Fix building boost for use in a DSO on linux. * Remove some of the assumptions in the CMakeLists.txt files that windows had to be the host platform when building windows binaries. * Reduce the number of wxStrings being constructed at program load time via static construction. * Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that these functions are useful even when the wxConfigBase comes from another source, as is the case in the KICAD_MANAGER_FRAME. * Move the setting of the KIPRJMOD environment variable into class PROJECT, so that it can be moved into a project variable soon, and out of FP_LIB_TABLE. * Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all its child wxFrames and wxDialogs now have a Kiway() member function which returns a KIWAY& that that window tree branch is in support of. This is like wxWindows DNA in that child windows get this member with proper value at time of construction. * Anticipate some of the needs for milestones B) and C) and make code adjustments now in an effort to reduce work in those milestones. * No testing has been done for python scripting, since milestone C) has that being largely reworked and re-thought-out.
12 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-2022 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 <config_params.h>
  30. #include <board_stackup_manager/board_stackup.h>
  31. #include <drc/drc_engine.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. #define DEFAULT_SILK_LINE_WIDTH 0.12
  37. #define DEFAULT_COPPER_LINE_WIDTH 0.20
  38. #define DEFAULT_EDGE_WIDTH 0.05
  39. #define DEFAULT_COURTYARD_WIDTH 0.05
  40. #define DEFAULT_LINE_WIDTH 0.10
  41. #define DEFAULT_SILK_TEXT_SIZE 1.0
  42. #define DEFAULT_COPPER_TEXT_SIZE 1.5
  43. #define DEFAULT_TEXT_SIZE 1.0
  44. #define DEFAULT_SILK_TEXT_WIDTH 0.15
  45. #define DEFAULT_COPPER_TEXT_WIDTH 0.30
  46. #define DEFAULT_TEXT_WIDTH 0.15
  47. #define DEFAULT_DIMENSION_ARROW_LENGTH 50 // mils, for legacy purposes
  48. #define DEFAULT_DIMENSION_EXTENSION_OFFSET 0.5
  49. // Board thickness, mainly for 3D view:
  50. #define DEFAULT_BOARD_THICKNESS_MM 1.6
  51. #define DEFAULT_PCB_EDGE_THICKNESS 0.15
  52. // soldermask to pad clearance. The default is 0 because usually board houses
  53. // create a clearance depending on their fab process: mask material, color, price, etc.
  54. #define DEFAULT_SOLDERMASK_EXPANSION 0.0
  55. #define DEFAULT_SOLDERMASK_TO_COPPER_CLEARANCE 0.0
  56. #define DEFAULT_SOLDERMASK_MIN_WIDTH 0.0
  57. #define DEFAULT_SOLDERPASTE_CLEARANCE 0.0
  58. #define DEFAULT_SOLDERPASTE_RATIO 0.0
  59. #define DEFAULT_CUSTOMTRACKWIDTH 0.2
  60. #define DEFAULT_CUSTOMDPAIRWIDTH 0.125
  61. #define DEFAULT_CUSTOMDPAIRGAP 0.18
  62. #define DEFAULT_CUSTOMDPAIRVIAGAP 0.18
  63. #define DEFAULT_MINCLEARANCE 0.0 // overall min clearance
  64. #define DEFAULT_MINCONNECTION 0.0 // overall min connection width
  65. #define DEFAULT_TRACKMINWIDTH 0.2 // track width min value
  66. #define DEFAULT_VIASMINSIZE 0.4 // vias (not micro vias) min diameter
  67. #define DEFAULT_MINTHROUGHDRILL 0.3 // through holes (not micro vias) min drill diameter
  68. #define DEFAULT_MICROVIASMINSIZE 0.2 // micro vias (not vias) min diameter
  69. #define DEFAULT_MICROVIASMINDRILL 0.1 // micro vias (not vias) min drill diameter
  70. #define DEFAULT_HOLETOHOLEMIN 0.25 // minimum web thickness between two drilled holes
  71. #define DEFAULT_HOLECLEARANCE 0.25 // copper-to-hole clearance (from IPC level A)
  72. #define DEFAULT_COPPEREDGECLEARANCE 0.01 // clearance between copper items and edge cuts
  73. #define LEGACY_COPPEREDGECLEARANCE -0.01 // A flag to indicate the legacy method (based
  74. // on edge cut line thicknesses) should be used.
  75. #define DEFAULT_SILKCLEARANCE 0.0
  76. #define DEFAULT_MINRESOLVEDSPOKES 2 // Fewer resolved spokes indicates a starved thermal
  77. #define MINIMUM_ERROR_SIZE_MM 0.001
  78. #define MAXIMUM_ERROR_SIZE_MM 0.1
  79. /**
  80. * Container to handle a stock of specific vias each with unique diameter and drill sizes
  81. * in the #BOARD class.
  82. */
  83. struct VIA_DIMENSION
  84. {
  85. int m_Diameter; // <= 0 means use Netclass via diameter
  86. int m_Drill; // <= 0 means use Netclass via drill
  87. VIA_DIMENSION()
  88. {
  89. m_Diameter = 0;
  90. m_Drill = 0;
  91. }
  92. VIA_DIMENSION( int aDiameter, int aDrill )
  93. {
  94. m_Diameter = aDiameter;
  95. m_Drill = aDrill;
  96. }
  97. bool operator==( const VIA_DIMENSION& aOther ) const
  98. {
  99. return ( m_Diameter == aOther.m_Diameter ) && ( m_Drill == aOther.m_Drill );
  100. }
  101. bool operator<( const VIA_DIMENSION& aOther ) const
  102. {
  103. if( m_Diameter != aOther.m_Diameter )
  104. return m_Diameter < aOther.m_Diameter;
  105. return m_Drill < aOther.m_Drill;
  106. }
  107. };
  108. /**
  109. * Container to handle a stock of specific differential pairs each with unique track width,
  110. * gap and via gap.
  111. */
  112. struct DIFF_PAIR_DIMENSION
  113. {
  114. int m_Width; // <= 0 means use Netclass differential pair width
  115. int m_Gap; // <= 0 means use Netclass differential pair gap
  116. int m_ViaGap; // <= 0 means use Netclass differential pair via gap
  117. DIFF_PAIR_DIMENSION()
  118. {
  119. m_Width = 0;
  120. m_Gap = 0;
  121. m_ViaGap = 0;
  122. }
  123. DIFF_PAIR_DIMENSION( int aWidth, int aGap, int aViaGap )
  124. {
  125. m_Width = aWidth;
  126. m_Gap = aGap;
  127. m_ViaGap = aViaGap;
  128. }
  129. bool operator==( const DIFF_PAIR_DIMENSION& aOther ) const
  130. {
  131. return ( m_Width == aOther.m_Width )
  132. && ( m_Gap == aOther.m_Gap )
  133. && ( m_ViaGap == aOther.m_ViaGap );
  134. }
  135. bool operator<( const DIFF_PAIR_DIMENSION& aOther ) const
  136. {
  137. if( m_Width != aOther.m_Width )
  138. return m_Width < aOther.m_Width;
  139. if( m_Gap != aOther.m_Gap )
  140. return m_Gap < aOther.m_Gap;
  141. return m_ViaGap < aOther.m_ViaGap;
  142. }
  143. };
  144. enum
  145. {
  146. LAYER_CLASS_SILK = 0,
  147. LAYER_CLASS_COPPER,
  148. LAYER_CLASS_EDGES,
  149. LAYER_CLASS_COURTYARD,
  150. LAYER_CLASS_FAB,
  151. LAYER_CLASS_OTHERS,
  152. LAYER_CLASS_COUNT
  153. };
  154. struct TEXT_ITEM_INFO
  155. {
  156. wxString m_Text;
  157. bool m_Visible;
  158. int m_Layer;
  159. TEXT_ITEM_INFO( const wxString& aText, bool aVisible, int aLayer )
  160. {
  161. m_Text = aText;
  162. m_Visible = aVisible;
  163. m_Layer = aLayer;
  164. }
  165. };
  166. // forward declaration from class_track.h
  167. enum class VIATYPE : int;
  168. // forward declarations from dimension.h
  169. enum class DIM_UNITS_FORMAT : int;
  170. enum class DIM_TEXT_POSITION : int;
  171. enum class DIM_UNITS_MODE : int;
  172. class PAD;
  173. /**
  174. * Container for design settings for a #BOARD object.
  175. */
  176. class BOARD_DESIGN_SETTINGS : public NESTED_SETTINGS
  177. {
  178. public:
  179. BOARD_DESIGN_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath );
  180. virtual ~BOARD_DESIGN_SETTINGS();
  181. BOARD_DESIGN_SETTINGS( const BOARD_DESIGN_SETTINGS& aOther);
  182. BOARD_DESIGN_SETTINGS& operator=( const BOARD_DESIGN_SETTINGS& aOther );
  183. bool LoadFromFile( const wxString& aDirectory = "" ) override;
  184. BOARD_STACKUP& GetStackupDescriptor() { return m_stackup; }
  185. const BOARD_STACKUP& GetStackupDescriptor() const { return m_stackup; }
  186. TEARDROP_PARAMETERS_LIST* GetTeadropParamsList()
  187. {
  188. return &m_TeardropParamsList;
  189. }
  190. SEVERITY GetSeverity( int aDRCErrorCode );
  191. /**
  192. * Return true if the DRC error code's severity is SEVERITY_IGNORE.
  193. */
  194. bool Ignore( int aDRCErrorCode );
  195. ZONE_SETTINGS& GetDefaultZoneSettings()
  196. {
  197. return m_defaultZoneSettings;
  198. }
  199. void SetDefaultZoneSettings( const ZONE_SETTINGS& aSettings )
  200. {
  201. m_defaultZoneSettings = aSettings;
  202. }
  203. /**
  204. * @return the current net class name.
  205. */
  206. inline const wxString& GetCurrentNetClassName() const
  207. {
  208. return m_currentNetClassName;
  209. }
  210. /**
  211. * Return true if netclass values should be used to obtain appropriate track width.
  212. */
  213. inline bool UseNetClassTrack() const
  214. {
  215. return ( m_trackWidthIndex == 0 && !m_useCustomTrackVia );
  216. }
  217. /**
  218. * Return true if netclass values should be used to obtain appropriate via size.
  219. */
  220. inline bool UseNetClassVia() const
  221. {
  222. return ( m_viaSizeIndex == 0 && !m_useCustomTrackVia );
  223. }
  224. /**
  225. * Return true if netclass values should be used to obtain appropriate diff pair dimensions.
  226. */
  227. inline bool UseNetClassDiffPair() const
  228. {
  229. return ( m_diffPairIndex == 0 && !m_useCustomDiffPair );
  230. }
  231. /**
  232. * @return the biggest clearance value found in NetClasses list.
  233. */
  234. int GetBiggestClearanceValue() const;
  235. /**
  236. * @return the smallest clearance value found in NetClasses list.
  237. */
  238. int GetSmallestClearanceValue() const;
  239. /**
  240. * @return the current track width list index.
  241. */
  242. inline unsigned GetTrackWidthIndex() const { return m_trackWidthIndex; }
  243. /**
  244. * Set the current track width list index to \a aIndex.
  245. *
  246. * @param aIndex is the track width list index.
  247. */
  248. void SetTrackWidthIndex( unsigned aIndex );
  249. /**
  250. * @return the current track width according to the selected options
  251. * ( using the default netclass value or a preset/custom value )
  252. * the default netclass is always in m_TrackWidthList[0]
  253. */
  254. int GetCurrentTrackWidth() const;
  255. /**
  256. * Sets custom width for track (i.e. not available in netclasses or preset list).
  257. *
  258. * To have it returned with GetCurrentTrackWidth() you need to enable custom track &
  259. * via sizes with #UseCustomTrackViaSize().
  260. *
  261. * @param aWidth is the new track width.
  262. */
  263. inline void SetCustomTrackWidth( int aWidth )
  264. {
  265. m_customTrackWidth = aWidth;
  266. }
  267. /**
  268. * @return Current custom width for a track.
  269. */
  270. inline int GetCustomTrackWidth() const
  271. {
  272. return m_customTrackWidth;
  273. }
  274. /**
  275. * @return the current via size list index.
  276. */
  277. inline unsigned GetViaSizeIndex() const
  278. {
  279. return m_viaSizeIndex;
  280. }
  281. /**
  282. * Set the current via size list index to \a aIndex.
  283. *
  284. * @param aIndex is the via size list index.
  285. */
  286. void SetViaSizeIndex( unsigned aIndex );
  287. /**
  288. * @return the current via size, according to the selected options
  289. * ( using the default netclass value or a preset/custom value )
  290. * the default netclass is always in m_TrackWidthList[0]
  291. */
  292. int GetCurrentViaSize() const;
  293. /**
  294. * Set custom size for via diameter (i.e. not available in netclasses or preset list).
  295. *
  296. * To have it returned with GetCurrentViaSize() you need to enable custom track & via sizes
  297. * with #UseCustomTrackViaSize().
  298. *
  299. * @param aSize is the new drill diameter.
  300. */
  301. inline void SetCustomViaSize( int aSize )
  302. {
  303. m_customViaSize.m_Diameter = aSize;
  304. }
  305. /**
  306. * @return Current custom size for the via diameter.
  307. */
  308. inline int GetCustomViaSize() const
  309. {
  310. return m_customViaSize.m_Diameter;
  311. }
  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 GetCurrentViaDrill() const;
  318. /**
  319. * Sets custom size for via drill (i.e. not available in netclasses or preset list).
  320. *
  321. * To have it returned with GetCurrentViaDrill() you need to enable custom track & via
  322. * sizes with #UseCustomTrackViaSize().
  323. *
  324. * @param aDrill is the new drill size.
  325. */
  326. inline void SetCustomViaDrill( int aDrill )
  327. {
  328. m_customViaSize.m_Drill = aDrill;
  329. }
  330. /**
  331. * @return Current custom size for the via drill.
  332. */
  333. inline int GetCustomViaDrill() const
  334. {
  335. return m_customViaSize.m_Drill;
  336. }
  337. /**
  338. * Enables/disables custom track/via size settings.
  339. *
  340. * If enabled, values set with #SetCustomTrackWidth(), #SetCustomViaSize(),
  341. * and #SetCustomViaDrill() are used for newly created tracks and vias.
  342. *
  343. * @param aEnabled decides if custom settings should be used for new tracks/vias.
  344. */
  345. inline void UseCustomTrackViaSize( bool aEnabled )
  346. {
  347. m_useCustomTrackVia = aEnabled;
  348. }
  349. /**
  350. * @return True if custom sizes of tracks & vias are enabled, false otherwise.
  351. */
  352. inline bool UseCustomTrackViaSize() const
  353. {
  354. return m_useCustomTrackVia;
  355. }
  356. /**
  357. * @return the current diff pair dimension list index.
  358. */
  359. inline unsigned GetDiffPairIndex() const { return m_diffPairIndex; }
  360. /**
  361. * @param aIndex is the diff pair dimensions list index to set.
  362. */
  363. void SetDiffPairIndex( unsigned aIndex );
  364. /**
  365. * Sets custom track width for differential pairs (i.e. not available in netclasses or
  366. * preset list).
  367. *
  368. * @param aDrill is the new track wdith.
  369. */
  370. inline void SetCustomDiffPairWidth( int aWidth )
  371. {
  372. m_customDiffPair.m_Width = aWidth;
  373. }
  374. /**
  375. * @return Current custom track width for differential pairs.
  376. */
  377. inline int GetCustomDiffPairWidth()
  378. {
  379. return m_customDiffPair.m_Width;
  380. }
  381. /**
  382. * Sets custom gap for differential pairs (i.e. not available in netclasses or preset
  383. * list).
  384. * @param aGap is the new gap.
  385. */
  386. inline void SetCustomDiffPairGap( int aGap )
  387. {
  388. m_customDiffPair.m_Gap = aGap;
  389. }
  390. /**
  391. * Function GetCustomDiffPairGap
  392. * @return Current custom gap width for differential pairs.
  393. */
  394. inline int GetCustomDiffPairGap()
  395. {
  396. return m_customDiffPair.m_Gap;
  397. }
  398. /**
  399. * Sets custom via gap for differential pairs (i.e. not available in netclasses or
  400. * preset list).
  401. *
  402. * @param aGap is the new gap. Specify 0 to use the DiffPairGap for vias as well.
  403. */
  404. inline void SetCustomDiffPairViaGap( int aGap )
  405. {
  406. m_customDiffPair.m_ViaGap = aGap;
  407. }
  408. /**
  409. * @return Current custom via gap width for differential pairs.
  410. */
  411. inline int GetCustomDiffPairViaGap()
  412. {
  413. return m_customDiffPair.m_ViaGap > 0 ? m_customDiffPair.m_ViaGap : m_customDiffPair.m_Gap;
  414. }
  415. /**
  416. * Enables/disables custom differential pair dimensions.
  417. *
  418. * @param aEnabled decides if custom settings should be used for new differential pairs.
  419. */
  420. inline void UseCustomDiffPairDimensions( bool aEnabled )
  421. {
  422. m_useCustomDiffPair = aEnabled;
  423. }
  424. /**
  425. * @return True if custom sizes of diff pairs are enabled, false otherwise.
  426. */
  427. inline bool UseCustomDiffPairDimensions() const
  428. {
  429. return m_useCustomDiffPair;
  430. }
  431. /**
  432. * @return the current diff pair track width, according to the selected options
  433. * ( using the default netclass value or a preset/custom value )
  434. */
  435. int GetCurrentDiffPairWidth() const;
  436. /**
  437. * @return the current diff pair gap, according to the selected options
  438. * ( using the default netclass value or a preset/custom value )
  439. */
  440. int GetCurrentDiffPairGap() const;
  441. /**
  442. * @return the current diff pair via gap, according to the selected options
  443. * ( using the default netclass value or a preset/custom value )
  444. * the default netclass is always in m_DiffPairDimensionsList[0].
  445. */
  446. int GetCurrentDiffPairViaGap() const;
  447. /**
  448. * Return a bit-mask of all the layers that are enabled.
  449. *
  450. * @return the enabled layers in bit-mapped form.
  451. */
  452. inline LSET GetEnabledLayers() const
  453. {
  454. return m_enabledLayers;
  455. }
  456. /**
  457. * Change the bit-mask of enabled layers to \a aMask.
  458. *
  459. * @param aMask = The new bit-mask of enabled layers.
  460. */
  461. void SetEnabledLayers( LSET aMask );
  462. /**
  463. * Test whether a given layer \a aLayerId is enabled.
  464. *
  465. * @param aLayerId The layer to be tested.
  466. * @return true if the layer is enabled.
  467. */
  468. inline bool IsLayerEnabled( PCB_LAYER_ID aLayerId ) const
  469. {
  470. if( aLayerId >= 0 && aLayerId < PCB_LAYER_ID_COUNT )
  471. return m_enabledLayers[aLayerId];
  472. return false;
  473. }
  474. /**
  475. * @return the number of enabled copper layers.
  476. */
  477. inline int GetCopperLayerCount() const
  478. {
  479. return m_copperLayerCount;
  480. }
  481. /**
  482. * Set the copper layer count to \a aNewLayerCount.
  483. *
  484. * @param aNewLayerCount The new number of enabled copper layers.
  485. */
  486. void SetCopperLayerCount( int aNewLayerCount );
  487. /**
  488. * The full thickness of the board including copper and masks.
  489. * @return
  490. */
  491. inline int GetBoardThickness() const { return m_boardThickness; }
  492. inline void SetBoardThickness( int aThickness ) { m_boardThickness = aThickness; }
  493. /*
  494. * Return an epsilon which accounts for rounding errors, etc.
  495. *
  496. * While currently an advanced cfg, going through this API allows us to easily change
  497. * it to board-specific if so desired.
  498. */
  499. int GetDRCEpsilon() const;
  500. /**
  501. * Pad & via drills are finish size.
  502. *
  503. * Adding the hole plating thickness gives you the actual hole size.
  504. */
  505. int GetHolePlatingThickness() const;
  506. /**
  507. * Return the default graphic segment thickness from the layer class for the given layer.
  508. */
  509. int GetLineThickness( PCB_LAYER_ID aLayer ) const;
  510. /**
  511. * Return the default text size from the layer class for the given layer.
  512. */
  513. wxSize GetTextSize( PCB_LAYER_ID aLayer ) const;
  514. /**
  515. * Return the default text thickness from the layer class for the given layer.
  516. */
  517. int GetTextThickness( PCB_LAYER_ID aLayer ) const;
  518. bool GetTextItalic( PCB_LAYER_ID aLayer ) const;
  519. bool GetTextUpright( PCB_LAYER_ID aLayer ) const;
  520. int GetLayerClass( PCB_LAYER_ID aLayer ) const;
  521. void SetAuxOrigin( const VECTOR2I& aOrigin ) { m_auxOrigin = aOrigin; }
  522. const VECTOR2I& GetAuxOrigin() { return m_auxOrigin; }
  523. void SetGridOrigin( const VECTOR2I& aOrigin ) { m_gridOrigin = aOrigin; }
  524. const VECTOR2I& GetGridOrigin() { return m_gridOrigin; }
  525. private:
  526. void initFromOther( const BOARD_DESIGN_SETTINGS& aOther );
  527. bool migrateSchema0to1();
  528. public:
  529. // Note: the first value in each dimensions list is the current netclass value
  530. std::vector<int> m_TrackWidthList;
  531. std::vector<VIA_DIMENSION> m_ViasDimensionsList;
  532. std::vector<DIFF_PAIR_DIMENSION> m_DiffPairDimensionsList;
  533. /** The parameters of teardrops for the different teardrop targets (via/pad, track end)
  534. * 3 set of parameters always exist: for round shapes, for rect shapes, for track ends
  535. */
  536. TEARDROP_PARAMETERS_LIST m_TeardropParamsList;
  537. VIATYPE m_CurrentViaType; ///< (VIA_BLIND_BURIED, VIA_THROUGH, VIA_MICROVIA)
  538. bool m_UseConnectedTrackWidth; // use width of existing track when creating a new,
  539. // connected track
  540. bool m_TempOverrideTrackWidth; // use selected track width temporarily even when
  541. // using connected track width
  542. int m_MinClearance; // overall min clearance
  543. int m_MinConn; // overall min connection width
  544. int m_TrackMinWidth; // overall min track width
  545. int m_ViasMinAnnularWidth; // overall minimum width of the via copper ring
  546. int m_ViasMinSize; // overall vias (not micro vias) min diameter
  547. int m_MinThroughDrill; // through hole (not micro vias) min drill diameter
  548. int m_MicroViasMinSize; // micro vias min diameter
  549. int m_MicroViasMinDrill; // micro vias min drill diameter
  550. int m_CopperEdgeClearance;
  551. int m_HoleClearance; // Hole to copper clearance
  552. int m_HoleToHoleMin; // Min width of web between two drilled holes
  553. int m_SilkClearance; // Min dist between two silk items
  554. int m_MinResolvedSpokes; // Min spoke count to not be a starved thermal
  555. int m_MinSilkTextHeight; // Min text height for silkscreen layers
  556. int m_MinSilkTextThickness; // Min text thickness for silkscreen layers
  557. std::shared_ptr<DRC_ENGINE> m_DRCEngine;
  558. std::map<int, SEVERITY> m_DRCSeverities; // Map from DRCErrorCode to SEVERITY
  559. std::set<wxString> m_DrcExclusions;
  560. // When smoothing the zone's outline there's the question of external fillets (that is, those
  561. // applied to concave corners). While it seems safer to never have copper extend outside the
  562. // zone outline, 5.1.x and prior did indeed fill them so we leave the mode available.
  563. bool m_ZoneKeepExternalFillets;
  564. // Maximum error allowed when approximating circles and arcs to segments
  565. int m_MaxError;
  566. // Global mask margins:
  567. int m_SolderMaskExpansion; // Solder mask inflation around the pad or via
  568. int m_SolderMaskMinWidth; // Solder mask min width (2 areas closer than this
  569. // width are merged)
  570. int m_SolderMaskToCopperClearance; // Min distance allowed from copper to a mask
  571. // aperture of another net
  572. int m_SolderPasteMargin; // Solder paste margin absolute value
  573. double m_SolderPasteMarginRatio; // Solder mask margin ratio value of pad size
  574. // The final margin is the sum of these 2 values
  575. bool m_AllowSoldermaskBridgesInFPs;
  576. std::shared_ptr<NET_SETTINGS> m_NetSettings;
  577. // Variables used in footprint editing (default value in item/footprint creation)
  578. std::vector<TEXT_ITEM_INFO> m_DefaultFPTextItems;
  579. // Arrays of default values for the various layer classes.
  580. int m_LineThickness[ LAYER_CLASS_COUNT ];
  581. wxSize m_TextSize[ LAYER_CLASS_COUNT ];
  582. int m_TextThickness[ LAYER_CLASS_COUNT ];
  583. bool m_TextItalic[ LAYER_CLASS_COUNT ];
  584. bool m_TextUpright[ LAYER_CLASS_COUNT ];
  585. // Default values for dimension objects
  586. DIM_UNITS_MODE m_DimensionUnitsMode;
  587. int m_DimensionPrecision; ///< Number of digits after the decimal
  588. DIM_UNITS_FORMAT m_DimensionUnitsFormat;
  589. bool m_DimensionSuppressZeroes;
  590. DIM_TEXT_POSITION m_DimensionTextPosition;
  591. bool m_DimensionKeepTextAligned;
  592. int m_DimensionArrowLength;
  593. int m_DimensionExtensionOffset;
  594. // Miscellaneous
  595. std::unique_ptr<PAD> m_Pad_Master; // A dummy pad to store all default parameters
  596. // when importing values or creating a new pad
  597. // Set to true if the board has a stackup management.
  598. // If not set a default basic stackup will be used to generate the gbrjob file.
  599. // Could be removed later, or at least always set to true
  600. bool m_HasStackup;
  601. /// Enable inclusion of stackup height in track length measurements and length tuning
  602. bool m_UseHeightForLengthCalcs;
  603. private:
  604. VECTOR2I m_auxOrigin; ///< origin for plot exports
  605. VECTOR2I m_gridOrigin; ///< origin for grid offsets
  606. // Indices into the trackWidth, viaSizes and diffPairDimensions lists.
  607. // The 0 index is always the current netclass value(s)
  608. unsigned m_trackWidthIndex;
  609. unsigned m_viaSizeIndex;
  610. unsigned m_diffPairIndex;
  611. // Custom values for track/via sizes (specified via dialog instead of netclass or lists)
  612. bool m_useCustomTrackVia;
  613. int m_customTrackWidth;
  614. VIA_DIMENSION m_customViaSize;
  615. // Custom values for differential pairs (specified via dialog instead of netclass/lists)
  616. bool m_useCustomDiffPair;
  617. DIFF_PAIR_DIMENSION m_customDiffPair;
  618. int m_copperLayerCount; ///< Number of copper layers for this design
  619. LSET m_enabledLayers; ///< Bit-mask for layer enabling
  620. int m_boardThickness; ///< Board thickness for 3D viewer
  621. /// Current net class name used to display netclass info.
  622. /// This is also the last used netclass after starting a track.
  623. wxString m_currentNetClassName;
  624. /** the description of layers stackup, for board fabrication
  625. * only physical layers are in layers stackup.
  626. * It includes not only layers enabled for the board edition, but also dielectric layers
  627. */
  628. BOARD_STACKUP m_stackup;
  629. /// The default settings that will be used for new zones
  630. ZONE_SETTINGS m_defaultZoneSettings;
  631. };
  632. #endif // BOARD_DESIGN_SETTINGS_H_