KiCad PCB EDA Suite
stackup_predefined_prms.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2019 Jean-Pierre Charras, jp.charras at wanadoo.fr
5  * Copyright (C) 2009-2021 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 
29 #ifndef STACKUP_PREDEFINED_PRMS_H
30 #define STACKUP_PREDEFINED_PRMS_H
31 
32 
33 #include <wx/string.h>
34 #include <wx/arrstr.h>
35 #include <wx/colour.h>
36 
37 #include <layer_ids.h>
38 #include <i18n_utility.h> // For _HKI definition
39 #include <gal/color4d.h>
40 
42 
43 // Keyword used in file to identify the dielectric layer type
44 #define KEY_CORE "core"
45 #define KEY_PREPREG "prepreg"
46 
47 #define KEY_COPPER "copper"
48 
49 // key string used for not specified parameters
50 // Can be translated in dialogs, and is also a keyword outside dialogs
51 wxString inline NotSpecifiedPrm()
52 {
53  return _HKI( "Not specified" );
54 }
55 
61 bool IsPrmSpecified( const wxString& aPrmValue );
62 
63 #define DEFAULT_SOLDERMASK_OPACITY 0.83
64 
65 // A reasonable Epsilon R value for solder mask dielectric
66 #define DEFAULT_EPSILON_R_SOLDERMASK 3.3
67 
68 // A default Epsilon R value for silkscreen dielectric
69 #define DEFAULT_EPSILON_R_SILKSCREEN 1.0
70 
71 // A minor struct to handle color in gerber job file and dialog
73 {
74 public:
76  {}
77 
78  FAB_LAYER_COLOR( const wxString& aColorName, const wxColor& aColor ) :
79  m_colorName( aColorName ),
80  m_color( aColor )
81  {}
82 
83  const wxString& GetName() const
84  {
85  return m_colorName;
86  }
87 
88  wxColor GetColor( BOARD_STACKUP_ITEM_TYPE aItemType ) const
89  {
90  if( aItemType == BS_ITEM_TYPE_SOLDERMASK )
91  return m_color.WithAlpha( DEFAULT_SOLDERMASK_OPACITY ).ToColour();
92  else
93  return m_color.WithAlpha( 1.0 ).ToColour();
94  }
95 
96 private:
97  wxString m_colorName; // the name (in job file) of the color
98  // User values are the HTML coding #rrggbbaa hexadecimal value.
100 };
101 
102 
107 wxArrayString GetCopperFinishStandardList( bool aTranslate );
108 
113 
118 
123 
125 {
127 }
128 
129 
130 #endif // #ifndef STACKUP_PREDEFINED_PRMS_H
BOARD_STACKUP_ITEM_TYPE
Definition: board_stackup.h:40
bool IsPrmSpecified(const wxString &aPrmValue)
#define DEFAULT_SOLDERMASK_OPACITY
COLOR4D WithAlpha(double aAlpha) const
Return a color with the same color, but the given alpha.
Definition: color4d.h:314
int GetColorUserDefinedListIdx()
int GetColorStandardListCount()
wxColor GetColor(BOARD_STACKUP_ITEM_TYPE aItemType) const
wxString NotSpecifiedPrm()
const wxString & GetName() const
wxColour GetDefaultUserColor(BOARD_STACKUP_ITEM_TYPE aType)
Some functions to handle hotkeys in KiCad.
wxArrayString GetCopperFinishStandardList(bool aTranslate)
FAB_LAYER_COLOR(const wxString &aColorName, const wxColor &aColor)
const FAB_LAYER_COLOR * GetColorStandardList()
#define _HKI(x)
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103