KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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-2022 KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Jon Evans <[email protected]>
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#include <eda_pattern_match.h>
28
34{
35public:
36 NET_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath );
37
38 virtual ~NET_SETTINGS();
39
40public:
41 std::map<wxString, std::shared_ptr<NETCLASS>> m_NetClasses;
42 std::shared_ptr<NETCLASS> m_DefaultNetClass;
43
44 std::vector<std::pair<std::unique_ptr<EDA_COMBINED_MATCHER>, wxString>>
46 mutable std::map<wxString, wxString> m_NetClassPatternAssignmentCache;
47
48 std::map<wxString, wxString> m_NetClassLabelAssignments;
49
56 std::map<wxString, KIGFX::COLOR4D> m_NetColorAssignments;
57
58public:
59 std::shared_ptr<NETCLASS> GetEffectiveNetClass( const wxString& aNetName ) const;
60
71 static bool ParseBusVector( const wxString& aBus, wxString* aName,
72 std::vector<wxString>* aMemberList );
73
82 static bool ParseBusGroup( const wxString& aGroup, wxString* name,
83 std::vector<wxString>* aMemberList );
84
85private:
86 bool migrateSchema0to1();
87 bool migrateSchema2to3();
88
89 // TODO: Add diff pairs, bus information, etc.
90};
91
92#endif // KICAD_NET_SETTINGS_H
const char * name
Definition: DXF_plotter.cpp:56
NESTED_SETTINGS is a JSON_SETTINGS that lives inside a JSON_SETTINGS.
NET_SETTINGS stores various net-related settings in a project context.
Definition: net_settings.h:34
std::shared_ptr< NETCLASS > m_DefaultNetClass
Definition: net_settings.h:42
std::map< wxString, KIGFX::COLOR4D > m_NetColorAssignments
A map of fully-qualified net names to colors used in the board context.
Definition: net_settings.h:56
std::map< wxString, wxString > m_NetClassLabelAssignments
Definition: net_settings.h:48
virtual ~NET_SETTINGS()
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.
std::map< wxString, wxString > m_NetClassPatternAssignmentCache
Definition: net_settings.h:46
bool migrateSchema0to1()
bool migrateSchema2to3()
std::shared_ptr< NETCLASS > GetEffectiveNetClass(const wxString &aNetName) const
std::vector< std::pair< std::unique_ptr< EDA_COMBINED_MATCHER >, wxString > > m_NetClassPatternAssignments
Definition: net_settings.h:45
static bool ParseBusVector(const wxString &aBus, wxString *aName, std::vector< wxString > *aMemberList)
Parse a bus vector (e.g.
std::map< wxString, std::shared_ptr< NETCLASS > > m_NetClasses
Definition: net_settings.h:41
Abstract pattern-matching tool and implementations.