2023-09-16 21:02:33 -04:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2023 Mark Roszko <mark.roszko@gmail.com>
|
2025-01-01 13:30:11 -08:00
|
|
|
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
|
2023-09-16 21:02:33 -04:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation, either version 3 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <jobs/job_export_pcb_dxf.h>
|
2024-07-15 18:20:13 -04:00
|
|
|
#include <jobs/job_registry.h>
|
|
|
|
#include <i18n_utility.h>
|
2023-09-16 21:02:33 -04:00
|
|
|
|
2024-12-31 23:07:50 -05:00
|
|
|
NLOHMANN_JSON_SERIALIZE_ENUM( JOB_EXPORT_PCB_DXF::GEN_MODE,
|
|
|
|
{
|
2025-01-09 23:25:13 -05:00
|
|
|
{ JOB_EXPORT_PCB_DXF::GEN_MODE::MULTI, "multi" },
|
|
|
|
{ JOB_EXPORT_PCB_DXF::GEN_MODE::SINGLE, "single" },
|
2024-12-31 23:07:50 -05:00
|
|
|
} )
|
|
|
|
|
2024-07-15 18:20:13 -04:00
|
|
|
NLOHMANN_JSON_SERIALIZE_ENUM( JOB_EXPORT_PCB_DXF::DXF_UNITS,
|
|
|
|
{
|
2025-03-02 11:34:30 +01:00
|
|
|
{ JOB_EXPORT_PCB_DXF::DXF_UNITS::INCH, "in" },
|
2025-03-01 20:24:37 +00:00
|
|
|
{ JOB_EXPORT_PCB_DXF::DXF_UNITS::MM, "mm" },
|
2024-07-15 18:20:13 -04:00
|
|
|
} )
|
2023-09-16 21:02:33 -04:00
|
|
|
|
2024-11-04 20:51:15 -05:00
|
|
|
JOB_EXPORT_PCB_DXF::JOB_EXPORT_PCB_DXF() :
|
2025-03-01 20:24:37 +00:00
|
|
|
JOB_EXPORT_PCB_PLOT( JOB_EXPORT_PCB_PLOT::PLOT_FORMAT::DXF, "dxf", false ),
|
|
|
|
m_plotGraphicItemsUsingContours( true ),
|
|
|
|
m_polygonMode( true ),
|
2025-03-02 11:34:30 +01:00
|
|
|
m_dxfUnits( DXF_UNITS::INCH ),
|
2025-03-01 20:24:37 +00:00
|
|
|
m_genMode( GEN_MODE::MULTI )
|
2023-09-16 21:02:33 -04:00
|
|
|
{
|
2024-12-31 23:07:50 -05:00
|
|
|
m_plotDrawingSheet = false;
|
|
|
|
|
2025-04-29 07:23:57 -03:00
|
|
|
m_params.emplace_back( new JOB_PARAM<double>( "scale", &m_scale, m_scale ) );
|
2025-03-02 19:26:34 +00:00
|
|
|
m_params.emplace_back( new JOB_PARAM<bool>( "plot_graphic_items_using_contours",
|
|
|
|
&m_plotGraphicItemsUsingContours,
|
2024-07-15 18:20:13 -04:00
|
|
|
m_plotGraphicItemsUsingContours ) );
|
|
|
|
m_params.emplace_back( new JOB_PARAM<DXF_UNITS>( "units", &m_dxfUnits, m_dxfUnits ) );
|
2024-12-31 23:07:50 -05:00
|
|
|
m_params.emplace_back( new JOB_PARAM<bool>( "polygon_mode", &m_polygonMode, m_polygonMode ) );
|
|
|
|
m_params.emplace_back( new JOB_PARAM<GEN_MODE>( "gen_mode", &m_genMode, m_genMode ) );
|
2024-07-15 18:20:13 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-12-28 21:18:15 -05:00
|
|
|
wxString JOB_EXPORT_PCB_DXF::GetDefaultDescription() const
|
2024-07-15 18:20:13 -04:00
|
|
|
{
|
2025-01-02 13:20:31 +00:00
|
|
|
return _( "Export DXF" );
|
2024-07-15 18:20:13 -04:00
|
|
|
}
|
|
|
|
|
2025-01-01 16:32:36 +00:00
|
|
|
|
2025-01-04 14:02:24 +00:00
|
|
|
wxString JOB_EXPORT_PCB_DXF::GetSettingsDialogTitle() const
|
2025-01-01 16:32:36 +00:00
|
|
|
{
|
2025-01-04 14:02:24 +00:00
|
|
|
return _( "Export DXF Job Settings" );
|
2025-01-01 16:32:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-07-15 18:20:13 -04:00
|
|
|
REGISTER_JOB( pcb_export_dxf, _HKI( "PCB: Export DXF" ), KIWAY::FACE_PCB, JOB_EXPORT_PCB_DXF );
|