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 <class_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 do not have "
59  "write 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  PART_LIBS::LibNamesAndPaths( &Prj(), true, &paths, &libNames );
134 
135  // Reload the 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< PART_LIB* >& aLibs )
145 {
146  PART_LIBS* libs = Prj().SchLibs();
147 
148  for( PART_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< PART_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, fullFileName );
212  aReporter.Report( msg, RPT_SEVERITY_INFO );
213 
214  prjLibTable.InsertRow( new SYMBOL_LIB_TABLE_ROW( libName, fullFileName,
215  pluginType ) );
216  }
217  else
218  {
219  msg.Printf( _( "Library \"%s\" not found." ), fullFileName );
220  aReporter.Report( msg, RPT_SEVERITY_WARNING );
221  }
222  }
223 
224  // Don't save empty project symbol library table.
225  if( !prjLibTable.IsEmpty() )
226  {
227  wxFileName fn( Prj().GetProjectPath(), SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
228 
229  try
230  {
231  FILE_OUTPUTFORMATTER formatter( fn.GetFullPath() );
232  prjLibTable.Format( &formatter, 0 );
233  }
234  catch( const IO_ERROR& ioe )
235  {
236  msg.Printf( _( "Failed to write project symbol library table. Error:\n %s" ),
237  ioe.What() );
238  aReporter.ReportTail( msg, RPT_SEVERITY_ERROR );
239  }
240 
241  aReporter.ReportTail( _( "Created project symbol library table.\n" ), RPT_SEVERITY_INFO );
242  }
243  }
244 }
245 
246 
248 {
249  wxString msg;
250  SCH_SCREENS schematic( m_frame->Schematic().Root() );
251  SCH_COMPONENT* symbol;
252  SCH_SCREEN* screen;
253 
254  for( screen = schematic.GetFirst(); screen; screen = schematic.GetNext() )
255  {
256  for( auto item : screen->Items().OfType( SCH_COMPONENT_T ) )
257  {
258  symbol = dynamic_cast<SCH_COMPONENT*>( item );
259 
260  if( !remapSymbolToLibTable( symbol ) )
261  {
262  msg.Printf( _( "No symbol \"%s\" found in symbol library table." ),
263  symbol->GetLibId().GetLibItemName().wx_str() );
264  aReporter.Report( msg, RPT_SEVERITY_WARNING );
265  }
266  else
267  {
268  msg.Printf( _( "Symbol \"%s\" mapped to symbol library \"%s\"." ),
269  symbol->GetLibId().GetLibItemName().wx_str(),
270  symbol->GetLibId().GetLibNickname().wx_str() );
271  aReporter.Report( msg, RPT_SEVERITY_ACTION );
272  screen->SetModify();
273  }
274  }
275  }
276 
277  aReporter.Report( _( "Symbol library table mapping complete!" ), RPT_SEVERITY_INFO );
278  schematic.UpdateSymbolLinks();
279 }
280 
281 
283 {
284  wxCHECK_MSG( aSymbol != NULL, false, "Null pointer passed to remapSymbolToLibTable." );
285  wxCHECK_MSG( aSymbol->GetLibId().GetLibNickname().empty(), false,
286  "Cannot remap symbol that is already mapped." );
287  wxCHECK_MSG( !aSymbol->GetLibId().GetLibItemName().empty(), false,
288  "The symbol LIB_ID name is empty." );
289 
290  PART_LIBS* libs = Prj().SchLibs();
291 
292  for( PART_LIBS_BASE::iterator it = libs->begin(); it != libs->end(); ++it )
293  {
294  // Ignore the cache library.
295  if( it->IsCache() )
296  continue;
297 
298  LIB_PART* alias = it->FindPart( aSymbol->GetLibId().GetLibItemName().wx_str() );
299 
300  // Found in the same library as the old look up method assuming the user didn't
301  // change the libraries or library ordering since the last time the schematic was
302  // loaded.
303  if( alias )
304  {
305  // Find the same library in the symbol library table using the full path and file name.
306  wxString libFileName = it->GetFullFileName();
307 
308  const LIB_TABLE_ROW* row = Prj().SchSymbolLibTable()->FindRowByURI( libFileName );
309 
310  if( row )
311  {
312  LIB_ID id = aSymbol->GetLibId();
313 
314  id.SetLibNickname( row->GetNickName() );
315 
316  // Don't resolve symbol library links now.
317  aSymbol->SetLibId( id );
318  return true;
319  }
320  }
321  }
322 
323  return false;
324 }
325 
326 
328 {
329  static wxString backupFolder = "rescue-backup";
330 
331  wxString tmp;
332  wxString errorMsg;
333  wxFileName srcFileName;
334  wxFileName destFileName;
335  wxFileName backupPath;
336  SCH_SCREENS schematic( m_frame->Schematic().Root() );
337 
338  // Copy backup files to different folder so as not to pollute the project folder.
339  destFileName.SetPath( Prj().GetProjectPath() );
340  destFileName.AppendDir( backupFolder );
341  backupPath = destFileName;
342 
343  if( !destFileName.DirExists() )
344  {
345  if( !destFileName.Mkdir() )
346  {
347  errorMsg.Printf( _( "Cannot create project remap back up folder \"%s\"." ),
348  destFileName.GetPath() );
349 
350  wxMessageDialog dlg( this, errorMsg, _( "Backup Error" ),
351  wxYES_NO | wxCENTRE | wxRESIZE_BORDER | wxICON_QUESTION );
352  dlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Continue with Rescue" ) ),
353  wxMessageDialog::ButtonLabel( _( "Abort Rescue" ) ) );
354 
355  if( dlg.ShowModal() == wxID_NO )
356  return false;
357  }
358  }
359 
360  // Time stamp to append to file name in case multiple remappings are performed.
361  wxString timeStamp = wxDateTime::Now().Format( "-%Y-%m-%d-%H-%M-%S" );
362 
363  // Back up symbol library table.
364  srcFileName.SetPath( Prj().GetProjectPath() );
365  srcFileName.SetName( SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
366  destFileName = srcFileName;
367  destFileName.AppendDir( backupFolder );
368  destFileName.SetName( destFileName.GetName() + timeStamp );
369 
370  tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
371  srcFileName.GetFullPath(), destFileName.GetFullPath() );
372  aReporter.Report( tmp, RPT_SEVERITY_INFO );
373 
374  if( wxFileName::Exists( srcFileName.GetFullPath() )
375  && !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
376  {
377  tmp.Printf( _( "Failed to back up file \"%s\".\n" ), 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 file \"%s\"." ),
404  screen->GetFileName(), destFileName.GetFullPath() );
405  aReporter.Report( tmp, RPT_SEVERITY_INFO );
406 
407  if( !destFileName.DirExists() && !destFileName.Mkdir( wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL ) )
408  {
409  tmp.Printf( _( "Failed to create backup folder \"%s\"\n" ), destFileName.GetPath() );
410  errorMsg += tmp;
411  continue;
412  }
413 
414  if( wxFileName::Exists( screen->GetFileName() )
415  && !wxCopyFile( screen->GetFileName(), destFileName.GetFullPath() ) )
416  {
417  tmp.Printf( _( "Failed to back up file \"%s\".\n" ), screen->GetFileName() );
418  errorMsg += tmp;
419  }
420  }
421 
422  // Back up the project file.
423  destFileName = Prj().GetProjectFullName();
424  destFileName.SetName( destFileName.GetName() + timeStamp );
425  destFileName.AppendDir( backupFolder );
426 
427  tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
428  Prj().GetProjectFullName(), destFileName.GetFullPath() );
429  aReporter.Report( tmp, RPT_SEVERITY_INFO );
430 
431  if( wxFileName::Exists( Prj().GetProjectFullName() )
432  && !wxCopyFile( Prj().GetProjectFullName(), destFileName.GetFullPath() ) )
433  {
434  tmp.Printf( _( "Failed to back up file \"%s\".\n" ), Prj().GetProjectFullName() );
435  errorMsg += tmp;
436  }
437 
438  // Back up the cache library.
439  srcFileName.SetPath( Prj().GetProjectPath() );
440  srcFileName.SetName( Prj().GetProjectName() + "-cache" );
441  srcFileName.SetExt( LegacySymbolLibFileExtension );
442 
443  destFileName = srcFileName;
444  destFileName.SetName( destFileName.GetName() + timeStamp );
445  destFileName.AppendDir( backupFolder );
446 
447  tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
448  srcFileName.GetFullPath(), destFileName.GetFullPath() );
449  aReporter.Report( tmp, RPT_SEVERITY_INFO );
450 
451  if( srcFileName.Exists()
452  && !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
453  {
454  tmp.Printf( _( "Failed to back up file \"%s\".\n" ), srcFileName.GetFullPath() );
455  errorMsg += tmp;
456  }
457 
458  // Back up the rescue symbol library if it exists.
459  srcFileName.SetName( Prj().GetProjectName() + "-rescue" );
460  destFileName.SetName( srcFileName.GetName() + timeStamp );
461 
462  tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
463  srcFileName.GetFullPath(),
464  destFileName.GetFullPath() );
465  aReporter.Report( tmp, RPT_SEVERITY_INFO );
466 
467  if( srcFileName.Exists()
468  && !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
469  {
470  tmp.Printf( _( "Failed to back up file \"%s\".\n" ), srcFileName.GetFullPath() );
471  errorMsg += tmp;
472  }
473 
474  // Back up the rescue symbol library document file if it exists.
475  srcFileName.SetExt( "dcm" );
476  destFileName.SetExt( srcFileName.GetExt() );
477 
478  tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
479  srcFileName.GetFullPath(),
480  destFileName.GetFullPath() );
481  aReporter.Report( tmp, RPT_SEVERITY_INFO );
482 
483  if( srcFileName.Exists()
484  && !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
485  {
486  tmp.Printf( _( "Failed to back up file \"%s\".\n" ), srcFileName.GetFullPath() );
487  errorMsg += tmp;
488  }
489 
490  if( !errorMsg.IsEmpty() )
491  {
492  wxMessageDialog dlg( this, _( "Some of the project files could not be backed up." ),
493  _( "Backup Error" ),
494  wxYES_NO | wxCENTRE | wxRESIZE_BORDER | wxICON_QUESTION );
495  errorMsg.Trim();
496  dlg.SetExtendedMessage( errorMsg );
497  dlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Continue with Rescue" ) ),
498  wxMessageDialog::ButtonLabel( _( "Abort Rescue" ) ) );
499 
500  if( dlg.ShowModal() == wxID_NO )
501  return false;
502  }
503 
504  return true;
505 }
506 
507 
508 void DIALOG_SYMBOL_REMAP::OnUpdateUIRemapButton( wxUpdateUIEvent& aEvent )
509 {
510  aEvent.Enable( !m_remapped );
511 }
EE_TYPE OfType(KICAD_T aType) const
Definition: sch_rtree.h:219
static const wxString & GetSymbolLibTableFileName()
static SYMBOL_LIB_TABLE & GetGlobalLibTable()
const UTF8 & GetLibItemName() const
Definition: lib_id.h:106
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_PLUGIN obje...
void SetLibId(const LIB_ID &aName)
Definition: sch_symbol.cpp:223
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:56
void OnUpdateUIRemapButton(wxUpdateUIEvent &aEvent) override
static void LibNamesAndPaths(PROJECT *aProject, bool doSave, wxString *aPaths, wxArrayString *aNames=NULL)
Save or load the names of the currently configured part libraries (without paths).
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
size_t getLibsNotInGlobalSymbolLibTable(std::vector< PART_LIB * > &aLibs)
Add libraries found in the legacy library list to aLibs that are not found in the global symbol libra...
static const wxString ShowType(SCH_FILE_T aFileType)
Return a brief name for a plugin, given aFileType enum.
Definition: sch_io_mgr.cpp:87
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:345
Schematic editor (Eeschema) main window.
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
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)
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)
#define NULL
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:29
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.
void remapSymbolsToLibTable(REPORTER &aReporter)
SCHEMATIC & Schematic() const
Define a library symbol object.
Definition: lib_symbol.h:93
Definition of file extensions used in Kicad.
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Definition: lib_id.h:92
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 indention level of aIndentLevel.
virtual const wxString GetProjectFullName() const
Return the full path and name of the project.
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:81
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
int SetLibNickname(const UTF8 &aNickname)
Override the logical library name portion of the LIB_ID to aNickname.
Definition: lib_id.cpp:193
A collection of PART_LIB objects.
bool backupProject(REPORTER &aReporter)
Backup all of the files that could be modified by the remapping with a time stamp appended to the fil...
bool remapSymbolToLibTable(SCH_COMPONENT *aSymbol)
SCH_SHEET & Root() const
Definition: schematic.h:116
see class PGM_BASE
#define _(s)
Definition: 3d_actions.cpp:33
EE_RTREE & Items()
Definition: sch_screen.h:162
wxString wx_str() const
Definition: utf8.cpp:51
Schematic symbol object.
Definition: sch_symbol.h:79
Used for text file output.
Definition: richio.h:453
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...
Definition for part library class.
void ClearUndoORRedoList(UNDO_REDO_LIST whichList, int aItemCount=-1) override
Free the undo or redo list from aList element.
void SetModify()
Definition: base_screen.h:59
void SetFileName(const wxString &aReportFileName)
const LIB_ID & GetLibId() const
Definition: sch_symbol.h:189
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
Definition: confirm.cpp:281
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:67
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:534
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.
bool empty() const
Definition: utf8.h:103