57    if( wxNOT_FOUND == i )
 
   60    wxString shrt = 
text.Mid( i + 1 );
 
   61    i = shrt.Find( 
QUOTE );
 
   63    if( wxNOT_FOUND == i )
 
   66    text = shrt.Mid( i + 1 );
 
   67    return shrt.Mid( 0, i );
 
 
   80                                           wxString* aErrorMessages )
 
   86    wxString    tmp, error_msg;
 
   93    for( 
const wxString& equfile : 
project.m_EquivalenceFiles )
 
   95        fn =  wxExpandEnvVars( equfile );
 
   97        if( fn.IsAbsolute() || fn.FileExists() )
 
   98            tmp = fn.GetFullPath();
 
  100            tmp = search.FindValidPath( fn.GetFullPath() );
 
  108                error_msg.Printf( 
_( 
"Equivalence file '%s' could not be found." ),
 
  111                if( ! aErrorMessages->IsEmpty() )
 
  112                    *aErrorMessages << wxT( 
"\n\n" );
 
  114                *aErrorMessages += error_msg;
 
  120        file = wxFopen( tmp, wxT( 
"rt" ) );
 
  122        if( file == 
nullptr )
 
  128                error_msg.Printf( 
_( 
"Error opening equivalence file '%s'." ), tmp );
 
  130                if( ! aErrorMessages->IsEmpty() )
 
  131                    *aErrorMessages << wxT( 
"\n\n" );
 
  133                *aErrorMessages += error_msg;
 
  139        while( 
GetLine( file, line, 
nullptr, 
sizeof( line ) ) != 
nullptr )
 
  147            if( value.IsEmpty() )
 
  152            if( footprint.IsEmpty() )
 
  155            value.Replace( wxT( 
" " ), wxT( 
"_" ) );
 
  160            aList.push_back( equivItem );
 
 
  180        wxMessageBox( error_msg, 
_( 
"Equivalence File Load Error" ), wxOK | wxICON_WARNING, 
this );
 
  187    msg.Printf( 
_( 
"%lu footprint/symbol equivalences found." ), (
unsigned long)equivList.size() );
 
  194    bool firstAssoc = 
true;
 
  196    for( 
int kk = 0;  kk < (int) 
m_netlist.GetCount();  kk++ )
 
  209        wxString fpid_candidate;
 
  211        for( 
int idx = 0; idx < (int) equivList.size(); idx++ )
 
  220            bool equ_is_unique = 
true;
 
  222            int  previous = idx-1;
 
  225                equ_is_unique = 
false;
 
  227            if( previous >= 0 && equivItem.
m_ComponentValue == equivList[previous].m_ComponentValue )
 
  228                equ_is_unique = 
false;
 
  231            if( fp && equ_is_unique )
 
  241            if( fp && fpid_candidate.IsEmpty() )
 
  250                found = ( filtercount == 0 ); 
 
  252                for( 
size_t jj = 0; jj < filtercount && !found; jj++ )
 
  257                msg.Printf( 
_( 
"Component %s: footprint %s not found in any of the project footprint libraries." ),
 
  261                if( !error_msg.IsEmpty() )
 
  262                    error_msg << wxT(
"\n\n");
 
  279        else if( !fpid_candidate.IsEmpty() )
 
  299    if( !error_msg.IsEmpty() )
 
  300        wxMessageBox( error_msg, 
_( 
"CvPcb Warning" ), wxOK | wxICON_WARNING, 
this );
 
 
wxString GetQuotedText(wxString &text)
Read the string between quotes.
 
bool sortListbyCmpValue(const FOOTPRINT_EQUIVALENCE &ref, const FOOTPRINT_EQUIVALENCE &test)
 
boost::ptr_vector< FOOTPRINT_EQUIVALENCE > FOOTPRINT_EQUIVALENCE_LIST
 
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
 
Store all of the related component information found in a netlist.
 
const wxString & GetReference() const
 
const wxString & GetValue() const
 
const wxArrayString & GetFootprintFilters() const
 
const LIB_ID & GetFPID() const
 
A class to define a footprint association to be made in cvpcb.
 
void SetStatusText(const wxString &aText, int aNumber=0) override
 
bool m_skipComponentSelect
 
int buildEquivalenceList(FOOTPRINT_EQUIVALENCE_LIST &aList, wxString *aErrorMessages=nullptr)
Read the .equ files and populate the list of equivalents.
 
FOOTPRINT_LIST * m_FootprintsList
 
void AssociateFootprint(const CVPCB_ASSOCIATION &aAssociation, bool aNewEntry=true, bool aAddUndoItem=true)
Associate a footprint with a specific component in the list.
 
SYMBOLS_LISTBOX * m_symbolsListBox
 
void AutomaticFootprintMatching()
Called by the automatic association button Read *.equ files to try to find corresponding footprint fo...
 
SEARCH_STACK & KifaceSearch()
Only for DSO specific 'non-library' files.
 
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
 
The backing store for a PROJECT, in JSON format.
 
virtual PROJECT_FILE & GetProjectFile() const
 
Look for files in a number of paths.
 
This file contains miscellaneous commonly used macros and functions.
 
wxString From_UTF8(const char *cstring)
 
char * GetLine(FILE *File, char *Line, int *LineNum, int SizeLine)
Read one line line from aFile.