22#ifndef KICAD_NET_SETTINGS_H
23#define KICAD_NET_SETTINGS_H
50 void SetDefaultNetclass( std::shared_ptr<NETCLASS> netclass );
53 std::shared_ptr<NETCLASS> GetDefaultNetclass();
56 bool HasNetclass(
const wxString& netclassName )
const;
59 void SetNetclass(
const wxString& netclassName, std::shared_ptr<NETCLASS>& netclass );
62 void SetNetclasses(
const std::map<wxString, std::shared_ptr<NETCLASS>>& netclasses );
65 const std::map<wxString, std::shared_ptr<NETCLASS>>& GetNetclasses()
const;
70 const std::map<wxString, std::shared_ptr<NETCLASS>>& GetCompositeNetclasses()
const;
73 void ClearNetclasses();
76 const std::map<wxString, std::set<wxString>>& GetNetclassLabelAssignments()
const;
79 void ClearNetclassLabelAssignments();
82 void ClearNetclassLabelAssignment(
const wxString& netName );
85 void SetNetclassLabelAssignment(
const wxString& netName,
86 const std::set<wxString>& netclasses );
89 void AppendNetclassLabelAssignment(
const wxString& netName,
90 const std::set<wxString>& netclasses );
93 bool HasNetclassLabelAssignment(
const wxString& netName )
const;
96 void SetNetclassPatternAssignment(
const wxString& pattern,
const wxString& netclass );
99 void SetNetclassPatternAssignments(
100 std::vector<std::pair<std::unique_ptr<EDA_COMBINED_MATCHER>, wxString>>&&
104 std::vector<std::pair<std::unique_ptr<EDA_COMBINED_MATCHER>, wxString>>&
105 GetNetclassPatternAssignments();
108 void ClearNetclassPatternAssignments();
111 void ClearCacheForNet(
const wxString& netName );
114 void ClearAllCaches();
120 const std::map<wxString, KIGFX::COLOR4D>& GetNetColorAssignments()
const;
123 void ClearNetColorAssignments();
126 bool HasEffectiveNetClass(
const wxString& aNetName )
const;
130 std::shared_ptr<NETCLASS> GetCachedEffectiveNetClass(
const wxString& aNetName )
const;
134 std::shared_ptr<NETCLASS> GetEffectiveNetClass(
const wxString& aNetName );
139 void RecomputeEffectiveNetclasses();
147 std::shared_ptr<NETCLASS> GetNetClassByName(
const wxString& aNetName )
const;
159 static bool ParseBusVector(
const wxString& aBus, wxString* aName,
160 std::vector<wxString>* aMemberList );
170 static bool ParseBusGroup(
const wxString& aGroup, wxString*
name,
171 std::vector<wxString>* aMemberList );
174 bool migrateSchema0to1();
175 bool migrateSchema1to2();
176 bool migrateSchema2to3();
177 bool migrateSchema3to4();
188 void makeEffectiveNetclass( std::shared_ptr<NETCLASS>& effectiveNetclass,
189 std::vector<NETCLASS*>& netclasses )
const;
193 bool addMissingDefaults(
NETCLASS* nc )
const;
205 std::vector<std::pair<std::unique_ptr<EDA_COMBINED_MATCHER>, wxString>>
bool operator==(const wxAuiPaneInfo &aLhs, const wxAuiPaneInfo &aRhs)
A color representation with 4 components: red, green, blue, alpha.
NESTED_SETTINGS is a JSON_SETTINGS that lives inside a JSON_SETTINGS.
A collection of nets and the parameters used to route or test these nets.
NET_SETTINGS stores various net-related settings in a project context.
std::map< wxString, std::shared_ptr< NETCLASS > > m_compositeNetClasses
Map of netclass names to netclass definitions for.
std::map< wxString, KIGFX::COLOR4D > m_netColorAssignments
A map of fully-qualified net names to colors used in the board context.
std::shared_ptr< NETCLASS > m_defaultNetClass
The default netclass.
std::map< wxString, std::shared_ptr< NETCLASS > > m_impicitNetClasses
Map of netclass names to netclass definitions for implicit netclasses.
std::vector< std::pair< std::unique_ptr< EDA_COMBINED_MATCHER >, wxString > > m_netClassPatternAssignments
List of net class pattern assignments.
std::map< wxString, std::shared_ptr< NETCLASS > > m_effectiveNetclassCache
Cache of nets to pattern-matched netclasses.
std::map< wxString, std::shared_ptr< NETCLASS > > m_netClasses
Map of netclass names to netclass definitions.
bool operator!=(const NET_SETTINGS &aOther) const
std::map< wxString, std::set< wxString > > m_netClassLabelAssignments
Map of net names to resolved netclasses.
Abstract pattern-matching tool and implementations.