KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcbnew.cpp File Reference
#include <pcbnew_scripting_helpers.h>
#include <pgm_base.h>
#include <eda_pattern_match.h>
#include <background_jobs_monitor.h>
#include <cli_progress_reporter.h>
#include <confirm.h>
#include <kiface_base.h>
#include <kiface_ids.h>
#include <kiway_holder.h>
#include <pcb_edit_frame.h>
#include <eda_dde.h>
#include <macros.h>
#include <wx/snglinst.h>
#include <gestfich.h>
#include <paths.h>
#include <pcbnew_settings.h>
#include <footprint_editor_settings.h>
#include <settings/settings_manager.h>
#include <settings/cvpcb_settings.h>
#include <footprint_library_adapter.h>
#include <footprint_edit_frame.h>
#include <footprint_viewer_frame.h>
#include <footprint_chooser_frame.h>
#include <footprint_wizard_frame.h>
#include <footprint_preview_panel.h>
#include <footprint_info_impl.h>
#include <footprint.h>
#include <nlohmann/json.hpp>
#include <dialogs/dialog_configure_paths.h>
#include <dialogs/panel_grid_settings.h>
#include <panel_display_options.h>
#include <panel_edit_options.h>
#include <panel_fp_editor_field_defaults.h>
#include <panel_fp_editor_graphics_defaults.h>
#include <panel_fp_user_layer_names.h>
#include <panel_fp_editor_color_settings.h>
#include <panel_pcbnew_color_settings.h>
#include <panel_pcbnew_action_plugins.h>
#include <panel_pcbnew_display_origin.h>
#include <panel_3D_display_options.h>
#include <panel_3D_opengl_options.h>
#include <panel_3D_raytracing_options.h>
#include <project_pcb.h>
#include <python_scripting.h>
#include <string_utils.h>
#include <thread_pool.h>
#include <trace_helpers.h>
#include <widgets/kistatusbar.h>
#include <wx/tokenzr.h>
#include "invoke_pcb_dialog.h"
#include <wildcards_and_files_ext.h>
#include "pcbnew_jobs_handler.h"
#include <dialogs/panel_toolbar_customization.h>
#include <3d_viewer/toolbars_3d.h>
#include <toolbars_footprint_editor.h>
#include <toolbars_pcb_editor.h>
#include <wx/crt.h>

Go to the source code of this file.

Classes

struct  PCB::IFACE
 

Namespaces

namespace  PCB
 

Functions

PyObject * PyInit__pcbnew (void)
 
static wxString filterFootprints (const wxString &aFilterJson)
 Filter footprints based on criteria passed as JSON.
 
PCB::IFACE KIFACE_BASE, UNITS_PROVIDER PCB::kiface ("pcbnew", KIWAY::FACE_PCB)
 
 IFACE (const char *aName, KIWAY::FACE_T aType)
 
bool OnKifaceStart (PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway) override
 
void Reset () override
 
void OnKifaceEnd () override
 
wxWindow * CreateKiWindow (wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
 
void * IfaceOrAddress (int aDataId) override
 Return a pointer to the requested object.
 
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 know the internal format of the various files (which may have paths in them that need updating).
 
int HandleJob (JOB *aJob, REPORTER *aReporter, PROGRESS_REPORTER *aProgressReporter) override
 
bool HandleJobConfig (JOB *aJob, wxWindow *aParent) override
 
void PreloadLibraries (KIWAY *aKiway) override
 
void ProjectChanged () override
 
void CancelPreload (bool aBlock=true) override
 
KIFACE_BASEKiface ()
 Global KIFACE_BASE "get" accessor.
 
KIFACE_API KIFACEKIFACE_GETTER (int *aKIFACEversion, int aKiwayVersion, PGM_BASE *aProgram)
 No name mangling. Each KIFACE (DSO/DLL) will implement this once.
 

Variables

std::unique_ptr< PCBNEW_JOBS_HANDLERm_jobHandler
 
std::shared_ptr< BACKGROUND_JOBm_libraryPreloadBackgroundJob
 
std::future< void > m_libraryPreloadReturn
 
std::atomic_bool m_libraryPreloadInProgress
 
std::atomic_bool m_libraryPreloadAbort
 

Function Documentation

◆ CancelPreload()

void kiface::CancelPreload ( bool aBlock = true)
override

References FRAME_PCB_EDITOR.

◆ CreateKiWindow()

wxWindow * kiface::CreateKiWindow ( wxWindow * aParent,
int aClassId,
KIWAY * aKiway,
int aCtlBits = 0 )
override

Definition at line 13 of file pcbnew.cpp.

◆ filterFootprints()

static wxString filterFootprints ( const wxString & aFilterJson)
static

Filter footprints based on criteria passed as JSON.

Input JSON format: {"pin_count": N, "filters": ["pattern1", ...], "zero_filters": bool, "max_results": N}

Output JSON format: ["lib:footprint1", "lib:footprint2", ...]

Parameters
aFilterJsonJSON string with filter parameters
Returns
JSON string with array of matching footprint LIB_IDs

Definition at line 105 of file pcbnew.cpp.

References LIBRARY_MANAGER_ADAPTER::AsyncLoad(), LIBRARY_MANAGER_ADAPTER::BlockUntilLoaded(), DO_NOT_INCLUDE_NPTH, PROJECT_PCB::FootprintLibAdapter(), FOOTPRINT_LIBRARY_ADAPTER::GetFootprints(), LIBRARY_MANAGER_ADAPTER::GetLibraryNames(), PGM_BASE::GetSettingsManager(), name, Pgm(), SETTINGS_MANAGER::Prj(), project, and top().

Referenced by PCB::IFACE::IfaceOrAddress(), and FOOTPRINT_SELECT_WIDGET::UpdateList().

◆ HandleJob()

int kiface::HandleJob ( JOB * aJob,
REPORTER * aReporter,
PROGRESS_REPORTER * aProgressReporter )
override

References PANEL_FP_EDIT_OPTIONS.

◆ HandleJobConfig()

bool kiface::HandleJobConfig ( JOB * aJob,
wxWindow * aParent )
override

◆ IFACE()

kiface::IFACE ( const char * aName,
KIWAY::FACE_T aType )

Definition at line 2 of file pcbnew.cpp.

◆ IfaceOrAddress()

void * kiface::IfaceOrAddress ( int aDataId)
override

Return a pointer to the requested object.

The safest way to use this is to retrieve a pointer to a static instance of an interface, similar to how the KIFACE interface is exported. But if you know what you are doing use it to retrieve anything you want.

Parameters
aDataIdidentifies which object you want the address of.
Returns
the object which must be cast into the know type.

Definition at line 277 of file pcbnew.cpp.

References DIALOG_CONFIGUREPATHS, ENVVARS_CHANGED, FRAME_FOOTPRINT_PREVIEW, and FRAME_FOOTPRINT_WIZARD.

◆ Kiface()

KIFACE_BASE & Kiface ( )

Global KIFACE_BASE "get" accessor.

Definition at line 587 of file pcbnew.cpp.

References PCB::kiface().

◆ KIFACE_GETTER()

KIFACE_API KIFACE * KIFACE_GETTER ( int * aKIFACEversion,
int aKiwayVersion,
PGM_BASE * aProgram )

No name mangling. Each KIFACE (DSO/DLL) will implement this once.

Definition at line 592 of file pcbnew.cpp.

References PCB::kiface(), and KIFACE_API.

◆ OnKifaceEnd()

void kiface::OnKifaceEnd ( )
override

Definition at line 11 of file test_app_main.cpp.

◆ OnKifaceStart()

bool kiface::OnKifaceStart ( PGM_BASE * aProgram,
int aCtlBits,
KIWAY * aKiway )
override

Definition at line 6 of file test_app_main.cpp.

◆ PreloadLibraries()

void kiface::PreloadLibraries ( KIWAY * aKiway)
override

◆ ProjectChanged()

void kiface::ProjectChanged ( )
override

◆ PyInit__pcbnew()

PyObject * PyInit__pcbnew ( void )

◆ Reset()

void kiface::Reset ( )
override

◆ SaveFileAs()

void kiface::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 know the internal format of the various files (which may have paths in them that need updating).

References FRAME_FOOTPRINT_EDITOR, GetAppSettings(), and PANEL_FP_ORIGINS_AXES.

Variable Documentation

◆ m_jobHandler

std::unique_ptr<PCBNEW_JOBS_HANDLER> m_jobHandler
private

Definition at line 338 of file pcbnew.cpp.

◆ m_libraryPreloadAbort

std::atomic_bool m_libraryPreloadAbort
private

Definition at line 342 of file pcbnew.cpp.

◆ m_libraryPreloadBackgroundJob

std::shared_ptr<BACKGROUND_JOB> m_libraryPreloadBackgroundJob
private

Definition at line 339 of file pcbnew.cpp.

◆ m_libraryPreloadInProgress

std::atomic_bool m_libraryPreloadInProgress
private

Definition at line 341 of file pcbnew.cpp.

◆ m_libraryPreloadReturn

std::future<void> m_libraryPreloadReturn
private

Definition at line 340 of file pcbnew.cpp.