2022-10-04 01:53:37 +00:00
/*
* This program source code file is part of KiCad , a free EDA CAD application .
*
* Copyright ( C ) 2022 Mark Roszko < mark . roszko @ gmail . com >
2023-12-19 14:29:17 -05:00
* Copyright ( C ) 1992 - 2023 KiCad Developers , see AUTHORS . txt for contributors .
2022-10-04 01:53:37 +00: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/>.
*/
2022-10-25 23:03:21 -04:00
# ifndef COMMAND_EXPORT_PCB_BASE_H
# define COMMAND_EXPORT_PCB_BASE_H
2022-10-04 01:53:37 +00:00
# include "command.h"
2022-10-25 23:03:21 -04:00
# include <layer_ids.h>
2024-07-08 20:58:47 -07:00
# include <lset.h>
# include <lseq.h>
2022-10-04 01:53:37 +00:00
namespace CLI
{
2022-10-28 09:43:35 -04:00
# define ARG_BLACKANDWHITE "--black-and-white"
2023-01-08 22:37:48 -05:00
# define ARG_BLACKANDWHITE_DESC "Black and white only"
2024-05-27 20:56:16 +01:00
# define ARG_SKETCH_PADS_ON_FAB_LAYERS "--sketch-pads-on-fab-layers"
# define ARG_SKETCH_PADS_ON_FAB_LAYERS_DESC "Draw pad outlines and their numbers on front and back fab layers"
2024-08-18 09:57:55 -06:00
# define ARG_HIDE_DNP_FPS_ON_FAB_LAYERS "--hide-DNP-footprints-on-fab-layers"
# define ARG_HIDE_DNP_FPS_ON_FAB_LAYERS_DESC "Don't plot text & graphics of DNP footprints on fab layers"
# define ARG_SKETCH_DNP_FPS_ON_FAB_LAYERS "--sketch-DNP-footprints-on-fab-layers"
# define ARG_SKETCH_DNP_FPS_ON_FAB_LAYERS_DESC "Plot graphics of DNP footprints in sketch mode on fab layers"
# define ARG_CROSSOUT_DNP_FPS_ON_FAB_LAYERS "--crossout-DNP-footprints-on-fab-layers"
# define ARG_CROSSOUT_DNP_FPS_ON_FAB_LAYERS_DESC "Plot an 'X' over the courtyard of DNP footprints on fab layers, and strikeout their reference designators"
2024-05-27 20:56:16 +01:00
# define ARG_DRILL_SHAPE_OPTION "--drill-shape-opt"
# define ARG_DRILL_SHAPE_OPTION_DESC "Set pad / via drill shape option (0 = no shape, 1 = small shape, 2 = actual shape)"
2023-06-03 20:44:03 +02:00
# define ARG_NEGATIVE "--negative"
# define ARG_NEGATIVE_SHORT "-n"
# define ARG_NEGATIVE_DESC "Plot as negative (useful for directly etching from the export)"
2022-10-28 09:43:35 -04:00
# define ARG_LAYERS "--layers"
2023-01-08 22:53:08 -05:00
# define ARG_EXCLUDE_REFDES "--exclude-refdes"
# define ARG_EXCLUDE_VALUE "--exclude-value"
2022-10-28 09:43:35 -04:00
# define ARG_THEME "--theme"
# define ARG_INCLUDE_BORDER_TITLE "--include-border-title"
2023-06-10 04:54:11 +03:00
# define ARG_MIRROR "--mirror"
2022-10-25 23:03:21 -04:00
2025-01-01 13:53:47 -05:00
# define ARG_PLOT_INVISIBLE_TEXT "--plot-invisible-text"
# define ARG_PLOT_INVISIBLE_TEXT_DESC "Force plotting of invisible values / refs"
2024-09-16 22:31:52 +00:00
# define ARG_FLIP_BOTTOM_PADS "--flip-bottom-pads"
# define ARG_UNIQUE_PINS "--unique-pins"
# define ARG_UNIQUE_FOOTPRINTS "--unique-footprints"
# define ARG_USE_DRILL_ORIGIN "--use-drill-origin"
# define ARG_STORE_ORIGIN_COORD "--store-origin-coord"
2024-12-31 10:52:26 -05:00
# define ARG_COMMON_LAYERS "--common-layers"
2023-08-19 11:51:50 -04:00
struct PCB_EXPORT_BASE_COMMAND : public COMMAND
2022-10-04 01:53:37 +00:00
{
2023-12-19 14:29:17 -05:00
PCB_EXPORT_BASE_COMMAND ( const std : : string & aName , bool aInputIsDir = false ,
bool aOutputIsDir = false ) ;
2022-10-25 23:03:21 -04:00
protected :
2023-01-01 11:50:40 -05:00
int doPerform ( KIWAY & aKiway ) override ;
2023-09-28 10:59:11 -04:00
LSEQ convertLayerStringList ( wxString & aLayerString , bool & aLayerArgSet ) const ;
2022-10-28 09:43:35 -04:00
void addLayerArg ( bool aRequire ) ;
2022-10-04 01:53:37 +00:00
2023-03-30 13:17:24 +02:00
// The list of canonical layer names used in .kicad_pcb files:
2022-10-25 23:03:21 -04:00
std : : map < std : : string , LSET > m_layerMasks ;
2023-03-30 13:17:24 +02:00
// The list of canonical layer names used in GUI (not translated):
std : : map < std : : string , LSET > m_layerGuiMasks ;
2023-09-28 10:59:11 -04:00
LSEQ m_selectedLayers ;
2022-12-11 13:57:21 -05:00
bool m_selectedLayersSet ;
2022-10-28 09:43:35 -04:00
2022-12-11 13:57:21 -05:00
bool m_hasLayerArg ;
bool m_requireLayers ;
2022-10-04 01:53:37 +00:00
} ;
2022-10-25 23:03:21 -04:00
} // namespace CLI
2022-10-04 01:53:37 +00:00
2023-06-03 20:44:03 +02:00
# endif