43 const std::map<std::string, UTF8>* aProperties )
45 wxASSERT( !aFileName || aSchematic );
51 wxCHECK_MSG( aSchematic->
IsValid(),
nullptr,
"Can't append to a schematic with no root!" );
52 rootSheet = aAppendToMe;
74 ltspiceDataDir.AppendDir( wxS(
"LTspice" ) );
75 ltspiceDataDir.AppendDir( wxS(
"lib" ) );
77 if( !ltspiceDataDir.DirExists() )
81 ltspiceDataDir.RemoveLastDir();
82 ltspiceDataDir.AppendDir( wxS(
"LTspice" ) );
83 ltspiceDataDir.AppendDir( wxS(
"lib" ) );
87 if( !ltspiceDataDir.DirExists() )
90 ltspiceDataDir = wxFileName(
"/Applications/LTspice.app/Contents/SharedSupport/ltspice/support/ltspice/drive_c/"
91 "users/crossover/AppData/Local/LTspice/lib",
96 if( !ltspiceDataDir.DirExists() )
101 wxFileName::GetPathSeparator() +
"LTspice*", wxDIR );
103 while( !foundFile.empty() )
105 ltspiceDataDir = wxFileName(foundFile, wxEmptyString);
106 ltspiceDataDir.AppendDir( wxS(
"lib" ) );
108 if( ltspiceDataDir.DirExists() )
111 foundFile = wxFindNextFile();
115 if( !ltspiceDataDir.DirExists() )
117 wxFileName fn( aFileName );
118 fn.SetFullName( wxEmptyString );
119 fn.AppendDir(
"lib" );
121 wxString localLibPath = fn.GetFullPath();
123 if( wxDirExists( localLibPath ) )
125 ltspiceDataDir = localLibPath;
129 m_reporter->Report( wxString::Format(
_(
"Unable to find LTspice symbols.\nInstall "
130 "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.
bool IsValid() const
A simple test if the schematic is loaded, not a complete one.
void SetTopLevelSheets(const std::vector< SCH_SHEET * > &aSheets)
Replace the top level sheets, rebuilding the hierarchy and connectivity around them.
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,...
void SetFileName(const wxString &aFileName)
Set the file name for this screen to aFileName.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void SetFileName(const wxString &aFilename)
void SyncUuidToScreen()
Take the identity of the screen this sheet owns.
SCH_SCREEN * GetScreen() const
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.