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