Browse Source

CADSTAR: look for the symbol library .csa file under different names.

newinvert
Alex Shvartzkop 2 years ago
parent
commit
ace7cbddfe
  1. 24
      eeschema/sch_plugins/cadstar/cadstar_sch_archive_plugin.cpp

24
eeschema/sch_plugins/cadstar/cadstar_sch_archive_plugin.cpp

@ -37,6 +37,7 @@
#include <sch_plugins/kicad/sch_sexpr_plugin.h>
#include <wildcards_and_files_ext.h>
#include <wx_filename.h>
#include <wx/dir.h>
const wxString CADSTAR_SCH_ARCHIVE_PLUGIN::GetName() const
@ -257,11 +258,28 @@ void CADSTAR_SCH_ARCHIVE_PLUGIN::ensureLoadedLibrary( const wxString& aLibraryPa
}
else
{
// If none specified, use
// symbol.csa in same folder as the .lib
// If none specified, look for the
// .csa file in same folder as the .lib
csafn = wxFileName( aLibraryPath );
csafn.SetName( "symbol" );
csafn.SetExt( "csa" );
if( !csafn.FileExists() )
{
csafn.SetName( "symbol" );
if( !csafn.FileExists() )
{
csafn = wxDir::FindFirst( csafn.GetPath(), wxS( "*.csa" ),
wxDIR_FILES | wxDIR_HIDDEN );
if( !csafn.FileExists() )
{
THROW_IO_ERROR( wxString::Format(
_( "Cannot find the .csa file corresponding to library '%s'." ),
aLibraryPath ) );
}
}
}
}
if( aProperties && aProperties->count( "fplib" ) )

Loading…
Cancel
Save