30#include <wx/filename.h>
64 const std::map<std::string, UTF8>* aProperties )
66 wxASSERT( !aFileName.IsEmpty() && aSchematic !=
nullptr );
80 wxCHECK_MSG( aSchematic->
IsValid(),
nullptr,
81 wxT(
"Can't append to a schematic with no root!" ) );
82 rootSheet = &aSchematic->
Root();
91 wxFileName newFilename( aFileName );
93 rootSheet->
SetFileName( newFilename.GetFullPath() );
106 wxFileName newFilename( aFileName );
129 if( projectName.IsEmpty() )
130 projectName = wxFileName( aFileName ).GetName();
Parser for DipTrace .dch schematic binary files.
void Parse()
Parse the .dch file and populate the schematic with KiCad objects.
REPORTER * m_reporter
Reporter to log errors/warnings to, may be nullptr.
PROGRESS_REPORTER * m_progressReporter
Progress reporter to track the progress of the operation, may be nullptr.
virtual const wxString GetProjectName() const
Return the short name of the project.
Holds all the data relating to one schematic.
SCH_SHEET_LIST BuildUnorderedSheetList() const
PROJECT & Project() const
Return a reference to the project this schematic is part of.
bool IsValid() const
A simple test if the schematic is loaded, not a complete one.
void SetTopLevelSheets(const std::vector< SCH_SHEET * > &aSheets)
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,...
bool CanReadSchematicFile(const wxString &aFileName) const override
Checks if this SCH_IO can read the specified schematic file.
virtual bool CanReadSchematicFile(const wxString &aFileName) const
Checks if this SCH_IO can read the specified schematic file.
void SetFileName(const wxString &aFileName)
Set the file name for this screen to aFileName.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void AddNewSymbolInstances(const SCH_SHEET_PATH &aPrefixSheetPath, const wxString &aProjectName)
Attempt to add new symbol instances for all symbols in this list of sheet paths prefixed with aPrefix...
void SetInitialPageNumbers()
Set initial sheet page numbers.
bool AllSheetPageNumbersEmpty() const
Check all of the sheet instance for empty page numbers.
void AddNewSheetInstances(const SCH_SHEET_PATH &aPrefixSheetPath, int aLastVirtualPageNumber)
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.
void SetFileName(const wxString &aFilename)
SCH_SCREEN * GetScreen() const
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
static const std::string KiCadSchematicFileExtension
#define THROW_IO_ERROR(msg)
macro which captures the "call site" values of FILE_, __FUNCTION & LINE
bool fileHasBinaryHeader(const wxString &aFilePath, const std::vector< uint8_t > &aHeader, size_t aOffset)
Check if a file starts with a defined binary header.
static const std::vector< uint8_t > DIPTRACE_SCH_HEADER_V11
DipTrace schematic legacy magic header: byte(11) + "DTSCHEMx.yy".
static const std::vector< uint8_t > DIPTRACE_SCH_HEADER_V7
DipTrace schematic modern magic header: byte(7) + "DTSCHEM".
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
Definition of file extensions used in Kicad.