KiCad PCB EDA Suite
Loading...
Searching...
No Matches
job_export_pcb_stackup.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) 2026 Krishna Swaroop <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
22
23#include <jobs/job_registry.h>
24#include <i18n_utility.h>
26#include <wx/filename.h>
27
38
40 JOB( "stackup", false ),
41 m_filename(),
44 m_includeColor( true ),
45 m_includeMaterial( true ),
46 m_includeThickness( true ),
47 m_includeEpsilonR( true ),
49 m_includeFinish( true ),
51{
52 m_params.emplace_back( new JOB_PARAM<OUTPUT_FORMAT>( "output_format", &m_format, m_format ) );
53 m_params.emplace_back( new JOB_PARAM<UNITS>( "units", &m_units, m_units ) );
54 m_params.emplace_back( new JOB_PARAM<bool>( "include_color", &m_includeColor, m_includeColor ) );
55 m_params.emplace_back( new JOB_PARAM<bool>( "include_material", &m_includeMaterial, m_includeMaterial ) );
56 m_params.emplace_back( new JOB_PARAM<bool>( "include_thickness", &m_includeThickness, m_includeThickness ) );
57 m_params.emplace_back( new JOB_PARAM<bool>( "include_epsilon_r", &m_includeEpsilonR, m_includeEpsilonR ) );
58 m_params.emplace_back( new JOB_PARAM<bool>( "include_loss_tangent", &m_includeLossTangent, m_includeLossTangent ) );
59 m_params.emplace_back( new JOB_PARAM<bool>( "include_finish", &m_includeFinish, m_includeFinish ) );
60 m_params.emplace_back(
61 new JOB_PARAM<bool>( "include_board_options", &m_includeBoardOptions, m_includeBoardOptions ) );
62}
63
64
66{
67 return _( "Export board stackup table" );
68}
69
70
72{
73 return _( "Export Board Stackup Job Settings" );
74}
75
76
77void JOB_EXPORT_PCB_STACKUP::SetDefaultOutputPath( const wxString& aReferenceName )
78{
79 wxFileName fn( aReferenceName );
80
81 fn.SetName( fn.GetName() + wxS( "_stackup" ) );
82
84 fn.SetExt( FILEEXT::JsonFileExtension );
85 else
86 fn.SetExt( FILEEXT::CsvFileExtension );
87
88 SetWorkingOutputPath( fn.GetFullName() );
89}
90
91
92REGISTER_JOB( pcb_export_stackup, _HKI( "PCB: Export Stackup Table" ), KIWAY::FACE_PCB, JOB_EXPORT_PCB_STACKUP );
wxString GetDefaultDescription() const override
wxString GetSettingsDialogTitle() const override
void SetDefaultOutputPath(const wxString &aReferenceName)
std::vector< JOB_PARAM_BASE * > m_params
Definition job.h:285
JOB(const std::string &aType, bool aOutputIsDirectory)
Definition job.cpp:26
void SetWorkingOutputPath(const wxString &aPath)
Sets a transient output path for the job, it takes priority over the configured output path when GetF...
Definition job.h:241
@ FACE_PCB
pcbnew DSO
Definition kiway.h:356
#define _(s)
static const std::string JsonFileExtension
static const std::string CsvFileExtension
Some functions to handle hotkeys in KiCad.
NLOHMANN_JSON_SERIALIZE_ENUM(JOB_EXPORT_PCB_STACKUP::OUTPUT_FORMAT, { { JOB_EXPORT_PCB_STACKUP::OUTPUT_FORMAT::CSV, "csv" }, { JOB_EXPORT_PCB_STACKUP::OUTPUT_FORMAT::JSON, "json" }, }) NLOHMANN_JSON_SERIALIZE_ENUM(JOB_EXPORT_PCB_STACKUP
#define REGISTER_JOB(job_name, title, face, T)
#define _HKI(x)
Definition page_info.cpp:40
Definition of file extensions used in Kicad.