38 m_pi = SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD );
64 BOOST_TEST_MESSAGE( fn.GetFullPath() );
85 for(
SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
86 screen->UpdateLocalLibSymbolLinks();
99 sheet.UpdateAllScreenReferences();
106 fn.AppendDir(
"netlists" );
108 wxString
path = fn.GetFullPath();
111 return wxFileName(
path );
120 loadSchematic(
"complex_hierarchy/complex_hierarchy" );
129 BOOST_CHECK_EQUAL( sheets.at( 0 ).GetPageNumber(),
"1" );
130 BOOST_CHECK_EQUAL( sheets.at( 1 ).GetPageNumber(),
"2" );
131 BOOST_CHECK_EQUAL( sheets.at( 2 ).GetPageNumber(),
"3" );
140 loadSchematic(
"complex_hierarchy_shared/ampli_ht/ampli_ht" );
144 BOOST_CHECK_EQUAL( sheets.size(), 2 );
145 BOOST_CHECK_EQUAL( sheets.at( 0 ).GetPageNumber(),
"i" );
146 BOOST_CHECK_EQUAL( sheets.at( 1 ).GetPageNumber(),
"ii" );
152 loadSchematic(
"complex_hierarchy_shared/complex_hierarchy" );
156 BOOST_CHECK_EQUAL( sheets.size(), 5 );
157 BOOST_CHECK_EQUAL( sheets.at( 0 ).GetPageNumber(),
"1" );
158 BOOST_CHECK_EQUAL( sheets.at( 1 ).GetPageNumber(),
"2" );
159 BOOST_CHECK_EQUAL( sheets.at( 2 ).GetPageNumber(),
"3" );
160 BOOST_CHECK_EQUAL( sheets.at( 3 ).GetPageNumber(),
"4" );
161 BOOST_CHECK_EQUAL( sheets.at( 4 ).GetPageNumber(),
"5" );
169 sheets.at( 0 ).SetPageNumber(
"A" );
170 sheets.at( 1 ).SetPageNumber(
"B" );
171 sheets.at( 2 ).SetPageNumber(
"C" );
172 sheets.at( 3 ).SetPageNumber(
"D" );
173 sheets.at( 4 ).SetPageNumber(
"E" );
176 wxString tempName =
"complex_hierarchy_shared/complex_hierarchy_modified";
177 wxFileName tempFn = buildFullPath( tempName );
178 m_pi->Save( tempFn.GetFullPath(), &m_schematic.Root(), &m_schematic );
179 loadSchematic( tempName );
181 sheets = m_schematic.GetSheets();
183 BOOST_CHECK_EQUAL( sheets.size(), 5 );
184 BOOST_CHECK_EQUAL( sheets.at( 0 ).GetPageNumber(),
"A" );
185 BOOST_CHECK_EQUAL( sheets.at( 1 ).GetPageNumber(),
"B" );
186 BOOST_CHECK_EQUAL( sheets.at( 2 ).GetPageNumber(),
"C" );
187 BOOST_CHECK_EQUAL( sheets.at( 3 ).GetPageNumber(),
"D" );
188 BOOST_CHECK_EQUAL( sheets.at( 4 ).GetPageNumber(),
"E" );
191 wxRemoveFile( tempFn.GetFullPath() );
198 loadSchematic(
"complex_hierarchy_shared/ampli_ht/ampli_ht" );
202 BOOST_CHECK_EQUAL( sheets.size(), 2 );
203 BOOST_CHECK_EQUAL( sheets.at( 0 ).GetPageNumber(),
"i" );
204 BOOST_CHECK_EQUAL( sheets.at( 1 ).GetPageNumber(),
"ii" );
208 BOOST_AUTO_TEST_SUITE_END()
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
PROJECT & Prj() const
A helper while we are not MDI-capable – return the one and only project.
Holds all the data relating to one schematic.
const std::string ProjectFileExtension
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
virtual SCH_SHEET * Load(const wxString &aFileName, SCHEMATIC *aSchematic, SCH_SHEET *aAppendToMe=nullptr, const PROPERTIES *aProperties=nullptr)
Load information from some input file format that this SCH_PLUGIN implementation knows about,...
const std::vector< SYMBOL_INSTANCE_REFERENCE > & GetSymbolInstances() const
TEST_SCH_SHEET_LIST_FIXTURE()
void UpdateSheetInstances(const std::vector< SCH_SHEET_INSTANCE > &aSheetInstances)
Update all of the sheet instance information using aSheetInstances.
BOOST_CHECK(v2.Cross(v1)==1)
virtual void SetElem(ELEM_T aIndex, _ELEM *aElem)
virtual ~TEST_SCH_SHEET_LIST_FIXTURE()
void SetRoot(SCH_SHEET *aRootSheet)
Initialize the schematic with a new root sheet.
Base class that schematic file and library loading and saving plugins should derive from.
SCHEMATIC m_schematic
Schematic to load
const std::vector< SCH_SHEET_INSTANCE > & GetSheetInstances() const
wxFileName buildFullPath(const wxString &aRelativePath)
Definition of file extensions used in Kicad.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
#define BOOST_TEST_CONTEXT(A)
void SetProject(PROJECT *aPrj)
void clear()
Forwarded method from std::vector.
void UpdateSymbolInstances(const std::vector< SYMBOL_INSTANCE_REFERENCE > &aSymbolInstances)
Update all of the symbol instance information using aSymbolInstances.
wxFileName GetEeschemaTestDataDir()
Get the configured location of Eeschema test data.
bool LoadProject(const wxString &aFullPath, bool aSetActive=true)
Loads a project or sets up a new project with a specified path.
void Reset()
Initialize this schematic to a blank one, unloading anything existing.
SCH_SHEET_LIST GetSheets() const override
Builds and returns an updated schematic hierarchy TODO: can this be cached?
bool AllSheetPageNumbersEmpty() const
Check all of the sheet instance for empty page numbers.
virtual const wxString & GetError() const
Return an error string to the caller.
const std::string KiCadSchematicFileExtension
SETTINGS_MANAGER m_manager
BOOST_AUTO_TEST_CASE(TestSheetListPageProperties)
void AnnotatePowerSymbols()
Silently annotate the not yet annotated power symbols of the entire hierarchy of the sheet path list.
SCH_SCREEN * RootScreen() const
Helper to retrieve the screen of the root sheet.
SCH_SHEET_PATH & CurrentSheet() const override
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
void SetInitialPageNumbers()
Set initial sheet page numbers.
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
void loadSchematic(const wxString &aRelativePath)