mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-21 16:23:44 +00:00
Naming consistency for jobs.
This commit is contained in:
parent
6aa25093da
commit
9ed3c8eb82
common/jobs
job_export_pcb_drill.cppjob_export_pcb_dxf.cppjob_export_pcb_gerber.cppjob_export_pcb_gerbers.cppjob_export_pcb_ipc2581.cppjob_export_pcb_odb.cppjob_export_pcb_pdf.cppjob_export_pcb_pos.cppjob_export_pcb_svg.cppjob_export_sch_bom.cppjob_export_sch_netlist.cppjob_export_sch_netlist.hjob_export_sch_plot.cppjob_pcb_drc.cppjob_pcb_render.cppjob_pcb_render.hjob_sch_erc.cpp
eeschema/dialogs
pcbnew/dialogs
@ -120,7 +120,7 @@ JOB_EXPORT_PCB_DRILL::JOB_EXPORT_PCB_DRILL() :
|
||||
|
||||
wxString JOB_EXPORT_PCB_DRILL::GetDefaultDescription() const
|
||||
{
|
||||
return _( "Drill data export" );
|
||||
return _( "Export drill data" );
|
||||
}
|
||||
|
||||
|
||||
|
@ -55,7 +55,7 @@ JOB_EXPORT_PCB_DXF::JOB_EXPORT_PCB_DXF() :
|
||||
|
||||
wxString JOB_EXPORT_PCB_DXF::GetDefaultDescription() const
|
||||
{
|
||||
return _( "PCB DXF export" );
|
||||
return _( "Export DXF" );
|
||||
}
|
||||
|
||||
|
||||
|
@ -68,7 +68,7 @@ JOB_EXPORT_PCB_GERBER::JOB_EXPORT_PCB_GERBER() :
|
||||
|
||||
wxString JOB_EXPORT_PCB_GERBER::GetDefaultDescription() const
|
||||
{
|
||||
return _( "Single Gerber export" );
|
||||
return _( "Export single Gerber" );
|
||||
}
|
||||
|
||||
|
||||
|
@ -40,7 +40,7 @@ JOB_EXPORT_PCB_GERBERS::JOB_EXPORT_PCB_GERBERS() :
|
||||
|
||||
wxString JOB_EXPORT_PCB_GERBERS::GetDefaultDescription() const
|
||||
{
|
||||
return _( "PCB Gerbers export" );
|
||||
return _( "Export Gerbers" );
|
||||
}
|
||||
|
||||
|
||||
|
@ -69,7 +69,7 @@ JOB_EXPORT_PCB_IPC2581::JOB_EXPORT_PCB_IPC2581() :
|
||||
|
||||
wxString JOB_EXPORT_PCB_IPC2581::GetDefaultDescription() const
|
||||
{
|
||||
return _( "IPC2581 export" );
|
||||
return _( "Export IPC2581" );
|
||||
}
|
||||
|
||||
|
||||
|
@ -54,7 +54,7 @@ JOB_EXPORT_PCB_ODB::JOB_EXPORT_PCB_ODB() :
|
||||
|
||||
wxString JOB_EXPORT_PCB_ODB::GetDefaultDescription() const
|
||||
{
|
||||
return _( "ODB++ export" );
|
||||
return _( "Export ODB++" );
|
||||
}
|
||||
|
||||
|
||||
|
@ -71,7 +71,7 @@ JOB_EXPORT_PCB_PDF::JOB_EXPORT_PCB_PDF() :
|
||||
|
||||
wxString JOB_EXPORT_PCB_PDF::GetDefaultDescription() const
|
||||
{
|
||||
return wxString::Format( _( "PCB PDF export" ) );
|
||||
return wxString::Format( _( "Export PDF" ) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -88,7 +88,7 @@ JOB_EXPORT_PCB_POS::JOB_EXPORT_PCB_POS() :
|
||||
|
||||
wxString JOB_EXPORT_PCB_POS::GetDefaultDescription() const
|
||||
{
|
||||
return _( "Placement data export" );
|
||||
return _( "Export position data" );
|
||||
}
|
||||
|
||||
|
||||
|
@ -55,7 +55,7 @@ JOB_EXPORT_PCB_SVG::JOB_EXPORT_PCB_SVG() :
|
||||
|
||||
wxString JOB_EXPORT_PCB_SVG::GetDefaultDescription() const
|
||||
{
|
||||
return _( "PCB SVG export" );
|
||||
return _( "Export SVG" );
|
||||
}
|
||||
|
||||
|
||||
|
@ -83,14 +83,15 @@ JOB_EXPORT_SCH_BOM::JOB_EXPORT_SCH_BOM() :
|
||||
|
||||
wxString JOB_EXPORT_SCH_BOM::GetDefaultDescription() const
|
||||
{
|
||||
return wxString::Format( _( "Schematic BOM export" ) );
|
||||
return wxString::Format( _( "Generate bill of materials" ) );
|
||||
}
|
||||
|
||||
|
||||
wxString JOB_EXPORT_SCH_BOM::GetOptionsDialogTitle() const
|
||||
{
|
||||
return wxString::Format( _( "Export BOM Job Options" ) );
|
||||
return wxString::Format( _( "Generate Bill of Materials Job Options" ) );
|
||||
}
|
||||
|
||||
|
||||
REGISTER_JOB( sch_export_bom, _HKI( "Schematic: Export BOM" ), KIWAY::FACE_SCH, JOB_EXPORT_SCH_BOM );
|
||||
REGISTER_JOB( sch_export_bom, _HKI( "Schematic: Generate Bill of Materials" ), KIWAY::FACE_SCH,
|
||||
JOB_EXPORT_SCH_BOM );
|
@ -23,6 +23,19 @@
|
||||
#include <i18n_utility.h>
|
||||
|
||||
|
||||
std::map<JOB_EXPORT_SCH_NETLIST::FORMAT, wxString> jobNetlistNameLookup =
|
||||
{
|
||||
{ JOB_EXPORT_SCH_NETLIST::FORMAT::KICADSEXPR, wxT( "KiCad" ) },
|
||||
{ JOB_EXPORT_SCH_NETLIST::FORMAT::KICADXML, wxT( "XML" ) },
|
||||
{ JOB_EXPORT_SCH_NETLIST::FORMAT::ORCADPCB2, wxT( "OrcadPCB2" ) },
|
||||
{ JOB_EXPORT_SCH_NETLIST::FORMAT::ALLEGRO, wxT( "Allegro" ) },
|
||||
{ JOB_EXPORT_SCH_NETLIST::FORMAT::PADS, wxT( "PADS" ) },
|
||||
{ JOB_EXPORT_SCH_NETLIST::FORMAT::CADSTAR, wxT( "CadStar" ) },
|
||||
{ JOB_EXPORT_SCH_NETLIST::FORMAT::SPICE, wxT( "SPICE" ) },
|
||||
{ JOB_EXPORT_SCH_NETLIST::FORMAT::SPICEMODEL, wxT( "SPICE Model" ) }
|
||||
};
|
||||
|
||||
|
||||
NLOHMANN_JSON_SERIALIZE_ENUM( JOB_EXPORT_SCH_NETLIST::FORMAT,
|
||||
{
|
||||
{ JOB_EXPORT_SCH_NETLIST::FORMAT::KICADSEXPR, "kicad" },
|
||||
@ -56,9 +69,15 @@ JOB_EXPORT_SCH_NETLIST::JOB_EXPORT_SCH_NETLIST() :
|
||||
}
|
||||
|
||||
|
||||
std::map<JOB_EXPORT_SCH_NETLIST::FORMAT, wxString>& JOB_EXPORT_SCH_NETLIST::GetFormatNameMap()
|
||||
{
|
||||
return jobNetlistNameLookup;
|
||||
}
|
||||
|
||||
|
||||
wxString JOB_EXPORT_SCH_NETLIST::GetDefaultDescription() const
|
||||
{
|
||||
return _( "Schematic Netlist Export" );
|
||||
return wxString::Format( _( "Export %s netlist" ), GetFormatNameMap()[format] );
|
||||
}
|
||||
|
||||
|
||||
|
@ -28,12 +28,6 @@
|
||||
class KICOMMON_API JOB_EXPORT_SCH_NETLIST : public JOB
|
||||
{
|
||||
public:
|
||||
JOB_EXPORT_SCH_NETLIST();
|
||||
wxString GetDefaultDescription() const override;
|
||||
wxString GetOptionsDialogTitle() const override;
|
||||
|
||||
wxString m_filename;
|
||||
|
||||
enum class FORMAT
|
||||
{
|
||||
KICADXML,
|
||||
@ -46,6 +40,15 @@ public:
|
||||
ALLEGRO
|
||||
};
|
||||
|
||||
static std::map<JOB_EXPORT_SCH_NETLIST::FORMAT, wxString>& GetFormatNameMap();
|
||||
|
||||
public:
|
||||
JOB_EXPORT_SCH_NETLIST();
|
||||
wxString GetDefaultDescription() const override;
|
||||
wxString GetOptionsDialogTitle() const override;
|
||||
|
||||
wxString m_filename;
|
||||
|
||||
FORMAT format;
|
||||
|
||||
bool m_spiceSaveAllVoltages;
|
||||
|
@ -125,7 +125,7 @@ JOB_EXPORT_SCH_PLOT_PDF::JOB_EXPORT_SCH_PLOT_PDF() :
|
||||
|
||||
wxString JOB_EXPORT_SCH_PLOT_PDF::GetDefaultDescription() const
|
||||
{
|
||||
return _( "Schematic PDF Plot" );
|
||||
return _( "Export PDF" );
|
||||
}
|
||||
|
||||
|
||||
@ -144,7 +144,7 @@ JOB_EXPORT_SCH_PLOT_DXF ::JOB_EXPORT_SCH_PLOT_DXF () :
|
||||
|
||||
wxString JOB_EXPORT_SCH_PLOT_DXF::GetDefaultDescription() const
|
||||
{
|
||||
return _( "Schematic DXF Plot" );
|
||||
return _( "Export DXF" );
|
||||
}
|
||||
|
||||
|
||||
@ -163,7 +163,7 @@ JOB_EXPORT_SCH_PLOT_SVG::JOB_EXPORT_SCH_PLOT_SVG() :
|
||||
|
||||
wxString JOB_EXPORT_SCH_PLOT_SVG::GetDefaultDescription() const
|
||||
{
|
||||
return _( "Schematic SVG Plot" );
|
||||
return _( "Export SVG" );
|
||||
}
|
||||
|
||||
|
||||
@ -182,7 +182,7 @@ JOB_EXPORT_SCH_PLOT_PS::JOB_EXPORT_SCH_PLOT_PS() :
|
||||
|
||||
wxString JOB_EXPORT_SCH_PLOT_PS::GetDefaultDescription() const
|
||||
{
|
||||
return _( "Schematic Postscript Plot" );
|
||||
return _( "Export Postscript" );
|
||||
}
|
||||
|
||||
|
||||
@ -201,7 +201,7 @@ JOB_EXPORT_SCH_PLOT_HPGL::JOB_EXPORT_SCH_PLOT_HPGL() :
|
||||
|
||||
wxString JOB_EXPORT_SCH_PLOT_HPGL::GetDefaultDescription() const
|
||||
{
|
||||
return _( "Schematic HPGL Plot" );
|
||||
return _( "Export HPGL" );
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,7 +34,7 @@ JOB_PCB_DRC::JOB_PCB_DRC() :
|
||||
|
||||
wxString JOB_PCB_DRC::GetDefaultDescription() const
|
||||
{
|
||||
return _( "Perform PCB DRC" );
|
||||
return _( "Perform DRC" );
|
||||
}
|
||||
|
||||
|
||||
|
@ -24,6 +24,12 @@
|
||||
#include <i18n_utility.h>
|
||||
|
||||
|
||||
std::map<JOB_PCB_RENDER::FORMAT, wxString> outputFormatNameMap = {
|
||||
{ JOB_PCB_RENDER::FORMAT::JPEG, wxT( "JPEG" ) },
|
||||
{ JOB_PCB_RENDER::FORMAT::PNG, wxT( "PNG" ) }
|
||||
};
|
||||
|
||||
|
||||
NLOHMANN_JSON_SERIALIZE_ENUM( JOB_PCB_RENDER::FORMAT,
|
||||
{
|
||||
{ JOB_PCB_RENDER::FORMAT::JPEG, "jpeg" },
|
||||
@ -72,9 +78,15 @@ JOB_PCB_RENDER::JOB_PCB_RENDER() :
|
||||
}
|
||||
|
||||
|
||||
std::map<JOB_PCB_RENDER::FORMAT, wxString>& JOB_PCB_RENDER::GetFormatNameMap()
|
||||
{
|
||||
return outputFormatNameMap;
|
||||
}
|
||||
|
||||
|
||||
wxString JOB_PCB_RENDER::GetDefaultDescription() const
|
||||
{
|
||||
return _( "Render PCB" );
|
||||
return wxString::Format( _( "Render %s" ), GetFormatNameMap()[m_format] );
|
||||
}
|
||||
|
||||
|
||||
|
@ -31,18 +31,21 @@
|
||||
class KICOMMON_API JOB_PCB_RENDER : public JOB
|
||||
{
|
||||
public:
|
||||
JOB_PCB_RENDER();
|
||||
wxString GetDefaultDescription() const override;
|
||||
wxString GetOptionsDialogTitle() const override;
|
||||
|
||||
wxString m_filename;
|
||||
|
||||
enum class FORMAT
|
||||
{
|
||||
PNG,
|
||||
JPEG
|
||||
};
|
||||
|
||||
static std::map<JOB_PCB_RENDER::FORMAT, wxString>& GetFormatNameMap();
|
||||
|
||||
public:
|
||||
JOB_PCB_RENDER();
|
||||
wxString GetDefaultDescription() const override;
|
||||
wxString GetOptionsDialogTitle() const override;
|
||||
|
||||
wxString m_filename;
|
||||
|
||||
enum class QUALITY
|
||||
{
|
||||
BASIC,
|
||||
|
@ -30,7 +30,7 @@ JOB_SCH_ERC::JOB_SCH_ERC() :
|
||||
|
||||
wxString JOB_SCH_ERC::GetDefaultDescription() const
|
||||
{
|
||||
return _( "Perform Schematic ERC" );
|
||||
return _( "Perform ERC" );
|
||||
}
|
||||
|
||||
|
||||
|
@ -81,16 +81,6 @@ enum PANEL_NETLIST_INDEX
|
||||
};
|
||||
|
||||
|
||||
std::map<JOB_EXPORT_SCH_NETLIST::FORMAT, wxString> jobNetlistNameLookup =
|
||||
{
|
||||
{ JOB_EXPORT_SCH_NETLIST::FORMAT::KICADSEXPR, wxT( "KiCad" ) },
|
||||
{ JOB_EXPORT_SCH_NETLIST::FORMAT::ORCADPCB2, wxT( "OrcadPCB2" ) },
|
||||
{ JOB_EXPORT_SCH_NETLIST::FORMAT::ALLEGRO, wxT( "Allegro" ) },
|
||||
{ JOB_EXPORT_SCH_NETLIST::FORMAT::PADS, wxT( "CadStar" ) },
|
||||
{ JOB_EXPORT_SCH_NETLIST::FORMAT::SPICE, wxT( "SPICE" ) },
|
||||
{ JOB_EXPORT_SCH_NETLIST::FORMAT::SPICEMODEL, wxT( "SPICE Model" ) }
|
||||
};
|
||||
|
||||
/* wxPanels for creating the NoteBook pages for each netlist format: */
|
||||
class EXPORT_NETLIST_PAGE : public wxPanel
|
||||
{
|
||||
@ -278,10 +268,7 @@ DIALOG_EXPORT_NETLIST::DIALOG_EXPORT_NETLIST( SCH_EDIT_FRAME* aEditFrame, wxWind
|
||||
SetupStandardButtons();
|
||||
|
||||
// custom netlist (external invokes, not supported)
|
||||
auto it = jobNetlistNameLookup.find( m_job->format );
|
||||
|
||||
if( it != jobNetlistNameLookup.end() )
|
||||
selectedPageFormatName = it->second;
|
||||
selectedPageFormatName = JOB_EXPORT_SCH_NETLIST::GetFormatNameMap()[m_job->format];
|
||||
|
||||
m_buttonAddGenerator->Hide();
|
||||
m_buttonDelGenerator->Hide();
|
||||
@ -477,11 +464,11 @@ bool DIALOG_EXPORT_NETLIST::NetlistUpdateOpt()
|
||||
}
|
||||
else
|
||||
{
|
||||
for (auto i = jobNetlistNameLookup.begin(); i != jobNetlistNameLookup.end(); ++i)
|
||||
for( const auto& [format, name] : JOB_EXPORT_SCH_NETLIST::GetFormatNameMap() )
|
||||
{
|
||||
if( i->second == m_PanelNetType[m_NoteBook->GetSelection()]->GetPageNetFmtName() )
|
||||
if( name == m_PanelNetType[m_NoteBook->GetSelection()]->GetPageNetFmtName() )
|
||||
{
|
||||
m_job->format = i->first;
|
||||
m_job->format = format;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -23,11 +23,6 @@
|
||||
#include <i18n_utility.h>
|
||||
#include <wx/display.h>
|
||||
|
||||
static std::map<JOB_PCB_RENDER::FORMAT, wxString> outputFormatMap = {
|
||||
{ JOB_PCB_RENDER::FORMAT::JPEG, _HKI( "JPEG" ) },
|
||||
{ JOB_PCB_RENDER::FORMAT::PNG, _HKI( "PNG" ) }
|
||||
};
|
||||
|
||||
static std::map<JOB_PCB_RENDER::BG_STYLE, wxString> bgStyleMap = {
|
||||
{ JOB_PCB_RENDER::BG_STYLE::BG_DEFAULT, _HKI( "Default" ) },
|
||||
{ JOB_PCB_RENDER::BG_STYLE::BG_OPAQUE, _HKI( "Opaque" ) },
|
||||
@ -54,7 +49,7 @@ DIALOG_RENDER_JOB::DIALOG_RENDER_JOB( wxWindow* aParent, JOB_PCB_RENDER* aJob )
|
||||
{
|
||||
SetTitle( aJob->GetOptionsDialogTitle() );
|
||||
|
||||
for( const auto& [k, name] : outputFormatMap )
|
||||
for( const auto& [k, name] : JOB_PCB_RENDER::GetFormatNameMap() )
|
||||
m_choiceFormat->Append( wxGetTranslation( name ) );
|
||||
|
||||
for( const auto& [k, name] : bgStyleMap )
|
||||
@ -73,7 +68,7 @@ DIALOG_RENDER_JOB::DIALOG_RENDER_JOB( wxWindow* aParent, JOB_PCB_RENDER* aJob )
|
||||
JOB_PCB_RENDER::FORMAT DIALOG_RENDER_JOB::getSelectedFormat()
|
||||
{
|
||||
int selIndx = m_choiceFormat->GetSelection();
|
||||
auto it = outputFormatMap.begin();
|
||||
auto it = JOB_PCB_RENDER::GetFormatNameMap().begin();
|
||||
std::advance( it, selIndx );
|
||||
return it->first;
|
||||
}
|
||||
@ -81,11 +76,11 @@ JOB_PCB_RENDER::FORMAT DIALOG_RENDER_JOB::getSelectedFormat()
|
||||
|
||||
void DIALOG_RENDER_JOB::setSelectedFormat( JOB_PCB_RENDER::FORMAT aFormat )
|
||||
{
|
||||
auto it = outputFormatMap.find( aFormat );
|
||||
auto it = JOB_PCB_RENDER::GetFormatNameMap().find( aFormat );
|
||||
|
||||
if( it != outputFormatMap.end() )
|
||||
if( it != JOB_PCB_RENDER::GetFormatNameMap().end() )
|
||||
{
|
||||
int idx = std::distance( outputFormatMap.begin(), it );
|
||||
int idx = std::distance( JOB_PCB_RENDER::GetFormatNameMap().begin(), it );
|
||||
m_choiceFormat->SetSelection( idx );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user