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