73 m_schematic = std::make_unique<SCHEMATIC>(
nullptr );
91 existingPath.push_back(
KIID() );
92 existingPath.push_back(
KIID() );
95 existingInstance.
m_Path = existingPath;
97 existingInstance.
m_Unit = 1;
102 m_schematic->AddTopLevelSheet( rootSheet );
112 wxString newProjectName = wxT(
"StandaloneProject" );
116 wxString ref = symbol->
GetRef( &newPath );
121 BOOST_CHECK_MESSAGE( ref == wxT(
"R202" ),
122 "Symbol reference should use existing instance data, not unannotated" );
123 BOOST_CHECK_MESSAGE( !ref.EndsWith( wxT(
"?" ) ),
124 "Symbol reference should NOT be unannotated" );
138 m_schematic = std::make_unique<SCHEMATIC>(
nullptr );
139 m_schematic->Reset();
156 m_schematic->AddTopLevelSheet( rootSheet );
162 wxString newProjectName = wxT(
"NewProject" );
165 wxString ref = symbol->
GetRef( &newPath );
167 BOOST_TEST_MESSAGE(
"Reference after CheckForMissingSymbolInstances (no prior instances): " << ref );
170 BOOST_CHECK_MESSAGE( ref == wxT(
"C101" ),
171 "Symbol reference should use field text when no instances exist" );
185 m_schematic = std::make_unique<SCHEMATIC>(
nullptr );
186 m_schematic->Reset();
193 m_schematic->AddTopLevelSheet( rootSheet );
201 otherPath.push_back(
KIID() );
202 otherPath.push_back(
KIID() );
217 screen->
Append( symbol1 );
225 symbol2->
SetRef( ¤tPath, wxT(
"C101" ) );
226 screen->
Append( symbol2 );
234 screen->
Append( symbol3 );
236 wxString projectName = wxT(
"CurrentProject" );
240 wxString ref1 = symbol1->
GetRef( ¤tPath );
241 wxString ref2 = symbol2->
GetRef( ¤tPath );
242 wxString ref3 = symbol3->
GetRef( ¤tPath );
248 BOOST_CHECK_MESSAGE( ref1 == wxT(
"R202" ),
249 "Symbol with other-path instance should use that reference" );
250 BOOST_CHECK_MESSAGE( ref2 == wxT(
"C101" ),
251 "Symbol with current-path instance should keep its reference" );
252 BOOST_CHECK_MESSAGE( ref3 == wxT(
"L1" ),
253 "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_TEST_MESSAGE("Polyline has "<< chain.PointCount()<< " points")
VECTOR2< int32_t > VECTOR2I