KiCad PCB EDA Suite
dialog_symbol_remap.cpp
Go to the documentation of this file.
1 
5 /*
6  * This program source code file is part of KiCad, a free EDA CAD application.
7  *
8  * Copyright (C) 2017 Wayne Stambaugh <stambaughw@gmail.com>
9  * Copyright (C) 2017-2021 KiCad Developers, see AUTHORS.txt for contributors.
10  *
11  * This program is free software: you can redistribute it and/or modify it
12  * under the terms of the GNU General Public License as published by the
13  * Free Software Foundation, either version 3 of the License, or (at your
14  * option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful, but
17  * WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program. If not, see <http://www.gnu.org/licenses/>.
23  */
24 
25 #include <macros.h>
26 #include <pgm_base.h>
27 #include <kiface_i.h>
28 #include <project.h>
29 #include <confirm.h>
30 #include <reporter.h>
32 #include <wx_html_report_panel.h>
33 
34 #include <symbol_library.h>
35 #include <core/kicad_algo.h>
36 #include <symbol_viewer_frame.h>
37 #include <project_rescue.h>
38 #include <sch_io_mgr.h>
39 #include <sch_symbol.h>
40 #include <sch_screen.h>
41 #include <sch_edit_frame.h>
42 #include <schematic.h>
44 #include <symbol_lib_table.h>
45 #include <env_paths.h>
46 
47 #include <dialog_symbol_remap.h>
48 
49 
51  DIALOG_SYMBOL_REMAP_BASE( aParent ),
52  m_frame( aParent )
53 {
54  m_remapped = false;
55 
56  if( !wxFileName::IsDirWritable( Prj().GetProjectPath() ) )
57  {
58  DisplayInfoMessage( this, _( "Remapping is not possible because you have insufficient "
59  "privileges to the project folder '%s'." ) );
60 
61  // Disable the remap button.
62  m_remapped = true;
63  }
64 
65  wxString text;
66 
67  text = _( "This schematic currently uses the project symbol library list look up method "
68  "for loading library symbols. KiCad will attempt to map the existing symbols "
69  "to use the new symbol library table. Remapping will change some project files "
70  "and schematics may not be compatible with older versions of KiCad. All files "
71  "that are changed will be backed up to the \"remap_backup\" folder in the project "
72  "folder should you need to revert any changes. If you choose to skip this step, "
73  "you will be responsible for manually remapping the symbols." );
74 
75  m_htmlCtrl->AppendToPage( text );
76 
77  m_messagePanel->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) );
78 }
79 
80 
81 void DIALOG_SYMBOL_REMAP::OnRemapSymbols( wxCommandEvent& aEvent )
82 {
83  SCH_EDIT_FRAME* parent = dynamic_cast< SCH_EDIT_FRAME* >( GetParent() );
84 
85  wxCHECK_RET( parent != nullptr, "Parent window is not type SCH_EDIT_FRAME." );
86 
87  wxBusyCursor busy;
88 
90  return;
91 
92  // Ignore the never show rescue setting for one last rescue of legacy symbol
93  // libraries before remapping to the symbol library table. This ensures the
94  // best remapping results.
95  LEGACY_RESCUER rescuer( Prj(), &parent->Schematic(), &parent->GetCurrentSheet(),
96  parent->GetCanvas()->GetBackend() );
97 
98  if( RESCUER::RescueProject( this, rescuer, false ) )
99  {
100  auto viewer = (SYMBOL_VIEWER_FRAME*) parent->Kiway().Player( FRAME_SCH_VIEWER, false );
101 
102  if( viewer )
103  viewer->ReCreateLibList();
104 
106  parent->SyncView();
107  parent->GetCanvas()->Refresh();
108  parent->OnModify();
109  }
110 
111  // The schematic is fully loaded, any legacy library symbols have been rescued. Now
112  // check to see if the schematic has not been converted to the symbol library table
113  // method for looking up symbols.
114  wxFileName prjSymLibTableFileName( Prj().GetProjectPath(),
116 
117  // Delete the existing project symbol library table.
118  if( prjSymLibTableFileName.FileExists() )
119  {
120  wxRemoveFile( prjSymLibTableFileName.GetFullPath() );
121  }
122 
125  Prj().SchSymbolLibTable();
126 
128 
129  // Remove all of the libraries from the legacy library list.
130  wxString paths;
131  wxArrayString libNames;
132 
133  SYMBOL_LIBS::LibNamesAndPaths( &Prj(), true, &paths, &libNames );
134 
135  // Reload the cache symbol library.
137  Prj().SchLibs();
138 
139  Raise();
140  m_remapped = true;
141 }
142 
143 
144 size_t DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable( std::vector< SYMBOL_LIB* >& aLibs )
145 {
146  SYMBOL_LIBS* libs = Prj().SchLibs();
147 
148  for( SYMBOL_LIBS_BASE::iterator it = libs->begin(); it != libs->end(); ++it )
149  {
150  // Ignore the cache library.
151  if( it->IsCache() )
152  continue;
153 
154  // Check for the obvious library name.
155  wxString libFileName = it->GetFullFileName();
156 
157  if( !SYMBOL_LIB_TABLE::GetGlobalLibTable().FindRowByURI( libFileName ) )
158  aLibs.push_back( &(*it) );
159  }
160 
161  return aLibs.size();
162 }
163 
164 
166 {
167  wxString msg;
168  std::vector< SYMBOL_LIB* > libs;
169 
171  {
172  SYMBOL_LIB_TABLE prjLibTable;
173  std::vector< wxString > libNames = SYMBOL_LIB_TABLE::GetGlobalLibTable().GetLogicalLibs();
174 
175  for( auto lib : libs )
176  {
177  wxString libName = lib->GetName();
178  int libNameInc = 1;
179  int libNameLen = libName.Length();
180 
181  // Spaces in the file name will break the symbol name because they are not
182  // quoted in the symbol library file format.
183  libName.Replace( " ", "-" );
184 
185  // Don't create duplicate table entries.
186  while( alg::contains( libNames, libName ) )
187  {
188  libName = libName.Left( libNameLen );
189  libName << libNameInc;
190  libNameInc++;
191  }
192 
193  wxString pluginType = SCH_IO_MGR::ShowType( SCH_IO_MGR::SCH_LEGACY );
194  wxFileName fn = lib->GetFullFileName();
195 
196  // Use environment variable substitution where possible. This is based solely
197  // on the internal user environment variable list. Checking against all of the
198  // system wide environment variables is probably not a good idea.
199  wxString fullFileName = NormalizePath( fn, &Pgm().GetLocalEnvVariables(), &Prj() );
200 
201  // Fall back to the absolute library path.
202  if( fullFileName.IsEmpty() )
203  fullFileName = lib->GetFullFileName();
204 
205  wxFileName tmpFn = fullFileName;
206 
207  // Don't add symbol libraries that do not exist.
208  if( tmpFn.Normalize() && tmpFn.FileExists() )
209  {
210  msg.Printf( _( "Adding library '%s', file '%s' to project symbol library table." ),
211  libName,
212  fullFileName );
213  aReporter.Report( msg, RPT_SEVERITY_INFO );
214 
215  prjLibTable.InsertRow( new SYMBOL_LIB_TABLE_ROW( libName, fullFileName,
216  pluginType ) );
217  }
218  else
219  {
220  msg.Printf( _( "Library '%s' not found." ), fullFileName );
221  aReporter.Report( msg, RPT_SEVERITY_WARNING );
222  }
223  }
224 
225  // Don't save empty project symbol library table.
226  if( !prjLibTable.IsEmpty() )
227  {
228  wxFileName fn( Prj().GetProjectPath(), SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
229 
230  try
231  {
232  FILE_OUTPUTFORMATTER formatter( fn.GetFullPath() );
233  prjLibTable.Format( &formatter, 0 );
234  }
235  catch( const IO_ERROR& ioe )
236  {
237  msg.Printf( _( "Failed to write project symbol library table. Error:\n %s" ),
238  ioe.What() );
239  aReporter.ReportTail( msg, RPT_SEVERITY_ERROR );
240  }
241 
242  aReporter.ReportTail( _( "Created project symbol library table.\n" ),
244  }
245  }
246 }
247 
248 
250 {
251  wxString msg;
252  SCH_SCREENS schematic( m_frame->Schematic().Root() );
253  SCH_SYMBOL* symbol;
254  SCH_SCREEN* screen;
255 
256  for( screen = schematic.GetFirst(); screen; screen = schematic.GetNext() )
257  {
258  for( auto item : screen->Items().OfType( SCH_SYMBOL_T ) )
259  {
260  symbol = dynamic_cast<SCH_SYMBOL*>( item );
261 
262  if( !remapSymbolToLibTable( symbol ) )
263  {
264  msg.Printf( _( "No symbol %s found in symbol library table." ),
265  symbol->GetLibId().GetLibItemName().wx_str() );
266  aReporter.Report( msg, RPT_SEVERITY_WARNING );
267  }
268  else
269  {
270  msg.Printf( _( "Symbol %s mapped to symbol library '%s'." ),
271  symbol->GetLibId().GetLibItemName().wx_str(),
272  symbol->GetLibId().GetLibNickname().wx_str() );
273  aReporter.Report( msg, RPT_SEVERITY_ACTION );
274  screen->SetContentModified();
275  }
276  }
277  }
278 
279  aReporter.Report( _( "Symbol library table mapping complete!" ), RPT_SEVERITY_INFO );
280  schematic.UpdateSymbolLinks();
281 }
282 
283 
285 {
286  wxCHECK_MSG( aSymbol != nullptr, false, "Null pointer passed to remapSymbolToLibTable." );
287  wxCHECK_MSG( aSymbol->GetLibId().GetLibNickname().empty(), false,
288  "Cannot remap symbol that is already mapped." );
289  wxCHECK_MSG( !aSymbol->GetLibId().GetLibItemName().empty(), false,
290  "The symbol LIB_ID name is empty." );
291 
292  SYMBOL_LIBS* libs = Prj().SchLibs();
293 
294  for( SYMBOL_LIBS_BASE::iterator it = libs->begin(); it != libs->end(); ++it )
295  {
296  // Ignore the cache library.
297  if( it->IsCache() )
298  continue;
299 
300  LIB_SYMBOL* alias = it->FindSymbol( aSymbol->GetLibId().GetLibItemName().wx_str() );
301 
302  // Found in the same library as the old look up method assuming the user didn't
303  // change the libraries or library ordering since the last time the schematic was
304  // loaded.
305  if( alias )
306  {
307  // Find the same library in the symbol library table using the full path and file name.
308  wxString libFileName = it->GetFullFileName();
309 
310  const LIB_TABLE_ROW* row = Prj().SchSymbolLibTable()->FindRowByURI( libFileName );
311 
312  if( row )
313  {
314  LIB_ID id = aSymbol->GetLibId();
315 
316  id.SetLibNickname( row->GetNickName() );
317 
318  // Don't resolve symbol library links now.
319  aSymbol->SetLibId( id );
320  return true;
321  }
322  }
323  }
324 
325  return false;
326 }
327 
328 
330 {
331  static wxString backupFolder = "rescue-backup";
332 
333  wxString tmp;
334  wxString errorMsg;
335  wxFileName srcFileName;
336  wxFileName destFileName;
337  wxFileName backupPath;
338  SCH_SCREENS schematic( m_frame->Schematic().Root() );
339 
340  // Copy backup files to different folder so as not to pollute the project folder.
341  destFileName.SetPath( Prj().GetProjectPath() );
342  destFileName.AppendDir( backupFolder );
343  backupPath = destFileName;
344 
345  if( !destFileName.DirExists() )
346  {
347  if( !destFileName.Mkdir() )
348  {
349  errorMsg.Printf( _( "Cannot create project remap back up folder '%s'." ),
350  destFileName.GetPath() );
351 
352  wxMessageDialog dlg( this, errorMsg, _( "Backup Error" ),
353  wxYES_NO | wxCENTRE | wxRESIZE_BORDER | wxICON_QUESTION );
354  dlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Continue with Rescue" ) ),
355  wxMessageDialog::ButtonLabel( _( "Abort Rescue" ) ) );
356 
357  if( dlg.ShowModal() == wxID_NO )
358  return false;
359  }
360  }
361 
362  // Time stamp to append to file name in case multiple remappings are performed.
363  wxString timeStamp = wxDateTime::Now().Format( "-%Y-%m-%d-%H-%M-%S" );
364 
365  // Back up symbol library table.
366  srcFileName.SetPath( Prj().GetProjectPath() );
367  srcFileName.SetName( SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
368  destFileName = srcFileName;
369  destFileName.AppendDir( backupFolder );
370  destFileName.SetName( destFileName.GetName() + timeStamp );
371 
372  tmp.Printf( _( "Backing up file '%s' to '%s'." ),
373  srcFileName.GetFullPath(),
374  destFileName.GetFullPath() );
375  aReporter.Report( tmp, RPT_SEVERITY_INFO );
376 
377  if( wxFileName::Exists( srcFileName.GetFullPath() )
378  && !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
379  {
380  tmp.Printf( _( "Failed to back up file '%s'.\n" ),
381  srcFileName.GetFullPath() );
382  errorMsg += tmp;
383  }
384 
385  // Back up the schematic files.
386  for( SCH_SCREEN* screen = schematic.GetFirst(); screen; screen = schematic.GetNext() )
387  {
388  destFileName = screen->GetFileName();
389  destFileName.SetName( destFileName.GetName() + timeStamp );
390 
391  // Check for nest hierarchical schematic paths.
392  if( destFileName.GetPath() != backupPath.GetPath() )
393  {
394  destFileName.SetPath( backupPath.GetPath() );
395 
396  wxArrayString srcDirs = wxFileName( screen->GetFileName() ).GetDirs();
397  wxArrayString destDirs = wxFileName( Prj().GetProjectPath() ).GetDirs();
398 
399  for( size_t i = destDirs.GetCount(); i < srcDirs.GetCount(); i++ )
400  destFileName.AppendDir( srcDirs[i] );
401  }
402  else
403  {
404  destFileName.AppendDir( backupFolder );
405  }
406 
407  tmp.Printf( _( "Backing up file '%s' to '%s'." ),
408  screen->GetFileName(),
409  destFileName.GetFullPath() );
410  aReporter.Report( tmp, RPT_SEVERITY_INFO );
411 
412  if( !destFileName.DirExists() && !destFileName.Mkdir( wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL ) )
413  {
414  tmp.Printf( _( "Failed to create backup folder '%s'.\n" ), destFileName.GetPath() );
415  errorMsg += tmp;
416  continue;
417  }
418 
419  if( wxFileName::Exists( screen->GetFileName() )
420  && !wxCopyFile( screen->GetFileName(), destFileName.GetFullPath() ) )
421  {
422  tmp.Printf( _( "Failed to back up file '%s'.\n" ), screen->GetFileName() );
423  errorMsg += tmp;
424  }
425  }
426 
427  // Back up the project file.
428  destFileName = Prj().GetProjectFullName();
429  destFileName.SetName( destFileName.GetName() + timeStamp );
430  destFileName.AppendDir( backupFolder );
431 
432  tmp.Printf( _( "Backing up file '%s' to '%s'." ),
433  Prj().GetProjectFullName(),
434  destFileName.GetFullPath() );
435  aReporter.Report( tmp, RPT_SEVERITY_INFO );
436 
437  if( wxFileName::Exists( Prj().GetProjectFullName() )
438  && !wxCopyFile( Prj().GetProjectFullName(), destFileName.GetFullPath() ) )
439  {
440  tmp.Printf( _( "Failed to back up file '%s'.\n" ), Prj().GetProjectFullName() );
441  errorMsg += tmp;
442  }
443 
444  // Back up the cache library.
445  srcFileName.SetPath( Prj().GetProjectPath() );
446  srcFileName.SetName( Prj().GetProjectName() + "-cache" );
447  srcFileName.SetExt( LegacySymbolLibFileExtension );
448 
449  destFileName = srcFileName;
450  destFileName.SetName( destFileName.GetName() + timeStamp );
451  destFileName.AppendDir( backupFolder );
452 
453  tmp.Printf( _( "Backing up file '%s' to '%s'." ),
454  srcFileName.GetFullPath(),
455  destFileName.GetFullPath() );
456  aReporter.Report( tmp, RPT_SEVERITY_INFO );
457 
458  if( srcFileName.Exists()
459  && !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
460  {
461  tmp.Printf( _( "Failed to back up file '%s'.\n" ), srcFileName.GetFullPath() );
462  errorMsg += tmp;
463  }
464 
465  // Back up the rescue symbol library if it exists.
466  srcFileName.SetName( Prj().GetProjectName() + "-rescue" );
467  destFileName.SetName( srcFileName.GetName() + timeStamp );
468 
469  tmp.Printf( _( "Backing up file '%s' to '%s'." ),
470  srcFileName.GetFullPath(),
471  destFileName.GetFullPath() );
472  aReporter.Report( tmp, RPT_SEVERITY_INFO );
473 
474  if( srcFileName.Exists()
475  && !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
476  {
477  tmp.Printf( _( "Failed to back up file '%s'.\n" ), srcFileName.GetFullPath() );
478  errorMsg += tmp;
479  }
480 
481  // Back up the rescue symbol library document file if it exists.
482  srcFileName.SetExt( LegacySymbolDocumentFileExtension );
483  destFileName.SetExt( srcFileName.GetExt() );
484 
485  tmp.Printf( _( "Backing up file '%s' to '%s'." ),
486  srcFileName.GetFullPath(),
487  destFileName.GetFullPath() );
488  aReporter.Report( tmp, RPT_SEVERITY_INFO );
489 
490  if( srcFileName.Exists()
491  && !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
492  {
493  tmp.Printf( _( "Failed to back up file '%s'.\n" ), srcFileName.GetFullPath() );
494  errorMsg += tmp;
495  }
496 
497  if( !errorMsg.IsEmpty() )
498  {
499  wxMessageDialog dlg( this, _( "Some of the project files could not be backed up." ),
500  _( "Backup Error" ),
501  wxYES_NO | wxCENTRE | wxRESIZE_BORDER | wxICON_QUESTION );
502  errorMsg.Trim();
503  dlg.SetExtendedMessage( errorMsg );
504  dlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Continue with Rescue" ) ),
505  wxMessageDialog::ButtonLabel( _( "Abort Rescue" ) ) );
506 
507  if( dlg.ShowModal() == wxID_NO )
508  return false;
509  }
510 
511  return true;
512 }
513 
514 
515 void DIALOG_SYMBOL_REMAP::OnUpdateUIRemapButton( wxUpdateUIEvent& aEvent )
516 {
517  aEvent.Enable( !m_remapped );
518 }
EE_TYPE OfType(KICAD_T aType) const
Definition: sch_rtree.h:216
static const wxString & GetSymbolLibTableFileName()
static SYMBOL_LIB_TABLE & GetGlobalLibTable()
const UTF8 & GetLibItemName() const
Definition: lib_id.h:104
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_PLUGIN obje...
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:53
void OnUpdateUIRemapButton(wxUpdateUIEvent &aEvent) override
Hold a record identifying a library accessed by the appropriate plug in object in the LIB_TABLE.
bool InsertRow(LIB_TABLE_ROW *aRow, bool doReplace=false)
Adds aRow if it does not already exist or if doReplace is true.
This file is part of the common library.
const std::string LegacySymbolLibFileExtension
SCH_EDIT_FRAME * m_frame
static void LibNamesAndPaths(PROJECT *aProject, bool doSave, wxString *aPaths, wxArrayString *aNames=nullptr)
Save or load the names of the currently configured symbol libraries (without paths).
static const wxString ShowType(SCH_FILE_T aFileType)
Return a brief name for a plugin, given aFileType enum.
Definition: sch_io_mgr.cpp:79
virtual REPORTER & ReportTail(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Places the report at the end of the list, for objects that support report ordering.
Definition: reporter.h:93
Symbol library viewer main window.
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:382
Schematic editor (Eeschema) main window.
void SetLibId(const LIB_ID &aName)
Definition: sch_symbol.cpp:229
bool remapSymbolToLibTable(SCH_SYMBOL *aSymbol)
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:64
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
Define a library symbol object.
Definition: lib_symbol.h:96
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
This file contains miscellaneous commonly used macros and functions.
virtual void SetElem(ELEM_T aIndex, _ELEM *aElem)
Definition: project.cpp:258
Class DIALOG_SYMBOL_REMAP_BASE.
static bool RescueProject(wxWindow *aParent, RESCUER &aRescuer, bool aRunningOnDemand)
const wxString & GetNickName() const
void OnRemapSymbols(wxCommandEvent &aEvent) override
void createProjectSymbolLibTable(REPORTER &aReporter)
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:30
void SyncView()
Mark all items for refresh.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
const std::string LegacySymbolDocumentFileExtension
void remapSymbolsToLibTable(REPORTER &aReporter)
SCHEMATIC & Schematic() const
Definition of file extensions used in Kicad.
Definition for symbol library class.
#define _(s)
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:90
DIALOG_SYMBOL_REMAP(SCH_EDIT_FRAME *aParent)
virtual void Format(OUTPUTFORMATTER *aOutput, int aIndentLevel) const override
Generate the table in s-expression format to aOutput with an indentation level of aIndentLevel.
virtual const wxString GetProjectFullName() const
Return the full path and name of the project.
Definition: project.cpp:116
WX_HTML_REPORT_PANEL * m_messagePanel
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
Definition: kicad_algo.h:98
A collection of SYMBOL_LIB objects.
int SetLibNickname(const UTF8 &aNickname)
Override the logical library name portion of the LIB_ID to aNickname.
Definition: lib_id.cpp:97
void SetContentModified(bool aModified=true)
Definition: base_screen.h:59
bool backupProject(REPORTER &aReporter)
Backup all of the files that could be modified by the remapping with a time stamp appended to the fil...
SCH_SHEET & Root() const
Definition: schematic.h:92
see class PGM_BASE
Schematic symbol object.
Definition: sch_symbol.h:78
EE_RTREE & Items()
Definition: sch_screen.h:102
wxString wx_str() const
Definition: utf8.cpp:46
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
Used for text file output.
Definition: richio.h:456
size_t getLibsNotInGlobalSymbolLibTable(std::vector< SYMBOL_LIB * > &aLibs)
Add libraries found in the legacy library list to aLibs that are not found in the global symbol libra...
SCH_SHEET_PATH & GetCurrentSheet() const
GAL_TYPE GetBackend() const
Return the type of backend currently used by GAL canvas.
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current screen and u...
void ClearUndoORRedoList(UNDO_REDO_LIST whichList, int aItemCount=-1) override
Free the undo or redo list from aList element.
void SetFileName(const wxString &aReportFileName)
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
Definition: confirm.cpp:280
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:75
wxString NormalizePath(const wxFileName &aFilePath, const ENV_VAR_MAP *aEnvVars, const wxString &aProjectPath)
Normalize a file path to an environmental variable, if possible.
Definition: env_paths.cpp:69
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:551
bool IsEmpty(bool aIncludeFallback=true)
Return true if the table is empty.
std::vector< wxString > GetLogicalLibs()
Return the logical library names, all of them that are pertinent to a look up done on this LIB_TABLE.
const LIB_ID & GetLibId() const
Definition: sch_symbol.h:147
bool empty() const
Definition: utf8.h:103