Loading cvpcb/autosel.cpp +2 −8 Original line number Original line Diff line number Diff line Loading @@ -149,14 +149,8 @@ found in the default search paths." ), if( alias.m_Name.CmpNoCase( component.m_Value ) != 0 ) if( alias.m_Name.CmpNoCase( component.m_Value ) != 0 ) continue; continue; BOOST_FOREACH( FOOTPRINT_INFO& footprint, m_footprints ) if( m_footprints.GetModuleInfo( alias.m_FootprintName ) ) { SetNewPkg( alias.m_FootprintName ); if( alias.m_FootprintName.CmpNoCase( footprint.m_Module ) == 0 ) { SetNewPkg( footprint.m_Module ); break; } } if( component.m_Module.IsEmpty() ) if( component.m_Module.IsEmpty() ) { { Loading cvpcb/class_footprints_listbox.cpp +8 −16 Original line number Original line Diff line number Diff line Loading @@ -12,17 +12,6 @@ #include "cvstruct.h" #include "cvstruct.h" FOOTPRINT_INFO* GetModuleDescrByName( const wxString& FootprintName, FOOTPRINT_LIST& list ) { BOOST_FOREACH( FOOTPRINT_INFO & footprint, list ) { if( footprint.m_Module == FootprintName ) return &footprint; } return NULL; } /***************************************/ /***************************************/ /* ListBox handling the footprint list */ /* ListBox handling the footprint list */ /***************************************/ /***************************************/ Loading Loading @@ -127,9 +116,11 @@ void FOOTPRINTS_LISTBOX::SetFootprintFullList( FOOTPRINT_LIST& list ) m_FullFootprintList.Clear(); m_FullFootprintList.Clear(); BOOST_FOREACH( FOOTPRINT_INFO & footprint, list ) { for( unsigned ii = 0; ii < list.GetCount(); ii++ ) { FOOTPRINT_INFO & footprint = list.GetItem(ii); msg.Printf( wxT( "%3d %s" ), m_FullFootprintList.GetCount() + 1, msg.Printf( wxT( "%3d %s" ), m_FullFootprintList.GetCount() + 1, footprint.m_Module.GetData() ); GetChars(footprint.m_Module) ); m_FullFootprintList.Add( msg ); m_FullFootprintList.Add( msg ); } } Loading @@ -145,7 +136,6 @@ void FOOTPRINTS_LISTBOX::SetFootprintFullList( FOOTPRINT_LIST& list ) void FOOTPRINTS_LISTBOX::SetFootprintFilteredList( COMPONENT* Component, void FOOTPRINTS_LISTBOX::SetFootprintFilteredList( COMPONENT* Component, FOOTPRINT_LIST& list ) FOOTPRINT_LIST& list ) { { FOOTPRINT_LIST::iterator i; wxString msg; wxString msg; unsigned jj; unsigned jj; int OldSelection = GetSelection(); int OldSelection = GetSelection(); Loading @@ -153,7 +143,9 @@ void FOOTPRINTS_LISTBOX::SetFootprintFilteredList( COMPONENT* Component, m_FilteredFootprintList.Clear(); m_FilteredFootprintList.Clear(); BOOST_FOREACH( FOOTPRINT_INFO & footprint, list ) { for( unsigned ii = 0; ii < list.GetCount(); ii++ ) { FOOTPRINT_INFO& footprint = list.GetItem(ii); /* Search for matching footprints */ /* Search for matching footprints */ for( jj = 0; jj < Component->m_FootprintFilter.GetCount(); jj++ ) for( jj = 0; jj < Component->m_FootprintFilter.GetCount(); jj++ ) { { Loading Loading @@ -250,7 +242,7 @@ void FOOTPRINTS_LISTBOX::OnLeftClick( wxListEvent& event ) FOOTPRINT_INFO* Module; FOOTPRINT_INFO* Module; wxString FootprintName = GetSelectedFootprint(); wxString FootprintName = GetSelectedFootprint(); Module = GetModuleDescrByName( FootprintName, GetParent()->m_footprints ); Module = GetParent()->m_footprints.GetModuleInfo( FootprintName ); wxASSERT(Module); wxASSERT(Module); if( GetParent()->DrawFrame ) if( GetParent()->DrawFrame ) { { Loading cvpcb/cvframe.cpp +45 −0 Original line number Original line Diff line number Diff line Loading @@ -17,6 +17,8 @@ #include "dialog_cvpcb_config.h" #include "dialog_cvpcb_config.h" #include "class_DisplayFootprintsFrame.h" #include "class_DisplayFootprintsFrame.h" #include "cvpcb_id.h" #include "cvpcb_id.h" #include "dialog_load_error.h" #include "build_version.h" #include "build_version.h" Loading Loading @@ -603,3 +605,46 @@ void CVPCB_MAINFRAME::DisplayStatus() msg.Empty(); msg.Empty(); SetStatusText( msg, 2 ); SetStatusText( msg, 2 ); } } /* * Read the list of libraries (*.mod files) and populates m_footprints * ( list of availaible modules in libs ). * for each module are stored * the module name * documentation string * associated keywords */ bool CVPCB_MAINFRAME::LoadFootprintFiles( ) { /* Check if there are footprint libraries in project file */ if( m_ModuleLibNames.GetCount() == 0 ) { wxMessageBox( _( "No PCB footprint libraries are listed in the current project file." ), _( "Project File Error" ), wxOK | wxICON_ERROR ); return false; } m_footprints.ReadFootprintFiles(m_ModuleLibNames); /* Display error messages, if any */ if( !m_footprints.m_filesNotFound.IsEmpty() || !m_footprints.m_filesInvalid.IsEmpty() ) { DIALOG_LOAD_ERROR dialog(NULL); if( !m_footprints.m_filesNotFound.IsEmpty() ) { wxString message = _("Some files could not be found!"); dialog.MessageSet(message); dialog.ListSet(m_footprints.m_filesNotFound); } /* Display if there are invalid files */ if( !m_footprints.m_filesInvalid.IsEmpty() ) { dialog.MessageSet( _("Some files are invalid!")); dialog.ListSet(m_footprints.m_filesInvalid); } dialog.ShowModal(); } return true; } cvpcb/footprint_info.h +70 −1 Original line number Original line Diff line number Diff line Loading @@ -27,7 +27,76 @@ public: } } }; }; typedef boost::ptr_vector< FOOTPRINT_INFO > FOOTPRINT_LIST; class FOOTPRINT_LIST { public: boost::ptr_vector< FOOTPRINT_INFO > m_List; wxString m_filesNotFound; wxString m_filesInvalid; public: /** * Function GetCount * @return the number of items stored in list */ unsigned GetCount() { return m_List.size(); } /** * Function GetModuleInfo * @return the item stored in list if found * @param aFootprintName = the name of item */ FOOTPRINT_INFO * GetModuleInfo( const wxString & aFootprintName ) { BOOST_FOREACH( FOOTPRINT_INFO& footprint, m_List ) { if( aFootprintName.CmpNoCase( footprint.m_Module ) == 0 ) return &footprint; } return NULL; } /** * Function GetItem * @return the aIdx item in list * @param aIdx = index of the given item */ FOOTPRINT_INFO & GetItem( unsigned aIdx ) { return m_List[aIdx]; } /** * Function AddItem * add aItem in list * @param aItem = item to add */ void AddItem( FOOTPRINT_INFO* aItem ) { m_List.push_back( aItem); } /** * Function ReadFootprintFiles * Read the list of libraries (*.mod files) and populates m_List ( list of availaible modules in libs ). * for each module, are stored * the module name * documentation string * associated keywords * library name * Module description format: * $MODULE c64acmd First line of module description * Li c64acmd DIN connector Library reference * Cd Europe 96 AC male vertical documentation string * Kw PAD_CONN DIN associated keywords * ...... other data (pads, outlines ..) * $Endmodule * * @param aFootprintsLibNames = an array string giving the list of libraries to load */ bool ReadFootprintFiles( wxArrayString & aFootprintsLibNames ); }; /* FOOTPRINT object list sort function. */ /* FOOTPRINT object list sort function. */ inline bool operator<( const FOOTPRINT_INFO& item1, const FOOTPRINT_INFO& item2 ) inline bool operator<( const FOOTPRINT_INFO& item1, const FOOTPRINT_INFO& item2 ) Loading cvpcb/listlib.cpp +16 −46 Original line number Original line Diff line number Diff line Loading @@ -4,7 +4,7 @@ /* /* * Functions to read footprint libraries and fill m_footprints by availlable footprints names * Functions to read footprint libraries and fill m_footprints by available footprints names * and their documentation (comments and keywords) * and their documentation (comments and keywords) */ */ #include "fctsys.h" #include "fctsys.h" Loading @@ -20,14 +20,13 @@ #include "filter_reader.h" #include "filter_reader.h" #include "footprint_info.h" #include "footprint_info.h" #include "dialog_load_error.h" /* /* Read the list of libraries (*.mod files) * Read the list of libraries (*.mod files) and populates m_footprints ( list of availaible modules in libs ). * for each module are stored * for each module are stored * the module name * the module name * documentation string * documentation string * associated keywords * associated keywords * lib name * Module description format: * Module description format: * $MODULE c64acmd First line of module description * $MODULE c64acmd First line of module description * Li c64acmd DIN connector Library reference * Li c64acmd DIN connector Library reference Loading @@ -35,39 +34,29 @@ * Kw PAD_CONN DIN associated keywords * Kw PAD_CONN DIN associated keywords * ...... other data (pads, outlines ..) * ...... other data (pads, outlines ..) * $Endmodule * $Endmodule * */ */ bool CVPCB_MAINFRAME::LoadFootprintFiles( ) bool FOOTPRINT_LIST::ReadFootprintFiles( wxArrayString & aFootprintsLibNames ) { { FILE* file; FILE* file; wxFileName filename; wxFileName filename; wxString libname; wxString libname; wxString files_not_found; wxString files_invalid; /* Check if footprint m_footprints is not empty */ if( !m_footprints.empty() ) m_footprints.clear(); /* Check if there are footprint libraries in project file */ // Clear data before reading files if( m_ModuleLibNames.GetCount() == 0 ) m_filesNotFound.Empty(); { m_filesInvalid.Empty(); wxMessageBox( _( "No PCB footprint libraries are listed in the current project file." ), m_List.clear(); _( "Project File Error" ), wxOK | wxICON_ERROR ); return false; } /* Parse Libraries Listed */ /* Parse Libraries Listed */ for( unsigned ii = 0; ii < m_ModuleLibNames.GetCount(); ii++ ) for( unsigned ii = 0; ii < aFootprintsLibNames.GetCount(); ii++ ) { { filename = m_ModuleLibNames[ii]; filename = aFootprintsLibNames[ii]; filename.SetExt( ModuleFileExtension ); filename.SetExt( ModuleFileExtension ); libname = wxGetApp().FindLibraryPath( filename ); libname = wxGetApp().FindLibraryPath( filename ); if( libname.IsEmpty() ) if( libname.IsEmpty() ) { { files_not_found << filename.GetFullName() << wxT("\n"); m_filesNotFound << filename.GetFullName() << wxT("\n"); continue; continue; } } Loading @@ -76,7 +65,7 @@ bool CVPCB_MAINFRAME::LoadFootprintFiles( ) if( file == NULL ) if( file == NULL ) { { files_invalid << libname << _(" (file cannot be opened)") << wxT("\n"); m_filesInvalid << libname << _(" (file cannot be opened)") << wxT("\n"); continue; continue; } } Loading @@ -93,7 +82,7 @@ bool CVPCB_MAINFRAME::LoadFootprintFiles( ) wxString msg; wxString msg; msg.Printf( _( "<%s> is not a valid Kicad PCB footprint library." ), msg.Printf( _( "<%s> is not a valid Kicad PCB footprint library." ), GetChars( libname ) ); GetChars( libname ) ); files_invalid << msg << wxT("\n"); m_filesInvalid << msg << wxT("\n"); continue; continue; } } Loading @@ -115,7 +104,7 @@ bool CVPCB_MAINFRAME::LoadFootprintFiles( ) FOOTPRINT_INFO* ItemLib = new FOOTPRINT_INFO(); FOOTPRINT_INFO* ItemLib = new FOOTPRINT_INFO(); ItemLib->m_Module = CONV_FROM_UTF8( StrPurge( line ) ); ItemLib->m_Module = CONV_FROM_UTF8( StrPurge( line ) ); ItemLib->m_LibName = libname; ItemLib->m_LibName = libname; m_footprints.push_back( ItemLib ); AddItem( ItemLib ); while( reader.ReadLine() ) while( reader.ReadLine() ) { { Loading Loading @@ -143,30 +132,11 @@ bool CVPCB_MAINFRAME::LoadFootprintFiles( ) if( !end ) if( !end ) { { files_invalid << libname << _(" (Unexpected end of file)") << wxT("\n"); m_filesInvalid << libname << _(" (Unexpected end of file)") << wxT("\n"); } } } } m_footprints.sort(); /* Display error messages, if any */ m_List.sort(); if( !files_not_found.IsEmpty() || !files_invalid.IsEmpty() ) { DIALOG_LOAD_ERROR dialog(NULL); if( !files_not_found.IsEmpty() ) { wxString message = _("Some files could not be found!"); dialog.MessageSet(message); dialog.ListSet(files_not_found); } /* Display if there are invalid files */ if( !files_invalid.IsEmpty() ) { dialog.MessageSet( _("Some files are invalid!")); dialog.ListSet(files_invalid); } dialog.ShowModal(); } return true; return true; } } Loading
cvpcb/autosel.cpp +2 −8 Original line number Original line Diff line number Diff line Loading @@ -149,14 +149,8 @@ found in the default search paths." ), if( alias.m_Name.CmpNoCase( component.m_Value ) != 0 ) if( alias.m_Name.CmpNoCase( component.m_Value ) != 0 ) continue; continue; BOOST_FOREACH( FOOTPRINT_INFO& footprint, m_footprints ) if( m_footprints.GetModuleInfo( alias.m_FootprintName ) ) { SetNewPkg( alias.m_FootprintName ); if( alias.m_FootprintName.CmpNoCase( footprint.m_Module ) == 0 ) { SetNewPkg( footprint.m_Module ); break; } } if( component.m_Module.IsEmpty() ) if( component.m_Module.IsEmpty() ) { { Loading
cvpcb/class_footprints_listbox.cpp +8 −16 Original line number Original line Diff line number Diff line Loading @@ -12,17 +12,6 @@ #include "cvstruct.h" #include "cvstruct.h" FOOTPRINT_INFO* GetModuleDescrByName( const wxString& FootprintName, FOOTPRINT_LIST& list ) { BOOST_FOREACH( FOOTPRINT_INFO & footprint, list ) { if( footprint.m_Module == FootprintName ) return &footprint; } return NULL; } /***************************************/ /***************************************/ /* ListBox handling the footprint list */ /* ListBox handling the footprint list */ /***************************************/ /***************************************/ Loading Loading @@ -127,9 +116,11 @@ void FOOTPRINTS_LISTBOX::SetFootprintFullList( FOOTPRINT_LIST& list ) m_FullFootprintList.Clear(); m_FullFootprintList.Clear(); BOOST_FOREACH( FOOTPRINT_INFO & footprint, list ) { for( unsigned ii = 0; ii < list.GetCount(); ii++ ) { FOOTPRINT_INFO & footprint = list.GetItem(ii); msg.Printf( wxT( "%3d %s" ), m_FullFootprintList.GetCount() + 1, msg.Printf( wxT( "%3d %s" ), m_FullFootprintList.GetCount() + 1, footprint.m_Module.GetData() ); GetChars(footprint.m_Module) ); m_FullFootprintList.Add( msg ); m_FullFootprintList.Add( msg ); } } Loading @@ -145,7 +136,6 @@ void FOOTPRINTS_LISTBOX::SetFootprintFullList( FOOTPRINT_LIST& list ) void FOOTPRINTS_LISTBOX::SetFootprintFilteredList( COMPONENT* Component, void FOOTPRINTS_LISTBOX::SetFootprintFilteredList( COMPONENT* Component, FOOTPRINT_LIST& list ) FOOTPRINT_LIST& list ) { { FOOTPRINT_LIST::iterator i; wxString msg; wxString msg; unsigned jj; unsigned jj; int OldSelection = GetSelection(); int OldSelection = GetSelection(); Loading @@ -153,7 +143,9 @@ void FOOTPRINTS_LISTBOX::SetFootprintFilteredList( COMPONENT* Component, m_FilteredFootprintList.Clear(); m_FilteredFootprintList.Clear(); BOOST_FOREACH( FOOTPRINT_INFO & footprint, list ) { for( unsigned ii = 0; ii < list.GetCount(); ii++ ) { FOOTPRINT_INFO& footprint = list.GetItem(ii); /* Search for matching footprints */ /* Search for matching footprints */ for( jj = 0; jj < Component->m_FootprintFilter.GetCount(); jj++ ) for( jj = 0; jj < Component->m_FootprintFilter.GetCount(); jj++ ) { { Loading Loading @@ -250,7 +242,7 @@ void FOOTPRINTS_LISTBOX::OnLeftClick( wxListEvent& event ) FOOTPRINT_INFO* Module; FOOTPRINT_INFO* Module; wxString FootprintName = GetSelectedFootprint(); wxString FootprintName = GetSelectedFootprint(); Module = GetModuleDescrByName( FootprintName, GetParent()->m_footprints ); Module = GetParent()->m_footprints.GetModuleInfo( FootprintName ); wxASSERT(Module); wxASSERT(Module); if( GetParent()->DrawFrame ) if( GetParent()->DrawFrame ) { { Loading
cvpcb/cvframe.cpp +45 −0 Original line number Original line Diff line number Diff line Loading @@ -17,6 +17,8 @@ #include "dialog_cvpcb_config.h" #include "dialog_cvpcb_config.h" #include "class_DisplayFootprintsFrame.h" #include "class_DisplayFootprintsFrame.h" #include "cvpcb_id.h" #include "cvpcb_id.h" #include "dialog_load_error.h" #include "build_version.h" #include "build_version.h" Loading Loading @@ -603,3 +605,46 @@ void CVPCB_MAINFRAME::DisplayStatus() msg.Empty(); msg.Empty(); SetStatusText( msg, 2 ); SetStatusText( msg, 2 ); } } /* * Read the list of libraries (*.mod files) and populates m_footprints * ( list of availaible modules in libs ). * for each module are stored * the module name * documentation string * associated keywords */ bool CVPCB_MAINFRAME::LoadFootprintFiles( ) { /* Check if there are footprint libraries in project file */ if( m_ModuleLibNames.GetCount() == 0 ) { wxMessageBox( _( "No PCB footprint libraries are listed in the current project file." ), _( "Project File Error" ), wxOK | wxICON_ERROR ); return false; } m_footprints.ReadFootprintFiles(m_ModuleLibNames); /* Display error messages, if any */ if( !m_footprints.m_filesNotFound.IsEmpty() || !m_footprints.m_filesInvalid.IsEmpty() ) { DIALOG_LOAD_ERROR dialog(NULL); if( !m_footprints.m_filesNotFound.IsEmpty() ) { wxString message = _("Some files could not be found!"); dialog.MessageSet(message); dialog.ListSet(m_footprints.m_filesNotFound); } /* Display if there are invalid files */ if( !m_footprints.m_filesInvalid.IsEmpty() ) { dialog.MessageSet( _("Some files are invalid!")); dialog.ListSet(m_footprints.m_filesInvalid); } dialog.ShowModal(); } return true; }
cvpcb/footprint_info.h +70 −1 Original line number Original line Diff line number Diff line Loading @@ -27,7 +27,76 @@ public: } } }; }; typedef boost::ptr_vector< FOOTPRINT_INFO > FOOTPRINT_LIST; class FOOTPRINT_LIST { public: boost::ptr_vector< FOOTPRINT_INFO > m_List; wxString m_filesNotFound; wxString m_filesInvalid; public: /** * Function GetCount * @return the number of items stored in list */ unsigned GetCount() { return m_List.size(); } /** * Function GetModuleInfo * @return the item stored in list if found * @param aFootprintName = the name of item */ FOOTPRINT_INFO * GetModuleInfo( const wxString & aFootprintName ) { BOOST_FOREACH( FOOTPRINT_INFO& footprint, m_List ) { if( aFootprintName.CmpNoCase( footprint.m_Module ) == 0 ) return &footprint; } return NULL; } /** * Function GetItem * @return the aIdx item in list * @param aIdx = index of the given item */ FOOTPRINT_INFO & GetItem( unsigned aIdx ) { return m_List[aIdx]; } /** * Function AddItem * add aItem in list * @param aItem = item to add */ void AddItem( FOOTPRINT_INFO* aItem ) { m_List.push_back( aItem); } /** * Function ReadFootprintFiles * Read the list of libraries (*.mod files) and populates m_List ( list of availaible modules in libs ). * for each module, are stored * the module name * documentation string * associated keywords * library name * Module description format: * $MODULE c64acmd First line of module description * Li c64acmd DIN connector Library reference * Cd Europe 96 AC male vertical documentation string * Kw PAD_CONN DIN associated keywords * ...... other data (pads, outlines ..) * $Endmodule * * @param aFootprintsLibNames = an array string giving the list of libraries to load */ bool ReadFootprintFiles( wxArrayString & aFootprintsLibNames ); }; /* FOOTPRINT object list sort function. */ /* FOOTPRINT object list sort function. */ inline bool operator<( const FOOTPRINT_INFO& item1, const FOOTPRINT_INFO& item2 ) inline bool operator<( const FOOTPRINT_INFO& item1, const FOOTPRINT_INFO& item2 ) Loading
cvpcb/listlib.cpp +16 −46 Original line number Original line Diff line number Diff line Loading @@ -4,7 +4,7 @@ /* /* * Functions to read footprint libraries and fill m_footprints by availlable footprints names * Functions to read footprint libraries and fill m_footprints by available footprints names * and their documentation (comments and keywords) * and their documentation (comments and keywords) */ */ #include "fctsys.h" #include "fctsys.h" Loading @@ -20,14 +20,13 @@ #include "filter_reader.h" #include "filter_reader.h" #include "footprint_info.h" #include "footprint_info.h" #include "dialog_load_error.h" /* /* Read the list of libraries (*.mod files) * Read the list of libraries (*.mod files) and populates m_footprints ( list of availaible modules in libs ). * for each module are stored * for each module are stored * the module name * the module name * documentation string * documentation string * associated keywords * associated keywords * lib name * Module description format: * Module description format: * $MODULE c64acmd First line of module description * $MODULE c64acmd First line of module description * Li c64acmd DIN connector Library reference * Li c64acmd DIN connector Library reference Loading @@ -35,39 +34,29 @@ * Kw PAD_CONN DIN associated keywords * Kw PAD_CONN DIN associated keywords * ...... other data (pads, outlines ..) * ...... other data (pads, outlines ..) * $Endmodule * $Endmodule * */ */ bool CVPCB_MAINFRAME::LoadFootprintFiles( ) bool FOOTPRINT_LIST::ReadFootprintFiles( wxArrayString & aFootprintsLibNames ) { { FILE* file; FILE* file; wxFileName filename; wxFileName filename; wxString libname; wxString libname; wxString files_not_found; wxString files_invalid; /* Check if footprint m_footprints is not empty */ if( !m_footprints.empty() ) m_footprints.clear(); /* Check if there are footprint libraries in project file */ // Clear data before reading files if( m_ModuleLibNames.GetCount() == 0 ) m_filesNotFound.Empty(); { m_filesInvalid.Empty(); wxMessageBox( _( "No PCB footprint libraries are listed in the current project file." ), m_List.clear(); _( "Project File Error" ), wxOK | wxICON_ERROR ); return false; } /* Parse Libraries Listed */ /* Parse Libraries Listed */ for( unsigned ii = 0; ii < m_ModuleLibNames.GetCount(); ii++ ) for( unsigned ii = 0; ii < aFootprintsLibNames.GetCount(); ii++ ) { { filename = m_ModuleLibNames[ii]; filename = aFootprintsLibNames[ii]; filename.SetExt( ModuleFileExtension ); filename.SetExt( ModuleFileExtension ); libname = wxGetApp().FindLibraryPath( filename ); libname = wxGetApp().FindLibraryPath( filename ); if( libname.IsEmpty() ) if( libname.IsEmpty() ) { { files_not_found << filename.GetFullName() << wxT("\n"); m_filesNotFound << filename.GetFullName() << wxT("\n"); continue; continue; } } Loading @@ -76,7 +65,7 @@ bool CVPCB_MAINFRAME::LoadFootprintFiles( ) if( file == NULL ) if( file == NULL ) { { files_invalid << libname << _(" (file cannot be opened)") << wxT("\n"); m_filesInvalid << libname << _(" (file cannot be opened)") << wxT("\n"); continue; continue; } } Loading @@ -93,7 +82,7 @@ bool CVPCB_MAINFRAME::LoadFootprintFiles( ) wxString msg; wxString msg; msg.Printf( _( "<%s> is not a valid Kicad PCB footprint library." ), msg.Printf( _( "<%s> is not a valid Kicad PCB footprint library." ), GetChars( libname ) ); GetChars( libname ) ); files_invalid << msg << wxT("\n"); m_filesInvalid << msg << wxT("\n"); continue; continue; } } Loading @@ -115,7 +104,7 @@ bool CVPCB_MAINFRAME::LoadFootprintFiles( ) FOOTPRINT_INFO* ItemLib = new FOOTPRINT_INFO(); FOOTPRINT_INFO* ItemLib = new FOOTPRINT_INFO(); ItemLib->m_Module = CONV_FROM_UTF8( StrPurge( line ) ); ItemLib->m_Module = CONV_FROM_UTF8( StrPurge( line ) ); ItemLib->m_LibName = libname; ItemLib->m_LibName = libname; m_footprints.push_back( ItemLib ); AddItem( ItemLib ); while( reader.ReadLine() ) while( reader.ReadLine() ) { { Loading Loading @@ -143,30 +132,11 @@ bool CVPCB_MAINFRAME::LoadFootprintFiles( ) if( !end ) if( !end ) { { files_invalid << libname << _(" (Unexpected end of file)") << wxT("\n"); m_filesInvalid << libname << _(" (Unexpected end of file)") << wxT("\n"); } } } } m_footprints.sort(); /* Display error messages, if any */ m_List.sort(); if( !files_not_found.IsEmpty() || !files_invalid.IsEmpty() ) { DIALOG_LOAD_ERROR dialog(NULL); if( !files_not_found.IsEmpty() ) { wxString message = _("Some files could not be found!"); dialog.MessageSet(message); dialog.ListSet(files_not_found); } /* Display if there are invalid files */ if( !files_invalid.IsEmpty() ) { dialog.MessageSet( _("Some files are invalid!")); dialog.ListSet(files_invalid); } dialog.ShowModal(); } return true; return true; } }