KiCad PCB EDA Suite
Loading...
Searching...
No Matches
eeschema.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2004 Jean-Pierre Charras, [email protected]
5 * Copyright (C) 2008 Wayne Stambaugh <[email protected]>
6 * Copyright (C) 2004-2023 KiCad Developers, see change_log.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#include <pgm_base.h>
27#include <kiface_base.h>
28#include <confirm.h>
29#include <gestfich.h>
30#include <eda_dde.h>
32#include "eeschema_helpers.h"
33#include <eeschema_settings.h>
34#include <sch_edit_frame.h>
35#include <symbol_edit_frame.h>
36#include <symbol_viewer_frame.h>
37#include <transform.h>
38#include <symbol_lib_table.h>
41#include <kiway.h>
44#include <sexpr/sexpr.h>
45#include <sexpr/sexpr_parser.h>
46#include <kiface_ids.h>
48#include <wx/ffile.h>
50
51#include <schematic.h>
52#include <connection_graph.h>
62#include <sim/simulator_frame.h>
63
64#include <wx/crt.h>
65
66// The main sheet of the project
68
69
70namespace SCH {
71
72
73static std::unique_ptr<SCHEMATIC> readSchematicFromFile( const std::string& aFilename )
74{
75 auto pi = SCH_IO_MGR::FindPlugin( SCH_IO_MGR::SCH_KICAD );
76 std::unique_ptr<SCHEMATIC> schematic = std::make_unique<SCHEMATIC>( nullptr );
77
78 auto &manager = Pgm().GetSettingsManager();
79
80 manager.LoadProject( "" );
81 schematic->Reset();
82 schematic->SetProject( &manager.Prj() );
83 schematic->SetRoot( pi->Load( aFilename, schematic.get() ) );
84 schematic->CurrentSheet().push_back( &schematic->Root() );
85
86 SCH_SCREENS screens( schematic->Root() );
87
88 for( SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
89 screen->UpdateLocalLibSymbolLinks();
90
91 SCH_SHEET_LIST sheets = schematic->GetSheets();
92
93 // Restore all of the loaded symbol instances from the root sheet screen.
94 sheets.UpdateSymbolInstanceData( schematic->RootScreen()->GetSymbolInstances() );
95
96 if( schematic->RootScreen()->GetFileFormatVersionAtLoad() < 20230221 )
97 for( SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
98 screen->FixLegacyPowerSymbolMismatches();
99
100 for( SCH_SCREEN* screen = screens.GetFirst(); screen; screen = screens.GetNext() )
101 screen->MigrateSimModels();
102
103 sheets.AnnotatePowerSymbols();
104
105 // NOTE: This is required for multi-unit symbols to be correct
106 for( SCH_SHEET_PATH& sheet : sheets )
107 sheet.UpdateAllScreenReferences();
108
109 // NOTE: SchematicCleanUp is not called; QA schematics must already be clean or else
110 // SchematicCleanUp must be freed from its UI dependencies.
111
112 schematic->ConnectionGraph()->Recalculate( sheets, true );
113
114 return schematic;
115}
116
117
118bool generateSchematicNetlist( const wxString& aFilename, wxString& aNetlist )
119{
120 std::unique_ptr<SCHEMATIC> schematic = readSchematicFromFile( aFilename.ToStdString() );
121 NETLIST_EXPORTER_KICAD exporter( schematic.get() );
122 STRING_FORMATTER formatter;
123
124 exporter.Format( &formatter, GNL_ALL | GNL_OPT_KICAD );
125 aNetlist = formatter.GetString();
126
127 return true;
128}
129
130
131static struct IFACE : public KIFACE_BASE, public UNITS_PROVIDER
132{
133 // Of course all are virtual overloads, implementations of the KIFACE.
134
135 IFACE( const char* aName, KIWAY::FACE_T aType ) :
136 KIFACE_BASE( aName, aType ),
138 {}
139
140 bool OnKifaceStart( PGM_BASE* aProgram, int aCtlBits ) override;
141
142 void Reset() override;
143
144 void OnKifaceEnd() override;
145
146 wxWindow* CreateKiWindow( wxWindow* aParent, int aClassId, KIWAY* aKiway,
147 int aCtlBits = 0 ) override
148 {
149 switch( aClassId )
150 {
151 case FRAME_SCH:
152 {
153 SCH_EDIT_FRAME* frame = new SCH_EDIT_FRAME( aKiway, aParent );
154
156
157 if( Kiface().IsSingle() )
159 // only run this under single_top, not under a project manager.
162
163 return frame;
164 }
165
167 {
168 SYMBOL_EDIT_FRAME* frame = new SYMBOL_EDIT_FRAME( aKiway, aParent );
169 return frame;
170 }
171
172 case FRAME_SIMULATOR:
173 {
174 SIMULATOR_FRAME* frame = new SIMULATOR_FRAME( aKiway, aParent );
175 return frame;
176 }
177
178 case FRAME_SCH_VIEWER:
180 {
181 SYMBOL_VIEWER_FRAME* frame = new SYMBOL_VIEWER_FRAME( aKiway, aParent,
182 FRAME_T( aClassId ) );
183 return frame;
184 }
185
187 InvokeSchEditSymbolLibTable( aKiway, aParent );
188 // Dialog has completed; nothing to return.
189 return nullptr;
190
192 {
193 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
195
196 return new PANEL_SYM_DISPLAY_OPTIONS( aParent, cfg );
197 }
198
200 {
201 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_SCH_SYMBOL_EDITOR, false );
202
203 if( !frame )
204 frame = aKiway->Player( FRAME_SCH_VIEWER, false );
205
206 if( !frame )
207 frame = aKiway->Player( FRAME_SCH, false );
208
209 if( frame )
210 SetUserUnits( frame->GetUserUnits() );
211
212 return new PANEL_SYM_EDITING_OPTIONS( aParent, this, frame );
213 }
214
215 case PANEL_SYM_COLORS:
216 return new PANEL_SYM_COLOR_SETTINGS( aParent );
217
219 {
220 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
222
223 return new PANEL_EESCHEMA_DISPLAY_OPTIONS( aParent, cfg );
224 }
225
227 {
228 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_SCH, false );
229
230 if( !frame )
231 frame = aKiway->Player( FRAME_SCH_SYMBOL_EDITOR, false );
232
233 if( !frame )
234 frame = aKiway->Player( FRAME_SCH_VIEWER, false );
235
236 if( frame )
237 SetUserUnits( frame->GetUserUnits() );
238
239 return new PANEL_EESCHEMA_EDITING_OPTIONS( aParent, this, frame );
240 }
241
243 {
244 EDA_BASE_FRAME* schSettingsProvider = aKiway->Player( FRAME_SCH, false );
245
246 return new PANEL_EESCHEMA_ANNOTATION_OPTIONS( aParent, schSettingsProvider );
247 }
248
249 case PANEL_SCH_COLORS:
250 return new PANEL_EESCHEMA_COLOR_SETTINGS( aParent );
251
253 return new PANEL_TEMPLATE_FIELDNAMES( aParent, nullptr );
254
255 default:
256 return nullptr;
257 }
258 }
259
270 void* IfaceOrAddress( int aDataId ) override
271 {
272 switch( aDataId )
273 {
275 return (void*) generateSchematicNetlist;
276 }
277
278 return nullptr;
279 }
280
286 void SaveFileAs( const wxString& aProjectBasePath, const wxString& aProjectName,
287 const wxString& aNewProjectBasePath, const wxString& aNewProjectName,
288 const wxString& aSrcFilePath, wxString& aErrors ) override;
289
290
291 int HandleJob( JOB* aJob ) override;
292
293private:
294 bool loadGlobalLibTable();
295
296 std::unique_ptr<EESCHEMA_JOBS_HANDLER> m_jobHandler;
297
298} kiface( "eeschema", KIWAY::FACE_SCH );
299
300} // namespace
301
302using namespace SCH;
303
305
306
308
309
310// KIFACE_GETTER's actual spelling is a substitution macro found in kiway.h.
311// KIFACE_GETTER will not have name mangling due to declaration in kiway.h.
312MY_API( KIFACE* ) KIFACE_GETTER( int* aKIFACEversion, int aKiwayVersion, PGM_BASE* aProgram )
313{
315 return &kiface;
316}
317
318
320{
321 wxASSERT( process ); // KIFACE_GETTER has already been called.
322 return *process;
323}
324
325// Similar to PGM_BASE& Pgm(), but return nullptr when a *.ki_face is run from
326// a python script or something else.
328{
329 return process;
330}
331
332
334{
335 // This is process-level-initialization, not project-level-initialization of the DSO.
336 // Do nothing in here pertinent to a project!
339
340 // Register the symbol editor settings as well because they share a KiFACE and need to be
341 // loaded prior to use to avoid threading deadlocks
344
345 start_common( aCtlBits );
346
347 if( !loadGlobalLibTable() )
348 return false;
349
350 m_jobHandler = std::make_unique<EESCHEMA_JOBS_HANDLER>();
351
352 return true;
353}
354
355
357{
359}
360
361
363{
365
366 if( !fn.FileExists() )
367 {
368 if( !( m_start_flags & KFCTL_CLI ) )
369 {
370 DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG symDialog( nullptr );
371
372 if( symDialog.ShowModal() != wxID_OK )
373 return false;
374 }
375 }
376 else
377 {
378 try
379 {
380 // The global table is not related to a specific project. All projects
381 // will use the same global table. So the KIFACE::OnKifaceStart() contract
382 // of avoiding anything project specific is not violated here.
384 return false;
385 }
386 catch( const IO_ERROR& ioe )
387 {
388 // if we are here, a incorrect global symbol library table was found.
389 // Incorrect global symbol library table is not a fatal error:
390 // the user just has to edit the (partially) loaded table.
391 wxString msg =
392 _( "An error occurred attempting to load the global symbol library table.\n"
393 "Please edit this global symbol library table in Preferences menu." );
394
395 DisplayErrorMessage( nullptr, msg, ioe.What() );
396 }
397 }
398
399 return true;
400}
401
402
404{
405 end_common();
406}
407
408
409static void traverseSEXPR( SEXPR::SEXPR* aNode,
410 const std::function<void( SEXPR::SEXPR* )>& aVisitor )
411{
412 aVisitor( aNode );
413
414 if( aNode->IsList() )
415 {
416 for( unsigned i = 0; i < aNode->GetNumberOfChildren(); i++ )
417 traverseSEXPR( aNode->GetChild( i ), aVisitor );
418 }
419}
420
421
422void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProjectName,
423 const wxString& aNewProjectBasePath, const wxString& aNewProjectName,
424 const wxString& aSrcFilePath, wxString& aErrors )
425{
426 wxFileName destFile( aSrcFilePath );
427 wxString destPath = destFile.GetPathWithSep();
428 wxUniChar pathSep = wxFileName::GetPathSeparator();
429 wxString ext = destFile.GetExt();
430
431 if( destPath.StartsWith( aProjectBasePath + pathSep ) )
432 destPath.Replace( aProjectBasePath, aNewProjectBasePath, false );
433
434 destFile.SetPath( destPath );
435
436 if( ext == LegacySchematicFileExtension ||
440 {
441 if( destFile.GetName() == aProjectName )
442 {
443 destFile.SetName( aNewProjectName );
444 }
445 else if( destFile.GetName() == aNewProjectName )
446 {
447 wxString msg;
448
449 if( !aErrors.empty() )
450 aErrors += wxS( "\n" );
451
452 msg.Printf( _( "Cannot copy file '%s' as it will be overwritten by the new root "
453 "sheet file." ), destFile.GetFullPath() );
454 aErrors += msg;
455 return;
456 }
457
458 // Sheet paths when auto-generated are relative to the root, so those will stay
459 // pointing to whatever they were pointing at.
460 // The author can create their own absolute and relative sheet paths. Absolute
461 // sheet paths aren't an issue, and relative ones will continue to work as long
462 // as the author didn't include any '..'s. If they did, it's still not clear
463 // whether they should be adjusted or not (as the author may be duplicating an
464 // entire tree with several projects within it), so we leave this as an exercise
465 // to the author.
466
467 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
468 }
469 else if( ext == SchematicSymbolFileExtension )
470 {
471 // Symbols are not project-specific. Keep their source names.
472 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
473 }
476 {
477 if( destFile.GetName() == aProjectName + wxS( "-cache" ) )
478 destFile.SetName( aNewProjectName + wxS( "-cache" ) );
479
480 if( destFile.GetName() == aProjectName + wxS( "-rescue" ) )
481 destFile.SetName( aNewProjectName + wxS( "-rescue" ) );
482
483 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
484 }
485 else if( ext == NetlistFileExtension )
486 {
487 bool success = false;
488
489 if( destFile.GetName() == aProjectName )
490 destFile.SetName( aNewProjectName );
491
492 try
493 {
494 SEXPR::PARSER parser;
495 std::unique_ptr<SEXPR::SEXPR> sexpr( parser.ParseFromFile( TO_UTF8( aSrcFilePath ) ) );
496
497 traverseSEXPR( sexpr.get(), [&]( SEXPR::SEXPR* node )
498 {
499 if( node->IsList() && node->GetNumberOfChildren() > 1
500 && node->GetChild( 0 )->IsSymbol()
501 && node->GetChild( 0 )->GetSymbol() == "source" )
502 {
503 auto pathNode = dynamic_cast<SEXPR::SEXPR_STRING*>( node->GetChild( 1 ) );
504 auto symNode = dynamic_cast<SEXPR::SEXPR_SYMBOL*>( node->GetChild( 1 ) );
505 wxString path;
506
507 if( pathNode )
508 path = pathNode->m_value;
509 else if( symNode )
510 path = symNode->m_value;
511
512 if( path == aProjectName + wxS( ".sch" ) )
513 path = aNewProjectName + wxS( ".sch" );
514 else if( path == aProjectBasePath + "/" + aProjectName + wxS( ".sch" ) )
515 path = aNewProjectBasePath + "/" + aNewProjectName + wxS( ".sch" );
516 else if( path.StartsWith( aProjectBasePath ) )
517 path.Replace( aProjectBasePath, aNewProjectBasePath, false );
518
519 if( pathNode )
520 pathNode->m_value = path;
521 else if( symNode )
522 symNode->m_value = path;
523 }
524 } );
525
526 wxFFile destNetList( destFile.GetFullPath(), "wb" );
527
528 if( destNetList.IsOpened() )
529 success = destNetList.Write( sexpr->AsString( 0 ) );
530
531 // wxFFile dtor will close the file
532 }
533 catch( ... )
534 {
535 success = false;
536 }
537
538 if( !success )
539 {
540 wxString msg;
541
542 if( !aErrors.empty() )
543 aErrors += wxS( "\n" );
544
545 msg.Printf( _( "Cannot copy file '%s'." ), destFile.GetFullPath() );
546 aErrors += msg;
547 }
548 }
549 else if( destFile.GetName() == wxS( "sym-lib-table" ) )
550 {
551 SYMBOL_LIB_TABLE symbolLibTable;
552 symbolLibTable.Load( aSrcFilePath );
553
554 for( unsigned i = 0; i < symbolLibTable.GetCount(); i++ )
555 {
556 LIB_TABLE_ROW& row = symbolLibTable.At( i );
557 wxString uri = row.GetFullURI();
558
559 uri.Replace( wxS( "/" ) + aProjectName + wxS( "-cache.lib" ),
560 wxS( "/" ) + aNewProjectName + wxS( "-cache.lib" ) );
561 uri.Replace( wxS( "/" ) + aProjectName + wxS( "-rescue.lib" ),
562 wxS( "/" ) + aNewProjectName + wxS( "-rescue.lib" ) );
563 uri.Replace( wxS( "/" ) + aProjectName + wxS( ".lib" ),
564 wxS( "/" ) + aNewProjectName + wxS( ".lib" ) );
565
566 row.SetFullURI( uri );
567 }
568
569 try
570 {
571 symbolLibTable.Save( destFile.GetFullPath() );
572 }
573 catch( ... )
574 {
575 wxString msg;
576
577 if( !aErrors.empty() )
578 aErrors += "\n";
579
580 msg.Printf( _( "Cannot copy file '%s'." ), destFile.GetFullPath() );
581 aErrors += msg;
582 }
583 }
584 else
585 {
586 wxFAIL_MSG( wxS( "Unexpected filetype for Eeschema::SaveFileAs()" ) );
587 }
588}
589
591{
592 return m_jobHandler->RunJob( aJob );
593}
constexpr EDA_IU_SCALE schIUScale
Definition: base_units.h:111
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:110
The base frame for deriving all KiCad main window classes.
static void SetSchEditFrame(SCH_EDIT_FRAME *aSchEditFrame)
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:76
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:30
An simple container class that lets us dispatch output jobs to kifaces.
Definition: job.h:28
A KIFACE implementation.
Definition: kiface_base.h:39
void InitSettings(APP_SETTINGS_BASE *aSettings)
Definition: kiface_base.h:97
void end_common()
Common things to do for a top program module, during OnKifaceEnd();.
Definition: kiface_base.cpp:42
APP_SETTINGS_BASE * KifaceSettings() const
Definition: kiface_base.h:95
bool start_common(int aCtlBits)
Common things to do for a top program module, during OnKifaceStart().
Definition: kiface_base.cpp:32
int m_start_flags
flags provided in OnKifaceStart()
Definition: kiface_base.h:125
bool IsSingle() const
Is this KIFACE running under single_top?
Definition: kiface_base.h:107
void CreateServer(int service, bool local=true)
Definition: eda_dde.cpp:43
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:279
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:432
FACE_T
Known KIFACE implementations.
Definition: kiway.h:285
@ FACE_SCH
eeschema DSO
Definition: kiway.h:286
Hold a record identifying a library accessed by the appropriate plug in object in the LIB_TABLE.
void SetFullURI(const wxString &aFullURI)
Change the full URI for the library.
const wxString GetFullURI(bool aSubstituted=false) const
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
LIB_TABLE_ROW & At(unsigned aIndex)
Get the 'n'th LIB_TABLE_ROW object.
void Load(const wxString &aFileName)
Load the library table using the path defined by aFileName aFallBackTable.
unsigned GetCount() const
Get the number of rows contained in the table.
void Save(const wxString &aFileName) const
Write this library table to aFileName in s-expression form.
Generate the KiCad netlist format supported by Pcbnew.
void Format(OUTPUTFORMATTER *aOutputFormatter, int aCtl)
Output this s-expression netlist into aOutputFormatter.
Container for data for KiCad programs.
Definition: pgm_base.h:96
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition: pgm_base.h:136
Schematic editor (Eeschema) main window.
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
Definition: sch_screen.h:662
SCH_SCREEN * GetNext()
SCH_SCREEN * GetFirst()
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void AnnotatePowerSymbols()
Silently annotate the not yet annotated power symbols of the entire hierarchy of the sheet path list.
void UpdateSymbolInstanceData(const std::vector< SCH_SYMBOL_INSTANCE > &aSymbolInstances)
Update all of the symbol instance information using aSymbolInstances.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:57
T * GetAppSettings()
Returns a handle to the a given settings by type If the settings have already been loaded,...
T * RegisterSettings(T *aSettings, bool aLoadNow=true)
Takes ownership of the pointer passed in.
std::unique_ptr< SEXPR > ParseFromFile(const std::string &aFilename)
size_t GetNumberOfChildren() const
Definition: sexpr.cpp:70
bool IsList() const
Definition: sexpr.h:49
SEXPR * GetChild(size_t aIndex) const
Definition: sexpr.cpp:48
The SIMULATOR_FRAME holds the main user-interface for running simulations.
Implement an OUTPUTFORMATTER to a memory buffer.
Definition: richio.h:427
const std::string & GetString()
Definition: richio.h:450
The symbol library editor main window.
static SYMBOL_LIB_TABLE & GetGlobalLibTable()
static wxString GetGlobalTableFileName()
Fetch the global symbol library table file name.
static bool LoadGlobalTable(SYMBOL_LIB_TABLE &aTable)
Load the global symbol library table into aTable.
Symbol library viewer main window.
EDA_UNITS GetUserUnits() const
void SetUserUnits(EDA_UNITS aUnits)
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:308
This file is part of the common library.
return & kiface
Definition: cvpcb.cpp:112
int PGM_BASE * aProgram
Definition: cvpcb.cpp:110
#define _(s)
DDE server & client.
#define KICAD_SCH_PORT_SERVICE_NUMBER
Scripting window listens for commands for other apps.
Definition: eda_dde.h:43
EDA_UNITS
Definition: eda_units.h:43
return & kiface
Definition: eeschema.cpp:315
int aKiwayVersion
Definition: eeschema.cpp:312
static PGM_BASE * process
Definition: eeschema.cpp:304
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:67
int PGM_BASE * aProgram
Definition: eeschema.cpp:313
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: eeschema.cpp:319
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
Definition: eeschema.cpp:307
static void traverseSEXPR(SEXPR::SEXPR *aNode, const std::function< void(SEXPR::SEXPR *)> &aVisitor)
Definition: eeschema.cpp:409
PGM_BASE * PgmOrNull()
similar to PGM_BASE& Pgm(), but return a reference that can be nullptr when running a shared lib from...
Definition: eeschema.cpp:327
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition: frame_type.h:33
@ FRAME_SCH_SYMBOL_EDITOR
Definition: frame_type.h:35
@ PANEL_SCH_FIELD_NAME_TEMPLATES
Definition: frame_type.h:76
@ FRAME_SCH_VIEWER
Definition: frame_type.h:36
@ PANEL_SCH_DISP_OPTIONS
Definition: frame_type.h:72
@ FRAME_SCH
Definition: frame_type.h:34
@ FRAME_SCH_VIEWER_MODAL
Definition: frame_type.h:37
@ FRAME_SIMULATOR
Definition: frame_type.h:38
@ PANEL_SYM_EDIT_OPTIONS
Definition: frame_type.h:69
@ PANEL_SCH_EDIT_OPTIONS
Definition: frame_type.h:73
@ PANEL_SYM_DISP_OPTIONS
Definition: frame_type.h:68
@ DIALOG_SCH_LIBRARY_TABLE
Definition: frame_type.h:104
@ PANEL_SYM_COLORS
Definition: frame_type.h:70
@ PANEL_SCH_ANNO_OPTIONS
Definition: frame_type.h:74
@ PANEL_SCH_COLORS
Definition: frame_type.h:75
void KiCopyFile(const wxString &aSrcPath, const wxString &aDestPath, wxString &aErrors)
Definition: gestfich.cpp:216
const std::string BackupFileSuffix
const std::string KiCadSymbolLibFileExtension
const std::string LegacySchematicFileExtension
const std::string LegacySymbolDocumentFileExtension
const std::string NetlistFileExtension
const std::string KiCadSchematicFileExtension
const std::string SchematicSymbolFileExtension
const std::string LegacySymbolLibFileExtension
#define MY_API(rettype)
Definition: import_export.h:55
@ KIFACE_NETLIST_SCHEMATIC
Definition: kiface_ids.h:56
#define KFCTL_CLI
Running as CLI app.
Definition: kiway.h:160
#define KIFACE_GETTER
Definition: kiway.h:111
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: macros.h:96
Definition: eeschema.cpp:70
static std::unique_ptr< SCHEMATIC > readSchematicFromFile(const std::string &aFilename)
Definition: eeschema.cpp:73
bool generateSchematicNetlist(const wxString &aFilename, wxString &aNetlist)
Definition: eeschema.cpp:118
#define GNL_ALL
@ GNL_OPT_KICAD
void InvokeSchEditSymbolLibTable(KIWAY *aKiway, wxWindow *aParent)
see class PGM_BASE
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:115
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits) override
Typically start_common() is called from here.
Implement a participant in the KIWAY alchemy.
Definition: kiway.h:151
void SaveFileAs(const wxString &aProjectBasePath, const wxString &aProjectName, const wxString &aNewProjectBasePath, const wxString &aNewProjectName, const wxString &aSrcFilePath, wxString &aErrors) override
Saving a file under a different name is delegated to the various KIFACEs because the project doesn't ...
Definition: eeschema.cpp:422
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits) override
Typically start_common() is called from here.
Definition: eeschema.cpp:333
wxWindow * CreateKiWindow(wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
Create a wxWindow for the current project.
Definition: eeschema.cpp:146
IFACE(const char *aName, KIWAY::FACE_T aType)
Definition: eeschema.cpp:135
void Reset() override
Reloads global state.
Definition: eeschema.cpp:356
void * IfaceOrAddress(int aDataId) override
Return a pointer to the requested object.
Definition: eeschema.cpp:270
std::unique_ptr< EESCHEMA_JOBS_HANDLER > m_jobHandler
Definition: eeschema.cpp:296
bool loadGlobalLibTable()
Definition: eeschema.cpp:362
void OnKifaceEnd() override
Called just once just before the DSO is to be unloaded.
Definition: eeschema.cpp:403
int HandleJob(JOB *aJob) override
Definition: eeschema.cpp:590
Definition of file extensions used in Kicad.