230 std::set<wxString> fieldNames;
234 for(
PCB_FIELD* field : fp->GetFields() )
236 wxCHECK2( field,
continue );
238 if( field->IsReference() )
241 fieldNames.insert( field->GetUntranslatedName() );
259 wxFileName brdFile =
m_parent->GetBoard()->GetFileName();
261 path = brdFile.GetFullPath();
266 wxCommandEvent
dummy;
285 brdFile.SetExt( wxT(
"emn" ) );
288 libFile.SetExt( wxT(
"emp" ) );
290 wxArrayString existing;
292 if( brdFile.FileExists() )
293 existing.push_back( brdFile.GetFullPath() );
295 if( libFile.FileExists() )
296 existing.push_back( libFile.GetFullPath() );
298 if( !existing.empty() )
302 if( existing.size() == 1 )
303 msg = wxString::Format(
_(
"File %s already exists." ), existing[0] );
305 msg = wxString::Format(
_(
"Files %s and %s already exist." ), existing[0], existing[1] );
307 KIDIALOG dlg(
this, msg,
_(
"Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
308 dlg.SetOKLabel(
_(
"Overwrite" ) );
315 for(
const wxFileName& fn : { brdFile, libFile } )
317 if( fn.FileExists() && !fn.IsFileWritable() )
319 wxMessageBox( wxString::Format(
_(
"Insufficient permissions to write file '%s'." ),
321 _(
"IDF Export" ), wxOK | wxICON_ERROR );
341 bool resetJob =
false;
357 wxMessageBox( wxString::Format(
_(
"Failed to create file '%s'." ),
m_filePickerIDF->GetPath() ) );
constexpr EDA_IU_SCALE pcbIUScale
int ExportIDF(const TOOL_EVENT &aEvent)
wxRadioButton * m_rbOriginDrill
wxCheckBox * m_cbHeightFromModels
TEXT_CTRL_EVAL * m_IDF_Xref
wxCheckBox * m_cbRemoveDNP
wxFilePickerCtrl * m_filePickerIDF
wxRadioButton * m_rbOriginUser
wxRadioButton * m_rbOriginGrid
wxChoice * m_outputUnitsChoice
DIALOG_EXPORT_IDF3_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Export IDFv3"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
wxRadioButton * m_rbOriginBoardCenter
wxCheckBox * m_cbRemoveUnspecified
wxChoice * m_choicePartNumberField
TEXT_CTRL_EVAL * m_IDF_Yref
bool TransferDataToWindow() override
bool TransferDataFromWindow() override
JOB_EXPORT_PCB_IDF * m_job
void GetJobSettings(JOB_EXPORT_PCB_IDF &aSettingsOut) const
IDF_EXPORT_SETTINGS GetSettings() const
void ApplySettings(const IDF_EXPORT_SETTINGS &aSettings)
void onRadioButtonsChanged(wxCommandEvent &event)
PCB_EDIT_FRAME * m_parent
DIALOG_EXPORT_IDF3(PCB_EDIT_FRAME *aEditFrame)
void OnOKButton(wxCommandEvent &event) override
void ApplyJobSettings(const JOB_EXPORT_PCB_IDF &aSettings)
void OptOut(wxWindow *aWindow)
Opt out of control state saving.
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...
Provide an extensible class to resolve 3D model paths.
bool Export(const wxString &aFullFileName) const
Generate IDFv3 compliant board (*.emn) and library (*.emp) files for aPcb.
IDF_SETTINGS::COORD_ORIGIN m_originMode
bool m_calculateHeightFromModels
VECTOR2D m_userOrigin
In whatever units the user specified in m_units.
wxString m_partNumberField
IDF_SETTINGS::UNITS m_units
wxString GetSettingsDialogTitle() const override
bool m_includeUnspecified
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
void DoNotShowCheckbox(wxString file, int line)
Shows the 'do not show again' checkbox.
The main frame for Pcbnew.
static S3D_CACHE * Get3DCacheManager(PROJECT *aProject, bool updateProjDir=false)
Return a pointer to an instance of the 3D cache manager.
FILENAME_RESOLVER * GetResolver() noexcept
A wrapper for reporting to a wxTextCtrl object.
static const std::string IdfV3BoardFileExtension
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
std::vector< FAB_LAYER_COLOR > dummy
Persisted settings for the IDF export dialog.
bool calculateHeightFromModels
IDF_SETTINGS::COORD_ORIGIN originMode
IDF_SETTINGS::UNITS units
IbisParser parser & reporter