|
KiCad PCB EDA Suite
|
#include "odb_export_job.h"#include "odb_entity.h"#include "odb_util.h"#include "pcb_io_odbpp.h"#include <thread_pool.h>#include <gestfich.h>#include <algorithm>#include <array>#include <filesystem>#include <set>#include <wx/dir.h>#include <board.h>#include <reporter.h>#include <confirm.h>#include <kidialog.h>#include <paths.h>#include <pcb_edit_frame.h>#include <progress_reporter.h>#include <project.h>#include <jobs/job_export_pcb_odb.h>#include <locale_io.h>#include <string_utils.h>Go to the source code of this file.
Functions | |
| bool | OdbVariantFileTokensCollide (const std::vector< wxString > &aTokens, const std::function< wxString(const wxString &)> &aLocaleFold) |
| Check whether variant output tokens could name the same file. | |
| static ODB_EXPORT_RESULT | generateOneODBPackage (const JOB_EXPORT_PCB_ODB &aJob, BOARD *aBoard, PCB_EDIT_FRAME *aParentFrame, PROGRESS_REPORTER *aProgressReporter, REPORTER *aReporter, wxString outputPath, const wxString &aVariant, const wxString &aProductName) |
| ODB_EXPORT_RESULT | GenerateODBPPFiles (const JOB_EXPORT_PCB_ODB &aJob, BOARD *aBoard, PCB_EDIT_FRAME *aParentFrame, PROGRESS_REPORTER *aProgressReporter, REPORTER *aReporter) |
| Generate the ODB++ tree or archive and return the write status and the paths written. | |
| wxString | UpdateOdbVariantOutputPath (const wxString &aPath, bool aDirectory, bool aSeparate, bool aRemoveAutomaticSuffix) |
| Add or remove the automatic variant suffix on the file stem or final directory. | |
| FAB::SECTION_SET | OdbDefaultSections (FAB::MODE aMode) |
| Sections a data set exports when no section key is given. | |
| wxString | OdbSectionKeyForSelection (FAB::MODE aMode, const FAB::SECTION_SET &aSelection) |
| Use an empty section key when Customize matches the data set default. | |
| wxString | OdbPreviewReferenceName (const wxString &aReference, const std::vector< ODB_MATRIX_PREVIEW_ROW > &aRows) |
| Matrix name of the row whose ID is aReference. | |
| std::vector< ODB_MATRIX_PREVIEW_ROW > | PreviewOdbMatrix (BOARD *aBoard, const JOB_EXPORT_PCB_ODB &aJob) |
| Build export matrix rows without layer overrides or writing files. | |
| ODB_EXPORT_RESULT GenerateODBPPFiles | ( | const JOB_EXPORT_PCB_ODB & | aJob, |
| BOARD * | aBoard, | ||
| PCB_EDIT_FRAME * | aParentFrame, | ||
| PROGRESS_REPORTER * | aProgressReporter, | ||
| REPORTER * | aReporter ) |
Generate the ODB++ tree or archive and return the write status and the paths written.
Definition at line 576 of file odb_export_job.cpp.
References _, ODB::VARIANT_NAMES::Build(), duplicate, ExpandVariantOutputPath(), generateOneODBPackage(), JOB::GetConfiguredOutputPath(), BOARD::GetCurrentVariant(), GetDefaultVariantName(), JOB::GetOutputPathIsDirectory(), BOARD::GetProject(), GetVariantFileToken(), BOARD::GetVariantNames(), JOB::GetWorkingOutputPath(), BOARD::HasVariant(), index, ODB::VARIANT_NAMES::LegalName(), JOB_EXPORT_PCB_FAB::m_dataSet, ODB::VARIANT_NAMES::m_listsFit, ODB::VARIANT_NAMES::m_renamed, JOB_EXPORT_PCB_FAB::m_sections, JOB_EXPORT_PCB_FAB::m_variantNames, JOB_EXPORT_PCB_ODB::m_variantPackaging, name, OdbVariantFileTokensCollide(), path, REPORTER::Report(), JOB::ResolveOutputPath(), result, RPT_SEVERITY_ERROR, RPT_SEVERITY_WARNING, FAB::SectionSetFromKeyString(), JOB_EXPORT_PCB_ODB::SEPARATE, and JOB_EXPORT_PCB_ODB::SupportsDataSet().
Referenced by PCBNEW_JOBS_HANDLER::JobExportOdb(), and DIALOG_EXPORT_ODBPP::onOKClick().
|
static |
Definition at line 345 of file odb_export_job.cpp.
References _, PROGRESS_REPORTER::AdvancePhase(), directory, PATHS::EnsurePathExists(), PCB_IO_ODBPP::Export(), FromFsPath(), BOARD::GetFileName(), GetKiCadThreadPool(), PROGRESS_REPORTER::KeepRefreshing(), JOB_EXPORT_PCB_ODB::m_compressionMode, JOB_EXPORT_PCB_FAB::m_filename, JOB_EXPORT_PCB_ODB::m_productName, SCOPED_TEMP_PATH::MakeDirectory(), JOB_EXPORT_PCB_ODB::NONE, SCOPED_TEMP_PATH::Path(), REPORTER::Report(), WX_FILENAME::ResolvePossibleSymlinks(), result, RPT_SEVERITY_ERROR, PROGRESS_REPORTER::SetCurrentProgress(), IO_BASE::SetProgressReporter(), IO_BASE::SetReporter(), KIDIALOG::ShowModal(), TGZ, JOB_EXPORT_PCB_ODB::TGZ, ToFsPath(), IO_ERROR::What(), WriteDirectoryArchive(), and ZIP.
Referenced by GenerateODBPPFiles().
| FAB::SECTION_SET OdbDefaultSections | ( | FAB::MODE | aMode | ) |
Sections a data set exports when no section key is given.
Definition at line 784 of file odb_export_job.cpp.
References FAB::DFX, FAB::RecommendedOptionalSections(), FAB::RequiredSections(), and FAB::SECTION_SET::Set().
Referenced by OdbSectionKeyForSelection(), and PANEL_FAB_EXPORT_CONTENT::ResolvedSections().
| wxString OdbPreviewReferenceName | ( | const wxString & | aReference, |
| const std::vector< ODB_MATRIX_PREVIEW_ROW > & | aRows ) |
Matrix name of the row whose ID is aReference.
Definition at line 811 of file odb_export_job.cpp.
Referenced by DIALOG_EXPORT_ODBPP::refreshLayerRows().
| wxString OdbSectionKeyForSelection | ( | FAB::MODE | aMode, |
| const FAB::SECTION_SET & | aSelection ) |
Use an empty section key when Customize matches the data set default.
Definition at line 802 of file odb_export_job.cpp.
References OdbDefaultSections(), and FAB::SectionKeyString().
Referenced by PANEL_FAB_EXPORT_CONTENT::onCustomizeClick().
| bool OdbVariantFileTokensCollide | ( | const std::vector< wxString > & | aTokens, |
| const std::function< wxString(const wxString &)> & | aLocaleFold ) |
Check whether variant output tokens could name the same file.
Definition at line 316 of file odb_export_job.cpp.
Referenced by GenerateODBPPFiles().
| std::vector< ODB_MATRIX_PREVIEW_ROW > PreviewOdbMatrix | ( | BOARD * | aBoard, |
| const JOB_EXPORT_PCB_ODB & | aJob ) |
Build export matrix rows without layer overrides or writing files.
Definition at line 823 of file odb_export_job.cpp.
References BOARD_LAYER, PCB_IO_ODBPP::ConfigureExport(), ODB::Enum2String(), BOARD::GetCurrentVariant(), BOARD::GetLayerName(), ODB_MATRIX_ENTITY::GetMatrixLayers(), ODB_MATRIX_ENTITY::InitEntityData(), ODB_MATRIX_ROW::m_addType, ODB_MATRIX_PREVIEW_ROW::m_boardLayer, ODB_MATRIX_ROW::m_context, ODB_MATRIX_ROW::m_cuBottom, ODB_MATRIX_ROW::m_cuTop, ODB_MATRIX_ROW::m_dielectricType, ODB_MATRIX_PREVIEW_ROW::m_displayLayer, ODB_MATRIX_PREVIEW_ROW::m_editable, ODB_MATRIX_ROW::m_endName, ODB_MATRIX_ROW::m_id, ODB_EXPORT_OPTIONS::m_layerOverrides, ODB_MATRIX_PREVIEW_ROW::m_matrix, ODB_MATRIX_ROW::m_name, ODB_MATRIX_ROW::m_polarity, ODB_MATRIX_ROW::m_ref, ODB_MATRIX_ROW::m_row, ODB_MATRIX_ROW::m_startName, ODB_MATRIX_ROW::m_type, and UNDEFINED_LAYER.
Referenced by DIALOG_EXPORT_ODBPP::refreshLayerRows().
| wxString UpdateOdbVariantOutputPath | ( | const wxString & | aPath, |
| bool | aDirectory, | ||
| bool | aSeparate, | ||
| bool | aRemoveAutomaticSuffix ) |
Add or remove the automatic variant suffix on the file stem or final directory.
Definition at line 743 of file odb_export_job.cpp.
Referenced by DIALOG_EXPORT_ODBPP::updateVariantFilename().