29#include <wx/filedlg.h>
36 FILE* cmpFile = wxFopen( aFullCmpFileName, wxT(
"wt" ) );
38 if( cmpFile ==
nullptr )
45 fprintf( cmpFile,
"\nBeginCmp\n" );
46 fprintf( cmpFile,
"TimeStamp = %s\n",
TO_UTF8( fp->m_Uuid.AsString() ) );
47 fprintf( cmpFile,
"Path = %s\n",
TO_UTF8( fp->GetPath().AsString() ) );
48 fprintf( cmpFile,
"Reference = %s;\n",
49 !fp->GetReference().IsEmpty() ?
TO_UTF8( fp->GetReference() ) :
"[NoRef]" );
50 fprintf( cmpFile,
"ValeurCmp = %s;\n",
51 !fp->GetValue().IsEmpty() ?
TO_UTF8( fp->GetValue() ) :
"[NoVal]" );
52 fprintf( cmpFile,
"IdModule = %s;\n", fp->GetFPID().Format().c_str() );
53 fprintf( cmpFile,
"EndCmp\n" );
56 fprintf( cmpFile,
"\nEndListe\n" );
67 wxString projectDir = wxPathOnly(
m_frame->Prj().GetProjectFullName() );
68 wxFileName fn =
board->GetFileName();
72 wxFileDialog dlg(
m_frame,
_(
"Save Footprint Association File" ), projectDir, fn.GetFullName(),
74 wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
78 if( dlg.ShowModal() == wxID_CANCEL )
81 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.