25#ifndef _SCH_IO_ALTIUM_H_
26#define _SCH_IO_ALTIUM_H_
33#include <wx/filename.h>
70 {
"SchLib",
"IntLib" } );
80 const std::map<std::string, UTF8>* aProperties =
nullptr )
override;
90 const wxString& aLibraryPath,
91 const std::map<std::string, UTF8>* aProperties =
nullptr )
override;
94 const wxString& aLibraryPath,
95 const std::map<std::string, UTF8>* aProperties =
nullptr )
override;
98 const wxString& aAliasName,
99 const std::map<std::string, UTF8>* aProperties =
nullptr )
override;
122 void ParseRecord(
int index, std::map<wxString, wxString>& properties,
123 const wxString& aSectionName );
135 void ParseComponent(
int aIndex,
const std::map<wxString, wxString>& aProperties );
136 void ParseTemplate(
int aIndex,
const std::map<wxString, wxString>& aProperties );
137 void ParsePin(
const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol =
nullsym);
138 void ParseLabel(
const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol =
nullsym, std::vector<int>& aFontSize =
nullint );
139 void ParseTextFrame(
const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol =
nullsym, std::vector<int>& aFontSize =
nullint );
140 void ParseNote(
const std::map<wxString, wxString>& aProperties );
141 void ParseBezier(
const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol =
nullsym);
142 void ParsePolyline(
const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol =
nullsym);
143 void ParsePolygon(
const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol =
nullsym);
145 void ParseArc(
const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol =
nullsym);
147 void ParseEllipse(
const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol =
nullsym);
148 void ParseCircle(
const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol =
nullsym);
149 void ParseLine(
const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol =
nullsym);
156 void ParsePieChart(
const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol =
nullsym);
157 void ParseRectangle(
const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol =
nullsym);
158 void ParseSheetSymbol(
int aIndex,
const std::map<wxString, wxString>& aProperties );
159 void ParseSheetEntry(
const std::map<wxString, wxString>& aProperties );
160 void ParsePowerPort(
const std::map<wxString, wxString>& aProperties );
162 void ParseNoERC(
const std::map<wxString, wxString>& aProperties );
163 void ParseNetLabel(
const std::map<wxString, wxString>& aProperties );
164 void ParseBus(
const std::map<wxString, wxString>& aProperties );
165 void ParseWire(
const std::map<wxString, wxString>& aProperties );
166 void ParseJunction(
const std::map<wxString, wxString>& aProperties );
167 void ParseImage(
const std::map<wxString, wxString>& aProperties );
168 void ParseSheet(
const std::map<wxString, wxString>& aProperties );
169 void ParseSheetName(
const std::map<wxString, wxString>& aProperties );
170 void ParseFileName(
const std::map<wxString, wxString>& aProperties );
171 void ParseDesignator(
const std::map<wxString, wxString>& aProperties );
172 void ParseLibDesignator(
const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol =
nullsym, std::vector<int>& aFontSize =
nullint );
173 void ParseBusEntry(
const std::map<wxString, wxString>& aProperties );
174 void ParseParameter(
const std::map<wxString, wxString>& aProperties );
175 void ParseLibParameter(
const std::map<wxString, wxString>& aProperties, std::vector<LIB_SYMBOL*>& aSymbol =
nullsym, std::vector<int>& aFontSize =
nullint );
181 std::vector<LIB_SYMBOL*>
ParseLibComponent(
const std::map<wxString, wxString>& aProperties );
183 void doEnumerateSymbolLib(
const wxString& aLibraryPath,
const std::map<std::string, UTF8>* aProperties,
184 std::function<
void(
const wxString&,
LIB_SYMBOL*)> aInserter );
224 void ensureLoadedLibrary(
const wxString& aLibraryPath,
const std::map<std::string, UTF8>* aProperties );
228 static bool isASCIIFile(
const wxString& aFileName );
232 std::map<wxString, std::map<wxString, LIB_SYMBOL*>>
m_libCache;
235 std::vector<std::pair<wxString, int>>
m_fonts;
Define a library symbol object.
Holds all the data relating to one schematic.
void ParseFileHeader(const ALTIUM_COMPOUND_FILE &aAltiumSchFile)
void ParseHyperlink(const std::map< wxString, wxString > &aProperties, std::vector< LIB_SYMBOL * > &aSymbol=nullsym)
void ParseSignalHarness(const std::map< wxString, wxString > &aProperties)
std::map< int, ASCH_TEMPLATE > m_altiumTemplates
std::map< int, ASCH_SYMBOL > m_altiumComponents
void ParsePort(const ASCH_PORT &aElem)
bool IsComponentPartVisible(const ASCH_OWNER_INTERFACE &aElem) const
void ParseNote(const std::map< wxString, wxString > &aProperties)
void ParseAltiumSch(const wxString &aFileName)
std::vector< ASCH_PORT > m_altiumPortsCurrentSheet
void ParseSheetName(const std::map< wxString, wxString > &aProperties)
void ParseBusEntry(const std::map< wxString, wxString > &aProperties)
const IO_BASE::IO_FILE_DESC GetLibraryDesc() const override
Get the descriptor for the library container that this IO plugin operates on.
SCH_SHEET * getCurrentSheet()
void ParseStorage(const ALTIUM_COMPOUND_FILE &aAltiumSchFile)
std::map< wxString, LIB_SYMBOL * > m_powerSymbols
void ParseBus(const std::map< wxString, wxString > &aProperties)
void ParseFileName(const std::map< wxString, wxString > &aProperties)
static bool isASCIIFile(const wxString &aFileName)
LIB_SYMBOL * LoadSymbol(const wxString &aLibraryPath, const wxString &aAliasName, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load a LIB_SYMBOL object having aPartName from the aLibraryPath containing a library format that this...
std::map< int, SCH_SHEET * > m_sheets
const IO_BASE::IO_FILE_DESC GetSchematicFileDesc() const override
Returns schematic file description for the SCH_IO.
void ParseLibHeader(const ALTIUM_COMPOUND_FILE &aAltiumSchFile, std::vector< int > &aFontSizes)
void ParseHarnessPort(const ASCH_PORT &aElem)
void ParseRoundRectangle(const std::map< wxString, wxString > &aProperties, std::vector< LIB_SYMBOL * > &aSymbol=nullsym)
int GetModifyHash() const override
Return the modification hash from the library cache.
void ParseLibDesignator(const std::map< wxString, wxString > &aProperties, std::vector< LIB_SYMBOL * > &aSymbol=nullsym, std::vector< int > &aFontSize=nullint)
std::map< int, int > m_altiumImplementationList
void ParseTextFrame(const std::map< wxString, wxString > &aProperties, std::vector< LIB_SYMBOL * > &aSymbol=nullsym, std::vector< int > &aFontSize=nullint)
void ParsePolygon(const std::map< wxString, wxString > &aProperties, std::vector< LIB_SYMBOL * > &aSymbol=nullsym)
void fixupSymbolPinNameNumbers(SYMBOL *aSymbol)
void ParseRecord(int index, std::map< wxString, wxString > &properties, const wxString &aSectionName)
std::vector< ASCH_PORT > m_altiumHarnessPortsCurrentSheet
void ParseDesignator(const std::map< wxString, wxString > &aProperties)
int m_harnessOwnerIndexOffset
std::map< wxString, LIB_SYMBOL * > ParseLibFile(const ALTIUM_COMPOUND_FILE &aAltiumSchFile)
static bool checkFileHeader(const wxString &aFileName)
long long getLibraryTimestamp(const wxString &aLibraryPath) const
std::map< wxString, std::map< wxString, LIB_SYMBOL * > > m_libCache
void ParseSheetEntry(const std::map< wxString, wxString > &aProperties)
IO_RELEASER< SCH_IO > m_pi
static bool isBinaryFile(const wxString &aFileName)
void ParseHarnessType(const std::map< wxString, wxString > &aProperties)
void ParseJunction(const std::map< wxString, wxString > &aProperties)
void ParseLibParameter(const std::map< wxString, wxString > &aProperties, std::vector< LIB_SYMBOL * > &aSymbol=nullsym, std::vector< int > &aFontSize=nullint)
void ParseASCIISchematic(const wxString &aFileName)
void ParsePolyline(const std::map< wxString, wxString > &aProperties, std::vector< LIB_SYMBOL * > &aSymbol=nullsym)
std::unique_ptr< ASCH_SHEET > m_altiumSheet
void ParseComponent(int aIndex, const std::map< wxString, wxString > &aProperties)
std::unique_ptr< TITLE_BLOCK > m_currentTitleBlock
void ParseImage(const std::map< wxString, wxString > &aProperties)
void ParseArc(const std::map< wxString, wxString > &aProperties, std::vector< LIB_SYMBOL * > &aSymbol=nullsym)
void ParseNetLabel(const std::map< wxString, wxString > &aProperties)
void ParseNoERC(const std::map< wxString, wxString > &aProperties)
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,...
void ParseImplementationList(int aIndex, const std::map< wxString, wxString > &aProperties)
std::vector< LIB_SYMBOL * > ParseLibComponent(const std::map< wxString, wxString > &aProperties)
void ParseSheet(const std::map< wxString, wxString > &aProperties)
void ParseParameter(const std::map< wxString, wxString > &aProperties)
bool ShouldPutItemOnSheet(int aOwnerindex)
void AddLibTextBox(const ASCH_TEXT_FRAME *aElem, std::vector< LIB_SYMBOL * > &aSymbol=nullsym, std::vector< int > &aFontSize=nullint)
bool CanReadSchematicFile(const wxString &aFileName) const override
Checks if this SCH_IO can read the specified schematic file.
void ParsePieChart(const std::map< wxString, wxString > &aProperties, std::vector< LIB_SYMBOL * > &aSymbol=nullsym)
std::unique_ptr< std::map< std::string, UTF8 > > m_properties
void ParseEllipticalArc(const std::map< wxString, wxString > &aProperties, std::vector< LIB_SYMBOL * > &aSymbol=nullsym)
void ParseEllipse(const std::map< wxString, wxString > &aProperties, std::vector< LIB_SYMBOL * > &aSymbol=nullsym)
void ParseWire(const std::map< wxString, wxString > &aProperties)
bool IsLibraryWritable(const wxString &aLibraryPath) override
Return true if the library at aLibraryPath is writable.
void ParseHarnessEntry(const std::map< wxString, wxString > &aProperties)
void EnumerateSymbolLib(wxArrayString &aSymbolNameList, const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Populate a list of LIB_SYMBOL alias names contained within the library aLibraryPath.
void ParseImplementation(const std::map< wxString, wxString > &aProperties, std::vector< LIB_SYMBOL * > &aSymbol=nullsym)
void ParseTemplate(int aIndex, const std::map< wxString, wxString > &aProperties)
void ParseAdditional(const ALTIUM_COMPOUND_FILE &aAltiumSchFile)
std::vector< ASCH_ADDITIONAL_FILE > m_altiumAdditional
void AddTextBox(const ASCH_TEXT_FRAME *aElem)
void ParsePowerPort(const std::map< wxString, wxString > &aProperties)
bool CanReadLibrary(const wxString &aFileName) const override
Checks if this IO object can read the specified library file/directory.
const ASCH_STORAGE_FILE * GetFileFromStorage(const wxString &aFilename) const
void ParseRectangle(const std::map< wxString, wxString > &aProperties, std::vector< LIB_SYMBOL * > &aSymbol=nullsym)
void doEnumerateSymbolLib(const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties, std::function< void(const wxString &, LIB_SYMBOL *)> aInserter)
std::vector< ASCH_STORAGE_FILE > m_altiumStorage
SCH_SHEET_PATH m_sheetPath
void ParseLabel(const std::map< wxString, wxString > &aProperties, std::vector< LIB_SYMBOL * > &aSymbol=nullsym, std::vector< int > &aFontSize=nullint)
void ParseBezier(const std::map< wxString, wxString > &aProperties, std::vector< LIB_SYMBOL * > &aSymbol=nullsym)
void ParseLine(const std::map< wxString, wxString > &aProperties, std::vector< LIB_SYMBOL * > &aSymbol=nullsym)
void ParseCircle(const std::map< wxString, wxString > &aProperties, std::vector< LIB_SYMBOL * > &aSymbol=nullsym)
std::map< int, SCH_SYMBOL * > m_symbols
void ParseSheetSymbol(int aIndex, const std::map< wxString, wxString > &aProperties)
std::vector< std::pair< wxString, int > > m_fonts
std::map< wxString, long long > m_timestamps
wxFileName getLibFileName()
SCH_SCREEN * getCurrentScreen()
void ParsePin(const std::map< wxString, wxString > &aProperties, std::vector< LIB_SYMBOL * > &aSymbol=nullsym)
std::map< int, LIB_SYMBOL * > m_libSymbols
void ParseHarnessConnector(int aIndex, const std::map< wxString, wxString > &aProperties)
void ensureLoadedLibrary(const wxString &aLibraryPath, const std::map< std::string, UTF8 > *aProperties)
Base class that schematic file and library loading and saving plugins should derive from.
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.
A base class for LIB_SYMBOL and SCH_SYMBOL.
Hold the information shown in the lower right corner of a plot, printout, or editing view.
std::unique_ptr< T > IO_RELEASER
Helper to hold and release an IO_BASE object when exceptions are thrown.
static std::vector< int > nullint
static std::vector< LIB_SYMBOL * > nullsym
SCH_IO_ALTIUM is a SCH_IO derivation for loading Altium .SchDoc schematic files.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
Container that describes file type info.