27#include <unordered_map>
67 const wxString& aNetKey )
const;
164 const std::set<class SCH_SYMBOL*>& aSymbols,
165 const std::set<wxString>& aNets,
166 const KIID& aTerminalPinA,
const KIID& aTerminalPinB,
167 const wxString& aRefA,
const wxString& aPinNumA,
168 const wxString& aRefB,
const wxString& aPinNumB );
216 void storeMemberNets(
const wxString& aName,
const std::set<wxString>& aNets );
221 friend class ::CONNECTION_GRAPH;
223 std::unique_ptr<SCH_NETCHAIN> );
234 const std::map<std::pair<wxString, wxString>, wxString>& aRefPinToNet,
235 const std::vector<std::unique_ptr<SCH_NETCHAIN>>& aPotentials,
236 const wxString& aChainName );
239 const wxString& aNetA,
const wxString& aNetB );
256 const std::set<class SCH_SYMBOL*>& aSymbols );
287 std::map<wxString, std::vector<BRIDGE_NEIGHBOR>>
adjacency;
Calculate the connectivity of a schematic and generate netlists.
NET_SETTINGS stores various net-related settings in a project context.
Holds all the data relating to one schematic.
Persistent chain configuration and the derived chains for one schematic.
void refreshCommittedChainPayload(SCH_NETCHAIN *aTarget, const std::set< wxString > &aNets, const std::set< class SCH_SYMBOL * > &aSymbols)
Replace the derived-view payload on aTarget with explicitly supplied member nets, and symbols.
std::map< wxString, wxString > m_netChainNetClassOverrides
void rekeyOverrideMaps(const wxString &aOld, const wxString &aNew)
Move every net-chain override map entry keyed by aOld to aNew.
std::vector< std::unique_ptr< SCH_NETCHAIN > > m_potentialNetChains
last built potential (uncommitted) net chains
void SetNetChainColorOverrides(const std::map< wxString, KIGFX::COLOR4D > &aOverrides)
SCH_NETCHAIN * GetNetChainForNet(const wxString &aNet)
bool refreshTerminalReferences(SCH_NETCHAIN &aChain)
std::map< wxString, std::set< wxString > > m_netChainMemberNetOverrides
void storeMemberNets(const wxString &aName, const std::set< wxString > &aNets)
Record the persistable subset of aNets as the restore fallback for aName.
void storeTerminalRefs(const SCH_NETCHAIN &aChain)
const std::vector< std::unique_ptr< SCH_NETCHAIN > > & GetCommittedNetChains() const
Return user-created (committed) net chains (legacy accessor retained under net-chain API).
SCH_NETCHAIN * GetNetChainByName(const wxString &aName)
static SCH_NETCHAIN * findPotentialChain(const std::vector< std::unique_ptr< SCH_NETCHAIN > > &aPotentials, const wxString &aNetA, const wxString &aNetB)
SCH_NETCHAIN * FindPotentialNetChainBetweenPins(SCH_PIN *aPinA, const SCH_SHEET_PATH &aPathA, SCH_PIN *aPinB, const SCH_SHEET_PATH &aPathB)
void SetNetChainNetClassOverrides(const std::map< wxString, wxString > &aOverrides)
Stash per-net-chain netclass overrides read from the schematic file.
const std::map< wxString, CHAIN_TERMINAL_REFS > & GetNetChainTerminalRefOverrides() const
void setSymbolName(SCH_SYMBOL *aSymbol, const wxString &aName)
void RefreshTerminalReferences()
void rebuild(const NETCHAIN_INPUT &aConnectivity)
BRIDGE_GRAPH buildBridgeAdjacency(const std::vector< SHEET_SYMBOLS > &aSheets)
Build the bridge graph used for net-chain discovery.
const std::map< wxString, std::set< wxString > > & GetNetChainMemberNetOverrides() const
bool ReplaceNetChainTerminalPin(const TERMINAL_CHANGE &aChange)
std::shared_ptr< NET_SETTINGS > liveNetSettings() const
Project net settings, or null for staged and temporary managers.
wxString NetKeyForTerminal(const KIID &aPin, const KIID_PATH &aSheet) const
Resolve a terminal pin UUID on a sheet instance to its chain member key.
std::map< wxString, CHAIN_TERMINAL_REFS > m_netChainTerminalRefOverrides
std::map< SCH_SYMBOL *, SCH_SCREEN * > GetBridgeSymbols(const SCH_NETCHAIN &aChain, const wxString &aNetKey) const
Symbols from the last rebuild whose passthrough joins aNetKey to another member of aChain,...
void Rebuild(const NETCHAIN_INPUT &aConnectivity, const std::function< void(NETCHAIN_MANAGER &)> &aBeforePublish={})
std::vector< std::unique_ptr< SCH_NETCHAIN > > m_committedNetChains
std::map< wxString, KIGFX::COLOR4D > m_netChainColorOverrides
void Merge(NETCHAIN_MANAGER &aOther)
static SCH_NETCHAIN * resolvePotentialChainByTerminals(const CHAIN_TERMINAL_REFS &aTermRefs, const std::map< std::pair< wxString, wxString >, wxString > &aRefPinToNet, const std::vector< std::unique_ptr< SCH_NETCHAIN > > &aPotentials, const wxString &aChainName)
Disambiguate the saved (refA.pinA, refB.pinB) terminal pair against the current set of potential net ...
bool DeleteCommittedNetChain(const wxString &aName)
Delete a committed net chain by name.
bool resolveTerminals(SCH_NETCHAIN &aChain, const CHAIN_TERMINAL_REFS *aSavedRefs=nullptr)
SCH_NETCHAIN * CreateManualNetChain(const wxString &aName, const std::set< class SCH_SYMBOL * > &aSymbols, const std::set< wxString > &aNets, const KIID &aTerminalPinA, const KIID &aTerminalPinB, const wxString &aRefA, const wxString &aPinNumA, const wxString &aRefB, const wxString &aPinNumB)
Commit a manually-defined net chain that the inferred-potential pass did not produce.
void refreshCommittedChainFromPotential(SCH_NETCHAIN *aTarget, const SCH_NETCHAIN &aSource)
Refresh aTarget from an inferred potential chain and resync its persisted member-net fallback.
const std::vector< std::unique_ptr< SCH_NETCHAIN > > & GetPotentialNetChains() const
Potential net chains are inferred groupings produced by RebuildNetChains() but not yet user-committed...
const std::map< wxString, wxString > & GetNetChainNetClassOverrides() const
void SetNetChainTerminalRefOverrides(const std::map< wxString, CHAIN_TERMINAL_REFS > &aRefs)
std::vector< BRIDGE_EDGE > m_bridgeEdges
raw bridge edges from the last rebuild
void SetSchematic(SCHEMATIC *aSchematic)
std::pair< CHAIN_TERMINAL_REF, CHAIN_TERMINAL_REF > CHAIN_TERMINAL_REFS
static wxString NetKeyForItem(const SCH_ITEM &aItem, const SCH_SHEET_PATH &aPath)
SCH_NETCHAIN * CreateNetChainFromPotential(SCH_NETCHAIN *aPotential, const wxString &aName)
Promote a potential net chain to an actual user net chain with the provided name.
friend class ::CONNECTION_GRAPH
NETCHAIN_MANAGER(SCHEMATIC *aSchematic)
bool NetChainsBuilt() const
Returns true once RebuildNetChains() has completed at least once on this graph.
void SetNetChainMemberNetOverrides(const std::map< wxString, std::set< wxString > > &aOverrides)
Stash per-chain member-net lists read from the schematic file.
void ApplyNetChainNetclasses()
Mirror each committed net chain's netclass override into the project NET_SETTINGS as a chain-derived ...
const std::map< wxString, KIGFX::COLOR4D > & GetNetChainColorOverrides() const
std::unordered_map< SCH_SYMBOL *, wxString > * m_pendingSymbolNames
bool RenameCommittedNetChain(const wxString &aOld, const wxString &aNew)
Rename a committed net chain.
Base class for any item which can be embedded within the SCHEMATIC container class,...
A net chain is a collection of nets that are connected together through passive components.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
void boost_test_inject_committed_net_chain(CONNECTION_GRAPH &, std::unique_ptr< SCH_NETCHAIN >)
std::map< wxString, std::vector< BRIDGE_NEIGHBOR > > adjacency
std::vector< BRIDGE_EDGE > edges