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-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
47 std::map<wxString, wxString> m_NetClassLabelAssignments;
48
55 std::map<wxString, KIGFX::COLOR4D> m_NetColorAssignments;
56
57public:
58 std::shared_ptr<NETCLASS> GetEffectiveNetClass( const wxString& aNetName ) const;
59
70 static bool ParseBusVector( const wxString& aBus, wxString* aName,
71 std::vector<wxString>* aMemberList );
72
81 static bool ParseBusGroup( const wxString& aGroup, wxString* name,
82 std::vector<wxString>* aMemberList );
83
84private:
85 bool migrateSchema0to1();
86 bool migrateSchema2to3();
87
88 // TODO: Add diff pairs, bus information, etc.
89};
90
91#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:55
std::map< wxString, wxString > m_NetClassLabelAssignments
Definition: net_settings.h:47
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.
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
NET_SETTINGS(JSON_SETTINGS *aParent, const std::string &aPath)
Abstract pattern-matching tool and implementations.