KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcbnew.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) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
6 * Copyright The KiCad Developers, see AUTHORS.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
27#include <pgm_base.h>
30#include <confirm.h>
31#include <kiface_base.h>
32#include <kiface_ids.h>
33#include <pcb_edit_frame.h>
34#include <eda_dde.h>
35#include <macros.h>
36#include <wx/snglinst.h>
37#include <gestfich.h>
38#include <paths.h>
39#include <pcbnew_settings.h>
49#include <footprint_info_impl.h>
53#include <panel_edit_options.h>
63#include <project_pcb.h>
64#include <python_scripting.h>
65#include <thread_pool.h>
66
67#include "invoke_pcb_dialog.h"
69#include "pcbnew_jobs_handler.h"
70
74#include <toolbars_pcb_editor.h>
75
76#include <wx/crt.h>
77
78/* init functions defined by swig */
79
80extern "C" PyObject* PyInit__pcbnew( void );
81
82namespace PCB {
83
84static struct IFACE : public KIFACE_BASE, public UNITS_PROVIDER
85{
86 // Of course all are virtual overloads, implementations of the KIFACE.
87
88 IFACE( const char* aName, KIWAY::FACE_T aType ) :
89 KIFACE_BASE( aName, aType ),
91 {}
92
93 bool OnKifaceStart( PGM_BASE* aProgram, int aCtlBits, KIWAY* aKiway ) override;
94
95 void Reset() override;
96
97 void OnKifaceEnd() override;
98
99 wxWindow* CreateKiWindow( wxWindow* aParent, int aClassId, KIWAY* aKiway, int aCtlBits = 0 ) override
100 {
101 switch( aClassId )
102 {
103 case FRAME_PCB_EDITOR:
104 {
105 auto frame = new PCB_EDIT_FRAME( aKiway, aParent );
106
107 // give the scripting helpers access to our frame
109
110 if( Kiface().IsSingle() )
111 {
112 // only run this under single_top, not under a project manager.
113 frame->CreateServer( KICAD_PCB_PORT_SERVICE_NUMBER );
114 }
115
116 return frame;
117 }
118
120 return new FOOTPRINT_EDIT_FRAME( aKiway, aParent );
121
123 return new FOOTPRINT_VIEWER_FRAME( aKiway, aParent );
124
126 return new FOOTPRINT_CHOOSER_FRAME( aKiway, aParent );
127
129 return new FOOTPRINT_WIZARD_FRAME( aKiway, aParent, FRAME_T( aClassId ) );
130
132 return FOOTPRINT_PREVIEW_PANEL::New( aKiway, aParent, this );
133
135 {
136 DIALOG_CONFIGURE_PATHS dlg( aParent );
137
138 // The dialog's constructor probably failed to set its Kiway because the
139 // dynamic_cast fails when aParent was allocated by a separate compilation
140 // module. So set it directly.
141 dlg.SetKiway( &dlg, aKiway );
142
143 // Use QuasiModal so that HTML help window will work
144 if( dlg.ShowQuasiModal() == wxID_OK )
146
147 // Dialog has completed; nothing to return.
148 return nullptr;
149 }
150
152 InvokePcbLibTableEditor( aKiway, aParent );
153 // Dialog has completed; nothing to return.
154 return nullptr;
155
157 return new PANEL_DISPLAY_OPTIONS( aParent, GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>( "fpedit" ) );
158
159 case PANEL_FP_GRIDS:
160 {
162 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
163
164 if( !frame )
165 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
166
167 if( !frame )
168 frame = aKiway->Player( FRAME_PCB_EDITOR, false );
169
170 if( frame )
171 SetUserUnits( frame->GetUserUnits() );
172
173 return new PANEL_GRID_SETTINGS( aParent, this, frame, cfg, FRAME_FOOTPRINT_EDITOR );
174 }
175
179
181 {
182 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
183
184 if( !frame )
185 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
186
187 if( !frame )
188 frame = aKiway->Player( FRAME_PCB_EDITOR, false );
189
190 if( frame )
191 SetUserUnits( frame->GetUserUnits() );
192
193 return new PANEL_EDIT_OPTIONS( aParent, this, frame, true );
194 }
195
197 {
198 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
199
200 if( !frame )
201 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
202
203 if( !frame )
204 frame = aKiway->Player( FRAME_PCB_EDITOR, false );
205
206 if( frame )
207 SetUserUnits( frame->GetUserUnits() );
208
209 return new PANEL_FP_EDITOR_FIELD_DEFAULTS( aParent );
210 }
211
213 {
214 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
215
216 if( !frame )
217 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
218
219 if( !frame )
220 frame = aKiway->Player( FRAME_PCB_EDITOR, false );
221
222 if( frame )
223 SetUserUnits( frame->GetUserUnits() );
224
225 return new PANEL_FP_EDITOR_GRAPHICS_DEFAULTS( aParent, this );
226 }
227
229 {
232
233 std::vector<TOOL_ACTION*> actions;
234 std::vector<ACTION_TOOLBAR_CONTROL*> controls;
235
237 actions.push_back( action );
238
240 controls.push_back( control );
241
242 return new PANEL_TOOLBAR_CUSTOMIZATION( aParent, cfg, tb, actions, controls );
243 }
244
245 case PANEL_FP_COLORS:
246 return new PANEL_FP_EDITOR_COLOR_SETTINGS( aParent );
247
249 return new PANEL_DISPLAY_OPTIONS( aParent, GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" ) );
250
251 case PANEL_PCB_GRIDS:
252 {
254 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_PCB_EDITOR, false );
255
256 if( !frame )
257 frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
258
259 if( !frame )
260 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
261
262 if( frame )
263 SetUserUnits( frame->GetUserUnits() );
264
265 return new PANEL_GRID_SETTINGS( aParent, this, frame, cfg, FRAME_PCB_EDITOR );
266 }
267
269 return new PANEL_PCBNEW_DISPLAY_ORIGIN( aParent, GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" ),
271
273 {
274 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_PCB_EDITOR, false );
275
276 if( !frame )
277 frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
278
279 if( !frame )
280 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
281
282 if( frame )
283 SetUserUnits( frame->GetUserUnits() );
284
285 return new PANEL_EDIT_OPTIONS( aParent, this, frame, false );
286 }
287
288 case PANEL_PCB_COLORS:
289 {
290 BOARD* board = nullptr;
291 EDA_BASE_FRAME* boardProvider = aKiway->Player( FRAME_PCB_EDITOR, false );
292
293 if( boardProvider )
294 board = static_cast<PCB_EDIT_FRAME*>( boardProvider )->GetBoard();
295
296 return new PANEL_PCBNEW_COLOR_SETTINGS( aParent, board );
297 }
298
300 {
303
304 std::vector<TOOL_ACTION*> actions;
305 std::vector<ACTION_TOOLBAR_CONTROL*> controls;
306
308 actions.push_back( action );
311 controls.push_back( control );
312
313 return new PANEL_TOOLBAR_CUSTOMIZATION( aParent, cfg, tb, actions, controls );
317 return new PANEL_PCBNEW_ACTION_PLUGINS( aParent );
318
320 return new PANEL_3D_DISPLAY_OPTIONS( aParent );
321
322 case PANEL_3DV_OPENGL:
323 return new PANEL_3D_OPENGL_OPTIONS( aParent );
324
326 return new PANEL_3D_RAYTRACING_OPTIONS( aParent );
327
329 {
332
333 std::vector<TOOL_ACTION*> actions;
334 std::vector<ACTION_TOOLBAR_CONTROL*> controls;
335
337 actions.push_back( action );
338
340 controls.push_back( control );
341
342 return new PANEL_TOOLBAR_CUSTOMIZATION( aParent, cfg, tb, actions, controls );
343 }
344
345 default:
346 return nullptr;
347 }
348 }
349
360 void* IfaceOrAddress( int aDataId ) override
361 {
362 switch( aDataId )
363 {
364 // Return a pointer to the global instance of the footprint list.
366 return (void*) &GFootprintList;
367
369 // This is the mechanism by which FOOTPRINT_SELECT_WIDGET can get access to the adapter
370 // without directly linking to pcbnew or pcbcommon, going through PROJECT::FootprintLibAdapter
371 // TODO this is kind of cursed and needs thought to support multi-project
373
375 return reinterpret_cast<void*>( PyInit__pcbnew );
376
377 default:
378 return nullptr;
379 }
380 }
381
387 void SaveFileAs( const wxString& aProjectBasePath, const wxString& aSrcProjectName,
388 const wxString& aNewProjectBasePath, const wxString& aNewProjectName,
389 const wxString& aSrcFilePath, wxString& aErrors ) override;
390
391 int HandleJob( JOB* aJob, REPORTER* aReporter, PROGRESS_REPORTER* aProgressReporter ) override;
392
393 bool HandleJobConfig( JOB* aJob, wxWindow* aParent ) override;
394
395 void PreloadLibraries( KIWAY* aKiway ) override;
396 void ProjectChanged() override;
397
398private:
399 std::unique_ptr<PCBNEW_JOBS_HANDLER> m_jobHandler;
400 std::shared_ptr<BACKGROUND_JOB> m_libraryPreloadBackgroundJob;
401 std::future<void> m_libraryPreloadReturn;
403 std::atomic_bool m_libraryPreloadAbort;
404
405} kiface( "pcbnew", KIWAY::FACE_PCB );
406
407} // namespace
408
409
410using namespace PCB;
411
412
414
415
416// KIFACE_GETTER's actual spelling is a substitution macro found in kiway.h.
417// KIFACE_GETTER will not have name mangling due to declaration in kiway.h.
418KIFACE_API KIFACE* KIFACE_GETTER( int* aKIFACEversion, int aKiwayVersion, PGM_BASE* aProgram )
419{
420 return &kiface;
421}
422
423
428
429
430bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits, KIWAY* aKiway )
431{
432 // This is process-level-initialization, not project-level-initialization of the DSO.
433 // Do nothing in here pertinent to a project!
435
436 SETTINGS_MANAGER& mgr = aProgram->GetSettingsManager();
437
440
441 // We intentionally register KifaceSettings after FOOTPRINT_EDITOR_SETTINGS and EDA_3D_VIEWER_SETTINGS
442 // In legacy configs, many settings were in a single editor config and the migration routine
443 // for the main editor file will try and call into the now separate settings stores
444 // to move the settings into them
446
447 // Register the footprint editor settings as well because they share a KiFACE and need to be
448 // loaded prior to use to avoid threading deadlocks
450
451 start_common( aCtlBits );
452
453 m_jobHandler = std::make_unique<PCBNEW_JOBS_HANDLER>( aKiway );
454
456 {
457 m_jobHandler->SetReporter( &CLI_REPORTER::GetInstance() );
458 m_jobHandler->SetProgressReporter( &CLI_PROGRESS_REPORTER::GetInstance() );
459 }
460
461 return true;
462}
463
464
466{
467}
468
469
471{
472 end_common();
473}
474
475
476void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aSrcProjectName,
477 const wxString& aNewProjectBasePath, const wxString& aNewProjectName,
478 const wxString& aSrcFilePath, wxString& aErrors )
479{
480 wxFileName destFile( aSrcFilePath );
481 wxString destPath = destFile.GetPathWithSep();
482 wxUniChar pathSep = wxFileName::GetPathSeparator();
483 wxString ext = destFile.GetExt();
484
485 if( destPath.StartsWith( aProjectBasePath + pathSep ) )
486 destPath.Replace( aProjectBasePath, aNewProjectBasePath, false );
487
488 wxString srcProjectFootprintLib = pathSep + aSrcProjectName + wxT( ".pretty" ) + pathSep;
489 wxString newProjectFootprintLib = pathSep + aNewProjectName + wxT( ".pretty" ) + pathSep;
490
491 destPath.Replace( srcProjectFootprintLib, newProjectFootprintLib, true );
492
493 destFile.SetPath( destPath );
494
497 {
498 if( destFile.GetName() == aSrcProjectName )
499 destFile.SetName( aNewProjectName );
500
501 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
502 }
503 else if( ext == FILEEXT::LegacyPcbFileExtension )
504 {
505 if( destFile.GetName() == aSrcProjectName )
506 destFile.SetName( aNewProjectName );
507
508 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
509 }
512 {
513 // Footprints are not project-specific. Keep their source names.
514 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
515 }
517 {
518 // TODO
519 }
520 else if( ext == wxT( "rpt" ) )
521 {
522 // DRC must be the "gold standard". Since we can't guarantee that there aren't
523 // any non-deterministic cases in the save-as algorithm, we don't want to certify
524 // the result with the source's DRC report. Therefore copy it under the old
525 // name.
526 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
527 }
528 // TODO(JE) library tables - does this feature even need to exist?
529#if 0
530 else if( destFile.GetName() == FILEEXT::FootprintLibraryTableFileName )
531 {
532 try
533 {
534 FP_LIB_TABLE fpLibTable;
535 fpLibTable.Load( aSrcFilePath );
536
537 for( unsigned i = 0; i < fpLibTable.GetCount(); i++ )
538 {
539 LIB_TABLE_ROW& row = fpLibTable.At( i );
540 wxString uri = row.GetFullURI();
541
542 uri.Replace( wxT( "/" ) + aSrcProjectName + wxT( ".pretty" ),
543 wxT( "/" ) + aNewProjectName + wxT( ".pretty" ) );
544
545 row.SetFullURI( uri );
546 }
547
548 fpLibTable.Save( destFile.GetFullPath() );
549 }
550 catch( ... )
551 {
552 wxString msg;
553
554 if( !aErrors.empty() )
555 aErrors += wxT( "\n" );
556
557 msg.Printf( _( "Cannot copy file '%s'." ), destFile.GetFullPath() );
558 aErrors += msg;
559 }
560 }
561#endif
562 else
563 {
564 wxFAIL_MSG( wxT( "Unexpected filetype for Pcbnew::SaveFileAs()" ) );
565 }
566}
567
568
569int IFACE::HandleJob( JOB* aJob, REPORTER* aReporter, PROGRESS_REPORTER* aProgressReporter )
570{
571 return m_jobHandler->RunJob( aJob, aReporter, aProgressReporter );
572}
573
574
575bool IFACE::HandleJobConfig( JOB* aJob, wxWindow* aParent )
576{
577 return m_jobHandler->HandleJobConfig( aJob, aParent );
578}
579
580
582{
583 constexpr static int interval = 150;
584 constexpr static int timeLimit = 120000;
585
586 wxCHECK( aKiway, /* void */ );
587
588 if( m_libraryPreloadInProgress.load() )
589 return;
590
592 Pgm().GetBackgroundJobMonitor().Create( _( "Loading Footprint Libraries" ) );
593
594 auto preload =
595 [this, aKiway]() -> void
596 {
597 std::shared_ptr<BACKGROUND_JOB_REPORTER> reporter =
599
601
602 int elapsed = 0;
603
604 reporter->Report( _( "Loading Footprint Libraries" ) );
605 adapter->AsyncLoad();
606
607 while( true )
608 {
609 if( m_libraryPreloadAbort.load() )
610 {
611 m_libraryPreloadAbort.store( false );
612 break;
613 }
614
615 std::this_thread::sleep_for( std::chrono::milliseconds( interval ) );
616
617 if( std::optional<float> loadStatus = adapter->AsyncLoadProgress() )
618 {
619 float progress = *loadStatus;
620 reporter->SetCurrentProgress( progress );
621
622 if( progress >= 1 )
623 break;
624 }
625 else
626 {
627 reporter->SetCurrentProgress( 1 );
628 break;
629 }
630
631 elapsed += interval;
632
633 if( elapsed > timeLimit )
634 break;
635 }
636
637 adapter->BlockUntilLoaded();
638
639 // TODO: Remove once fp-info-cache isn't a thing
640 GFootprintList.ReadFootprintFiles( adapter, nullptr, reporter.get() );
641
644 m_libraryPreloadInProgress.store( false );
645
646 std::string payload = "";
647 aKiway->ExpressMail( FRAME_PCB_EDITOR, MAIL_RELOAD_LIB, payload, nullptr, true );
648 aKiway->ExpressMail( FRAME_FOOTPRINT_EDITOR, MAIL_RELOAD_LIB, payload, nullptr, true );
649 aKiway->ExpressMail( FRAME_CVPCB, MAIL_RELOAD_LIB, payload, nullptr, true );
650 };
651
653 m_libraryPreloadInProgress.store( true );
654 m_libraryPreloadReturn = tp.submit_task( preload );
655}
656
657
659{
660 if( m_libraryPreloadInProgress.load() )
661 m_libraryPreloadAbort.store( true );
662}
constexpr EDA_IU_SCALE pcbIUScale
Definition base_units.h:112
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
static std::list< TOOL_ACTION * > & GetActionList()
Return list of TOOL_ACTIONs.
Class to hold basic information about controls that can be added to the toolbars.
static std::list< ACTION_TOOLBAR_CONTROL * > & GetCustomControlList()
Get the list of custom controls that could be used on toolbars.
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
std::shared_ptr< BACKGROUND_JOB > Create(const wxString &aName)
Creates a background job with the given name.
void Remove(std::shared_ptr< BACKGROUND_JOB > job)
Removes the given background job from any lists and frees it.
static PROGRESS_REPORTER & GetInstance()
static REPORTER & GetInstance()
Definition reporter.cpp:129
The base frame for deriving all KiCad main window classes.
An interface to the global shared library manager that is schematic-specific and linked to one projec...
void AsyncLoad() override
Loads all available libraries for this adapter type in the background.
static FOOTPRINT_PREVIEW_PANEL * New(KIWAY *aKiway, wxWindow *aParent, UNITS_PROVIDER *aUnitsProvider)
Component library viewer main window.
An simple container class that lets us dispatch output jobs to kifaces.
Definition job.h:183
A KIFACE implementation.
Definition kiface_base.h:39
KIFACE_BASE(const char *aKifaceName, KIWAY::FACE_T aId)
Definition kiface_base.h:67
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();.
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().
int m_start_flags
flags provided in OnKifaceStart()
bool IsSingle() const
Is this KIFACE running under single_top?
void SetKiway(wxWindow *aDest, KIWAY *aKiway)
It is only used for debugging, since "this" is not a wxWindow*.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition kiway.h:292
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition kiway.cpp:403
virtual void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr, bool aFromOtherThread=false)
Send aPayload to aDestination from aSource.
Definition kiway.cpp:507
FACE_T
Known KIFACE implementations.
Definition kiway.h:298
@ FACE_PCB
pcbnew DSO
Definition kiway.h:300
virtual void CommonSettingsChanged(int aFlags=0)
Call CommonSettingsChanged() on all KIWAY_PLAYERs.
Definition kiway.cpp:600
virtual PROJECT & Prj() const
Return the PROJECT associated with this KIWAY.
Definition kiway.cpp:200
std::optional< float > AsyncLoadProgress() const
Returns async load progress between 0.0 and 1.0, or nullopt if load is not in progress.
The main frame for Pcbnew.
Container for data for KiCad programs.
Definition pgm_base.h:107
virtual BACKGROUND_JOBS_MONITOR & GetBackgroundJobMonitor() const
Definition pgm_base.h:135
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition pgm_base.h:129
A progress reporter interface for use in multi-threaded environments.
static FOOTPRINT_LIBRARY_ADAPTER * FootprintLibAdapter(PROJECT *aProject)
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:73
T * RegisterSettings(T *aSettings, bool aLoadNow=true)
Take ownership of the pointer passed in.
Represent a single user action.
UNITS_PROVIDER(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits)
EDA_UNITS GetUserUnits() const
void SetUserUnits(EDA_UNITS aUnits)
This file is part of the common library.
#define _(s)
DDE server & client.
#define KICAD_PCB_PORT_SERVICE_NUMBER
Pcbnew listens on this port for commands from Eeschema.
Definition eda_dde.h:40
EDA_UNITS
Definition eda_units.h:48
FOOTPRINT_LIST_IMPL GFootprintList
The global footprint info table.
Definition cvpcb.cpp:138
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition frame_type.h:33
@ PANEL_PCB_GRIDS
Definition frame_type.h:96
@ FRAME_PCB_EDITOR
Definition frame_type.h:42
@ PANEL_3DV_TOOLBARS
Definition frame_type.h:106
@ FRAME_FOOTPRINT_VIEWER
Definition frame_type.h:45
@ PANEL_3DV_OPENGL
Definition frame_type.h:104
@ PANEL_FP_DEFAULT_GRAPHICS_VALUES
Definition frame_type.h:92
@ PANEL_PCB_TOOLBARS
Definition frame_type.h:99
@ PANEL_PCB_ORIGINS_AXES
Definition frame_type.h:101
@ FRAME_FOOTPRINT_WIZARD
Definition frame_type.h:46
@ PANEL_PCB_EDIT_OPTIONS
Definition frame_type.h:97
@ PANEL_FP_DISPLAY_OPTIONS
Definition frame_type.h:86
@ PANEL_PCB_COLORS
Definition frame_type.h:98
@ PANEL_3DV_RAYTRACING
Definition frame_type.h:105
@ DIALOG_PCB_LIBRARY_TABLE
Definition frame_type.h:124
@ FRAME_FOOTPRINT_PREVIEW
Definition frame_type.h:48
@ FRAME_FOOTPRINT_CHOOSER
Definition frame_type.h:44
@ PANEL_FP_GRIDS
Definition frame_type.h:87
@ PANEL_FP_ORIGINS_AXES
Definition frame_type.h:93
@ PANEL_PCB_DISPLAY_OPTS
Definition frame_type.h:95
@ DIALOG_CONFIGUREPATHS
Definition frame_type.h:121
@ PANEL_FP_COLORS
Definition frame_type.h:89
@ PANEL_FP_DEFAULT_FIELDS
Definition frame_type.h:91
@ FRAME_FOOTPRINT_EDITOR
Definition frame_type.h:43
@ PANEL_FP_EDIT_OPTIONS
Definition frame_type.h:88
@ PANEL_FP_TOOLBARS
Definition frame_type.h:90
@ PANEL_PCB_ACTION_PLUGINS
Definition frame_type.h:100
@ PANEL_3DV_DISPLAY_OPTIONS
Definition frame_type.h:103
@ FRAME_CVPCB
Definition frame_type.h:52
void KiCopyFile(const wxString &aSrcPath, const wxString &aDestPath, wxString &aErrors)
Definition gestfich.cpp:290
static const std::string LegacyPcbFileExtension
static const std::string FootprintLibraryTableFileName
static const std::string BackupFileSuffix
static const std::string LegacyFootprintLibPathExtension
static const std::string FootprintAssignmentFileExtension
static const std::string KiCadFootprintFileExtension
static const std::string KiCadPcbFileExtension
#define KIFACE_API
PROJECT & Prj()
Definition kicad.cpp:629
@ KIFACE_SCRIPTING_LEGACY
Definition kiface_ids.h:44
@ KIFACE_FOOTPRINT_LIBRARY_ADAPTER
Definition kiface_ids.h:40
@ KIFACE_FOOTPRINT_LIST
Return a pointer to the global instance of FOOTPRINT_LIST from pcbnew.
Definition kiface_ids.h:39
#define KFCTL_CLI
Running as CLI app.
Definition kiway.h:164
#define KIFACE_GETTER
Definition kiway.h:110
This file contains miscellaneous commonly used macros and functions.
@ MAIL_RELOAD_LIB
Definition mail_type.h:57
PCB::IFACE KIFACE_BASE, UNITS_PROVIDER kiface("pcbnew", KIWAY::FACE_PCB)
void InvokePcbLibTableEditor(KIWAY *aKiway, wxWindow *aCaller)
Function InvokePcbLibTableEditor shows the modal DIALOG_FP_LIB_TABLE for purposes of editing the glob...
PyObject * PyInit__pcbnew(void)
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
Definition pcbnew.cpp:413
SETTINGS_MANAGER * GetSettingsManager()
void ScriptingSetPcbEditFrame(PCB_EDIT_FRAME *aPcbEditFrame)
BOARD * GetBoard()
PGM_BASE & Pgm()
The global program "get" accessor.
Definition pgm_base.cpp:946
see class PGM_BASE
T * GetToolbarSettings(const wxString &aFilename)
T * GetAppSettings(const char *aFilename)
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway) override
Typically start_common() is called from here.
Implement a participant in the KIWAY alchemy.
Definition kiway.h:155
std::atomic_bool m_libraryPreloadInProgress
Definition pcbnew.cpp:402
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway) override
Typically start_common() is called from here.
Definition pcbnew.cpp:430
void PreloadLibraries(KIWAY *aKiway) override
Definition pcbnew.cpp:581
void ProjectChanged() override
Definition pcbnew.cpp:658
void SaveFileAs(const wxString &aProjectBasePath, const wxString &aSrcProjectName, 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 pcbnew.cpp:476
std::shared_ptr< BACKGROUND_JOB > m_libraryPreloadBackgroundJob
Definition pcbnew.cpp:400
void * IfaceOrAddress(int aDataId) override
Return a pointer to the requested object.
Definition pcbnew.cpp:360
void Reset() override
Reloads global state.
Definition pcbnew.cpp:465
wxWindow * CreateKiWindow(wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
Create a wxWindow for the current project.
Definition pcbnew.cpp:99
IFACE(const char *aName, KIWAY::FACE_T aType)
Definition pcbnew.cpp:88
std::atomic_bool m_libraryPreloadAbort
Definition pcbnew.cpp:403
int HandleJob(JOB *aJob, REPORTER *aReporter, PROGRESS_REPORTER *aProgressReporter) override
Definition pcbnew.cpp:569
std::unique_ptr< PCBNEW_JOBS_HANDLER > m_jobHandler
Definition pcbnew.cpp:399
bool HandleJobConfig(JOB *aJob, wxWindow *aParent) override
Definition pcbnew.cpp:575
void OnKifaceEnd() override
Called just once just before the DSO is to be unloaded.
Definition pcbnew.cpp:470
std::future< void > m_libraryPreloadReturn
Definition pcbnew.cpp:401
thread_pool & GetKiCadThreadPool()
Get a reference to the current thread pool.
static thread_pool * tp
BS::priority_thread_pool thread_pool
Definition thread_pool.h:31
#define ENVVARS_CHANGED
Definition of file extensions used in Kicad.