KiCad PCB EDA Suite
Loading...
Searching...
No Matches
job_export_sch_netlist.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) 2023 Mark Roszko <[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 <jobs/job_registry.h>
23#include <i18n_utility.h>
24
25
26std::map<JOB_EXPORT_SCH_NETLIST::FORMAT, wxString> jobNetlistNameLookup =
27{
30 { JOB_EXPORT_SCH_NETLIST::FORMAT::ORCADPCB2, wxT( "OrcadPCB2" ) },
31 { JOB_EXPORT_SCH_NETLIST::FORMAT::ALLEGRO, wxT( "Allegro" ) },
32 { JOB_EXPORT_SCH_NETLIST::FORMAT::PADS, wxT( "PADS" ) },
33 { JOB_EXPORT_SCH_NETLIST::FORMAT::CADSTAR, wxT( "CadStar" ) },
34 { JOB_EXPORT_SCH_NETLIST::FORMAT::SPICE, wxT( "SPICE" ) },
35 { JOB_EXPORT_SCH_NETLIST::FORMAT::SPICEMODEL, wxT( "SPICE Model" ) }
36};
37
38
40 {
49 } )
50
52 JOB( "netlist", false ),
53 m_filename(),
54 format( FORMAT::KICADSEXPR ),
55 m_spiceSaveAllVoltages( false ),
56 m_spiceSaveAllCurrents( false ),
57 m_spiceSaveAllDissipations( false ),
58 m_spiceSaveAllEvents( false )
59{
60 m_params.emplace_back( new JOB_PARAM<FORMAT>( "format", &format, format ) );
61 m_params.emplace_back( new JOB_PARAM<bool>( "spice.save_all_voltages", &m_spiceSaveAllVoltages,
62 m_spiceSaveAllVoltages ) );
63 m_params.emplace_back( new JOB_PARAM<bool>( "spice.save_all_currents", &m_spiceSaveAllCurrents,
64 m_spiceSaveAllCurrents ) );
65 m_params.emplace_back( new JOB_PARAM<bool>( "spice.save_all_events", &m_spiceSaveAllEvents,
66 m_spiceSaveAllEvents ) );
67 m_params.emplace_back( new JOB_PARAM<bool>( "spice.save_all_dissipations", &m_spiceSaveAllDissipations,
68 m_spiceSaveAllDissipations ) );
69}
70
71
72std::map<JOB_EXPORT_SCH_NETLIST::FORMAT, wxString>& JOB_EXPORT_SCH_NETLIST::GetFormatNameMap()
73{
75}
76
77
79{
80 return wxString::Format( _( "Export %s netlist" ), GetFormatNameMap()[format] );
81}
82
83
85{
86 return wxString::Format( _( "Export Netlist Job Settings" ) );
87}
88
89
90REGISTER_JOB( sch_export_netlist, _HKI( "Schematic: Export Netlist" ), KIWAY::FACE_SCH,
static std::map< JOB_EXPORT_SCH_NETLIST::FORMAT, wxString > & GetFormatNameMap()
wxString GetDefaultDescription() const override
wxString GetSettingsDialogTitle() const override
Definition: job.h:50
An simple container class that lets us dispatch output jobs to kifaces.
Definition: job.h:182
@ FACE_SCH
eeschema DSO
Definition: kiway.h:292
#define _HKI(x)
#define _(s)
Some functions to handle hotkeys in KiCad.
std::map< JOB_EXPORT_SCH_NETLIST::FORMAT, wxString > jobNetlistNameLookup
NLOHMANN_JSON_SERIALIZE_ENUM(JOB_EXPORT_SCH_NETLIST::FORMAT, { { JOB_EXPORT_SCH_NETLIST::FORMAT::KICADSEXPR, "kicad" }, { JOB_EXPORT_SCH_NETLIST::FORMAT::KICADXML, "xml" }, { JOB_EXPORT_SCH_NETLIST::FORMAT::ALLEGRO, "allegro" }, { JOB_EXPORT_SCH_NETLIST::FORMAT::PADS, "pads" }, { JOB_EXPORT_SCH_NETLIST::FORMAT::CADSTAR, "cadstar" }, { JOB_EXPORT_SCH_NETLIST::FORMAT::ORCADPCB2, "orcadpcb2" }, { JOB_EXPORT_SCH_NETLIST::FORMAT::SPICE, "spice" }, { JOB_EXPORT_SCH_NETLIST::FORMAT::SPICEMODEL, "spicemodel" }, }) JOB_EXPORT_SCH_NETLIST
#define REGISTER_JOB(job_name, title, face, T)
Definition: job_registry.h:64