44 const std::map<std::string, UTF8>* aProperties )
46 wxASSERT( !aFileName || aSchematic );
52 wxCHECK_MSG( aSchematic->
IsValid(),
nullptr,
"Can't append to a schematic with no root!" );
53 rootSheet = aAppendToMe;
75 ltspiceDataDir.AppendDir( wxS(
"LTspice" ) );
76 ltspiceDataDir.AppendDir( wxS(
"lib" ) );
78 if( !ltspiceDataDir.DirExists() )
82 ltspiceDataDir.RemoveLastDir();
83 ltspiceDataDir.AppendDir( wxS(
"LTspice" ) );
84 ltspiceDataDir.AppendDir( wxS(
"lib" ) );
88 if( !ltspiceDataDir.DirExists() )
91 ltspiceDataDir = wxFileName(
"/Applications/LTspice.app/Contents/SharedSupport/ltspice/support/ltspice/drive_c/"
92 "users/crossover/AppData/Local/LTspice/lib",
97 if( !ltspiceDataDir.DirExists() )
102 wxFileName::GetPathSeparator() +
"LTspice*", wxDIR );
104 while( !foundFile.empty() )
106 ltspiceDataDir = wxFileName(foundFile, wxEmptyString);
107 ltspiceDataDir.AppendDir( wxS(
"lib" ) );
109 if( ltspiceDataDir.DirExists() )
112 foundFile = wxFindNextFile();
116 if( !ltspiceDataDir.DirExists() )
118 wxFileName fn( aFileName );
119 fn.SetFullName( wxEmptyString );
120 fn.AppendDir(
"lib" );
122 wxString localLibPath = fn.GetFullPath();
124 if( wxDirExists( localLibPath ) )
126 ltspiceDataDir = localLibPath;
130 m_reporter->Report( wxString::Format(
_(
"Unable to find LTspice symbols.\nInstall "
131 "LTspice or put its library files into %s" ),
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.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
void Load(SCHEMATIC *aSchematic, SCH_SHEET *aRootSheet, const wxFileName &aLibraryFileName, REPORTER *aReporter)
The main function responsible for loading the .asc and .asy files.
Holds all the data relating to one schematic.
int FixupJunctionsAfterImport()
Add junctions to this schematic where required.
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_PATH & CurrentSheet() const
int GetModifyHash() const override
schematic PLUGIN for LTspice (*.asc) and (.asy) format.
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,...
const KIID & GetUuid() const
void SetFileName(const wxString &aFileName)
Set the file name for this screen to aFileName.
void UpdateAllScreenReferences() const
Update all the symbol references for this sheet path.
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.