KiCad PCB EDA Suite
Loading...
Searching...
No Matches
command_pcb_export_specctra.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
21#include <cli/exit_codes.h>
23#include <string_utils.h>
24#include <wx/crt.h>
25#include <wx/file.h>
26
27
30{
31 m_argParser.add_description( UTF8STDSTR( _( "Export the PCB as a Specctra DSN file (.dsn)" ) ) );
32
34}
35
36
38{
39 std::unique_ptr<JOB_EXPORT_PCB_SPECCTRA_DSN> specctraJob( new JOB_EXPORT_PCB_SPECCTRA_DSN() );
40
41 specctraJob->m_filename = m_argInput;
42 specctraJob->SetConfiguredOutputPath( m_argOutput );
43 specctraJob->SetVarOverrides( m_argDefineVars );
44
45 if( !wxFile::Exists( specctraJob->m_filename ) )
46 {
47 wxFprintf( stderr, _( "Board file does not exist or is not accessible\n" ) );
49 }
50
51 return aKiway.ProcessJob( KIWAY::FACE_PCB, specctraJob.get() );
52}
std::map< wxString, wxString > m_argDefineVars
Value of the drawing sheet arg if configured.
Definition command.h:153
argparse::ArgumentParser m_argParser
Definition command.h:113
void addDefineArg()
Set up the drawing sheet arg used by many of the export commands.
Definition command.cpp:214
wxString m_argOutput
Value of the output arg if configured.
Definition command.h:143
wxString m_argInput
Value of the common input arg if configured.
Definition command.h:138
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:348
int ProcessJob(KIWAY::FACE_T aFace, JOB *aJob, REPORTER *aReporter=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr)
Definition kiway.cpp:753
@ FACE_PCB
pcbnew DSO
Definition kiway.h:356
#define UTF8STDSTR(s)
Definition command.h:27
#define _(s)
static const int ERR_INVALID_INPUT_FILE
Definition exit_codes.h:33
PCB_EXPORT_BASE_COMMAND(const std::string &aName, IO_TYPE aInputType=IO_TYPE::FILE, IO_TYPE aOutputType=IO_TYPE::FILE)