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)
 
int JobUpgrade (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, REPORTER *aReporter, PROGRESS_REPORTER *aProgressReporter)
 
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 66 of file job_dispatcher.cpp.

References JOB::GetType(), and 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 211 of file eeschema_jobs_handler.cpp.

References _, GetColorSettings(), SCHEMATIC::GetEmbeddedFiles(), DS_DATA_MODEL::GetTheInstance(), SCH_RENDER_SETTINGS::LoadColors(), 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::Project(), 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 483 of file eeschema_jobs_handler.cpp.

References _, FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn(), FIELDS_EDITOR_GRID_DATA_MODEL::ApplyBomPreset(), PROJECT::ApplyTextVars(), BOM_FMT_PRESET::BuiltInPresets(), BOM_PRESET::BuiltInPresets(), alg::contains(), copy, FILEEXT::CsvFileExtension, DO_TRANSLATE, PATHS::EnsurePathExists(), erc, CLI::EXIT_CODES::ERR_INVALID_INPUT_FILE, CLI::EXIT_CODES::ERR_INVALID_OUTPUT_CONFLICT, CLI::EXIT_CODES::ERR_UNKNOWN, BOM_PRESET::excludeDNP, FIELDS_EDITOR_GRID_DATA_MODEL::Export(), BOM_FMT_PRESET::fieldDelimiter, BOM_PRESET::fieldsOrdered, BOM_PRESET::filterString, GetCanonicalFieldName(), JOB::GetConfiguredOutputPath(), SCH_REFERENCE_LIST::GetCount(), GetDefaultFieldName(), SCH_SYMBOL::GetFields(), FIELDS_EDITOR_GRID_DATA_MODEL::GetFieldsOrdered(), SCHEMATIC::GetFileName(), JOB::GetFullOutputPath(), GetGeneratedFieldDisplayName(), getSchematic(), SCH_SHEET_LIST::GetSymbols(), TEMPLATES::GetTemplateFieldNames(), SCH_SCREEN::GetTitleBlock(), JOB::GetVarOverrides(), BOM_FIELD::groupBy, BOM_PRESET::groupSymbols, SCHEMATIC::Hierarchy(), IsGeneratedField(), 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_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::Project(), BOM_FMT_PRESET::refDelimiter, BOM_FMT_PRESET::refRangeDelimiter, res, SCHEMATIC::RootScreen(), RPT_SEVERITY_ACTION, RPT_SEVERITY_ERROR, RPT_SEVERITY_WARNING, JOB::SetConfiguredOutputPath(), SCHEMATIC::Settings(), JOB::SetTitleBlock(), 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 263 of file eeschema_jobs_handler.cpp.

References _, PROJECT::ApplyTextVars(), EESCHEMA_SETTINGS::APPEARANCE::default_font, DXF, PATHS::EnsurePathExists(), CLI::EXIT_CODES::ERR_ARGS, CLI::EXIT_CODES::ERR_INVALID_INPUT_FILE, CLI::EXIT_CODES::ERR_INVALID_OUTPUT_CONFLICT, CLI::EXIT_CODES::ERR_UNKNOWN, GetAppSettings(), JOB::GetFullOutputPath(), JOB::GetOutputPathIsDirectory(), getSchematic(), SCH_SCREEN::GetTitleBlock(), JOB::GetVarOverrides(), HPGL, InitRenderSettings(), KICAD_FONT_NAME, EESCHEMA_SETTINGS::m_Appearance, JOB_EXPORT_SCH_PLOT::m_blackAndWhite, SCH_PLOT_OPTS::m_blackAndWhite, JOB_EXPORT_SCH_PLOT::m_defaultFont, JOB_EXPORT_SCH_PLOT::m_drawingSheet, SCH_PLOT_OPTS::m_DXF_File_Unit, JOB_EXPORT_SCH_PLOT::m_filename, JOB_EXPORT_SCH_PLOT::m_minPenWidth, SCH_PLOT_OPTS::m_outputDirectory, 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, SCH_PLOT_OPTS::m_plotHopOver, JOB_EXPORT_SCH_PLOT::m_plotPages, SCH_PLOT_OPTS::m_plotPages, JOB_DISPATCHER::m_reporter, JOB_EXPORT_SCH_PLOT::m_show_hop_over, JOB_EXPORT_SCH_PLOT::m_theme, SCH_PLOT_OPTS::m_theme, JOB_EXPORT_SCH_PLOT::m_useBackgroundColor, SCH_PLOT_OPTS::m_useBackgroundColor, MM, CLI::EXIT_CODES::OK, PAGE_SIZE_A, PAGE_SIZE_A4, PAGE_SIZE_AUTO, PDF, POST, SCHEMATIC::Project(), SCHEMATIC::RootScreen(), RPT_SEVERITY_ERROR, JOB::SetTitleBlock(), and SVG.

Referenced by EESCHEMA_JOBS_HANDLER().

◆ JobExportPythonBom()

◆ JobSchErc()

◆ JobSymExportSvg()

◆ JobSymUpgrade()

◆ JobUpgrade()

◆ 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,
REPORTER * aReporter,
PROGRESS_REPORTER * aProgressReporter )
inherited

◆ SetProgressReporter()

void JOB_DISPATCHER::SetProgressReporter ( PROGRESS_REPORTER * aReporter)
inherited

Definition at line 84 of file job_dispatcher.cpp.

References m_progressReporter.

◆ SetReporter()

void JOB_DISPATCHER::SetReporter ( REPORTER * aReporter)
inherited

Definition at line 77 of file job_dispatcher.cpp.

References m_reporter.

Member Data Documentation

◆ m_cliSchematic

SCHEMATIC* EESCHEMA_JOBS_HANDLER::m_cliSchematic
private

Definition at line 73 of file eeschema_jobs_handler.h.

Referenced by EESCHEMA_JOBS_HANDLER(), and getSchematic().

◆ m_jobConfigHandlers

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

Definition at line 55 of file job_dispatcher.h.

Referenced by HandleJobConfig(), and Register().

◆ m_jobHandlers

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

Definition at line 53 of file job_dispatcher.h.

Referenced by Register(), and RunJob().

◆ m_kiway

◆ m_progressReporter

◆ m_reporter

REPORTER* JOB_DISPATCHER::m_reporter
protectedinherited

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