|
KiCad PCB EDA Suite
|
Bridges SCHEMATIC's listener stream into the generic TEXT_VAR_TRACKER. More...
#include <schematic_text_var_adapter.h>
Public Member Functions | |
| SCHEMATIC_TEXT_VAR_ADAPTER (SCHEMATIC &aSchematic) | |
| ~SCHEMATIC_TEXT_VAR_ADAPTER () override=default | |
| TEXT_VAR_TRACKER & | Tracker () |
| const TEXT_VAR_TRACKER & | Tracker () const |
| void | OnSchItemsAdded (SCHEMATIC &aSch, std::vector< SCH_ITEM * > &aItems) override |
| void | OnSchItemsRemoved (SCHEMATIC &aSch, std::vector< SCH_ITEM * > &aItems) override |
| void | OnSchItemsChanged (SCHEMATIC &aSch, std::vector< SCH_ITEM * > &aItems) override |
| void | RebuildIndex () |
| Walk every sheet in the hierarchy and register text-bearing items. | |
| std::vector< TEXT_VAR_REF_KEY > | ExtractSourceKeys (EDA_ITEM *aItem) const |
Return the keys aItem could source as a cross-reference target. | |
| virtual void | OnSchSheetChanged (SCHEMATIC &aSch) |
Private Member Functions | |
| void | registerItem (SCH_ITEM *aItem) |
| void | unregisterItem (SCH_ITEM *aItem) |
| void | handleItemChanged (SCH_ITEM *aItem) |
Private Attributes | |
| SCHEMATIC & | m_schematic |
| TEXT_VAR_TRACKER | m_tracker |
Bridges SCHEMATIC's listener stream into the generic TEXT_VAR_TRACKER.
Mirrors BOARD_TEXT_VAR_ADAPTER but for schematic items. A SCH_SYMBOL can carry multiple instance-specific references (different refdes on different SCH_SHEET_PATH instances); the adapter keys cross-ref source emission on the symbol's reference on the schematic's current sheet path. This is a known simplification — repeat-sheet schematics where U1 has different refdes in each sheet instance will over-invalidate but not miss updates. The proper fix is to extend TEXT_VAR_REF_KEY with an optional KIID_PATH scope so cross-refs can be per-instance (codex review finding 2).
Definition at line 43 of file schematic_text_var_adapter.h.
|
explicit |
Definition at line 33 of file schematic_text_var_adapter.cpp.
References ExtractSourceKeys(), m_schematic, and m_tracker.
|
overridedefault |
| std::vector< TEXT_VAR_REF_KEY > SCHEMATIC_TEXT_VAR_ADAPTER::ExtractSourceKeys | ( | EDA_ITEM * | aItem | ) | const |
Return the keys aItem could source as a cross-reference target.
For a SCH_SYMBOL, these are ${REFDES:FIELD} keys — one per field, using the symbol's reference on the schematic's current sheet path.
Definition at line 180 of file schematic_text_var_adapter.cpp.
References TEXT_VAR_REF_KEY::CROSS_REF, SCH_SYMBOL::GetFields(), EDA_ITEM::GetParent(), SCH_SYMBOL::GetRef(), TEXT_VAR_REF_KEY::kind, m_schematic, path, TEXT_VAR_REF_KEY::primary, and TEXT_VAR_REF_KEY::secondary.
Referenced by SCHEMATIC_TEXT_VAR_ADAPTER().
|
private |
Definition at line 97 of file schematic_text_var_adapter.cpp.
References FilterTrackable(), m_tracker, and text.
Referenced by OnSchItemsChanged().
|
overridevirtual |
Reimplemented from SCHEMATIC_LISTENER.
Definition at line 136 of file schematic_text_var_adapter.cpp.
References registerItem().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
overridevirtual |
Reimplemented from SCHEMATIC_LISTENER.
Definition at line 152 of file schematic_text_var_adapter.cpp.
References handleItemChanged().
Referenced by BOOST_AUTO_TEST_CASE().
|
overridevirtual |
Reimplemented from SCHEMATIC_LISTENER.
Definition at line 144 of file schematic_text_var_adapter.cpp.
References unregisterItem().
Referenced by BOOST_AUTO_TEST_CASE().
|
inlinevirtualinherited |
Reimplemented in DIALOG_SYMBOL_FIELDS_TABLE.
Definition at line 71 of file schematic.h.
Referenced by SCHEMATIC::OnSchSheetChanged().
| void SCHEMATIC_TEXT_VAR_ADAPTER::RebuildIndex | ( | ) |
Walk every sheet in the hierarchy and register text-bearing items.
Invoked after bulk operations (file load, sheet rename) that may have bypassed per-item notifications.
Definition at line 160 of file schematic_text_var_adapter.cpp.
References SCH_SCREEN::Items(), m_schematic, m_tracker, path, and registerItem().
|
private |
Definition at line 42 of file schematic_text_var_adapter.cpp.
References FilterTrackable(), m_tracker, registerItem(), and text.
Referenced by OnSchItemsAdded(), RebuildIndex(), and registerItem().
|
inline |
Definition at line 49 of file schematic_text_var_adapter.h.
References m_tracker.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 50 of file schematic_text_var_adapter.h.
References m_tracker.
|
private |
Definition at line 77 of file schematic_text_var_adapter.cpp.
References m_tracker.
Referenced by OnSchItemsRemoved().
|
private |
Definition at line 75 of file schematic_text_var_adapter.h.
Referenced by ExtractSourceKeys(), RebuildIndex(), and SCHEMATIC_TEXT_VAR_ADAPTER().
|
private |
Definition at line 76 of file schematic_text_var_adapter.h.
Referenced by handleItemChanged(), RebuildIndex(), registerItem(), SCHEMATIC_TEXT_VAR_ADAPTER(), Tracker(), Tracker(), and unregisterItem().