|
KiCad PCB EDA Suite
|
Model-owned source resolver. More...
#include <conn_facade.h>
Public Member Functions | |
| FACADE () | |
| ~FACADE () | |
| FACADE (const FACADE &)=delete | |
| FACADE & | operator= (const FACADE &)=delete |
| void | Recalculate (SCHEMATIC &aSchematic, bool aRebuild=false, const std::function< void(SCH_ITEM *)> &aChangedHandler={}) |
| Update the complete model and apply netclasses, dangling flags and dirty-state clearing. | |
| SUBSCRIPTION | Subscribe (std::function< void(const CHANGE_SET &)> aListener) |
| void | Update (SCHEMATIC &aSchematic, bool aRebuild=false) |
| bool | UpdateShadow (SCHEMATIC &aSchematic, const SCH_SHEET_LIST &aPaths, bool aRebuild=false) |
| void | Update (const SCH_SHEET_LIST &aPaths, uint64_t aTextEpoch, const BUS_ALIASES &aAliases, bool aRebuild=false) |
| void | Clear () |
| void | ApplyNetclasses (NET_SETTINGS &aSettings) const |
| Replace label-derived assignments from a complete publication; invalidate changed net caches. | |
| std::optional< ITEM_VIEW > | Connection (const KIID &aItem, const KIID_PATH &aPath) const |
| std::optional< NET_VIEW > | GetSubgraphForItem (const KIID &aItem, const KIID_PATH &aPath) const |
| std::vector< NET_GROUP > | GetNetMap () const |
| Owned query-time groups in canonical name order, with unique instances in KIID_PATH order. | |
| std::vector< wxString > | NetNames () const |
| std::optional< NET_GROUP > | NetByName (const wxString &aName) const |
| std::vector< NET_GROUP > | BusWithMembers (const wxString &aName) const |
| std::vector< NET_GROUP > | BundlesOf (NODE_ID aSignal) const |
| std::vector< wxString > | GetEquivalentBusNames (const wxString &aName) const |
| void | PrepareTextChecks (SCHEMATIC &aSchematic, bool aIncludeDrawingSheet=false) |
| std::vector< TEXT_CHECK_FACT > | TextChecks (const KIID_PATH &aPath, bool aDrawingSheet=false) const |
| void | PrepareSimulationModels (SCHEMATIC &aSchematic) |
| std::vector< SIMULATION_MODEL_FACT > | SimulationModels (const KIID_PATH &aPath) const |
| const PUBLICATION & | Published () const |
| const ENGINE & | Engine () const |
| const SESSION_KEYS & | Keys () const |
Private Member Functions | |
| void | updateModel (SCHEMATIC &aSchematic, const SCH_SHEET_LIST &aPaths, bool aRebuild) |
| Capture the text context and advance the text epoch when it or an external source changed. | |
Private Attributes | |
| std::shared_ptr< FACADE_STATE > | m_state |
Friends | |
| class | PUBLICATION_HOLD |
Model-owned source resolver.
Graph stages retain only keys and extracted values.
Definition at line 122 of file conn_facade.h.
| SCH_CONNECTIVITY::FACADE::FACADE | ( | ) |
Definition at line 551 of file conn_facade.cpp.
References m_state.
Referenced by FACADE(), and operator=().
| SCH_CONNECTIVITY::FACADE::~FACADE | ( | ) |
Definition at line 553 of file conn_facade.cpp.
| void SCH_CONNECTIVITY::FACADE::ApplyNetclasses | ( | NET_SETTINGS & | aSettings | ) | const |
Replace label-derived assignments from a complete publication; invalidate changed net caches.
Call after Update for authoritative model application. Shadow updates never call this.
Definition at line 881 of file conn_facade.cpp.
References NET_SETTINGS::ClearCacheForNet(), NET_SETTINGS::ClearNetclassLabelAssignment(), NET_SETTINGS::GetNetclassLabelAssignments(), Keys(), SCH_CONNECTIVITY::SESSION_KEYS::Name(), name, Published(), and NET_SETTINGS::SetNetclassLabelAssignment().
Referenced by BOOST_AUTO_TEST_CASE(), SCH_CONNECTIVITY::Dump(), and Recalculate().
Definition at line 1294 of file conn_facade.cpp.
References m_state, SCH_CONNECTIVITY::PUBLICATION::ParentsOf(), and Published().
| std::vector< NET_GROUP > SCH_CONNECTIVITY::FACADE::BusWithMembers | ( | const wxString & | aName | ) | const |
Definition at line 1276 of file conn_facade.cpp.
References m_state, SCH_CONNECTIVITY::PUBLICATION::MembersOf(), and Published().
| void SCH_CONNECTIVITY::FACADE::Clear | ( | ) |
Definition at line 982 of file conn_facade.cpp.
References m_state.
Referenced by Recalculate(), Update(), Update(), UpdateShadow(), and ~FACADE().
| std::optional< ITEM_VIEW > SCH_CONNECTIVITY::FACADE::Connection | ( | const KIID & | aItem, |
| const KIID_PATH & | aPath ) const |
Definition at line 1102 of file conn_facade.cpp.
References SCH_CONNECTIVITY::SESSION_KEYS::FindInstance(), Keys(), and m_state.
Referenced by addConnections(), SCH_CONNECTIVITY::AppendConnectionInfo(), BOOST_DATA_TEST_CASE_F(), SCH_CONNECTIVITY::CapturePreviewNetCodes(), SCH_CONNECTIVITY::Dump(), SCH_SELECTION_TOOL::expandConnectionWithGraph(), findSingleNetLabelForPin(), SCH_LABEL_BASE::IsType(), BUS_UNFOLD_MENU::memberEntries(), and publishedConnection().
| const ENGINE & SCH_CONNECTIVITY::FACADE::Engine | ( | ) | const |
Definition at line 1009 of file conn_facade.cpp.
References m_state.
Referenced by ERC_TESTER::TestConnectivity().
| std::vector< wxString > SCH_CONNECTIVITY::FACADE::GetEquivalentBusNames | ( | const wxString & | aName | ) | const |
Definition at line 1309 of file conn_facade.cpp.
References equivalent(), SCH_CONNECTIVITY::PUBLICATION::EquivalentBusNames(), SCH_CONNECTIVITY::PUBLICATION::FindByName(), m_state, name, and Published().
| std::vector< NET_GROUP > SCH_CONNECTIVITY::FACADE::GetNetMap | ( | ) | const |
Owned query-time groups in canonical name order, with unique instances in KIID_PATH order.
Reacquire the collection after Update; individual views resolve current publication.
Definition at line 1234 of file conn_facade.cpp.
References group, m_state, name, Published(), and result.
| std::optional< NET_VIEW > SCH_CONNECTIVITY::FACADE::GetSubgraphForItem | ( | const KIID & | aItem, |
| const KIID_PATH & | aPath ) const |
Definition at line 1219 of file conn_facade.cpp.
References SCH_CONNECTIVITY::SESSION_KEYS::FindInstance(), Keys(), and m_state.
Referenced by BACK_ANNOTATE::processNetNameChange().
| const SESSION_KEYS & SCH_CONNECTIVITY::FACADE::Keys | ( | ) | const |
Definition at line 1008 of file conn_facade.cpp.
References m_state.
Referenced by ApplyNetclasses(), Connection(), SCH_CONNECTIVITY::Dump(), GetSubgraphForItem(), NetNames(), Recalculate(), and Update().
| std::optional< NET_GROUP > SCH_CONNECTIVITY::FACADE::NetByName | ( | const wxString & | aName | ) | const |
Definition at line 1265 of file conn_facade.cpp.
References SCH_CONNECTIVITY::PUBLICATION::FindByName(), m_state, and Published().
Referenced by SCH_EDIT_FRAME::RefreshConnectivity().
| std::vector< wxString > SCH_CONNECTIVITY::FACADE::NetNames | ( | ) | const |
Definition at line 1249 of file conn_facade.cpp.
References Keys(), m_state, name, Published(), and result.
| void SCH_CONNECTIVITY::FACADE::PrepareSimulationModels | ( | SCHEMATIC & | aSchematic | ) |
Definition at line 1077 of file conn_facade.cpp.
References SCH_CONNECTIVITY::ExtractSimulationModelFacts(), SCHEMATIC::GetCurrentVariant(), m_state, and path.
| void SCH_CONNECTIVITY::FACADE::PrepareTextChecks | ( | SCHEMATIC & | aSchematic, |
| bool | aIncludeDrawingSheet = false ) |
Definition at line 1011 of file conn_facade.cpp.
References SCH_CONNECTIVITY::ExtractDrawingSheetTextChecks(), SCH_CONNECTIVITY::ExtractTextChecks(), DS_DATA_MODEL::GetTheInstance(), m_state, path, DS_DATA_MODEL::SaveInString(), DS_DATA_MODEL::SetAltInstance(), and DS_DATA_MODEL::VoidListAllowed().
| const PUBLICATION & SCH_CONNECTIVITY::FACADE::Published | ( | ) | const |
Definition at line 1007 of file conn_facade.cpp.
References m_state.
Referenced by ApplyNetclasses(), BOOST_AUTO_TEST_CASE(), BundlesOf(), BusWithMembers(), SCH_CONNECTIVITY::Dump(), GetEquivalentBusNames(), GetNetMap(), NetByName(), NetNames(), Recalculate(), and SCH_EDIT_FRAME::RefreshConnectivity().
| void SCH_CONNECTIVITY::FACADE::Recalculate | ( | SCHEMATIC & | aSchematic, |
| bool | aRebuild = false, | ||
| const std::function< void(SCH_ITEM *)> & | aChangedHandler = {} ) |
Update the complete model and apply netclasses, dangling flags and dirty-state clearing.
The current instance controls shared-screen display state; callbacks run after application. A callback that clears or destroys the model retires the remaining notifications in its batch.
Definition at line 574 of file conn_facade.cpp.
References SCH_CONNECTIVITY::NETCHAIN_MANAGER::ApplyNetChainNetclasses(), ApplyNetclasses(), SCH_CONNECTIVITY::PUBLICATION::Auxiliary(), SCHEMATIC::BuildSheetListSortedByPageNumbers(), SCH_CONNECTIVITY::CHANGE_SET::changedItems, SCH_CONNECTIVITY::PUBLICATION::Changes(), Clear(), SCH_SCREEN::ConnectivityId(), SCHEMATIC::CurrentSheet(), SCH_CONNECTIVITY::CHANGE_SET::Empty(), SCH_CONNECTIVITY::SESSION_KEYS::FindInstance(), SCH_SCREEN::GetConnectivityItem(), PROJECT::GetProjectFile(), SCH_CONNECTIVITY::INVALID_ID, SCHEMATIC::IsValid(), SCH_SCREEN::Items(), SCH_CONNECTIVITY::NETCHAIN_INPUT::NET::key, Keys(), m_state, SCH_NETCHAIN::MakeKey(), SCH_CONNECTIVITY::SESSION_KEYS::Name(), SCHEMATIC::NetChains(), PROJECT_FILE::NetSettings(), NO_RECURSE, path, SCH_SHEET_PATH::PathRef(), SCHEMATIC::Project(), Published(), SCH_CONNECTIVITY::NETCHAIN_MANAGER::Rebuild(), SCH_CONNECTIVITY::AUXILIARY::RuleAreasOf(), SCH_BUS_BUS_ENTRY_T, SCH_BUS_WIRE_ENTRY_T, SCH_DIRECTIVE_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_LINE_T, SCH_PIN_T, SCH_SHEET_PIN_T, SCH_ITEM::SetConnectivityDirty(), SCH_CONNECTIVITY::NETCHAIN_INPUT::sheets, SCH_CONNECTIVITY::SIGNAL, SCH_CONNECTIVITY::NETCHAIN_INPUT::storage, EDA_ITEM::Type(), and updateModel().
| std::vector< SIMULATION_MODEL_FACT > SCH_CONNECTIVITY::FACADE::SimulationModels | ( | const KIID_PATH & | aPath | ) | const |
Definition at line 1092 of file conn_facade.cpp.
References m_state.
|
nodiscard |
Definition at line 559 of file conn_facade.cpp.
References m_state.
Referenced by SCH_EDIT_FRAME::subscribeConnectivity().
| std::vector< TEXT_CHECK_FACT > SCH_CONNECTIVITY::FACADE::TextChecks | ( | const KIID_PATH & | aPath, |
| bool | aDrawingSheet = false ) const |
Definition at line 1062 of file conn_facade.cpp.
References m_state.
| void SCH_CONNECTIVITY::FACADE::Update | ( | const SCH_SHEET_LIST & | aPaths, |
| uint64_t | aTextEpoch, | ||
| const BUS_ALIASES & | aAliases, | ||
| bool | aRebuild = false ) |
Definition at line 948 of file conn_facade.cpp.
References Clear(), SCH_SCREEN::ConnectivitySource(), Keys(), m_state, and path.
| void SCH_CONNECTIVITY::FACADE::Update | ( | SCHEMATIC & | aSchematic, |
| bool | aRebuild = false ) |
Definition at line 844 of file conn_facade.cpp.
References SCHEMATIC::BuildSheetListSortedByPageNumbers(), Clear(), and updateModel().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_DATA_TEST_CASE_F(), and updateModel().
|
private |
Capture the text context and advance the text epoch when it or an external source changed.
Definition at line 923 of file conn_facade.cpp.
References SCHEMATIC::GetAllBusAliases(), m_state, and Update().
Referenced by Recalculate(), Update(), and UpdateShadow().
| bool SCH_CONNECTIVITY::FACADE::UpdateShadow | ( | SCHEMATIC & | aSchematic, |
| const SCH_SHEET_LIST & | aPaths, | ||
| bool | aRebuild = false ) |
Definition at line 859 of file conn_facade.cpp.
References Clear(), and updateModel().
|
friend |
Definition at line 177 of file conn_facade.h.
References PUBLICATION_HOLD.
Referenced by PUBLICATION_HOLD.
|
private |
Definition at line 183 of file conn_facade.h.
Referenced by BundlesOf(), BusWithMembers(), Clear(), Connection(), Engine(), FACADE(), GetEquivalentBusNames(), GetNetMap(), GetSubgraphForItem(), Keys(), NetByName(), NetNames(), PrepareSimulationModels(), PrepareTextChecks(), SCH_CONNECTIVITY::PUBLICATION_HOLD::PUBLICATION_HOLD(), Published(), Recalculate(), SimulationModels(), Subscribe(), TextChecks(), Update(), updateModel(), and ~FACADE().