37#include <wx/filename.h>
38#include <wx/stdpaths.h>
45 wxString tempDir = wxStandardPaths::Get().GetTempDir();
46 wxString projectPath = tempDir + wxFileName::GetPathSeparator()
47 + wxT(
"test_pinmap_ovr.kicad_pro" );
51 m_schematic = std::make_unique<SCHEMATIC>(
nullptr );
59 if( wxFileExists( file ) )
68 wxString dir = wxStandardPaths::Get().GetTempDir();
69 wxString
name = wxFileName::CreateTempFileName( dir + wxFileName::GetPathSeparator()
70 +
"pin_map_override" );
83 screen->
SetFileName(
"pin_map_override.kicad_sch" );
86 path.push_back( sheet );
88 m_libSym = std::make_unique<LIB_SYMBOL>(
"LM358",
nullptr );
91 pin1->SetNumber(
"1" );
146 ov.
m_Edits.push_back( { wxS(
"1" ), wxS(
"8" ) } );
147 ov.
m_Edits.push_back( { wxS(
"8" ), wxS(
"1" ) } );
180 ov.
m_Edits.push_back( { wxS(
"1" ), wxS(
"8" ) } );
183 wxString fileName = tempFile();
189 wxFile f( fileName );
191 f.ReadAll( &contents );
192 BOOST_CHECK( contents.Contains( wxS(
"(pin_map_override" ) ) );
193 BOOST_CHECK( contents.Contains( wxS(
"named_map" ) ) );
204 BOOST_REQUIRE_EQUAL(
result.m_Edits.size(), 1u );
215 wxString fileName = tempFile();
220 wxFile f( fileName );
222 f.ReadAll( &contents );
223 BOOST_CHECK( !contents.Contains( wxS(
"(pin_map_override" ) ) );
EE_TYPE OfType(KICAD_T aType) const
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
A SCH_IO derivation for loading schematic files using the new s-expression file format.
void SaveSchematicFile(const wxString &aFileName, SCH_SHEET *aSheet, SCHEMATIC *aSchematic, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Write aSchematic to a storage file in a format that this SCH_IO implementation knows about,...
SCH_SHEET * LoadSchematicFile(const wxString &aFileName, SCHEMATIC *aSchematic, SCH_SHEET *aAppendToMe=nullptr, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load information from some input file format that this SCH_IO implementation knows about,...
Base class for any item which can be embedded within the SCHEMATIC container class,...
void Append(SCH_ITEM *aItem, bool aUpdateLibSymbol=true)
EE_RTREE & Items()
Get the full RTree, usually for iterating.
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.
SCH_SCREEN * GetScreen() const
Variant information for a schematic symbol.
PIN_MAP_INSTANCE_OVERRIDE m_PinMapOverride
Per-instance pin-to-pad map override for this variant (issue #2282).
void InitializeAttributes(const SCH_SYMBOL &aSymbol)
PIN_MAP_INSTANCE_OVERRIDE GetPinMapOverride(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const
void SetPinMapOverride(const PIN_MAP_INSTANCE_OVERRIDE &aOverride, const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString)
Set the per-instance pin-to-pad map override (issue #2282).
void UpdatePins()
Updates the cache of SCH_PIN objects for each pin.
@ 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.
std::vector< FAB_LAYER_COLOR > dummy
Per-instance override of the active pin map and a sparse delta on top.
std::vector< PIN_MAP_ENTRY > m_Edits
PIN_MAP_OVERRIDE_MODE m_Mode
SCH_SHEET * placeSymbol(const PIN_MAP_INSTANCE_OVERRIDE &aOverride)
Place a one-pin symbol carrying aOverride on a fresh top sheet and return the sheet.
std::vector< wxString > m_tempFiles
PIN_MAP_OVERRIDE_FIXTURE()
SETTINGS_MANAGER m_settingsManager
~PIN_MAP_OVERRIDE_FIXTURE()
std::unique_ptr< SCHEMATIC > m_schematic
SCH_SYMBOL * reload(const wxString &aFileName)
std::unique_ptr< LIB_SYMBOL > m_libSym
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(BaseOverrideSetGet)
wxString result
Test unit parsing edge cases and error handling.
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I