69 m_schematic = std::make_unique<SCHEMATIC>(
nullptr );
87 existingPath.push_back(
KIID() );
88 existingPath.push_back(
KIID() );
91 existingInstance.
m_Path = existingPath;
93 existingInstance.
m_Unit = 1;
98 m_schematic->AddTopLevelSheet( rootSheet );
108 wxString newProjectName = wxT(
"StandaloneProject" );
112 wxString ref = symbol->
GetRef( &newPath );
118 "Symbol reference should use existing instance data, not unannotated" );
120 "Symbol reference should NOT be unannotated" );
134 m_schematic = std::make_unique<SCHEMATIC>(
nullptr );
135 m_schematic->Reset();
152 m_schematic->AddTopLevelSheet( rootSheet );
158 wxString newProjectName = wxT(
"NewProject" );
161 wxString ref = symbol->
GetRef( &newPath );
163 BOOST_TEST_MESSAGE(
"Reference after CheckForMissingSymbolInstances (no prior instances): " << ref );
167 "Symbol reference should use field text when no instances exist" );
181 m_schematic = std::make_unique<SCHEMATIC>(
nullptr );
182 m_schematic->Reset();
189 m_schematic->AddTopLevelSheet( rootSheet );
197 otherPath.push_back(
KIID() );
198 otherPath.push_back(
KIID() );
213 screen->
Append( symbol1 );
221 symbol2->
SetRef( ¤tPath, wxT(
"C101" ) );
222 screen->
Append( symbol2 );
230 screen->
Append( symbol3 );
232 wxString projectName = wxT(
"CurrentProject" );
236 wxString ref1 = symbol1->
GetRef( ¤tPath );
237 wxString ref2 = symbol2->
GetRef( ¤tPath );
238 wxString ref3 = symbol3->
GetRef( ¤tPath );
245 "Symbol with other-path instance should use that reference" );
247 "Symbol with current-path instance should keep its reference" );
249 "Symbol with no instances should use field text" );
A logical library item identifier and consists of various portions much like a URI.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
void SetText(const wxString &aText) override
void Append(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
void CheckForMissingSymbolInstances(const wxString &aProjectName)
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
void SetLibId(const LIB_ID &aName)
const std::vector< SCH_SYMBOL_INSTANCE > & GetInstances() const
void SetPosition(const VECTOR2I &aPosition) override
void SetRef(const SCH_SHEET_PATH *aSheet, const wxString &aReference)
Set the reference for the given sheet path for this symbol.
void AddHierarchicalReference(const KIID_PATH &aPath, const wxString &aRef, int aUnit)
Add a full hierarchical reference to this symbol.
void SetPrefix(const wxString &aPrefix)
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
SCH_FIELD * GetField(FIELD_T aFieldType)
Return a mandatory field in this symbol.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
std::vector< FAB_LAYER_COLOR > dummy
std::unique_ptr< SCHEMATIC > m_schematic
SETTINGS_MANAGER m_settingsManager
A simple container for schematic symbol instance information.
@ REFERENCE
Field Reference of part, i.e. "IC21".
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_FIXTURE_TEST_CASE(Issue22576MissingInstancesFallback, ISSUE22576_FIXTURE)
Test that CheckForMissingSymbolInstances uses existing instance data as fallback.
BOOST_CHECK_MESSAGE(totalMismatches==0, std::to_string(totalMismatches)+" board(s) with strategy disagreements")
BOOST_TEST_MESSAGE("\n=== Real-World Polygon PIP Benchmark ===\n"<< formatTable(table))
VECTOR2< int32_t > VECTOR2I