50 m_editFrame( aEditFrame ),
59 { wxID_CANCEL,
_(
"Close" ) } } );
65 GetSizer()->SetSizeHints(
this );
74 m_editFrame( aEditFrame ),
91 GetSizer()->SetSizeHints(
this );
183 wxDirDialog dirDialog(
this,
_(
"Select Output Directory" ),
path );
185 if( dirDialog.ShowModal() == wxID_CANCEL )
188 wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
190 if(
IsOK(
this,
_(
"Use a relative path?" ) ) )
194 if( !dirName.MakeRelativeTo( boardFilePath ) )
249 std::function<bool( wxString* )> textResolver =
250 [&]( wxString* token ) ->
bool
260 wxFileName outputDir = wxFileName::DirName(
path );
266 msg.Printf(
_(
"Could not write plot files to folder '%s'." ), outputDir.GetPath() );
272 fn.SetPath( outputDir.GetPath() );
284 msg.Printf(
_(
"Failed to create file '%s'." ), fn.GetFullPath() );
290 msg.Printf(
_(
"Front (top side) placement file: '%s'." ), filename );
293 msg.Printf(
_(
"Component count: %d." ), fpcount );
306 msg.Printf(
_(
"Failed to create file '%s'." ), filename );
313 msg.Printf(
_(
"Back (bottom side) placement file: '%s'." ), filename );
316 msg.Printf(
_(
"Component count: %d." ), fpcount );
319 fullcount += fpcount;
320 msg.Printf(
_(
"Full component count: %d." ), fullcount );
338 int bottomSide =
true;
344 topSide, bottomSide, useCSVfmt, useAuxOrigin, negateBottomX );
349 wxMessageBox(
_(
"No footprint for automated placement." ) );
357 std::function<bool( wxString* )> textResolver =
358 [&]( wxString* token ) ->
bool
368 wxFileName outputDir = wxFileName::DirName(
path );
374 msg.Printf(
_(
"Could not write plot files to folder '%s'." ), outputDir.GetPath() );
380 fn.SetPath( outputDir.GetPath() );
384 bottomSide = singleFile;
392 fn.SetExt( wxT(
"csv" ) );
397 useCSVfmt, useAuxOrigin, negateBottomX );
400 msg.Printf(
_(
"Failed to create file '%s'." ), fn.GetFullPath() );
407 msg.Printf(
_(
"Placement file: '%s'." ), fn.GetFullPath() );
409 msg.Printf(
_(
"Front (top side) placement file: '%s'." ), fn.GetFullPath() );
413 msg.Printf(
_(
"Component count: %d." ), fpcount );
427 fn.SetPath( outputDir.GetPath() );
434 fn.SetExt( wxT(
"csv" ) );
439 useCSVfmt, useAuxOrigin, negateBottomX );
443 msg.Printf(
_(
"Failed to create file '%s'." ), fn.GetFullPath() );
452 msg.Printf(
_(
"Back (bottom side) placement file: '%s'." ), fn.GetFullPath() );
455 msg.Printf(
_(
"Component count: %d." ), fpcount );
461 fullcount += fpcount;
462 msg.Printf(
_(
"Full component count: %d." ), fullcount );
480 bool aOnlySMD,
bool aNoTHItems,
bool aExcludeDNP,
481 bool aTopSide,
bool aBottomSide,
bool aFormatCSV,
482 bool aUseAuxOrigin,
bool aNegateBottomX )
484 FILE * file =
nullptr;
486 if( !aFullFileName.IsEmpty() )
488 file = wxFopen( aFullFileName, wxT(
"wt" ) );
490 if( file ==
nullptr )
496 aBottomSide, aFormatCSV, aUseAuxOrigin, aNegateBottomX );
507 fputs( data.c_str(), file );
521 wxDirDialog dirDialog(
m_frame,
_(
"Select Output Directory" ), boardFilePath );
523 if( dirDialog.ShowModal() == wxID_CANCEL )
527 fn.SetPath( dirDialog.GetPath() );
528 fn.SetExt( wxT(
"rpt" ) );
530 FILE* rptfile = wxFopen( fn.GetFullPath(), wxT(
"wt" ) );
532 if( rptfile ==
nullptr )
534 wxMessageBox( wxString::Format(
_(
"Footprint report file created:\n'%s'." ), fn.GetFullPath() ),
535 _(
"Footprint Report" ), wxICON_INFORMATION );
551 fputs( data.c_str(), rptfile );
554 wxMessageBox( wxString::Format(
_(
"Footprint report file created:\n'%s'." ), fn.GetFullPath() ),
555 _(
"Footprint Report" ), wxICON_INFORMATION );
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
int GenFootprintsReport(const TOOL_EVENT &aEvent)
int GeneratePosFile(const TOOL_EVENT &aEvent)
Information pertinent to a Pcbnew printed circuit board.
bool ResolveTextVar(wxString *token, int aDepth) const
const wxString & GetFileName() const
void SetupStandardButtons(std::map< int, wxString > aLabels={})
bool m_useDrillPlaceFileOrigin
bool m_excludeFootprintsWithTh
wxString GetSettingsDialogTitle() const override
void SetConfiguredOutputPath(const wxString &aPath)
Sets the configured output path for the job, this path is always saved to file.
wxString GetConfiguredOutputPath() const
Returns the configured output path for the job.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
The main frame for Pcbnew.
int DoGenFootprintsPositionFile(const wxString &aFullFileName, bool aUnitsMM, bool aOnlySMD, bool aNoTHItems, bool aExcludeDNP, bool aTopSide, bool aBottomSide, bool aFormatCSV, bool aUseAuxOrigin, bool aNegateBottomX)
Create an ASCII footprint position file.
Used to create Gerber drill files.
const wxString GetPlaceFileName(const wxString &aFullBaseFilename, PCB_LAYER_ID aLayer) const
int CreatePlaceFile(const wxString &aFullFilename, PCB_LAYER_ID aLayer, bool aIncludeBrdEdges, bool aExcludeDNP)
Create an pnp gerber file.
The ASCII format of the kicad place file is:
static wxString DecorateFilename(const wxString &aBaseName, bool aFront, bool aBack)
std::string GenPositionData()
build a string filled with the position data
std::string GenReportData()
build a string filled with the pad report data This report does not used options aForceSmdItems,...
virtual const wxString AbsolutePath(const wxString &aFileName) const
Fix up aFileName if it is relative to the project's directory to be an absolute path and filename.
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Report a string with a given severity.
EDA_UNITS GetUserUnits() const
void MsgPanelSetMinSize(const wxSize &aMinSize)
Set the min size of the area which displays html messages.
void SetFileName(const wxString &aReportFileName)
Set the report full file name to the string.
REPORTER & Reporter()
Return the reporter object that reports to this panel.
const wxString ExpandEnvVarSubstitutions(const wxString &aString, const PROJECT *aProject)
Replace any environment variable & text variable references with their values.
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, int aFlags)
bool EnsureFileDirectoryExists(wxFileName *aTargetFullFileName, const wxString &aBaseFilename, REPORTER *aReporter)
Make aTargetFullFileName absolute and create the path of this file if it doesn't yet exist.
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
void DisplayError(wxWindow *aParent, const wxString &aText)
Display an error or warning message box with aMessage.
This file is part of the common library.
Classes used in place file generation.
static const std::string FootprintPlaceFileExtension
#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.