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-2020 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_component.h>
39 #include <sch_screen.h>
40 #include <sch_edit_frame.h>
41 #include <schematic.h>
43 #include <symbol_lib_table.h>
44 #include <env_paths.h>
45 
46 #include <dialog_symbol_remap.h>
47 
48 
50  DIALOG_SYMBOL_REMAP_BASE( aParent ),
51  m_frame( aParent )
52 {
53  m_remapped = false;
54 
55  if( !wxFileName::IsDirWritable( Prj().GetProjectPath() ) )
56  {
57  DisplayInfoMessage( this, _( "Remapping is not possible because you do not have "
58  "write privileges to the project folder \"%s\"." ) );
59 
60  // Disable the remap button.
61  m_remapped = true;
62  }
63 
64  wxString text;
65 
66  text = _( "This schematic currently uses the project symbol library list look up method "
67  "for loading library symbols. KiCad will attempt to map the existing symbols "
68  "to use the new symbol library table. Remapping will change some project files "
69  "and schematics may not be compatible with older versions of KiCad. All files "
70  "that are changed will be backed up to the \"remap_backup\" folder in the project "
71  "folder should you need to revert any changes. If you choose to skip this step, "
72  "you will be responsible for manually remapping the symbols." );
73 
74  m_htmlCtrl->AppendToPage( text );
75 }
76 
77 
78 void DIALOG_SYMBOL_REMAP::OnRemapSymbols( wxCommandEvent& aEvent )
79 {
80  SCH_EDIT_FRAME* parent = dynamic_cast< SCH_EDIT_FRAME* >( GetParent() );
81 
82  wxCHECK_RET( parent != nullptr, "Parent window is not type SCH_EDIT_FRAME." );
83 
84  wxBusyCursor busy;
85 
87  return;
88 
89  // Ignore the never show rescue setting for one last rescue of legacy symbol
90  // libraries before remapping to the symbol library table. This ensures the
91  // best remapping results.
92  LEGACY_RESCUER rescuer( Prj(), &parent->Schematic(), &parent->GetCurrentSheet(),
93  parent->GetCanvas()->GetBackend() );
94 
95  if( RESCUER::RescueProject( this, rescuer, false ) )
96  {
97  LIB_VIEW_FRAME* viewer = (LIB_VIEW_FRAME*) parent->Kiway().Player( FRAME_SCH_VIEWER, false );
98 
99  if( viewer )
100  viewer->ReCreateListLib();
101 
102  parent->GetScreen()->ClearUndoORRedoList( parent->GetScreen()->m_UndoList, 1 );
103  parent->SyncView();
104  parent->GetCanvas()->Refresh();
105  parent->OnModify();
106  }
107 
108  // The schematic is fully loaded, any legacy library symbols have been rescued. Now
109  // check to see if the schematic has not been converted to the symbol library table
110  // method for looking up symbols.
111  wxFileName prjSymLibTableFileName( Prj().GetProjectPath(),
113 
114  // Delete the existing project symbol library table.
115  if( prjSymLibTableFileName.FileExists() )
116  {
117  wxRemoveFile( prjSymLibTableFileName.GetFullPath() );
118  }
119 
122  Prj().SchSymbolLibTable();
123 
125 
126  // Remove all of the libraries from the legacy library list.
127  wxString paths;
128  wxArrayString libNames;
129 
130  PART_LIBS::LibNamesAndPaths( &Prj(), true, &paths, &libNames );
131 
132  // Reload the the cache symbol library.
134  Prj().SchLibs();
135 
136  Raise();
137  m_remapped = true;
138 }
139 
140 
141 size_t DIALOG_SYMBOL_REMAP::getLibsNotInGlobalSymbolLibTable( std::vector< PART_LIB* >& aLibs )
142 {
143  PART_LIBS* libs = Prj().SchLibs();
144 
145  for( PART_LIBS_BASE::iterator it = libs->begin(); it != libs->end(); ++it )
146  {
147  // Ignore the cache library.
148  if( it->IsCache() )
149  continue;
150 
151  // Check for the obvious library name.
152  wxString libFileName = it->GetFullFileName();
153 
154  if( !SYMBOL_LIB_TABLE::GetGlobalLibTable().FindRowByURI( libFileName ) )
155  aLibs.push_back( &(*it) );
156  }
157 
158  return aLibs.size();
159 }
160 
161 
163 {
164  wxString msg;
165  std::vector< PART_LIB* > libs;
166 
168  {
169  SYMBOL_LIB_TABLE prjLibTable;
170  std::vector< wxString > libNames = SYMBOL_LIB_TABLE::GetGlobalLibTable().GetLogicalLibs();
171 
172  for( auto lib : libs )
173  {
174  wxString libName = lib->GetName();
175  int libNameInc = 1;
176  int libNameLen = libName.Length();
177 
178  // Spaces in the file name will break the symbol name because they are not
179  // quoted in the symbol library file format.
180  libName.Replace( " ", "-" );
181 
182  // Don't create duplicate table entries.
183  while( std::find( libNames.begin(), libNames.end(), libName ) != libNames.end() )
184  {
185  libName = libName.Left( libNameLen );
186  libName << libNameInc;
187  libNameInc++;
188  }
189 
190  wxString pluginType = SCH_IO_MGR::ShowType( SCH_IO_MGR::SCH_LEGACY );
191  wxFileName fn = lib->GetFullFileName();
192 
193  // Use environment variable substitution where possible. This is based solely
194  // on the internal user environment variable list. Checking against all of the
195  // system wide environment variables is probably not a good idea.
196  wxString fullFileName = NormalizePath( fn, &Pgm().GetLocalEnvVariables(), &Prj() );
197 
198  // Fall back to the absolute library path.
199  if( fullFileName.IsEmpty() )
200  fullFileName = lib->GetFullFileName();
201 
202  wxFileName tmpFn = fullFileName;
203 
204  // Don't add symbol libraries that do not exist.
205  if( tmpFn.Normalize() && tmpFn.FileExists() )
206  {
207  msg.Printf( _( "Adding library \"%s\", file \"%s\" to project symbol library table." ),
208  libName, 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" ), RPT_SEVERITY_INFO );
239  }
240  }
241 }
242 
243 
245 {
246  wxString msg;
247  SCH_SCREENS schematic( m_frame->Schematic().Root() );
248  SCH_COMPONENT* symbol;
249  SCH_SCREEN* screen;
250 
251  for( screen = schematic.GetFirst(); screen; screen = schematic.GetNext() )
252  {
253  for( auto item : screen->Items().OfType( SCH_COMPONENT_T ) )
254  {
255  symbol = dynamic_cast<SCH_COMPONENT*>( item );
256 
257  if( !remapSymbolToLibTable( symbol ) )
258  {
259  msg.Printf( _( "No symbol \"%s\" found in symbol library table." ),
260  symbol->GetLibId().GetLibItemName().wx_str() );
261  aReporter.Report( msg, RPT_SEVERITY_WARNING );
262  }
263  else
264  {
265  msg.Printf( _( "Symbol \"%s\" mapped to symbol library \"%s\"." ),
266  symbol->GetLibId().GetLibItemName().wx_str(),
267  symbol->GetLibId().GetLibNickname().wx_str() );
268  aReporter.Report( msg, RPT_SEVERITY_ACTION );
269  screen->SetModify();
270  }
271  }
272  }
273 
274  aReporter.Report( _( "Symbol library table mapping complete!" ), RPT_SEVERITY_INFO );
275  schematic.UpdateSymbolLinks();
276 }
277 
278 
280 {
281  wxCHECK_MSG( aSymbol != NULL, false, "Null pointer passed to remapSymbolToLibTable." );
282  wxCHECK_MSG( aSymbol->GetLibId().GetLibNickname().empty(), false,
283  "Cannot remap symbol that is already mapped." );
284  wxCHECK_MSG( !aSymbol->GetLibId().GetLibItemName().empty(), false,
285  "The symbol LIB_ID name is empty." );
286 
287  PART_LIBS* libs = Prj().SchLibs();
288 
289  for( PART_LIBS_BASE::iterator it = libs->begin(); it != libs->end(); ++it )
290  {
291  // Ignore the cache library.
292  if( it->IsCache() )
293  continue;
294 
295  LIB_PART* alias = it->FindPart( aSymbol->GetLibId().GetLibItemName().wx_str() );
296 
297  // Found in the same library as the old look up method assuming the user didn't
298  // change the libraries or library ordering since the last time the schematic was
299  // loaded.
300  if( alias )
301  {
302  // Find the same library in the symbol library table using the full path and file name.
303  wxString libFileName = it->GetFullFileName();
304 
305  const LIB_TABLE_ROW* row = Prj().SchSymbolLibTable()->FindRowByURI( libFileName );
306 
307  if( row )
308  {
309  LIB_ID id = aSymbol->GetLibId();
310 
311  id.SetLibNickname( row->GetNickName() );
312 
313  // Don't resolve symbol library links now.
314  aSymbol->SetLibId( id );
315  return true;
316  }
317  }
318  }
319 
320  return false;
321 }
322 
323 
325 {
326  static wxString backupFolder = "rescue-backup";
327 
328  wxString tmp;
329  wxString errorMsg;
330  wxFileName srcFileName;
331  wxFileName destFileName;
332  wxFileName backupPath;
333  SCH_SCREENS schematic( m_frame->Schematic().Root() );
334 
335  // Copy backup files to different folder so as not to pollute the project folder.
336  destFileName.SetPath( Prj().GetProjectPath() );
337  destFileName.AppendDir( backupFolder );
338  backupPath = destFileName;
339 
340  if( !destFileName.DirExists() )
341  {
342  if( !destFileName.Mkdir() )
343  {
344  errorMsg.Printf( _( "Cannot create project remap back up folder \"%s\"." ),
345  destFileName.GetPath() );
346 
347  wxMessageDialog dlg( this, errorMsg, _( "Backup Error" ),
348  wxYES_NO | wxCENTRE | wxRESIZE_BORDER | wxICON_QUESTION );
349  dlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Continue with Rescue" ) ),
350  wxMessageDialog::ButtonLabel( _( "Abort Rescue" ) ) );
351 
352  if( dlg.ShowModal() == wxID_NO )
353  return false;
354  }
355  }
356 
357  // Time stamp to append to file name in case multiple remappings are performed.
358  wxString timeStamp = wxDateTime::Now().Format( "-%Y-%m-%d-%H-%M-%S" );
359 
360  // Back up symbol library table.
361  srcFileName.SetPath( Prj().GetProjectPath() );
362  srcFileName.SetName( SYMBOL_LIB_TABLE::GetSymbolLibTableFileName() );
363  destFileName = srcFileName;
364  destFileName.AppendDir( backupFolder );
365  destFileName.SetName( destFileName.GetName() + timeStamp );
366 
367  tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
368  srcFileName.GetFullPath(), destFileName.GetFullPath() );
369  aReporter.Report( tmp, RPT_SEVERITY_INFO );
370 
371  if( wxFileName::Exists( srcFileName.GetFullPath() )
372  && !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
373  {
374  tmp.Printf( _( "Failed to back up file \"%s\".\n" ), srcFileName.GetFullPath() );
375  errorMsg += tmp;
376  }
377 
378  // Back up the schematic files.
379  for( SCH_SCREEN* screen = schematic.GetFirst(); screen; screen = schematic.GetNext() )
380  {
381  destFileName = screen->GetFileName();
382  destFileName.SetName( destFileName.GetName() + timeStamp );
383 
384  // Check for nest hierarchical schematic paths.
385  if( destFileName.GetPath() != backupPath.GetPath() )
386  {
387  destFileName.SetPath( backupPath.GetPath() );
388 
389  wxArrayString srcDirs = wxFileName( screen->GetFileName() ).GetDirs();
390  wxArrayString destDirs = wxFileName( Prj().GetProjectPath() ).GetDirs();
391 
392  for( size_t i = destDirs.GetCount(); i < srcDirs.GetCount(); i++ )
393  destFileName.AppendDir( srcDirs[i] );
394  }
395  else
396  {
397  destFileName.AppendDir( backupFolder );
398  }
399 
400  tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
401  screen->GetFileName(), destFileName.GetFullPath() );
402  aReporter.Report( tmp, RPT_SEVERITY_INFO );
403 
404  if( !destFileName.DirExists() && !destFileName.Mkdir( wxS_DIR_DEFAULT, wxPATH_MKDIR_FULL ) )
405  {
406  tmp.Printf( _( "Failed to create backup folder \"%s\"\n" ), destFileName.GetPath() );
407  errorMsg += tmp;
408  continue;
409  }
410 
411  if( wxFileName::Exists( screen->GetFileName() )
412  && !wxCopyFile( screen->GetFileName(), destFileName.GetFullPath() ) )
413  {
414  tmp.Printf( _( "Failed to back up file \"%s\".\n" ), screen->GetFileName() );
415  errorMsg += tmp;
416  }
417  }
418 
419  // Back up the project file.
420  destFileName = Prj().GetProjectFullName();
421  destFileName.SetName( destFileName.GetName() + timeStamp );
422  destFileName.AppendDir( backupFolder );
423 
424  tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
425  Prj().GetProjectFullName(), destFileName.GetFullPath() );
426  aReporter.Report( tmp, RPT_SEVERITY_INFO );
427 
428  if( wxFileName::Exists( Prj().GetProjectFullName() )
429  && !wxCopyFile( Prj().GetProjectFullName(), destFileName.GetFullPath() ) )
430  {
431  tmp.Printf( _( "Failed to back up file \"%s\".\n" ), Prj().GetProjectFullName() );
432  errorMsg += tmp;
433  }
434 
435  // Back up the cache library.
436  srcFileName.SetPath( Prj().GetProjectPath() );
437  srcFileName.SetName( Prj().GetProjectName() + "-cache" );
438  srcFileName.SetExt( LegacySymbolLibFileExtension );
439 
440  destFileName = srcFileName;
441  destFileName.SetName( destFileName.GetName() + timeStamp );
442  destFileName.AppendDir( backupFolder );
443 
444  tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
445  srcFileName.GetFullPath(), destFileName.GetFullPath() );
446  aReporter.Report( tmp, RPT_SEVERITY_INFO );
447 
448  if( srcFileName.Exists()
449  && !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
450  {
451  tmp.Printf( _( "Failed to back up file \"%s\".\n" ), srcFileName.GetFullPath() );
452  errorMsg += tmp;
453  }
454 
455  // Back up the rescue symbol library if it exists.
456  srcFileName.SetName( Prj().GetProjectName() + "-rescue" );
457  destFileName.SetName( srcFileName.GetName() + timeStamp );
458 
459  tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
460  srcFileName.GetFullPath(),
461  destFileName.GetFullPath() );
462  aReporter.Report( tmp, RPT_SEVERITY_INFO );
463 
464  if( srcFileName.Exists()
465  && !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
466  {
467  tmp.Printf( _( "Failed to back up file \"%s\".\n" ), srcFileName.GetFullPath() );
468  errorMsg += tmp;
469  }
470 
471  // Back up the rescue symbol library document file if it exists.
472  srcFileName.SetExt( "dcm" );
473  destFileName.SetExt( srcFileName.GetExt() );
474 
475  tmp.Printf( _( "Backing up file \"%s\" to file \"%s\"." ),
476  srcFileName.GetFullPath(),
477  destFileName.GetFullPath() );
478  aReporter.Report( tmp, RPT_SEVERITY_INFO );
479 
480  if( srcFileName.Exists()
481  && !wxCopyFile( srcFileName.GetFullPath(), destFileName.GetFullPath() ) )
482  {
483  tmp.Printf( _( "Failed to back up file \"%s\".\n" ), srcFileName.GetFullPath() );
484  errorMsg += tmp;
485  }
486 
487  if( !errorMsg.IsEmpty() )
488  {
489  wxMessageDialog dlg( this, _( "Some of the project files could not be backed up." ),
490  _( "Backup Error" ),
491  wxYES_NO | wxCENTRE | wxRESIZE_BORDER | wxICON_QUESTION );
492  errorMsg.Trim();
493  dlg.SetExtendedMessage( errorMsg );
494  dlg.SetYesNoLabels( wxMessageDialog::ButtonLabel( _( "Continue with Rescue" ) ),
495  wxMessageDialog::ButtonLabel( _( "Abort Rescue" ) ) );
496 
497  if( dlg.ShowModal() == wxID_NO )
498  return false;
499  }
500 
501  return true;
502 }
503 
504 
505 void DIALOG_SYMBOL_REMAP::OnUpdateUIRemapButton( wxUpdateUIEvent& aEvent )
506 {
507  aEvent.Enable( !m_remapped );
508 }
static const wxString & GetSymbolLibTableFileName()
static SYMBOL_LIB_TABLE & GetGlobalLibTable()
const UTF8 & GetLibItemName() const
Definition: lib_id.h:114
Hold a record identifying a symbol library accessed by the appropriate symbol library SCH_PLUGIN obje...
void SetLibId(const LIB_ID &aName)
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:104
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:81
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:94
Schematic editor (Eeschema) main window.
REPORTER is 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
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:252
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 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:342
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:82
void SyncView()
Mark all items for refresh.
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.
void remapSymbolsToLibTable(REPORTER &aReporter)
SCHEMATIC & Schematic() const
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:116
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)
SCH_SHEET & Root() const
Definition: schematic.h:97
see class PGM_BASE
#define _(s)
Definition: 3d_actions.cpp:33
EE_RTREE & Items()
Definition: sch_screen.h:158
wxString wx_str() const
Definition: utf8.cpp:51
Schematic symbol object.
Definition: sch_component.h:88
FILE_OUTPUTFORMATTER may be used for text file output.
Definition: richio.h:492
SCH_SHEET_PATH & GetCurrentSheet() const
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:804
Definition for part library class.
void SetModify()
Definition: base_screen.h:183
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:546
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