KiCad PCB EDA Suite
net_settings.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) 2020 CERN
5  * Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
6  * @author Jon Evans <jon@craftyjon.com>
7  *
8  * This program is free software: you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License as published by the
10  * Free Software Foundation, either version 3 of the License, or (at your
11  * option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef KICAD_NET_SETTINGS_H
23 #define KICAD_NET_SETTINGS_H
24 
25 #include <netclass.h>
27 
33 {
34 public:
35  NET_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath );
36 
37  virtual ~NET_SETTINGS();
38 
39 public:
41 
42  // Runtime map of label to netclass-name for quick lookup. Includes both composite labels
43  // (buses) and atomic net names (including individual bus members).
44  std::map<wxString, wxString> m_NetClassAssignments;
45 
52  std::map<wxString, KIGFX::COLOR4D> m_PcbNetColors;
53 
54 public:
55  const wxString& GetNetclassName( const wxString& aNetName ) const;
56 
67  static bool ParseBusVector( const wxString& aBus, wxString* aName,
68  std::vector<wxString>* aMemberList );
69 
78  static bool ParseBusGroup( const wxString& aGroup, wxString* name,
79  std::vector<wxString>* aMemberList );
80 
85 
86 private:
87  bool migrateSchema0to1();
88 
89  // TODO: Add diff pairs, bus information, etc.
90 };
91 
92 #endif // KICAD_NET_SETTINGS_H
std::map< wxString, wxString > m_NetClassAssignments
Definition: net_settings.h:44
const wxString & GetNetclassName(const wxString &aNetName) const
std::map< wxString, KIGFX::COLOR4D > m_PcbNetColors
A map of fully-qualified net names to colors used in the board context.
Definition: net_settings.h:52
virtual ~NET_SETTINGS()
void RebuildNetClassAssignments()
Rebuild netclass assignments from the netclass membership lists.
static bool ParseBusGroup(const wxString &aGroup, wxString *name, std::vector< wxString > *aMemberList)
Parse a bus group label into the name and a list of components.
NESTED_SETTINGS is a JSON_SETTINGS that lives inside a JSON_SETTINGS.
A container for NETCLASS instances.
Definition: netclass.h:218
NETCLASSES m_NetClasses
Definition: net_settings.h:40
NET_SETTINGS stores various net-related settings in a project context.
Definition: net_settings.h:32
const char * name
Definition: DXF_plotter.cpp:56
static bool ParseBusVector(const wxString &aBus, wxString *aName, std::vector< wxString > *aMemberList)
Parse a bus vector (e.g.
bool migrateSchema0to1()
NET_SETTINGS(JSON_SETTINGS *aParent, const std::string &aPath)