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 <[email protected]>
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_base.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 
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  wxFileName tmpFn = fullFileName;
202 
203  // Don't add symbol libraries that do not exist.
204  if( tmpFn.Normalize() && tmpFn.FileExists() )
205  {
206  msg.Printf( _( "Adding library '%s', file '%s' to project symbol library table." ),
207  libName,
208  fullFileName );
209  aReporter.Report( msg, RPT_SEVERITY_INFO );
210 
211  prjLibTable.InsertRow( new SYMBOL_LIB_TABLE_ROW( libName, fullFileName,
212  pluginType ) );
213  }
214  else
215  {
216  msg.Printf( _( "Library '%s' not found." ), fullFileName );
217  aReporter.Report( msg, RPT_SEVERITY_WARNING );
218  }
219  }
220 
221  // Don't save empty project symbol library table.
222  if( !prjLibTable.IsEmpty() )
223  {
224  wxFileName fn( Prj().GetProjectPath(), SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
225 
226  try
227  {
228  FILE_OUTPUTFORMATTER formatter( fn.GetFullPath() );
229  prjLibTable.Format( &formatter, 0 );
230  }
231  catch( const IO_ERROR& ioe )
232  {
233  msg.Printf( _( "Failed to write project symbol library table. Error:\n %s" ),
234  ioe.What() );
235  aReporter.ReportTail( msg, RPT_SEVERITY_ERROR );
236  }
237 
238  aReporter.ReportTail( _( "Created project symbol library table.\n" ),
240  }
241  }
242 }
243 
244 
246 {
247  wxString msg;
248  SCH_SCREENS schematic( m_frame->Schematic().Root() );
249  SCH_SYMBOL* symbol;
250  SCH_SCREEN* screen;
251 
252  for( screen = schematic.GetFirst(); screen; screen = schematic.GetNext() )
253  {
254  for( auto item : screen->Items().OfType( SCH_SYMBOL_T ) )
255  {
256  symbol = dynamic_cast<SCH_SYMBOL*>( item );
257 
258  if( !remapSymbolToLibTable( symbol ) )
259  {
260  msg.Printf( _( "No symbol %s found in symbol library table." ),
261  symbol->GetLibId().GetLibItemName().wx_str() );
262  aReporter.Report( msg, RPT_SEVERITY_WARNING );
263  }
264  else
265  {
266  msg.Printf( _( "Symbol %s mapped to symbol library '%s'." ),
267  symbol->GetLibId().GetLibItemName().wx_str(),
268  symbol->GetLibId().GetLibNickname().wx_str() );
269  aReporter.Report( msg, RPT_SEVERITY_ACTION );
270  screen->SetContentModified();
271  }
272  }
273  }
274 
275  aReporter.Report( _( "Symbol library table mapping complete!" ), RPT_SEVERITY_INFO );
276  schematic.UpdateSymbolLinks();
277 }
278 
279 
281 {
282  wxCHECK_MSG( aSymbol != nullptr, false, "Null pointer passed to remapSymbolToLibTable." );
283  wxCHECK_MSG( aSymbol->GetLibId().GetLibNickname().empty(), false,
284  "Cannot remap symbol that is already mapped." );
285  wxCHECK_MSG( !aSymbol->GetLibId().GetLibItemName().empty(), false,
286  "The symbol LIB_ID name is empty." );
287 
288  SYMBOL_LIBS* libs = Prj().SchLibs();
289 
290  for( SYMBOL_LIBS_BASE::iterator it = libs->begin(); it != libs->end(); ++it )
291  {
292  // Ignore the cache library.
293  if( it->IsCache() )
294  continue;
295 
296  LIB_SYMBOL* alias = it->FindSymbol( aSymbol->GetLibId().GetLibItemName().wx_str() );
297 
298  // Found in the same library as the old look up method assuming the user didn't
299  // change the libraries or library ordering since the last time the schematic was
300  // loaded.
301  if( alias )
302  {
303  // Find the same library in the symbol library table using the full path and file name.
304  wxString libFileName = it->GetFullFileName();
305 
306  const LIB_TABLE_ROW* row = Prj().SchSymbolLibTable()->FindRowByURI( libFileName );
307 
308  if( row )
309  {
310  LIB_ID id = aSymbol->GetLibId();
311 
312  id.SetLibNickname( row->GetNickName() );
313 
314  // Don't resolve symbol library links now.
315  aSymbol->SetLibId( id );
316  return true;
317  }
318  }
319  }
320 
321  return false;
322 }
323 
324 
326 {
327  static wxString backupFolder = "rescue-backup";
328 
329  wxString tmp;
330  wxString errorMsg;
331  wxFileName srcFileName;
332  wxFileName destFileName;
333  wxFileName backupPath;
334  SCH_SCREENS schematic( m_frame->Schematic().Root() );
335 
336  // Copy backup files to different folder so as not to pollute the project folder.
337  destFileName.SetPath( Prj().GetProjectPath() );
338  destFileName.AppendDir( backupFolder );
339  backupPath = destFileName;
340 
341  if( !destFileName.DirExists() )
342  {
343  if( !destFileName.Mkdir() )
344  {
345  errorMsg.Printf( _( "Cannot create project remap back up folder '%s'." ),
346  destFileName.GetPath() );
347 
348  wxMessageDialog dlg( this, errorMsg, _( "Backup Error" ),
349  wxYES_NO | wxCENTRE | wxRESIZE_BORDER | wxICON_QUESTION );
350  dlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Continue with Rescue" ) ),
351  wxMessageDialog::ButtonLabel( _( "Abort Rescue" ) ) );
352 
353  if( dlg.ShowModal() == wxID_NO )
354  return false;
355  }
356  }
357 
358  // Time stamp to append to file name in case multiple remappings are performed.
359  wxString timeStamp = wxDateTime::Now().Format( "-%Y-%m-%d-%H-%M-%S" );
360 
361  // Back up symbol library table.
362  srcFileName.SetPath( Prj().GetProjectPath() );
363  srcFileName.SetName( SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
364  destFileName = srcFileName;
365  destFileName.AppendDir( backupFolder );
366  destFileName.SetName( destFileName.GetName() + timeStamp );
367 
368  tmp.Printf( _( "Backing up file '%s' to '%s'." ),
369  srcFileName.GetFullPath(),
370  destFileName.GetFullPath() );
371  aReporter.Report( tmp, RPT_SEVERITY_INFO );
372 
373  if( wxFileName::Exists( srcFileName.GetFullPath() )
374  && !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
375  {
376  tmp.Printf( _( "Failed to back up file '%s'.\n" ),
377  srcFileName.GetFullPath() );
378  errorMsg += tmp;
379  }
380 
381  // Back up the schematic files.
382  for( SCH_SCREEN* screen = schematic.GetFirst(); screen; screen = schematic.GetNext() )
383  {
384  destFileName = screen->GetFileName();
385  destFileName.SetName( destFileName.GetName() + timeStamp );
386 
387  // Check for nest hierarchical schematic paths.
388  if( destFileName.GetPath() != backupPath.GetPath() )
389  {
390  destFileName.SetPath( backupPath.GetPath() );
391 
392  wxArrayString srcDirs = wxFileName( screen->GetFileName() ).GetDirs();
393  wxArrayString destDirs = wxFileName( Prj().GetProjectPath() ).GetDirs();
394 
395  for( size_t i = destDirs.GetCount(); i < srcDirs.GetCount(); i++ )
396  destFileName.AppendDir( srcDirs[i] );
397  }
398  else
399  {
400  destFileName.AppendDir( backupFolder );
401  }
402 
403  tmp.Printf( _( "Backing up file '%s' to '%s'." ),
404  screen->GetFileName(),
405  destFileName.GetFullPath() );
406  aReporter.Report( tmp, RPT_SEVERITY_INFO );
407 
408  if( !destFileName.DirExists() && !destFileName.Mkdir( wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL ) )
409  {
410  tmp.Printf( _( "Failed to create backup folder '%s'.\n" ), destFileName.GetPath() );
411  errorMsg += tmp;
412  continue;
413  }
414 
415  if( wxFileName::Exists( screen->GetFileName() )
416  && !wxCopyFile( screen->GetFileName(), destFileName.GetFullPath() ) )
417  {
418  tmp.Printf( _( "Failed to back up file '%s'.\n" ), screen->GetFileName() );
419  errorMsg += tmp;
420  }
421  }
422 
423  // Back up the project file.
424  destFileName = Prj().GetProjectFullName();
425  destFileName.SetName( destFileName.GetName() + timeStamp );
426  destFileName.AppendDir( backupFolder );
427 
428  tmp.Printf( _( "Backing up file '%s' to '%s'." ),
429  Prj().GetProjectFullName(),
430  destFileName.GetFullPath() );
431  aReporter.Report( tmp, RPT_SEVERITY_INFO );
432 
433  if( wxFileName::Exists( Prj().GetProjectFullName() )
434  && !wxCopyFile( Prj().GetProjectFullName(), destFileName.GetFullPath() ) )
435  {
436  tmp.Printf( _( "Failed to back up file '%s'.\n" ), Prj().GetProjectFullName() );
437  errorMsg += tmp;
438  }
439 
440  // Back up the cache library.
441  srcFileName.SetPath( Prj().GetProjectPath() );
442  srcFileName.SetName( Prj().GetProjectName() + "-cache" );
443  srcFileName.SetExt( LegacySymbolLibFileExtension );
444 
445  destFileName = srcFileName;
446  destFileName.SetName( destFileName.GetName() + timeStamp );
447  destFileName.AppendDir( backupFolder );
448 
449  tmp.Printf( _( "Backing up file '%s' to '%s'." ),
450  srcFileName.GetFullPath(),
451  destFileName.GetFullPath() );
452  aReporter.Report( tmp, RPT_SEVERITY_INFO );
453 
454  if( srcFileName.Exists()
455  && !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
456  {
457  tmp.Printf( _( "Failed to back up file '%s'.\n" ), srcFileName.GetFullPath() );
458  errorMsg += tmp;
459  }
460 
461  // Back up the rescue symbol library if it exists.
462  srcFileName.SetName( Prj().GetProjectName() + "-rescue" );
463  destFileName.SetName( srcFileName.GetName() + timeStamp );
464 
465  tmp.Printf( _( "Backing up file '%s' to '%s'." ),
466  srcFileName.GetFullPath(),
467  destFileName.GetFullPath() );
468  aReporter.Report( tmp, RPT_SEVERITY_INFO );
469 
470  if( srcFileName.Exists()
471  && !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
472  {
473  tmp.Printf( _( "Failed to back up file '%s'.\n" ), srcFileName.GetFullPath() );
474  errorMsg += tmp;
475  }
476 
477  // Back up the rescue symbol library document file if it exists.
478  srcFileName.SetExt( LegacySymbolDocumentFileExtension );
479  destFileName.SetExt( srcFileName.GetExt() );
480 
481  tmp.Printf( _( "Backing up file '%s' to '%s'." ),
482  srcFileName.GetFullPath(),
483  destFileName.GetFullPath() );
484  aReporter.Report( tmp, RPT_SEVERITY_INFO );
485 
486  if( srcFileName.Exists()
487  && !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
488  {
489  tmp.Printf( _( "Failed to back up file '%s'.\n" ), srcFileName.GetFullPath() );
490  errorMsg += tmp;
491  }
492 
493  if( !errorMsg.IsEmpty() )
494  {
495  wxMessageDialog dlg( this, _( "Some of the project files could not be backed up." ),
496  _( "Backup Error" ),
497  wxYES_NO | wxCENTRE | wxRESIZE_BORDER | wxICON_QUESTION );
498  errorMsg.Trim();
499  dlg.SetExtendedMessage( errorMsg );
500  dlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Continue with Rescue" ) ),
501  wxMessageDialog::ButtonLabel( _( "Abort Rescue" ) ) );
502 
503  if( dlg.ShowModal() == wxID_NO )
504  return false;
505  }
506 
507  return true;
508 }
509 
510 
511 void DIALOG_SYMBOL_REMAP::OnUpdateUIRemapButton( wxUpdateUIEvent& aEvent )
512 {
513  aEvent.Enable( !m_remapped );
514 }
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:99
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:383
Schematic editor (Eeschema) main window.
void SetLibId(const LIB_ID &aName)
Definition: sch_symbol.cpp:238
bool remapSymbolToLibTable(SCH_SYMBOL *aSymbol)
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:70
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.
bool AppendToPage(const wxString &aSource)
Definition: html_window.cpp:57
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:99
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()
Gets the full RTree, usually for iterating.
Definition: sch_screen.h:110
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:307
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:568
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