101 m_schematic->CreateDefaultScreens();
103 std::vector<SCH_SHEET*> topSheets = m_schematic->GetTopLevelSheets();
112 subSheet->
SetName(
"SubSheet" );
116 topScreen->
Append( subSheet );
118 m_schematic->RefreshHierarchy();
120 auto chain = std::make_unique<SCH_NETCHAIN>();
121 chain->SetName( wxT(
"TEST_CHAIN" ) );
122 chain->AddNet( wxT(
"/NET_A" ) );
123 chain->AddNet( wxT(
"/NET_B" ) );
124 chain->SetTerminalRefs( wxT(
"U1" ), wxT(
"1" ), wxT(
"U2" ), wxT(
"2" ) );
128 BOOST_REQUIRE_EQUAL( m_schematic->ConnectionGraph()->GetCommittedNetChains().size(), 1u );
130 wxString topFileName = GetTempFileName(
"netchain_main" );
131 topFileName +=
".kicad_sch";
132 m_tempFiles.push_back( topFileName );
134 wxString subFileName = GetTempFileName(
"netchain_sub" );
135 subFileName +=
".kicad_sch";
136 m_tempFiles.push_back( subFileName );
139 BOOST_CHECK_NO_THROW(
141 BOOST_CHECK_NO_THROW(
147 auto countOccurrences = [](
const wxString& aHaystack,
const wxString& aNeedle )
152 while( ( pos = aHaystack.find( aNeedle, pos ) ) != wxString::npos )
155 pos += aNeedle.length();
161 wxString topContents;
163 wxFFile readback( topFileName,
"rb" );
164 BOOST_REQUIRE( readback.IsOpened() && readback.ReadAll( &topContents ) );
167 wxString subContents;
169 wxFFile readback( subFileName,
"rb" );
170 BOOST_REQUIRE( readback.IsOpened() && readback.ReadAll( &subContents ) );
175 "Top-level sheet file is missing the chain name" );
179 "Sub-sheet file unexpectedly contains the chain name" );
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,...
BOOST_CHECK_EQUAL(result, "25.4")