44#include <wx/filename.h>
45#include <wx/stdpaths.h>
52 wxString tempDir = wxStandardPaths::Get().GetTempDir();
53 wxString projectPath = tempDir + wxFileName::GetPathSeparator() + wxT(
"test_issue24943.kicad_pro" );
56 m_schematic = std::make_unique<SCHEMATIC>(
nullptr );
67 m_libSym = std::make_unique<LIB_SYMBOL>(
"OPAMP",
nullptr );
70 pin->SetNumber(
"1" );
120 m_unitA->SetValueFieldText( wxS(
"AAA" ), &m_path, wxS(
"V1" ) );
121 sync( m_unitA, wxS(
"V1" ) );
123 BOOST_CHECK_EQUAL( m_unitB->GetValue(
false, &m_path,
false, wxS(
"V1" ) ), wxS(
"AAA" ) );
135 for(
SCH_SYMBOL* unit : { m_unitA, m_unitB } )
139 unit->AddField( mpn );
142 m_unitA->SetFieldText( wxS(
"MPN" ), wxS(
"222" ), &m_path, wxS(
"V1" ) );
143 sync( m_unitA, wxS(
"V1" ) );
145 BOOST_CHECK_EQUAL( m_unitB->GetFieldText( wxS(
"MPN" ), &m_path, wxS(
"V1" ) ), wxS(
"222" ) );
156 m_unitA->SetExcludedFromBOM(
true, &m_path, wxS(
"V1" ) );
157 sync( m_unitA, wxS(
"V1" ) );
159 BOOST_CHECK( m_unitB->GetExcludedFromBOM( &m_path, wxS(
"V1" ) ) );
160 BOOST_CHECK( !m_unitB->GetExcludedFromBOM( &m_path ) );
169 m_unitA->SetDNP(
true, &m_path, wxS(
"V1" ) );
170 sync( m_unitA, wxS(
"V1" ) );
172 BOOST_CHECK( m_unitB->GetDNP( &m_path, wxS(
"V1" ) ) );
173 BOOST_CHECK( !m_unitB->GetDNP( &m_path ) );
182 m_unitA->SetValueFieldText( wxS(
"BBB" ), &m_path, wxEmptyString );
183 sync( m_unitA, wxEmptyString );
void SetText(const wxString &aText) override
void Append(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
void SetFileName(const wxString &aFileName)
Set the file name for this screen to aFileName.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void SyncOtherUnits(const SCH_SHEET_PATH &aSourceSheet, SCH_COMMIT &aCommit, PROPERTY_BASE *aProperty, const wxString &aVariantName=wxEmptyString)
Keep fields other than the reference, include/exclude flags, and alternate pin assignments in sync in...
@ PT_PASSIVE
pin for passive symbols: must be connected, and can be connected to any pin.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
Regression tests for issue 24943, design variant edits on multi-unit symbols.
SETTINGS_MANAGER m_settingsManager
void sync(SCH_SYMBOL *aSource, const wxString &aVariant)
std::unique_ptr< LIB_SYMBOL > m_libSym
std::unique_ptr< SCHEMATIC > m_schematic
@ USER
The field ID hasn't been set yet; field is invalid.
@ VALUE
Field Value of part, i.e. "3.3K".
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(ValueSyncUnderVariant)
A value assigned under a variant must reach the sibling unit as the same variant differential,...
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I