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
40 bool operator==( const NET_SETTINGS& aOther ) const;
41
42 bool operator!=( const NET_SETTINGS& aOther ) const { return !operator==( aOther ); }
43
44public:
45 std::map<wxString, std::shared_ptr<NETCLASS>> m_NetClasses;
46 std::shared_ptr<NETCLASS> m_DefaultNetClass;
47
48 std::vector<std::pair<std::unique_ptr<EDA_COMBINED_MATCHER>, wxString>>
50 mutable std::map<wxString, wxString> m_NetClassPatternAssignmentCache;
51
52 std::map<wxString, wxString> m_NetClassLabelAssignments;
53
60 std::map<wxString, KIGFX::COLOR4D> m_NetColorAssignments;
61
62public:
63 std::shared_ptr<NETCLASS> GetEffectiveNetClass( const wxString& aNetName ) const;
64
71 std::shared_ptr<NETCLASS> GetNetClassByName( const wxString& aNetName ) const;
72
83 static bool ParseBusVector( const wxString& aBus, wxString* aName,
84 std::vector<wxString>* aMemberList );
85
94 static bool ParseBusGroup( const wxString& aGroup, wxString* name,
95 std::vector<wxString>* aMemberList );
96
97private:
98 bool migrateSchema0to1();
99 bool migrateSchema2to3();
100
101 // TODO: Add diff pairs, bus information, etc.
102};
103
104#endif // KICAD_NET_SETTINGS_H
const char * name
Definition: DXF_plotter.cpp:57
bool operator==(const wxAuiPaneInfo &aLhs, const wxAuiPaneInfo &aRhs)
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:46
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:60
std::map< wxString, wxString > m_NetClassLabelAssignments
Definition: net_settings.h:52
std::map< wxString, wxString > m_NetClassPatternAssignmentCache
Definition: net_settings.h:50
std::vector< std::pair< std::unique_ptr< EDA_COMBINED_MATCHER >, wxString > > m_NetClassPatternAssignments
Definition: net_settings.h:49
bool operator!=(const NET_SETTINGS &aOther) const
Definition: net_settings.h:42
std::map< wxString, std::shared_ptr< NETCLASS > > m_NetClasses
Definition: net_settings.h:45
Abstract pattern-matching tool and implementations.
#define KICOMMON_API
Definition: kicommon.h:28