100 m_schematic->CreateDefaultScreens();
102 std::vector<SCH_SHEET*> topSheets = m_schematic->GetTopLevelSheets();
111 subSheet->
SetName(
"SubSheet" );
115 topScreen->
Append( subSheet );
117 m_schematic->RefreshHierarchy();
119 auto chain = std::make_unique<SCH_NETCHAIN>();
120 chain->SetName( wxT(
"TEST_CHAIN" ) );
121 chain->AddNet( wxT(
"/NET_A" ) );
122 chain->AddNet( wxT(
"/NET_B" ) );
123 chain->SetTerminalRefs( wxT(
"U1" ), wxT(
"1" ), wxT(
"U2" ), wxT(
"2" ) );
127 BOOST_REQUIRE_EQUAL( m_schematic->ConnectionGraph()->GetCommittedNetChains().size(), 1u );
129 wxString topFileName = GetTempFileName(
"netchain_main" );
130 topFileName +=
".kicad_sch";
131 m_tempFiles.push_back( topFileName );
133 wxString subFileName = GetTempFileName(
"netchain_sub" );
134 subFileName +=
".kicad_sch";
135 m_tempFiles.push_back( subFileName );
138 BOOST_CHECK_NO_THROW(
140 BOOST_CHECK_NO_THROW(
146 auto countOccurrences = [](
const wxString& aHaystack,
const wxString& aNeedle )
151 while( ( pos = aHaystack.find( aNeedle, pos ) ) != wxString::npos )
154 pos += aNeedle.length();
160 wxString topContents;
162 wxFFile readback( topFileName,
"rb" );
163 BOOST_REQUIRE( readback.IsOpened() && readback.ReadAll( &topContents ) );
166 wxString subContents;
168 wxFFile readback( subFileName,
"rb" );
169 BOOST_REQUIRE( readback.IsOpened() && readback.ReadAll( &subContents ) );
174 "Top-level sheet file is missing the chain name" );
178 "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")