45#include <wx/filename.h>
63 m_page1->GetScreen()->SetFileName( wxT(
"page1.kicad_sch" ) );
67 m_page1->GetScreen()->Append( wire );
80 page2->
SetName( wxT(
"Untitled" ) );
108 SCH_SCREEN* page1Screen = m_page1->GetScreen();
109 size_t itemCount = page1Screen->
Items().
size();
114 m_schematic->SetCurrentSheet( page2Path );
119 BOOST_CHECK( m_schematic->IsTopLevelSheet( m_schematic->CurrentSheet().at( 0 ) ) );
120 BOOST_CHECK( m_schematic->CurrentSheet().LastScreen() == page1Screen );
123 BOOST_CHECK( m_schematic->Hierarchy().HasPath( m_schematic->CurrentSheet().Path() ) );
136 SCH_SCREEN* page1Screen = m_page1->GetScreen();
140 m_schematic->SetCurrentSheet( page2Path );
146 wxString tmpName = wxFileName::CreateTempFileName( wxT(
"issue24870" ) );
151 std::ifstream stream(
path );
154 std::unique_ptr<SCHEMATIC> reloaded =
163 for(
SCH_ITEM* item : reloaded->RootScreen()->Items() )
175 wxRemoveFile( tmpName );
176 wxRemoveFile(
path );
size_t size() const
Return the number of items in the tree.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Base class for any item which can be embedded within the SCHEMATIC container class,...
Segment description base class to describe items which have 2 end points (track, wire,...
bool IsWire() const
Return true if the line is a wire.
void SetEndPoint(const VECTOR2I &aPosition)
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...
void SetPageNumber(const wxString &aPageNumber)
Set the sheet instance user definable page number.
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 SetName(const wxString &aName)
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
static std::string ToStdString(const wxString &aStr)
std::unique_ptr< SCHEMATIC > ReadSchematicFromStream(std::istream &aStream, PROJECT *aProject)
void DumpSchematicToFile(SCHEMATIC &aSchematic, SCH_SHEET &aSheet, const std::string &aFilename)
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
std::vector< FAB_LAYER_COLOR > dummy
SETTINGS_MANAGER m_settingsManager
SCH_SHEET * addSecondPage()
Add a second top-level sheet the way HIERARCHY_PANE's "New Top-Level Sheet" does.
std::unique_ptr< SCHEMATIC > m_schematic
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(DeleteDisplayedPageRetargetsCurrentSheet)
Deleting the top-level sheet that is being displayed must retarget the current sheet onto a page that...
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I