KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
dialog_gen_footprint_position.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24/*
25 * 1 - create ASCII files for automatic placement of smd components
26 * 2 - create a footprint report (pos and footprint descr) (ascii file)
27 */
28
30#include <confirm.h>
31#include <pcb_edit_frame.h>
32#include <pcbnew_settings.h>
34#include <bitmaps.h>
35#include <reporter.h>
38#include <kiface_base.h>
44
45#include <wx/dirdlg.h>
46#include <wx/msgdlg.h>
47
48
51 m_editFrame( aEditFrame ),
52 m_job( nullptr )
53{
54 m_messagesPanel->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) );
56 initDialog();
57
58 SetupStandardButtons( { { wxID_OK, _( "Generate Position File" ) },
59 { wxID_CANCEL, _( "Close" ) } } );
60
61 GetSizer()->SetSizeHints( this );
62 Centre();
63}
64
65
66
68 PCB_EDIT_FRAME* aEditFrame,
69 wxWindow* aParent ) :
71 m_editFrame( aEditFrame ),
72 m_job( aJob )
73{
74 m_messagesPanel->Hide();
75 initDialog();
76
78
79 GetSizer()->SetSizeHints( this );
80 Centre();
81}
82
83
85{
86 if( !m_job )
87 {
88 m_browseButton->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) );
89
90 PROJECT_FILE& projectFile = m_editFrame->Prj().GetProjectFile();
92
93 m_units = cfg->m_PlaceFile.units == 0 ? EDA_UNITS::INCH : EDA_UNITS::MM;
94
95 // Output directory
97
98 // Update Options
99 m_unitsCtrl->SetSelection( cfg->m_PlaceFile.units );
100 m_singleFile->SetValue( cfg->m_PlaceFile.file_options == 1 );
101 m_formatCtrl->SetSelection( cfg->m_PlaceFile.file_format );
104 m_onlySMD->SetValue( cfg->m_PlaceFile.only_SMD );
105 m_negateXcb->SetValue( cfg->m_PlaceFile.negate_xcoord );
106 m_excludeTH->SetValue( cfg->m_PlaceFile.exclude_TH );
107
108 // Update sizes and sizers:
109 m_messagesPanel->MsgPanelSetMinSize( wxSize( -1, 160 ) );
110 }
111 else
112 {
113 SetTitle( m_job->GetSettingsDialogTitle() );
114
115 m_browseButton->Hide();
116 m_units = m_job->m_units == JOB_EXPORT_PCB_POS::UNITS::INCH ? EDA_UNITS::INCH : EDA_UNITS::MM;
117 m_staticTextDir->SetLabel( _( "Output file:" ) );
119
120 m_unitsCtrl->SetSelection( static_cast<int>( m_job->m_units ) );
121 m_singleFile->SetValue( m_job->m_singleFile );
122 m_formatCtrl->SetSelection( static_cast<int>( m_job->m_format ) );
125 m_onlySMD->SetValue( m_job->m_smdOnly );
126 m_negateXcb->SetValue( m_job->m_negateBottomX );
128 m_excludeDNP->SetValue( m_job->m_excludeDNP );
129
130 m_messagesPanel->Hide();
131 }
132
133 // DIALOG_SHIM needs a unique hash_key because classname will be the same for both job and
134 // non-job versions (which have different sizes).
135 m_hash_key = TO_UTF8( GetTitle() );
136
137 GetSizer()->SetSizeHints( this );
138}
139
140
142{
143 m_unitsLabel->Enable( m_formatCtrl->GetSelection() != 2 );
144 m_unitsCtrl->Enable( m_formatCtrl->GetSelection() != 2 );
145}
146
147
149{
150 m_singleFile->Enable( m_formatCtrl->GetSelection() != 2 );
151}
152
153
155{
156 if( m_formatCtrl->GetSelection() == 2 )
157 {
158 m_onlySMD->SetValue( false );
159 m_onlySMD->Enable( false );
160 }
161 else
162 {
163 m_onlySMD->Enable( true );
164 }
165}
166
167
169{
170 if( m_formatCtrl->GetSelection() == 2 )
171 {
172 m_negateXcb->SetValue( false );
173 m_negateXcb->Enable( false );
174 }
175 else
176 {
177 m_negateXcb->Enable( true );
178 }
179}
180
182{
183 if( m_formatCtrl->GetSelection() == 2 )
184 {
185 m_excludeTH->SetValue( false );
186 m_excludeTH->Enable( false );
187 }
188 else
189 {
190 m_excludeTH->Enable( true );
191 }
192}
193
194
196{
197 return m_unitsCtrl->GetSelection() == 1;
198}
199
200
202{
203 return m_singleFile->GetValue();
204}
205
206
208{
209 return m_onlySMD->GetValue();
210}
211
212
214{
215 return m_excludeTH->GetValue();
216}
217
218
220{
221 return m_excludeDNP->GetValue();
222}
223
224
226{
227 m_cbIncludeBoardEdge->Enable( m_formatCtrl->GetSelection() == 2 );
228}
229
230
232{
233 // Build the absolute path of current output directory to preselect it in the file browser.
234 wxString path = ExpandEnvVarSubstitutions( m_outputDirectoryName->GetValue(), &Prj() );
235 path = Prj().AbsolutePath( path );
236
237 wxDirDialog dirDialog( this, _( "Select Output Directory" ), path );
238
239 if( dirDialog.ShowModal() == wxID_CANCEL )
240 return;
241
242 wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
243
244 wxMessageDialog dialog( this, _( "Use a relative path?"), _( "Plot Output Directory" ),
245 wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT );
246
247 if( dialog.ShowModal() == wxID_YES )
248 {
249 wxString boardFilePath = ( (wxFileName) m_editFrame->GetBoard()->GetFileName() ).GetPath();
250
251 if( !dirName.MakeRelativeTo( boardFilePath ) )
252 {
253 wxMessageBox( _( "Cannot make path relative (target volume different from board "
254 "file volume)!" ),
255 _( "Plot Output Directory" ), wxOK | wxICON_ERROR );
256 }
257 }
258
259 m_outputDirectoryName->SetValue( dirName.GetFullPath() );
260}
261
262
263void DIALOG_GEN_FOOTPRINT_POSITION::onGenerate( wxCommandEvent& event )
264{
265 if( !m_job )
266 {
267 m_units = m_unitsCtrl->GetSelection() == 0 ? EDA_UNITS::INCH : EDA_UNITS::MM;
268
270
271 wxString dirStr = m_outputDirectoryName->GetValue();
272 // Keep unix directory format convention in cfg files
273 dirStr.Replace( wxT( "\\" ), wxT( "/" ) );
274
276 cfg->m_PlaceFile.output_directory = dirStr;
277 cfg->m_PlaceFile.units = m_units == EDA_UNITS::INCH ? 0 : 1;
278 cfg->m_PlaceFile.file_options = m_singleFile->GetValue() ? 1 : 0;
279 cfg->m_PlaceFile.file_format = m_formatCtrl->GetSelection();
281 cfg->m_PlaceFile.exclude_TH = m_excludeTH->GetValue();
282 cfg->m_PlaceFile.only_SMD = m_onlySMD->GetValue();
284 cfg->m_PlaceFile.negate_xcoord = m_negateXcb->GetValue();
285
286 if( m_formatCtrl->GetSelection() == 2 )
288 else
290 }
291 else
292 {
296 m_job->m_format = static_cast<JOB_EXPORT_PCB_POS::FORMAT>( m_formatCtrl->GetSelection() );
298 m_job->m_singleFile = m_singleFile->GetValue();
301 m_job->m_smdOnly = m_onlySMD->GetValue();
303 m_job->m_negateBottomX = m_negateXcb->GetValue();
304 m_job->m_excludeDNP = m_excludeDNP->GetValue();
305
306 event.Skip(); // Allow normal close action
307 }
308}
309
310
312{
313 BOARD* brd = m_editFrame->GetBoard();
314 wxString msg;
315 int fullcount = 0;
316
317 // Create output directory if it does not exist (also transform it in absolute form).
318 // Bail if it fails.
319
320 std::function<bool( wxString* )> textResolver =
321 [&]( wxString* token ) -> bool
322 {
323 // Handles board->GetTitleBlock() *and* board->GetProject()
324 return m_editFrame->GetBoard()->ResolveTextVar( token, 0 );
325 };
326
328 path = ExpandTextVars( path, &textResolver );
329 path = ExpandEnvVarSubstitutions( path, nullptr );
330
331 wxFileName outputDir = wxFileName::DirName( path );
332 wxString boardFilename = m_editFrame->GetBoard()->GetFileName();
333
335
336 if( !EnsureFileDirectoryExists( &outputDir, boardFilename, m_reporter ) )
337 {
338 msg.Printf( _( "Could not write plot files to folder '%s'." ), outputDir.GetPath() );
339 DisplayError( this, msg );
340 return false;
341 }
342
343 wxFileName fn = m_editFrame->GetBoard()->GetFileName();
344 fn.SetPath( outputDir.GetPath() );
345
346 // Create the Front and Top side placement files. Gerber P&P files are always separated.
347 // Not also they include all footprints
348 PLACEFILE_GERBER_WRITER exporter( brd );
349 wxString filename = exporter.GetPlaceFileName( fn.GetFullPath(), F_Cu );
350
351 int fpcount = exporter.CreatePlaceFile( filename, F_Cu, m_cbIncludeBoardEdge->GetValue() );
352
353 if( fpcount < 0 )
354 {
355 msg.Printf( _( "Failed to create file '%s'." ), fn.GetFullPath() );
356 wxMessageBox( msg );
358 return false;
359 }
360
361 msg.Printf( _( "Front (top side) placement file: '%s'." ), filename );
363
364 msg.Printf( _( "Component count: %d." ), fpcount );
366
367 // Create the Back or Bottom side placement file
368 fullcount = fpcount;
369
370 filename = exporter.GetPlaceFileName( fn.GetFullPath(), B_Cu );
371
372 fpcount = exporter.CreatePlaceFile( filename, B_Cu, m_cbIncludeBoardEdge->GetValue() );
373
374 if( fpcount < 0 )
375 {
376 msg.Printf( _( "Failed to create file '%s'." ), filename );
378 wxMessageBox( msg );
379 return false;
380 }
381
382 // Display results
383 msg.Printf( _( "Back (bottom side) placement file: '%s'." ), filename );
385
386 msg.Printf( _( "Component count: %d." ), fpcount );
388
389 fullcount += fpcount;
390 msg.Printf( _( "Full component count: %d." ), fullcount );
392
393 m_reporter->Report( _( "Done." ), RPT_SEVERITY_INFO );
394
395 return true;
396}
397
398
400{
401 BOARD* brd = m_editFrame->GetBoard();
402 wxString msg;
403 bool singleFile = OneFileOnly();
404 bool useCSVfmt = m_formatCtrl->GetSelection() == 1;
405 bool useAuxOrigin = m_useDrillPlaceOrigin->GetValue();
406 int fullcount = 0;
407 int topSide = true;
408 int bottomSide = true;
409 bool negateBottomX = m_negateXcb->GetValue();
410
411 // Test for any footprint candidate in list.
412 {
414 topSide, bottomSide, useCSVfmt, useAuxOrigin, negateBottomX );
415 exporter.GenPositionData();
416
417 if( exporter.GetFootprintCount() == 0 )
418 {
419 wxMessageBox( _( "No footprint for automated placement." ) );
420 return false;
421 }
422 }
423
424 // Create output directory if it does not exist (also transform it in absolute form).
425 // Bail if it fails.
426
427 std::function<bool( wxString* )> textResolver =
428 [&]( wxString* token ) -> bool
429 {
430 // Handles board->GetTitleBlock() *and* board->GetProject()
431 return m_editFrame->GetBoard()->ResolveTextVar( token, 0 );
432 };
433
435 path = ExpandTextVars( path, &textResolver );
436 path = ExpandEnvVarSubstitutions( path, nullptr );
437
438 wxFileName outputDir = wxFileName::DirName( path );
439 wxString boardFilename = m_editFrame->GetBoard()->GetFileName();
440
442
443 if( !EnsureFileDirectoryExists( &outputDir, boardFilename, m_reporter ) )
444 {
445 msg.Printf( _( "Could not write plot files to folder '%s'." ), outputDir.GetPath() );
446 DisplayError( this, msg );
447 return false;
448 }
449
450 wxFileName fn = m_editFrame->GetBoard()->GetFileName();
451 fn.SetPath( outputDir.GetPath() );
452
453 // Create the Front or Top side placement file, or a single file
454 topSide = true;
455 bottomSide = singleFile;
456
457 fn.SetName( PLACE_FILE_EXPORTER::DecorateFilename( fn.GetName(), topSide, bottomSide ) );
459
460 if( useCSVfmt )
461 {
462 fn.SetName( fn.GetName() + wxT( "-" ) + FILEEXT::FootprintPlaceFileExtension );
463 fn.SetExt( wxT( "csv" ) );
464 }
465
466 int fpcount = m_editFrame->DoGenFootprintsPositionFile( fn.GetFullPath(), UnitsMM(), OnlySMD(),
467 ExcludeAllTH(), ExcludeDNP(), topSide,
468 bottomSide, useCSVfmt, useAuxOrigin,
469 negateBottomX );
470 if( fpcount < 0 )
471 {
472 msg.Printf( _( "Failed to create file '%s'." ), fn.GetFullPath() );
473 wxMessageBox( msg );
475 return false;
476 }
477
478 if( singleFile )
479 msg.Printf( _( "Placement file: '%s'." ), fn.GetFullPath() );
480 else
481 msg.Printf( _( "Front (top side) placement file: '%s'." ), fn.GetFullPath() );
482
484
485 msg.Printf( _( "Component count: %d." ), fpcount );
487
488 if( singleFile )
489 {
490 m_reporter->Report( _( "Done." ), RPT_SEVERITY_INFO );
491 return true;
492 }
493
494 // Create the Back or Bottom side placement file
495 fullcount = fpcount;
496 topSide = false;
497 bottomSide = true;
498 fn = brd->GetFileName();
499 fn.SetPath( outputDir.GetPath() );
500 fn.SetName( PLACE_FILE_EXPORTER::DecorateFilename( fn.GetName(), topSide, bottomSide ) );
502
503 if( useCSVfmt )
504 {
505 fn.SetName( fn.GetName() + wxT( "-" ) + FILEEXT::FootprintPlaceFileExtension );
506 fn.SetExt( wxT( "csv" ) );
507 }
508
509 fpcount = m_editFrame->DoGenFootprintsPositionFile( fn.GetFullPath(), UnitsMM(), OnlySMD(),
510 ExcludeAllTH(), ExcludeDNP(), topSide,
511 bottomSide, useCSVfmt,
512 useAuxOrigin, negateBottomX );
513
514 if( fpcount < 0 )
515 {
516 msg.Printf( _( "Failed to create file '%s'." ), fn.GetFullPath() );
518 wxMessageBox( msg );
519 return false;
520 }
521
522 // Display results
523 if( !singleFile )
524 {
525 msg.Printf( _( "Back (bottom side) placement file: '%s'." ), fn.GetFullPath() );
527
528 msg.Printf( _( "Component count: %d." ), fpcount );
530 }
531
532 if( !singleFile )
533 {
534 fullcount += fpcount;
535 msg.Printf( _( "Full component count: %d." ), fullcount );
537 }
538
539 m_reporter->Report( _( "Done." ), RPT_SEVERITY_INFO );
540 return true;
541}
542
543
545{
546 DIALOG_GEN_FOOTPRINT_POSITION dlg( getEditFrame<PCB_EDIT_FRAME>() );
547 dlg.ShowModal();
548 return 0;
549}
550
551
552int PCB_EDIT_FRAME::DoGenFootprintsPositionFile( const wxString& aFullFileName, bool aUnitsMM,
553 bool aOnlySMD, bool aNoTHItems, bool aExcludeDNP,
554 bool aTopSide, bool aBottomSide, bool aFormatCSV,
555 bool aUseAuxOrigin, bool aNegateBottomX )
556{
557 FILE * file = nullptr;
558
559 if( !aFullFileName.IsEmpty() )
560 {
561 file = wxFopen( aFullFileName, wxT( "wt" ) );
562
563 if( file == nullptr )
564 return -1;
565 }
566
567 std::string data;
568 PLACE_FILE_EXPORTER exporter( GetBoard(), aUnitsMM, aOnlySMD, aNoTHItems, aExcludeDNP, aTopSide,
569 aBottomSide, aFormatCSV, aUseAuxOrigin, aNegateBottomX );
570 data = exporter.GenPositionData();
571
572 // if aFullFileName is empty, the file is not created, only the
573 // count of footprints to place is returned
574 if( file )
575 {
576 // Creates a footprint position file
577 // aSide = 0 -> Back (bottom) side)
578 // aSide = 1 -> Front (top) side)
579 // aSide = 2 -> both sides
580 fputs( data.c_str(), file );
581 fclose( file );
582 }
583
584 return exporter.GetFootprintCount();
585}
586
587
588void PCB_EDIT_FRAME::GenFootprintsReport( wxCommandEvent& event )
589{
590 wxFileName fn;
591
592 wxString boardFilePath = ( (wxFileName) GetBoard()->GetFileName() ).GetPath();
593 wxDirDialog dirDialog( this, _( "Select Output Directory" ), boardFilePath );
594
595 if( dirDialog.ShowModal() == wxID_CANCEL )
596 return;
597
598 fn = GetBoard()->GetFileName();
599 fn.SetPath( dirDialog.GetPath() );
600 fn.SetExt( wxT( "rpt" ) );
601
602 bool unitMM = GetUserUnits() == EDA_UNITS::MM;
603 bool success = DoGenFootprintsReport( fn.GetFullPath(), unitMM );
604
605 wxString msg;
606
607 if( success )
608 {
609 msg.Printf( _( "Footprint report file created:\n'%s'." ), fn.GetFullPath() );
610 wxMessageBox( msg, _( "Footprint Report" ), wxICON_INFORMATION );
611 }
612 else
613 {
614 msg.Printf( _( "Failed to create file '%s'." ), fn.GetFullPath() );
615 DisplayError( this, msg );
616 }
617}
618
619
620bool PCB_EDIT_FRAME::DoGenFootprintsReport( const wxString& aFullFilename, bool aUnitsMM )
621{
622 FILE* rptfile = wxFopen( aFullFilename, wxT( "wt" ) );
623
624 if( rptfile == nullptr )
625 return false;
626
627 std::string data;
628 PLACE_FILE_EXPORTER exporter( GetBoard(), aUnitsMM,
629 false, false, // SMD aOnlySMD, aNoTHItems
630 false, // aExcludeDNP
631 true, true, // aTopSide, aBottomSide
632 false, true, false // aFormatCSV, aUseAuxOrigin, aNegateBottomX
633 );
634 data = exporter.GenReportData();
635
636 fputs( data.c_str(), rptfile );
637 fclose( rptfile );
638
639 return true;
640}
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Definition: bitmap.cpp:110
int GeneratePosFile(const TOOL_EVENT &aEvent)
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:297
bool ResolveTextVar(wxString *token, int aDepth) const
Definition: board.cpp:434
const wxString & GetFileName() const
Definition: board.h:334
Class DIALOG_GEN_FOOTPRINT_POSITION_BASE.
The dialog to create footprint position files and choose options (one or 2 files, units and force all...
void onUpdateUIincludeBoardEdge(wxUpdateUIEvent &event) override
void onUpdateUIExcludeTH(wxUpdateUIEvent &event) override
bool CreateGerberFiles()
Creates placement files in gerber format.
void onGenerate(wxCommandEvent &event) override
void onUpdateUIFileOpt(wxUpdateUIEvent &event) override
void onUpdateUIOnlySMD(wxUpdateUIEvent &event) override
DIALOG_GEN_FOOTPRINT_POSITION(PCB_EDIT_FRAME *aEditFrame)
bool CreateAsciiFiles()
Creates files in text or csv format.
void onUpdateUInegXcoord(wxUpdateUIEvent &event) override
void onOutputDirectoryBrowseClicked(wxCommandEvent &event) override
void onUpdateUIUnits(wxUpdateUIEvent &event) override
EDA_UNITS m_units
Definition: dialog_shim.h:193
void SetupStandardButtons(std::map< int, wxString > aLabels={})
std::string m_hash_key
Definition: dialog_shim.h:194
int ShowModal() override
wxString GetSettingsDialogTitle() const override
void SetConfiguredOutputPath(const wxString &aPath)
Sets the configured output path for the job, this path is always saved to file.
Definition: job.cpp:153
wxString GetConfiguredOutputPath() const
Returns the configured output path for the job.
Definition: job.h:226
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
DIALOG_PLACE_FILE m_PlaceFile
PCBNEW_SETTINGS * GetPcbNewSettings() const
BOARD * GetBoard() const
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.
void GenFootprintsReport(wxCommandEvent &event)
Call DoGenFootprintsReport to create a footprint report file.
bool DoGenFootprintsReport(const wxString &aFullFilename, bool aUnitsMM)
Create an ASCII footprint report file giving some infos on footprints and board outlines.
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)
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,...
The backing store for a PROJECT, in JSON format.
Definition: project_file.h:73
wxString m_PcbLastPath[LAST_PATH_SIZE]
MRU path storage.
Definition: project_file.h:173
virtual PROJECT_FILE & GetProjectFile() const
Definition: project.h:203
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.
Definition: project.cpp:370
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
void SetBitmap(const wxBitmapBundle &aBmp)
Generic, UI-independent tool event.
Definition: tool_event.h:168
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.
Definition: common.cpp:351
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, int aFlags)
Definition: common.cpp:59
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.
Definition: common.cpp:372
void DisplayError(wxWindow *aParent, const wxString &aText)
Display an error or warning message box with aMessage.
Definition: confirm.cpp:170
This file is part of the common library.
#define _(s)
Classes used in place file generation.
static const std::string FootprintPlaceFileExtension
@ B_Cu
Definition: layer_ids.h:65
@ F_Cu
Definition: layer_ids.h:64
int GetUserUnits()
Return the currently selected user unit value for the interface.
@ LAST_PATH_POS_FILES
Definition: project_file.h:57
@ RPT_SEVERITY_ERROR
@ RPT_SEVERITY_INFO
@ RPT_SEVERITY_ACTION
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: string_utils.h:403
Definition of file extensions used in Kicad.