33#include <wx/filedlg.h>
40 FILE* cmpFile = wxFopen( aFullCmpFileName, wxT(
"wt" ) );
42 if( cmpFile ==
nullptr )
49 fprintf( cmpFile,
"\nBeginCmp\n" );
50 fprintf( cmpFile,
"TimeStamp = %s\n",
TO_UTF8( fp->m_Uuid.AsString() ) );
51 fprintf( cmpFile,
"Path = %s\n",
TO_UTF8( fp->GetPath().AsString() ) );
52 fprintf( cmpFile,
"Reference = %s;\n",
53 !fp->GetReference().IsEmpty() ?
TO_UTF8( fp->GetReference() ) :
"[NoRef]" );
54 fprintf( cmpFile,
"ValeurCmp = %s;\n",
55 !fp->GetValue().IsEmpty() ?
TO_UTF8( fp->GetValue() ) :
"[NoVal]" );
56 fprintf( cmpFile,
"IdModule = %s;\n", fp->GetFPID().Format().c_str() );
57 fprintf( cmpFile,
"EndCmp\n" );
60 fprintf( cmpFile,
"\nEndListe\n" );
71 wxString projectDir = wxPathOnly(
m_frame->Prj().GetProjectFullName() );
72 wxFileName fn =
board->GetFileName();
76 wxFileDialog dlg(
m_frame,
_(
"Save Footprint Association File" ), projectDir, fn.GetFullName(),
78 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
82 if( dlg.ShowModal() == wxID_CANCEL )
85 wxString
path = dlg.GetPath();
int ExportCmpFile(const TOOL_EVENT &aEvent)
Information pertinent to a Pcbnew printed circuit board.
const FOOTPRINTS & Footprints() const
void DisplayError(wxWindow *aParent, const wxString &aText)
Display an error or warning message box with aMessage.
This file is part of the common library.
static const std::string FootprintAssignmentFileExtension
static wxString FootprintAssignmentFileWildcard()
This file contains miscellaneous commonly used macros and functions.
wxString GetISO8601CurrentDateTime()
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition of file extensions used in Kicad.