KiCad PCB EDA Suite
netclass.cpp
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) 2009 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
5 * Copyright (C) 2009 Jean-Pierre Charras, [email protected]
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
26#include <netclass.h>
27#include <macros.h>
28#include <base_units.h>
29
30// This will get mapped to "kicad_default" in the specctra_export.
31const char NETCLASS::Default[] = "Default";
32
33// Initial values for netclass initialization
34const int DEFAULT_CLEARANCE = pcbIUScale.mmToIU( 0.2 ); // track to track and track to pads clearance
43
46
47const int DEFAULT_LINE_STYLE = 0; // solid
48
49
50NETCLASS::NETCLASS( const wxString& aName ) :
51 m_Name( aName ),
52 m_PcbColor( KIGFX::COLOR4D::UNSPECIFIED )
53{
54 // Default settings
58 // These defaults will be overwritten by SetParams,
59 // from the board design parameters, later
66
69 SetSchematicColor( COLOR4D::UNSPECIFIED );
71}
72
73
75{
76}
77
78
constexpr EDA_IU_SCALE schIUScale
Definition: base_units.h:111
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:109
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
void SetViaDiameter(int aDia)
Definition: netclass.h:81
void SetViaDrill(int aSize)
Definition: netclass.h:85
static const char Default[]
the name of the default NETCLASS
Definition: netclass.h:49
~NETCLASS()
Definition: netclass.cpp:74
void SetuViaDiameter(int aSize)
Definition: netclass.h:89
void SetDiffPairWidth(int aSize)
Definition: netclass.h:97
void SetLineStyle(int aStyle)
Definition: netclass.h:120
NETCLASS(const wxString &aName)
Create a NETCLASS instance with aName.
Definition: netclass.cpp:50
void SetSchematicColor(COLOR4D aColor)
Definition: netclass.h:117
void SetDiffPairViaGap(int aSize)
Definition: netclass.h:105
void SetuViaDrill(int aSize)
Definition: netclass.h:93
void SetDiffPairGap(int aSize)
Definition: netclass.h:101
void SetClearance(int aClearance)
Definition: netclass.h:73
void SetBusWidth(int aWidth)
Definition: netclass.h:114
void SetWireWidth(int aWidth)
Definition: netclass.h:111
void SetTrackWidth(int aWidth)
Definition: netclass.h:77
This file contains miscellaneous commonly used macros and functions.
The Cairo implementation of the graphics abstraction layer.
Definition: color4d.cpp:266
const int DEFAULT_UVIA_DIAMETER
Definition: netclass.cpp:37
const int DEFAULT_DIFF_PAIR_WIDTH
Definition: netclass.cpp:40
const int DEFAULT_DIFF_PAIR_GAP
Definition: netclass.cpp:41
const int DEFAULT_DIFF_PAIR_VIAGAP
Definition: netclass.cpp:42
const int DEFAULT_LINE_STYLE
Definition: netclass.cpp:47
const int DEFAULT_CLEARANCE
Definition: netclass.cpp:34
const int DEFAULT_UVIA_DRILL
Definition: netclass.cpp:38
const int DEFAULT_TRACK_WIDTH
Definition: netclass.cpp:39
const int DEFAULT_WIRE_WIDTH
Definition: netclass.cpp:44
const int DEFAULT_VIA_DRILL
Definition: netclass.cpp:36
const int DEFAULT_VIA_DIAMETER
Definition: netclass.cpp:35
const int DEFAULT_BUS_WIDTH
Definition: netclass.cpp:45
constexpr int MilsToIU(int mils) const
Definition: base_units.h:94
constexpr int mmToIU(double mm) const
Definition: base_units.h:89