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@verizon.net>
9  * Copyright (C) 2017-2019 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 <lib_view_frame.h>
36 #include <project_rescue.h>
37 #include <sch_io_mgr.h>
38 #include <sch_sheet.h>
39 #include <sch_component.h>
40 #include <sch_screen.h>
41 #include <sch_edit_frame.h>
42 #include <symbol_lib_table.h>
43 #include <env_paths.h>
44 
45 #include <dialog_symbol_remap.h>
46 
47 
49  DIALOG_SYMBOL_REMAP_BASE( aParent )
50 {
51  m_remapped = false;
52 
53  if( !wxFileName::IsDirWritable( Prj().GetProjectPath() ) )
54  {
55  DisplayInfoMessage( this, _( "Remapping is not possible because you do not have "
56  "write privileges to the project folder \"%s\"." ) );
57 
58  // Disable the remap button.
59  m_remapped = true;
60  }
61 
62  wxString text;
63 
64  text = _( "This schematic currently uses the project symbol library list look up method "
65  "for loading library symbols. KiCad will attempt to map the existing symbols "
66  "to use the new symbol library table. Remapping will change some project files "
67  "and schematics may not be compatible with older versions of KiCad. All files "
68  "that are changed will be backed up to the \"remap_backup\" folder in the project "
69  "folder should you need to revert any changes. If you choose to skip this step, "
70  "you will be responsible for manually remapping the symbols." );
71 
72  m_htmlCtrl->AppendToPage( text );
73 }
74 
75 
76 void DIALOG_SYMBOL_REMAP::OnRemapSymbols( wxCommandEvent& aEvent )
77 {
78  SCH_EDIT_FRAME* parent = dynamic_cast< SCH_EDIT_FRAME* >( GetParent() );
79 
80  wxCHECK_RET( parent != nullptr, "Parent window is not type SCH_EDIT_FRAME." );
81 
82  wxBusyCursor busy;
83 
85  return;
86 
87  // Ignore the never show rescue setting for one last rescue of legacy symbol
88  // libraries before remapping to the symbol library table. This ensures the
89  // best remapping results.
90  LEGACY_RESCUER rescuer( Prj(), &parent->GetCurrentSheet(), parent->GetCanvas()->GetBackend() );
91 
92  if( RESCUER::RescueProject( this, rescuer, false ) )
93  {
94  LIB_VIEW_FRAME* viewer = (LIB_VIEW_FRAME*) parent->Kiway().Player( FRAME_SCH_VIEWER, false );
95 
96  if( viewer )
97  viewer->ReCreateListLib();
98 
99  parent->GetScreen()->ClearUndoORRedoList( parent->GetScreen()->m_UndoList, 1 );
100  parent->SyncView();
101  parent->GetCanvas()->Refresh();
102  parent->OnModify();
103  }
104 
105  // The schematic is fully loaded, any legacy library symbols have been rescued. Now
106  // check to see if the schematic has not been converted to the symbol library table
107  // method for looking up symbols.
108  wxFileName prjSymLibTableFileName( Prj().GetProjectPath(),
110 
111  // Delete the existing project symbol library table.
112  if( prjSymLibTableFileName.FileExists() )
113  {
114  wxRemoveFile( prjSymLibTableFileName.GetFullPath() );
115  }
116 
119  Prj().SchSymbolLibTable();
120 
122 
123  // Remove all of the libraries from the legacy library list.
124  wxString paths;
125  wxArrayString libNames;
126 
127  PART_LIBS::LibNamesAndPaths( &Prj(), true, &paths, &libNames );
128 
129  // Reload the the cache symbol library.
131  Prj().SchLibs();
132 
133  Raise();
134  m_remapped = true;
135 }
136 
137 
138 size_t DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable( std::vector< PART_LIB* >& aLibs )
139 {
140  PART_LIBS* libs = Prj().SchLibs();
141 
142  for( PART_LIBS_BASE::iterator it = libs->begin(); it != libs->end(); ++it )
143  {
144  // Ignore the cache library.
145  if( it->IsCache() )
146  continue;
147 
148  // Check for the obvious library name.
149  wxString libFileName = it->GetFullFileName();
150 
151  if( !SYMBOL_LIB_TABLE::GetGlobalLibTable().FindRowByURI( libFileName ) )
152  aLibs.push_back( &(*it) );
153  }
154 
155  return aLibs.size();
156 }
157 
158 
160 {
161  wxString msg;
162  std::vector< PART_LIB* > libs;
163 
165  {
166  SYMBOL_LIB_TABLE prjLibTable;
167  std::vector< wxString > libNames = SYMBOL_LIB_TABLE::GetGlobalLibTable().GetLogicalLibs();
168 
169  for( auto lib : libs )
170  {
171  wxString libName = lib->GetName();
172  int libNameInc = 1;
173  int libNameLen = libName.Length();
174 
175  // Spaces in the file name will break the symbol name because they are not
176  // quoted in the symbol library file format.
177  libName.Replace( " ", "-" );
178 
179  // Don't create duplicate table entries.
180  while( std::find( libNames.begin(), libNames.end(), libName ) != libNames.end() )
181  {
182  libName = libName.Left( libNameLen );
183  libName << libNameInc;
184  libNameInc++;
185  }
186 
187  wxString pluginType = SCH_IO_MGR::ShowType( SCH_IO_MGR::SCH_LEGACY );
188  wxFileName fn = lib->GetFullFileName();
189 
190  // Use environment variable substitution where possible. This is based solely
191  // on the internal user environment variable list. Checking against all of the
192  // system wide environment variables is probably not a good idea.
193  wxString fullFileName = NormalizePath( fn, &Pgm().GetLocalEnvVariables(), &Prj() );
194 
195  // Fall back to the absolute library path.
196  if( fullFileName.IsEmpty() )
197  fullFileName = lib->GetFullFileName();
198 
199  wxFileName tmpFn = fullFileName;
200 
201  // Don't add symbol libraries that do not exist.
202  if( tmpFn.Normalize() && tmpFn.FileExists() )
203  {
204  msg.Printf( _( "Adding library \"%s\", file \"%s\" to project symbol library table." ),
205  libName, fullFileName );
206  aReporter.Report( msg, RPT_SEVERITY_INFO );
207 
208  prjLibTable.InsertRow( new SYMBOL_LIB_TABLE_ROW( libName, fullFileName,
209  pluginType ) );
210  }
211  else
212  {
213  msg.Printf( _( "Library \"%s\" not found." ), fullFileName );
214  aReporter.Report( msg, RPT_SEVERITY_WARNING );
215  }
216  }
217 
218  // Don't save empty project symbol library table.
219  if( !prjLibTable.IsEmpty() )
220  {
221  wxFileName fn( Prj().GetProjectPath(), SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
222 
223  try
224  {
225  FILE_OUTPUTFORMATTER formatter( fn.GetFullPath() );
226  prjLibTable.Format( &formatter, 0 );
227  }
228  catch( const IO_ERROR& ioe )
229  {
230  msg.Printf( _( "Failed to write project symbol library table. Error:\n %s" ),
231  ioe.What() );
232  aReporter.ReportTail( msg, RPT_SEVERITY_ERROR );
233  }
234 
235  aReporter.ReportTail( _( "Created project symbol library table.\n" ), RPT_SEVERITY_INFO );
236  }
237  }
238 }
239 
240 
242 {
243  wxString msg;
244  SCH_SCREENS schematic;
245  SCH_COMPONENT* symbol;
246  SCH_SCREEN* screen;
247 
248  for( screen = schematic.GetFirst(); screen; screen = schematic.GetNext() )
249  {
250  for( auto item : screen->Items().OfType( SCH_COMPONENT_T ) )
251  {
252  symbol = dynamic_cast<SCH_COMPONENT*>( item );
253 
254  if( !remapSymbolToLibTable( symbol ) )
255  {
256  msg.Printf( _( "No symbol \"%s\" found in symbol library table." ),
257  symbol->GetLibId().GetLibItemName().wx_str() );
258  aReporter.Report( msg, RPT_SEVERITY_WARNING );
259  }
260  else
261  {
262  msg.Printf( _( "Symbol \"%s\" mapped to symbol library \"%s\"." ),
263  symbol->GetLibId().GetLibItemName().wx_str(),
264  symbol->GetLibId().GetLibNickname().wx_str() );
265  aReporter.Report( msg, RPT_SEVERITY_ACTION );
266  screen->SetModify();
267  }
268  }
269  }
270 
271  aReporter.Report( _( "Symbol library table mapping complete!" ), RPT_SEVERITY_INFO );
272  schematic.UpdateSymbolLinks( true );
273 }
274 
275 
277 {
278  wxCHECK_MSG( aSymbol != NULL, false, "Null pointer passed to remapSymbolToLibTable." );
279  wxCHECK_MSG( aSymbol->GetLibId().GetLibNickname().empty(), false,
280  "Cannot remap symbol that is already mapped." );
281  wxCHECK_MSG( !aSymbol->GetLibId().GetLibItemName().empty(), false,
282  "The symbol LIB_ID name is empty." );
283 
284  PART_LIBS* libs = Prj().SchLibs();
285 
286  for( PART_LIBS_BASE::iterator it = libs->begin(); it != libs->end(); ++it )
287  {
288  // Ignore the cache library.
289  if( it->IsCache() )
290  continue;
291 
292  LIB_PART* alias = it->FindPart( aSymbol->GetLibId().GetLibItemName().wx_str() );
293 
294  // Found in the same library as the old look up method assuming the user didn't
295  // change the libraries or library ordering since the last time the schematic was
296  // loaded.
297  if( alias )
298  {
299  // Find the same library in the symbol library table using the full path and file name.
300  wxString libFileName = it->GetFullFileName();
301 
302  const LIB_TABLE_ROW* row = Prj().SchSymbolLibTable()->FindRowByURI( libFileName );
303 
304  if( row )
305  {
306  LIB_ID id = aSymbol->GetLibId();
307 
308  id.SetLibNickname( row->GetNickName() );
309 
310  // Don't resolve symbol library links now.
311  aSymbol->SetLibId( id, nullptr, nullptr );
312  return true;
313  }
314  }
315  }
316 
317  return false;
318 }
319 
320 
322 {
323  static wxString backupFolder = "rescue-backup";
324 
325  wxString tmp;
326  wxString errorMsg;
327  wxFileName srcFileName;
328  wxFileName destFileName;
329  wxFileName backupPath;
330  SCH_SCREENS schematic;
331 
332  // Copy backup files to different folder so as not to pollute the project folder.
333  destFileName.SetPath( Prj().GetProjectPath() );
334  destFileName.AppendDir( backupFolder );
335  backupPath = destFileName;
336 
337  if( !destFileName.DirExists() )
338  {
339  if( !destFileName.Mkdir() )
340  {
341  errorMsg.Printf( _( "Cannot create project remap back up folder \"%s\"." ),
342  destFileName.GetPath() );
343 
344  wxMessageDialog dlg( this, errorMsg, _( "Backup Error" ),
345  wxYES_NO | wxCENTRE | wxRESIZE_BORDER | wxICON_QUESTION );
346  dlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Continue with Rescue" ) ),
347  wxMessageDialog::ButtonLabel( _( "Abort Rescue" ) ) );
348 
349  if( dlg.ShowModal() == wxID_NO )
350  return false;
351  }
352  }
353 
354  // Time stamp to append to file name in case multiple remappings are performed.
355  wxString timeStamp = wxDateTime::Now().Format( "-%Y-%m-%d-%H-%M-%S" );
356 
357  // Back up symbol library table.
358  srcFileName.SetPath( Prj().GetProjectPath() );
359  srcFileName.SetName( SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
360  destFileName = srcFileName;
361  destFileName.AppendDir( backupFolder );
362  destFileName.SetName( destFileName.GetName() + timeStamp );
363 
364  tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
365  srcFileName.GetFullPath(), destFileName.GetFullPath() );
366  aReporter.Report( tmp, RPT_SEVERITY_INFO );
367 
368  if( wxFileName::Exists( srcFileName.GetFullPath() )
369  && !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
370  {
371  tmp.Printf( _( "Failed to back up file \"%s\".\n" ), srcFileName.GetFullPath() );
372  errorMsg += tmp;
373  }
374 
375  // Back up the schematic files.
376  for( SCH_SCREEN* screen = schematic.GetFirst(); screen; screen = schematic.GetNext() )
377  {
378  destFileName = screen->GetFileName();
379  destFileName.SetName( destFileName.GetName() + timeStamp );
380 
381  // Check for nest hierarchical schematic paths.
382  if( destFileName.GetPath() != backupPath.GetPath() )
383  {
384  destFileName.SetPath( backupPath.GetPath() );
385 
386  wxArrayString srcDirs = wxFileName( screen->GetFileName() ).GetDirs();
387  wxArrayString destDirs = wxFileName( Prj().GetProjectPath() ).GetDirs();
388 
389  for( size_t i = destDirs.GetCount(); i < srcDirs.GetCount(); i++ )
390  destFileName.AppendDir( srcDirs[i] );
391  }
392  else
393  {
394  destFileName.AppendDir( backupFolder );
395  }
396 
397  tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
398  screen->GetFileName(), destFileName.GetFullPath() );
399  aReporter.Report( tmp, RPT_SEVERITY_INFO );
400 
401  if( !destFileName.DirExists() && !destFileName.Mkdir( wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL ) )
402  {
403  tmp.Printf( _( "Failed to create backup folder \"%s\"\n" ), destFileName.GetPath() );
404  errorMsg += tmp;
405  continue;
406  }
407 
408  if( wxFileName::Exists( screen->GetFileName() )
409  && !wxCopyFile( screen->GetFileName(), destFileName.GetFullPath() ) )
410  {
411  tmp.Printf( _( "Failed to back up file \"%s\".\n" ), screen->GetFileName() );
412  errorMsg += tmp;
413  }
414  }
415 
416  // Back up the project file.
417  destFileName = Prj().GetProjectFullName();
418  destFileName.SetName( destFileName.GetName() + timeStamp );
419  destFileName.AppendDir( backupFolder );
420 
421  tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
422  Prj().GetProjectFullName(), destFileName.GetFullPath() );
423  aReporter.Report( tmp, RPT_SEVERITY_INFO );
424 
425  if( wxFileName::Exists( Prj().GetProjectFullName() )
426  && !wxCopyFile( Prj().GetProjectFullName(), destFileName.GetFullPath() ) )
427  {
428  tmp.Printf( _( "Failed to back up file \"%s\".\n" ), Prj().GetProjectFullName() );
429  errorMsg += tmp;
430  }
431 
432  // Back up the cache library.
433  srcFileName.SetPath( Prj().GetProjectPath() );
434  srcFileName.SetName( Prj().GetProjectName() + "-cache" );
435  srcFileName.SetExt( SchematicLibraryFileExtension );
436 
437  destFileName = srcFileName;
438  destFileName.SetName( destFileName.GetName() + timeStamp );
439  destFileName.AppendDir( backupFolder );
440 
441  tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
442  srcFileName.GetFullPath(), destFileName.GetFullPath() );
443  aReporter.Report( tmp, RPT_SEVERITY_INFO );
444 
445  if( srcFileName.Exists()
446  && !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
447  {
448  tmp.Printf( _( "Failed to back up file \"%s\".\n" ), srcFileName.GetFullPath() );
449  errorMsg += tmp;
450  }
451 
452  // Back up the rescue symbol library if it exists.
453  srcFileName.SetName( Prj().GetProjectName() + "-rescue" );
454  destFileName.SetName( srcFileName.GetName() + timeStamp );
455 
456  tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
457  srcFileName.GetFullPath(),
458  destFileName.GetFullPath() );
459  aReporter.Report( tmp, RPT_SEVERITY_INFO );
460 
461  if( srcFileName.Exists()
462  && !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
463  {
464  tmp.Printf( _( "Failed to back up file \"%s\".\n" ), srcFileName.GetFullPath() );
465  errorMsg += tmp;
466  }
467 
468  // Back up the rescue symbol library document file if it exists.
469  srcFileName.SetExt( "dcm" );
470  destFileName.SetExt( srcFileName.GetExt() );
471 
472  tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
473  srcFileName.GetFullPath(),
474  destFileName.GetFullPath() );
475  aReporter.Report( tmp, RPT_SEVERITY_INFO );
476 
477  if( srcFileName.Exists()
478  && !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
479  {
480  tmp.Printf( _( "Failed to back up file \"%s\".\n" ), srcFileName.GetFullPath() );
481  errorMsg += tmp;
482  }
483 
484  if( !errorMsg.IsEmpty() )
485  {
486  wxMessageDialog dlg( this, _( "Some of the project files could not be backed up." ),
487  _( "Backup Error" ),
488  wxYES_NO | wxCENTRE | wxRESIZE_BORDER | wxICON_QUESTION );
489  errorMsg.Trim();
490  dlg.SetExtendedMessage( errorMsg );
491  dlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Continue with Rescue" ) ),
492  wxMessageDialog::ButtonLabel( _( "Abort Rescue" ) ) );
493 
494  if( dlg.ShowModal() == wxID_NO )
495  return false;
496  }
497 
498  return true;
499 }
500 
501 
502 void DIALOG_SYMBOL_REMAP::OnUpdateUIRemapButton( wxUpdateUIEvent& aEvent )
503 {
504  aEvent.Enable( !m_remapped );
505 }
static const wxString & GetSymbolLibTableFileName()
static SYMBOL_LIB_TABLE & GetGlobalLibTable()
const UTF8 & GetLibItemName() const
Definition: lib_id.h:114
SCH_SCREEN * GetNext()
Definition: sch_screen.cpp:970
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_PLUGIN obje...
KIWAY & Kiway() const
Function Kiway returns a reference to the KIWAY that this object has an opportunity to participate in...
Definition: kiway_holder.h:56
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:103
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.
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:79
EE_TYPE OfType(KICAD_T aType)
Definition: sch_rtree.h:219
virtual REPORTER & ReportTail(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Function ReportTail Places the report at the end of the list, for objects that support report orderin...
Definition: reporter.h:92
Schematic editor (Eeschema) main window.
REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:62
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:51
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Function Report is a pure virtual function to override in the derived object.
Symbol library viewer main window.
This file contains miscellaneous commonly used macros and functions.
VTBL_ENTRY void SetElem(ELEM_T aIndex, _ELEM *aElem)
Definition: project.cpp:244
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
Class DIALOG_SYMBOL_REMAP_BASE.
static bool RescueProject(wxWindow *aParent, RESCUER &aRescuer, bool aRunningOnDemand)
const wxString & GetNickName() const
void SetLibId(const LIB_ID &aName, PART_LIBS *aLibs=NULL)
void OnRemapSymbols(wxCommandEvent &aEvent) override
void createProjectSymbolLibTable(REPORTER &aReporter)
#define NULL
VTBL_ENTRY KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=NULL)
Function Player returns the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:341
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
UNDO_REDO_CONTAINER m_UndoList
Objects list for the undo command (old data)
Definition: base_screen.h:132
void SyncView()
Mark all items for refresh.
const std::string SchematicLibraryFileExtension
PROJECT & Prj() const
Function Prj returns a reference to the PROJECT "associated with" this KIWAY.
REPORTER & Reporter()
returns the reporter object that reports to this panel
SCH_DRAW_PANEL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
SCH_SHEET_PATH & GetCurrentSheet()
void remapSymbolsToLibTable(REPORTER &aReporter)
Define a library symbol object.
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:97
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.
VTBL_ENTRY const wxString GetProjectFullName() const
Function GetProjectFullName returns the full path and name of the project.
Definition: project.cpp:96
WX_HTML_REPORT_PANEL * m_messagePanel
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)
see class PGM_BASE
void UpdateSymbolLinks(bool aForce=false)
Initialize or reinitialize the weak reference to the LIB_PART for each SCH_COMPONENT found in the ful...
#define _(s)
Definition: 3d_actions.cpp:33
EE_RTREE & Items()
Definition: sch_screen.h:127
wxString wx_str() const
Definition: utf8.cpp:51
SCH_COMPONENT describes a real schematic component.
Definition: sch_component.h:99
FILE_OUTPUTFORMATTER may be used for text file output.
Definition: richio.h:492
SCH_SCREEN * GetFirst()
Definition: sch_screen.cpp:959
GAL_TYPE GetBackend() const
Function GetBackend Returns 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...
virtual void ClearUndoORRedoList(UNDO_REDO_CONTAINER &aList, int aItemCount=-1) override
Free the undo or redo list from aList element.
Definition: sch_screen.cpp:627
Definition for part library class.
void SetModify()
Definition: base_screen.h:224
bool ReCreateListLib()
Creates or recreates a sorted list of currently loaded libraries.
const LIB_ID & GetLibId() const
void DisplayInfoMessage(wxWindow *aParent, const wxString &aMessage, const wxString &aExtraInfo)
Display an informational message box with aMessage.
Definition: confirm.cpp:267
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
wxString NormalizePath(const wxFileName &aFilePath, const ENV_VAR_MAP *aEnvVars, const wxString &aProjectPath)
Normalizes a file path to an environmental variable, if possible.
Definition: env_paths.cpp:68
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:491
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:108