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>
25#include <wx/filename.h>
26
37
39 JOB( "stackup", false ),
40 m_filename(),
43 m_includeColor( true ),
44 m_includeMaterial( true ),
45 m_includeThickness( true ),
46 m_includeEpsilonR( true ),
48 m_includeFinish( true ),
50{
51 m_params.emplace_back( new JOB_PARAM<OUTPUT_FORMAT>( "output_format", &m_format, m_format ) );
52 m_params.emplace_back( new JOB_PARAM<UNITS>( "units", &m_units, m_units ) );
53 m_params.emplace_back( new JOB_PARAM<bool>( "include_color", &m_includeColor, m_includeColor ) );
54 m_params.emplace_back( new JOB_PARAM<bool>( "include_material", &m_includeMaterial, m_includeMaterial ) );
55 m_params.emplace_back( new JOB_PARAM<bool>( "include_thickness", &m_includeThickness, m_includeThickness ) );
56 m_params.emplace_back( new JOB_PARAM<bool>( "include_epsilon_r", &m_includeEpsilonR, m_includeEpsilonR ) );
57 m_params.emplace_back( new JOB_PARAM<bool>( "include_loss_tangent", &m_includeLossTangent, m_includeLossTangent ) );
58 m_params.emplace_back( new JOB_PARAM<bool>( "include_finish", &m_includeFinish, m_includeFinish ) );
59 m_params.emplace_back(
60 new JOB_PARAM<bool>( "include_board_options", &m_includeBoardOptions, m_includeBoardOptions ) );
61}
62
63
65{
66 return _( "Export board stackup table" );
67}
68
69
71{
72 return _( "Export Board Stackup Job Settings" );
73}
74
75
76void JOB_EXPORT_PCB_STACKUP::SetDefaultOutputPath( const wxString& aReferenceName )
77{
78 wxFileName fn( aReferenceName );
79
80 fn.SetName( fn.GetName() + wxS( "_stackup" ) );
81
83 fn.SetExt( FILEEXT::JsonFileExtension );
84 else
85 fn.SetExt( FILEEXT::CsvFileExtension );
86
87 SetWorkingOutputPath( fn.GetFullName() );
88}
89
90
91REGISTER_JOB( pcb_export_stackup, _( "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:277
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:348
#define _(s)
static const std::string JsonFileExtension
static const std::string CsvFileExtension
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)
Definition of file extensions used in Kicad.