KiCad PCB EDA Suite
Loading...
Searching...
No Matches
command_pcb_export_ipcd356.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) 2025 Connor Goss <[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 along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
22#include <cli/exit_codes.h>
24#include <kiface_base.h>
25#include <string_utils.h>
26#include <wx/crt.h>
27
28#include <macros.h>
29#include <wx/tokenzr.h>
30
31#include <locale_io.h>
32
34{
35 m_argParser.add_description( std::string( "Generate IPC-D-356 netlist file" ) );
36}
37
38
40{
41 int exitCode = PCB_EXPORT_BASE_COMMAND::doPerform( aKiway );
42
43 if( exitCode != EXIT_CODES::OK )
44 return exitCode;
45
46 std::unique_ptr<JOB_EXPORT_PCB_IPCD356> ipcd356Job( new JOB_EXPORT_PCB_IPCD356() );
47
48 ipcd356Job->m_filename = m_argInput;
49 ipcd356Job->SetConfiguredOutputPath( m_argOutput );
50
51 if( !wxFile::Exists( ipcd356Job->m_filename ) )
52 {
53 wxFprintf( stderr, _( "Board file does not exist or is not accessible\n" ) );
55 }
56
57 exitCode = aKiway.ProcessJob( KIWAY::FACE_PCB, ipcd356Job.get() );
58
59 return exitCode;
60}
argparse::ArgumentParser m_argParser
Definition: command.h:100
int doPerform(KIWAY &aKiway) override
The internal handler that should be overloaded to implement command specific processing and work.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:285
@ FACE_PCB
pcbnew DSO
Definition: kiway.h:293
int ProcessJob(KIWAY::FACE_T aFace, JOB *aJob, REPORTER *aReporter=nullptr)
Definition: kiway.cpp:711
#define _(s)
This file contains miscellaneous commonly used macros and functions.
static const int OK
Definition: exit_codes.h:30
static const int ERR_INVALID_INPUT_FILE
Definition: exit_codes.h:33
int doPerform(KIWAY &aKiway) override
The internal handler that should be overloaded to implement command specific processing and work.