22#include <wx/choicdlg.h>
23#include <wx/filedlg.h>
50 { wxID_CANCEL,
_(
"Close" ) } } );
64 int btnWidth =
m_stdButtons->GetMinSize().GetWidth() + 10;
66 int minWidth = std::max( btnWidth, panelWidth );
67 wxSize dialogMin = GetMinSize();
69 if( dialogMin.GetWidth() < minWidth )
71 SetMinSize( wxSize( minWidth, dialogMin.GetHeight() ) );
72 SetSize( wxSize( std::max( GetSize().GetWidth(), minWidth ), GetSize().GetHeight() ) );
87 SetTitle(
m_job->GetSettingsDialogTitle() );
101 int btnWidth =
m_stdButtons->GetMinSize().GetWidth() + 10;
103 int minWidth = std::max( btnWidth, panelWidth );
104 wxSize dialogMin = GetMinSize();
106 if( dialogMin.GetWidth() < minWidth )
108 SetMinSize( wxSize( minWidth, dialogMin.GetHeight() ) );
109 SetSize( wxSize( std::max( GetSize().GetWidth(), minWidth ), GetSize().GetHeight() ) );
118 wxFileName fn(
Prj().AbsolutePath(
path ) );
119 wxString ipc_files =
_(
"IPC-2581 Files (*.xml)|*.xml" );
120 wxString compressed_files =
_(
"IPC-2581 Compressed Files (*.zip)|*.zip" );
122 wxFileDialog dlg(
this,
_(
"Export IPC-2581 File" ), fn.GetPath(), fn.GetFullName(),
123 m_cbCompress->IsChecked() ? compressed_files : ipc_files,
124 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
128 if( dlg.ShowModal() == wxID_CANCEL )
180 if( pcbFileName.GetName().empty() )
182 reporter.Report(
_(
"The board must be saved before generating IPC-2581 file." ),
187 if( !
m_parent->IsWritable( pcbFileName ) )
189 reporter.Report( wxString::Format(
_(
"Insufficient permissions to write file '%s'." ),
190 pcbFileName.GetFullPath() ),
223 wxFileName brdFile(
m_parent->GetBoard()->GetFileName() );
224 brdFile.SetExt( wxT(
"xml" ) );
225 path = brdFile.GetFullPath();
238 wxCommandEvent
dummy;
302 ? wxS(
"anonymize" ) : wxS(
"include" );
304 ? wxS(
"omit" ) : wxS(
"include" );
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
wxStdDialogButtonSizer * m_stdButtons
PANEL_FAB_EXPORT_CONTENT * m_contentPanel
wxTextCtrl * m_outputFileName
wxChoice * m_versionChoice
DIALOG_EXPORT_2581_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Export IPC-2581"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
WX_HTML_REPORT_PANEL * m_messagesPanel
STD_BITMAP_BUTTON * m_browseButton
wxCheckBox * m_cbCompress
bool TransferDataToWindow() override
void onCompressCheck(wxCommandEvent &event) override
void onOKClick(wxCommandEvent &event) override
bool TransferDataFromWindow() override
DIALOG_EXPORT_2581(PCB_EDIT_FRAME *aParent)
PCB_EDIT_FRAME * m_parent
void onBrowseClicked(wxCommandEvent &event) override
wxString GetUnitsString() const
JOB_EXPORT_PCB_IPC2581 * m_job
wxString GetOutputPath() const
void saveToProject()
Keep the dialog selections A job keeps them on the job.
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
The main frame for Pcbnew.
static constexpr int EXPORT_PHASES
Content logistic history CAD data components the two netlists BOM vendor list references the write an...
The backing store for a PROJECT, in JSON format.
struct IP2581_BOM m_IP2581Bom
Layer pair list for the board.
virtual PROJECT_FILE & GetProjectFile() const
A pure virtual class used to derive REPORTER objects from.
static void ResolvePossibleSymlinks(wxFileName &aFilename)
Multi-thread safe progress reporter dialog, intended for use of tasks that parallel reporting back of...
const wxString ExpandEnvVarSubstitutions(const wxString &aString, const PROJECT *aProject)
Replace any environment variable & text variable references with their values.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
bool GenerateIpc2581File(JOB_EXPORT_PCB_IPC2581 &aJob, BOARD *aBoard, PROGRESS_REPORTER *aProgressReporter, REPORTER *aReporter)
Write the IPC-2581 file or archive of aJob and record it as a job output.
std::optional< MODE > ModeFromToken(const wxString &aToken)
Read a Table 4 function mode token in upper case or in lower case.
wxString ModeToken(MODE aMode)
Table 4 function mode token such as FABRICATION.
std::vector< FAB_LAYER_COLOR > dummy
std::optional< wxString > sections
Table 4 section key, unset when the mode picks the sections.
wxString mfg
Manufacturer name column.
wxString refDes
Set to include or to omit.
wxString bomRev
Explicit BOM revision override set by user.
wxString schRevision
Auto-propagated schematic title block revision.
wxString MPN
Manufacturer part number column.
wxString netNames
Set to include or to anonymize.
wxString id
Internal ID column.
wxString dist
Distributor name column.
wxString mode
Table 4 function mode token.
wxString distPN
Distributor part number column.
Fields that supply the IPC-2581 BOM section.
IbisParser parser & reporter