KiCad PCB EDA Suite
Loading...
Searching...
No Matches
EESCHEMA_JOBS_HANDLER Class Reference

Handle Eeschema job dispatches. More...

#include <eeschema_jobs_handler.h>

Inheritance diagram for EESCHEMA_JOBS_HANDLER:
JOB_DISPATCHER

Public Member Functions

 EESCHEMA_JOBS_HANDLER (KIWAY *aKiway)
 
int JobExportBom (JOB *aJob)
 
int JobExportPythonBom (JOB *aJob)
 
int JobExportNetlist (JOB *aJob)
 
int JobExportPlot (JOB *aJob)
 
int JobSchErc (JOB *aJob)
 
int JobSymUpgrade (JOB *aJob)
 
int JobSymExportSvg (JOB *aJob)
 
void InitRenderSettings (SCH_RENDER_SETTINGS *aRenderSettings, const wxString &aTheme, SCHEMATIC *aSch, const wxString &aDrawingSheetOverride=wxEmptyString)
 Configure the SCH_RENDER_SETTINGS object with the correct data to be used with plotting.
 
void Register (const std::string &aJobTypeName, std::function< int(JOB *job)> aHandler, std::function< bool(JOB *job, wxWindow *aParent)> aConfigHandler)
 
int RunJob (JOB *aJob)
 
bool HandleJobConfig (JOB *aJob, wxWindow *aParent)
 
void SetReporter (REPORTER *aReporter)
 
void SetProgressReporter (PROGRESS_REPORTER *aReporter)
 

Protected Attributes

KIWAYm_kiway
 
REPORTERm_reporter
 
PROGRESS_REPORTERm_progressReporter
 

Private Member Functions

SCHEMATICgetSchematic (const wxString &aPath)
 
int doSymExportSvg (JOB_SYM_EXPORT_SVG *aSvgJob, SCH_RENDER_SETTINGS *aRenderSettings, LIB_SYMBOL *symbol)
 
DS_PROXY_VIEW_ITEMgetDrawingSheetProxyView (SCHEMATIC *aSch)
 

Private Attributes

SCHEMATICm_cliSchematic
 
std::map< std::string, std::function< int(JOB *job)> > m_jobHandlers
 
std::map< std::string, std::function< bool(JOB *job, wxWindow *aParent)> > m_jobConfigHandlers
 

Detailed Description

Handle Eeschema job dispatches.

Definition at line 37 of file eeschema_jobs_handler.h.

Constructor & Destructor Documentation

◆ EESCHEMA_JOBS_HANDLER()

Member Function Documentation

◆ doSymExportSvg()

◆ getDrawingSheetProxyView()

◆ getSchematic()

◆ HandleJobConfig()

bool JOB_DISPATCHER::HandleJobConfig ( JOB aJob,
wxWindow *  aParent 
)
inherited

Definition at line 58 of file job_dispatcher.cpp.

References JOB::GetType(), and JOB_DISPATCHER::m_jobConfigHandlers.

◆ InitRenderSettings()

void EESCHEMA_JOBS_HANDLER::InitRenderSettings ( SCH_RENDER_SETTINGS aRenderSettings,
const wxString &  aTheme,
SCHEMATIC aSch,
const wxString &  aDrawingSheetOverride = wxEmptyString 
)

Configure the SCH_RENDER_SETTINGS object with the correct data to be used with plotting.

It's sort of a kludge due to the plotter depending on this object normally managed by the frame and canvas

Parameters
aRenderSettingsThe object to populate with working settings.
aThemeThe theme to take color data from to stick into render settings, can be left blank for default.
aSchThe schematic to further copy settings from to be put into aRenderSettings.

Definition at line 188 of file eeschema_jobs_handler.cpp.

References _, SETTINGS_MANAGER::GetColorSettings(), SCHEMATIC::GetEmbeddedFiles(), PGM_BASE::GetSettingsManager(), DS_DATA_MODEL::GetTheInstance(), SCH_RENDER_SETTINGS::LoadColors(), DS_DATA_MODEL::LoadDrawingSheet(), SCHEMATIC_SETTINGS::m_DashedLineDashRatio, SCHEMATIC_SETTINGS::m_DashedLineGapRatio, SCHEMATIC_SETTINGS::m_DefaultLineWidth, SCH_RENDER_SETTINGS::m_LabelSizeRatio, SCHEMATIC_SETTINGS::m_LabelSizeRatio, SCH_RENDER_SETTINGS::m_PinSymbolSize, SCHEMATIC_SETTINGS::m_PinSymbolSize, JOB_DISPATCHER::m_reporter, SCHEMATIC_SETTINGS::m_SchDrawingSheetFileName, SCH_RENDER_SETTINGS::m_ShowHiddenFields, SCH_RENDER_SETTINGS::m_ShowHiddenPins, SCH_RENDER_SETTINGS::m_ShowPinAltIcons, SCH_RENDER_SETTINGS::m_TextOffsetRatio, SCHEMATIC_SETTINGS::m_TextOffsetRatio, path, Pgm(), SCHEMATIC::Prj(), REPORTER::Report(), FILENAME_RESOLVER::ResolvePath(), RPT_SEVERITY_ERROR, KIGFX::RENDER_SETTINGS::SetDashLengthRatio(), KIGFX::RENDER_SETTINGS::SetDefaultPenWidth(), KIGFX::RENDER_SETTINGS::SetGapLengthRatio(), FILENAME_RESOLVER::SetProgramBase(), FILENAME_RESOLVER::SetProject(), and SCHEMATIC::Settings().

Referenced by JobExportPlot().

◆ JobExportBom()

int EESCHEMA_JOBS_HANDLER::JobExportBom ( JOB aJob)

Definition at line 446 of file eeschema_jobs_handler.cpp.

References _, FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn(), FIELDS_EDITOR_GRID_DATA_MODEL::ApplyBomPreset(), PROJECT::ApplyTextVars(), BOM_PRESET::BuiltInPresets(), BOM_FMT_PRESET::BuiltInPresets(), copy, FILEEXT::CsvFileExtension, erc, CLI::EXIT_CODES::ERR_INVALID_INPUT_FILE, CLI::EXIT_CODES::ERR_UNKNOWN, BOM_PRESET::excludeDNP, FIELDS_EDITOR_GRID_DATA_MODEL::Export(), BOM_FMT_PRESET::fieldDelimiter, BOM_PRESET::fieldsOrdered, BOM_PRESET::filterString, SCH_REFERENCE_LIST::GetCount(), TEMPLATE_FIELDNAME::GetDefaultFieldName(), SCH_SYMBOL::GetFieldCount(), SCH_SYMBOL::GetFields(), FIELDS_EDITOR_GRID_DATA_MODEL::GetFieldsOrdered(), SCHEMATIC::GetFileName(), JOB::GetOutputPath(), getSchematic(), SCH_SHEET_LIST::GetSymbols(), TEMPLATES::GetTemplateFieldNames(), GetTextVars(), JOB::GetVarOverrides(), BOM_FIELD::groupBy, BOM_PRESET::groupSymbols, SCHEMATIC::Hierarchy(), BOM_PRESET::includeExcludedFromBOM, IsTextVar(), BOM_FMT_PRESET::keepLineBreaks, BOM_FMT_PRESET::keepTabs, BOM_FIELD::label, JOB_EXPORT_SCH_BOM::m_bomFmtPresetName, SCHEMATIC_SETTINGS::m_BomFmtPresets, JOB_EXPORT_SCH_BOM::m_bomPresetName, SCHEMATIC_SETTINGS::m_BomPresets, JOB_EXPORT_SCH_BOM::m_excludeDNP, JOB_EXPORT_SCH_BOM::m_fieldDelimiter, JOB_EXPORT_SCH_BOM::m_fieldsGroupBy, JOB_EXPORT_SCH_BOM::m_fieldsLabels, JOB_EXPORT_SCH_BOM::m_fieldsOrdered, JOB_EXPORT_SCH_BOM::m_filename, JOB_EXPORT_SCH_BOM::m_filterString, JOB_EXPORT_SCH_BOM::m_includeExcludedFromBOM, JOB_EXPORT_SCH_BOM::m_keepLineBreaks, JOB_EXPORT_SCH_BOM::m_keepTabs, JOB_EXPORT_SCH_BOM::m_refDelimiter, JOB_EXPORT_SCH_BOM::m_refRangeDelimiter, JOB_DISPATCHER::m_reporter, JOB_EXPORT_SCH_BOM::m_sortAsc, JOB_EXPORT_SCH_BOM::m_sortField, JOB_EXPORT_SCH_BOM::m_stringDelimiter, SCHEMATIC_SETTINGS::m_TemplateFieldNames, MANDATORY_FIELDS, BOM_FIELD::name, CLI::EXIT_CODES::OK, SCHEMATIC::Prj(), BOM_FMT_PRESET::refDelimiter, BOM_FMT_PRESET::refRangeDelimiter, REPORTER::Report(), res, RPT_SEVERITY_ERROR, RPT_SEVERITY_WARNING, JOB::SetOutputPath(), SCHEMATIC::Settings(), BOM_FIELD::show, BOM_PRESET::sortAsc, BOM_PRESET::sortField, and BOM_FMT_PRESET::stringDelimiter.

Referenced by EESCHEMA_JOBS_HANDLER().

◆ JobExportNetlist()

◆ JobExportPlot()

int EESCHEMA_JOBS_HANDLER::JobExportPlot ( JOB aJob)

Definition at line 242 of file eeschema_jobs_handler.cpp.

References PROJECT::ApplyTextVars(), CLI::EXIT_CODES::ERR_INVALID_INPUT_FILE, CLI::EXIT_CODES::ERR_UNKNOWN, getSchematic(), JOB::GetVarOverrides(), InitRenderSettings(), JOB_EXPORT_SCH_PLOT::m_blackAndWhite, SCH_PLOT_OPTS::m_blackAndWhite, JOB_EXPORT_SCH_PLOT::m_drawingSheet, JOB_EXPORT_SCH_PLOT::m_filename, JOB_EXPORT_SCH_PLOT::m_HPGLPaperSizeSelect, SCH_PLOT_OPTS::m_HPGLPaperSizeSelect, JOB_EXPORT_SCH_PLOT::m_HPGLPenSize, SCH_PLOT_OPTS::m_HPGLPenSize, JOB_EXPORT_SCH_PLOT::m_HPGLPlotOrigin, SCH_PLOT_OPTS::m_HPGLPlotOrigin, JOB_EXPORT_SCH_PLOT::m_outputDirectory, SCH_PLOT_OPTS::m_outputDirectory, JOB_EXPORT_SCH_PLOT::m_outputFile, SCH_PLOT_OPTS::m_outputFile, JOB_EXPORT_SCH_PLOT::m_pageSizeSelect, SCH_PLOT_OPTS::m_pageSizeSelect, JOB_EXPORT_SCH_PLOT::m_PDFHierarchicalLinks, SCH_PLOT_OPTS::m_PDFHierarchicalLinks, JOB_EXPORT_SCH_PLOT::m_PDFMetadata, SCH_PLOT_OPTS::m_PDFMetadata, JOB_EXPORT_SCH_PLOT::m_PDFPropertyPopups, SCH_PLOT_OPTS::m_PDFPropertyPopups, JOB_EXPORT_SCH_PLOT::m_plotAll, SCH_PLOT_OPTS::m_plotAll, JOB_EXPORT_SCH_PLOT::m_plotDrawingSheet, SCH_PLOT_OPTS::m_plotDrawingSheet, JOB_EXPORT_SCH_PLOT::m_plotFormat, JOB_EXPORT_SCH_PLOT::m_plotPages, SCH_PLOT_OPTS::m_plotPages, JOB_DISPATCHER::m_reporter, JOB_EXPORT_SCH_PLOT::m_theme, SCH_PLOT_OPTS::m_theme, JOB_EXPORT_SCH_PLOT::m_useBackgroundColor, SCH_PLOT_OPTS::m_useBackgroundColor, CLI::EXIT_CODES::OK, and SCHEMATIC::Prj().

Referenced by EESCHEMA_JOBS_HANDLER().

◆ JobExportPythonBom()

◆ JobSchErc()

◆ JobSymExportSvg()

◆ JobSymUpgrade()

◆ Register()

void JOB_DISPATCHER::Register ( const std::string &  aJobTypeName,
std::function< int(JOB *job)>  aHandler,
std::function< bool(JOB *job, wxWindow *aParent)>  aConfigHandler 
)
inherited

◆ RunJob()

int JOB_DISPATCHER::RunJob ( JOB aJob)
inherited

◆ SetProgressReporter()

void JOB_DISPATCHER::SetProgressReporter ( PROGRESS_REPORTER aReporter)
inherited

Definition at line 76 of file job_dispatcher.cpp.

References JOB_DISPATCHER::m_progressReporter.

◆ SetReporter()

void JOB_DISPATCHER::SetReporter ( REPORTER aReporter)
inherited

Definition at line 69 of file job_dispatcher.cpp.

References JOB_DISPATCHER::m_reporter.

Member Data Documentation

◆ m_cliSchematic

SCHEMATIC* EESCHEMA_JOBS_HANDLER::m_cliSchematic
private

Definition at line 72 of file eeschema_jobs_handler.h.

Referenced by getSchematic().

◆ m_jobConfigHandlers

std::map<std::string, std::function<bool( JOB* job, wxWindow* aParent )> > JOB_DISPATCHER::m_jobConfigHandlers
privateinherited

Definition at line 54 of file job_dispatcher.h.

Referenced by JOB_DISPATCHER::HandleJobConfig(), and JOB_DISPATCHER::Register().

◆ m_jobHandlers

std::map<std::string, std::function<int( JOB* job )> > JOB_DISPATCHER::m_jobHandlers
privateinherited

Definition at line 52 of file job_dispatcher.h.

Referenced by JOB_DISPATCHER::Register(), and JOB_DISPATCHER::RunJob().

◆ m_kiway

KIWAY* JOB_DISPATCHER::m_kiway
protectedinherited

Definition at line 47 of file job_dispatcher.h.

Referenced by PCBNEW_JOBS_HANDLER::JobExportDrc(), and JobSchErc().

◆ m_progressReporter

PROGRESS_REPORTER* JOB_DISPATCHER::m_progressReporter
protectedinherited

◆ m_reporter


The documentation for this class was generated from the following files: