KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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, see <https://www.gnu.org/licenses/>.
18 */
19
20/*
21 * 1 - create ASCII files for automatic placement of smd components
22 * 2 - create a footprint report (pos and footprint descr) (ascii file)
23 */
24
26
27#include <wx/dirdlg.h>
28#include <wx/msgdlg.h>
29
30#include <board.h>
31#include <confirm.h>
32#include <pcb_edit_frame.h>
34#include <bitmaps.h>
35#include <reporter.h>
38#include <kiface_base.h>
39#include <string_utils.h>
45
46
49 m_editFrame( aEditFrame ),
50 m_job( nullptr )
51{
52 m_messagesPanel->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) );
53 m_messagesPanel->MsgPanelSetMinSize( wxSize( -1, 160 ) );
54
56
57 m_variantChoiceCtrl->Append( m_editFrame->GetBoard()->GetVariantNamesForUI() );
58
59 wxString currentVariant = m_editFrame->GetBoard()->GetCurrentVariant();
60
61 if( !currentVariant.IsEmpty() )
62 {
63 int selection = m_variantChoiceCtrl->FindString( currentVariant );
64
65 if( selection != wxNOT_FOUND )
66 m_variantChoiceCtrl->SetSelection( selection );
67 else
68 m_variantChoiceCtrl->SetSelection( 0 );
69 }
70 else
71 {
72 m_variantChoiceCtrl->SetSelection( 0 );
73 }
74
75 SetupStandardButtons( { { wxID_OK, _( "Generate Position File" ) },
76 { wxID_CANCEL, _( "Close" ) } } );
77
78 // DIALOG_SHIM needs a unique hash_key because classname will be the same for both job and
79 // non-job versions.
80 m_hash_key = TO_UTF8( GetTitle() );
81
82 GetSizer()->SetSizeHints( this );
83 Centre();
84}
85
86
88 PCB_EDIT_FRAME* aEditFrame,
89 wxWindow* aParent ) :
91 m_editFrame( aEditFrame ),
92 m_job( aJob )
93{
94 SetTitle( m_job->GetSettingsDialogTitle() );
95
96 m_browseButton->Hide();
98 m_staticTextDir->SetLabel( _( "Output file:" ) );
99
100 if( m_editFrame && m_editFrame->GetBoard() )
101 m_variantChoiceCtrl->Append( m_editFrame->GetBoard()->GetVariantNamesForUI() );
102
103 m_messagesPanel->Hide();
104
106
107 // DIALOG_SHIM needs a unique hash_key because classname will be the same for both job and
108 // non-job versions.
109 m_hash_key = TO_UTF8( GetTitle() );
110
111 GetSizer()->SetSizeHints( this );
112 Centre();
113}
114
115
117{
118 if( m_job )
119 {
120 m_outputDirectoryName->SetValue( m_job->GetConfiguredOutputPath() );
121
122 m_unitsCtrl->SetSelection( static_cast<int>( m_job->m_units ) );
123 m_singleFile->SetValue( m_job->m_singleFile );
124 m_formatCtrl->SetSelection( static_cast<int>( m_job->m_format ) );
125 m_cbIncludeBoardEdge->SetValue( m_job->m_gerberBoardEdge );
126 m_useDrillPlaceOrigin->SetValue( m_job->m_useDrillPlaceFileOrigin );
127 m_onlySMD->SetValue( m_job->m_smdOnly );
128 m_negateXcb->SetValue( m_job->m_negateBottomX );
129 m_excludeTH->SetValue( m_job->m_excludeFootprintsWithTh );
130 m_excludeDNP->SetValue( m_job->m_excludeDNP );
131 m_excludeBOM->SetValue( m_job->m_excludeBOM );
132
133 if( !m_job->m_variant.IsEmpty() )
134 {
135 int selection = m_variantChoiceCtrl->FindString( m_job->m_variant );
136
137 if( selection != wxNOT_FOUND )
138 m_variantChoiceCtrl->SetSelection( selection );
139 else
140 m_variantChoiceCtrl->SetSelection( 0 );
141 }
142 else
143 {
144 m_variantChoiceCtrl->SetSelection( 0 );
145 }
146 }
147
148 return true;
149}
150
151
153{
154 m_unitsLabel->Enable( m_formatCtrl->GetSelection() != 2 );
155 m_unitsCtrl->Enable( m_formatCtrl->GetSelection() != 2 );
156}
157
158
160{
161 m_singleFile->Enable( m_formatCtrl->GetSelection() != 2 );
162}
163
164
166{
167 if( m_formatCtrl->GetSelection() == 2 )
168 {
169 m_onlySMD->SetValue( false );
170 m_onlySMD->Enable( false );
171 }
172 else
173 {
174 m_onlySMD->Enable( true );
175 }
176}
177
178
180{
181 if( m_formatCtrl->GetSelection() == 2 )
182 {
183 m_negateXcb->SetValue( false );
184 m_negateXcb->Enable( false );
185 }
186 else
187 {
188 m_negateXcb->Enable( true );
189 }
190}
191
193{
194 if( m_formatCtrl->GetSelection() == 2 )
195 {
196 if( event.GetEventObject() == m_excludeTH )
197 m_excludeTH->SetValue( false );
198 else if( event.GetEventObject() == m_excludeDNP )
199 m_excludeDNP->SetValue( false );
200 else if( event.GetEventObject() == m_excludeBOM )
201 m_excludeBOM->SetValue( false );
202
203 event.Enable( false );
204 }
205 else
206 {
207 event.Enable( true );
208 }
209}
210
211
213{
214 m_cbIncludeBoardEdge->Enable( m_formatCtrl->GetSelection() == 2 );
215}
216
217
219{
220 // Build the absolute path of current output directory to preselect it in the file browser.
221 wxString path = ExpandEnvVarSubstitutions( m_outputDirectoryName->GetValue(), &Prj() );
222 path = Prj().AbsolutePath( path );
223
224 wxDirDialog dirDialog( this, _( "Select Output Directory" ), path );
225
226 if( dirDialog.ShowModal() == wxID_CANCEL )
227 return;
228
229 wxFileName dirName = wxFileName::DirName( dirDialog.GetPath() );
230
231 if( IsOK( this, _( "Use a relative path?" ) ) )
232 {
233 wxString boardFilePath = ( (wxFileName) m_editFrame->GetBoard()->GetFileName() ).GetPath();
234
235 if( !dirName.MakeRelativeTo( boardFilePath ) )
236 {
237 DisplayErrorMessage( this, _( "Cannot make path relative (target volume different from board "
238 "file volume)!" ) );
239 }
240 }
241
242 m_outputDirectoryName->SetValue( dirName.GetFullPath() );
243}
244
245
246void DIALOG_GEN_FOOTPRINT_POSITION::onGenerate( wxCommandEvent& event )
247{
248 if( !m_job )
249 {
250 m_units = m_unitsCtrl->GetSelection() == 0 ? EDA_UNITS::INCH : EDA_UNITS::MM;
251
253 // Keep unix directory format convention in cfg files
254 m_outputDirectory.Replace( wxT( "\\" ), wxT( "/" ) );
255
256 if( m_formatCtrl->GetSelection() == 2 )
258 else
260 }
261 else
262 {
263 m_job->SetConfiguredOutputPath( m_outputDirectoryName->GetValue() );
264 m_job->m_units = m_unitsCtrl->GetSelection() == 0 ? JOB_EXPORT_PCB_POS::UNITS::INCH
266 m_job->m_format = static_cast<JOB_EXPORT_PCB_POS::FORMAT>( m_formatCtrl->GetSelection() );
268 m_job->m_singleFile = m_singleFile->GetValue();
269 m_job->m_gerberBoardEdge = m_cbIncludeBoardEdge->GetValue();
270 m_job->m_excludeFootprintsWithTh = m_excludeTH->GetValue();
271 m_job->m_smdOnly = m_onlySMD->GetValue();
272 m_job->m_useDrillPlaceFileOrigin = m_useDrillPlaceOrigin->GetValue();
273 m_job->m_negateBottomX = m_negateXcb->GetValue();
274 m_job->m_excludeDNP = m_excludeDNP->GetValue();
275 m_job->m_excludeBOM = m_excludeBOM->GetValue();
276 m_job->m_variant = getSelectedVariant();
277
278 event.Skip(); // Allow normal close action
279 }
280}
281
282
284{
285 BOARD* brd = m_editFrame->GetBoard();
286 wxString msg;
287 int fullcount = 0;
288
289 // Create output directory if it does not exist (also transform it in absolute form).
290 // Bail if it fails.
291
292 std::function<bool( wxString* )> textResolver =
293 [&]( wxString* token ) -> bool
294 {
295 // Handles board->GetTitleBlock() *and* board->GetProject()
296 return m_editFrame->GetBoard()->ResolveTextVar( token, 0 );
297 };
298
299 wxString path = m_outputDirectory;
300 path = ExpandTextVars( path, &textResolver );
302
303 wxFileName outputDir = wxFileName::DirName( path );
304 wxString boardFilename = m_editFrame->GetBoard()->GetFileName();
305 REPORTER* reporter = &m_messagesPanel->Reporter();
306
307 if( !EnsureFileDirectoryExists( &outputDir, boardFilename, reporter ) )
308 {
309 msg.Printf( _( "Could not write plot files to folder '%s'." ), outputDir.GetPath() );
310 DisplayError( this, msg );
311 return false;
312 }
313
314 wxFileName fn = m_editFrame->GetBoard()->GetFileName();
315 fn.SetPath( outputDir.GetPath() );
316
317 // Create the Front and Top side placement files. Gerber P&P files are always separated.
318 // Not also they include all footprints
319 PLACEFILE_GERBER_WRITER exporter( brd );
320
321 // Set the selected variant for variant-aware DNP/BOM/position file filtering
322 exporter.SetVariant( getSelectedVariant() );
323
324 wxString filename = exporter.GetPlaceFileName( fn.GetFullPath(), F_Cu );
325
326 int fpcount = exporter.CreatePlaceFile( filename, F_Cu, m_cbIncludeBoardEdge->GetValue(),
327 m_excludeDNP->GetValue(), ExcludeBOM() );
328
329 if( fpcount < 0 )
330 {
331 msg.Printf( _( "Failed to create file '%s'." ), fn.GetFullPath() );
332 wxMessageBox( msg );
333 reporter->Report( msg, RPT_SEVERITY_ERROR );
334 return false;
335 }
336
337 msg.Printf( _( "Front (top side) placement file: '%s'." ), filename );
338 reporter->Report( msg, RPT_SEVERITY_ACTION );
339
340 msg.Printf( _( "Component count: %d." ), fpcount );
341 reporter->Report( msg, RPT_SEVERITY_INFO );
342
343 // Create the Back or Bottom side placement file
344 fullcount = fpcount;
345
346 filename = exporter.GetPlaceFileName( fn.GetFullPath(), B_Cu );
347
348 fpcount = exporter.CreatePlaceFile( filename, B_Cu, m_cbIncludeBoardEdge->GetValue(),
349 m_excludeDNP->GetValue(), ExcludeBOM() );
350
351 if( fpcount < 0 )
352 {
353 msg.Printf( _( "Failed to create file '%s'." ), filename );
354 reporter->Report( msg, RPT_SEVERITY_ERROR );
355 wxMessageBox( msg );
356 return false;
357 }
358
359 // Display results
360 msg.Printf( _( "Back (bottom side) placement file: '%s'." ), filename );
361 reporter->Report( msg, RPT_SEVERITY_ACTION );
362
363 msg.Printf( _( "Component count: %d." ), fpcount );
364 reporter->Report( msg, RPT_SEVERITY_INFO );
365
366 fullcount += fpcount;
367 msg.Printf( _( "Full component count: %d." ), fullcount );
368 reporter->Report( msg, RPT_SEVERITY_INFO );
369
370 reporter->Report( _( "Done." ), RPT_SEVERITY_INFO );
371
372 return true;
373}
374
375
377{
378 BOARD* brd = m_editFrame->GetBoard();
379 wxString msg;
380 bool singleFile = OneFileOnly();
381 bool useCSVfmt = m_formatCtrl->GetSelection() == 1;
382 bool useAuxOrigin = m_useDrillPlaceOrigin->GetValue();
383 int fullcount = 0;
384 int topSide = true;
385 int bottomSide = true;
386 bool negateBottomX = m_negateXcb->GetValue();
387
388 // Test for any footprint candidate in list.
389 {
391 ExcludeBOM(), topSide, bottomSide, useCSVfmt, useAuxOrigin,
392 negateBottomX );
393
394 // Set the selected variant for variant-aware DNP/BOM/position file filtering
395 exporter.SetVariant( getSelectedVariant() );
396
397 exporter.GenPositionData();
398
399 if( exporter.GetFootprintCount() == 0 )
400 {
401 wxMessageBox( _( "No footprint for automated placement." ) );
402 return false;
403 }
404 }
405
406 // Create output directory if it does not exist (also transform it in absolute form).
407 // Bail if it fails.
408
409 std::function<bool( wxString* )> textResolver =
410 [&]( wxString* token ) -> bool
411 {
412 // Handles board->GetTitleBlock() *and* board->GetProject()
413 return m_editFrame->GetBoard()->ResolveTextVar( token, 0 );
414 };
415
416 wxString path = m_outputDirectory;
417 path = ExpandTextVars( path, &textResolver );
419
420 wxFileName outputDir = wxFileName::DirName( path );
421 wxString boardFilename = m_editFrame->GetBoard()->GetFileName();
422 REPORTER* reporter = &m_messagesPanel->Reporter();
423
424 if( !EnsureFileDirectoryExists( &outputDir, boardFilename, reporter ) )
425 {
426 msg.Printf( _( "Could not write plot files to folder '%s'." ), outputDir.GetPath() );
427 DisplayError( this, msg );
428 return false;
429 }
430
431 wxFileName fn = m_editFrame->GetBoard()->GetFileName();
432 fn.SetPath( outputDir.GetPath() );
433
434 // Create the Front or Top side placement file, or a single file
435 topSide = true;
436 bottomSide = singleFile;
437
438 fn.SetName( PLACE_FILE_EXPORTER::DecorateFilename( fn.GetName(), topSide, bottomSide ) );
440
441 if( useCSVfmt )
442 {
443 fn.SetName( fn.GetName() + wxT( "-" ) + FILEEXT::FootprintPlaceFileExtension );
444 fn.SetExt( wxT( "csv" ) );
445 }
446
447 int fpcount = m_editFrame->DoGenFootprintsPositionFile( fn.GetFullPath(), UnitsMM(), OnlySMD(),
448 ExcludeAllTH(), ExcludeDNP(), ExcludeBOM(), topSide,
449 bottomSide, useCSVfmt, useAuxOrigin, negateBottomX );
450 if( fpcount < 0 )
451 {
452 msg.Printf( _( "Failed to create file '%s'." ), fn.GetFullPath() );
453 wxMessageBox( msg );
454 reporter->Report( msg, RPT_SEVERITY_ERROR );
455 return false;
456 }
457
458 if( singleFile )
459 msg.Printf( _( "Placement file: '%s'." ), fn.GetFullPath() );
460 else
461 msg.Printf( _( "Front (top side) placement file: '%s'." ), fn.GetFullPath() );
462
463 reporter->Report( msg, RPT_SEVERITY_ACTION );
464
465 msg.Printf( _( "Component count: %d." ), fpcount );
466 reporter->Report( msg, RPT_SEVERITY_INFO );
467
468 if( singleFile )
469 {
470 reporter->Report( _( "Done." ), RPT_SEVERITY_INFO );
471 return true;
472 }
473
474 // Create the Back or Bottom side placement file
475 fullcount = fpcount;
476 topSide = false;
477 bottomSide = true;
478 fn = brd->GetFileName();
479 fn.SetPath( outputDir.GetPath() );
480 fn.SetName( PLACE_FILE_EXPORTER::DecorateFilename( fn.GetName(), topSide, bottomSide ) );
482
483 if( useCSVfmt )
484 {
485 fn.SetName( fn.GetName() + wxT( "-" ) + FILEEXT::FootprintPlaceFileExtension );
486 fn.SetExt( wxT( "csv" ) );
487 }
488
489 fpcount = m_editFrame->DoGenFootprintsPositionFile( fn.GetFullPath(), UnitsMM(), OnlySMD(),
490 ExcludeAllTH(), ExcludeDNP(), ExcludeBOM(), topSide,
491 bottomSide, useCSVfmt, useAuxOrigin, negateBottomX );
492
493 if( fpcount < 0 )
494 {
495 msg.Printf( _( "Failed to create file '%s'." ), fn.GetFullPath() );
496 reporter->Report( msg, RPT_SEVERITY_ERROR );
497 wxMessageBox( msg );
498 return false;
499 }
500
501 // Display results
502 if( !singleFile )
503 {
504 msg.Printf( _( "Back (bottom side) placement file: '%s'." ), fn.GetFullPath() );
505 reporter->Report( msg, RPT_SEVERITY_ACTION );
506
507 msg.Printf( _( "Component count: %d." ), fpcount );
508 reporter->Report( msg, RPT_SEVERITY_INFO );
509 }
510
511 if( !singleFile )
512 {
513 fullcount += fpcount;
514 msg.Printf( _( "Full component count: %d." ), fullcount );
515 reporter->Report( msg, RPT_SEVERITY_INFO );
516 }
517
518 reporter->Report( _( "Done." ), RPT_SEVERITY_INFO );
519 return true;
520}
521
522
524{
525 wxString variant;
526 int selection = m_variantChoiceCtrl->GetSelection();
527
528 // Selection 0 is the default variant (empty string)
529 if( ( selection != 0 ) && ( selection != wxNOT_FOUND ) )
530 variant = m_variantChoiceCtrl->GetString( selection );
531
532 return variant;
533}
534
535
542
543
544int PCB_EDIT_FRAME::DoGenFootprintsPositionFile( const wxString& aFullFileName, bool aUnitsMM,
545 bool aOnlySMD, bool aNoTHItems, bool aExcludeDNP,
546 bool aExcludeBOM, bool aTopSide, bool aBottomSide,
547 bool aFormatCSV, bool aUseAuxOrigin, bool aNegateBottomX )
548{
549 FILE * file = nullptr;
550
551 if( !aFullFileName.IsEmpty() )
552 {
553 file = wxFopen( aFullFileName, wxT( "wt" ) );
554
555 if( file == nullptr )
556 return -1;
557 }
558
559 std::string data;
560 PLACE_FILE_EXPORTER exporter( GetBoard(), aUnitsMM, aOnlySMD, aNoTHItems, aExcludeDNP,
561 aExcludeBOM, aTopSide, aBottomSide, aFormatCSV, aUseAuxOrigin,
562 aNegateBottomX );
563
564 // Set the current variant for variant-aware DNP/BOM/position file filtering
565 exporter.SetVariant( GetBoard()->GetCurrentVariant() );
566
567 data = exporter.GenPositionData();
568
569 // if aFullFileName is empty, the file is not created, only the
570 // count of footprints to place is returned
571 if( file )
572 {
573 // Creates a footprint position file
574 // aSide = 0 -> Back (bottom) side)
575 // aSide = 1 -> Front (top) side)
576 // aSide = 2 -> both sides
577 fputs( data.c_str(), file );
578 fclose( file );
579 }
580
581 return exporter.GetFootprintCount();
582}
583
584
586{
587 BOARD* board = m_frame->GetBoard();
588 wxFileName fn;
589
590 wxString boardFilePath = ( (wxFileName) board->GetFileName() ).GetPath();
591 wxDirDialog dirDialog( m_frame, _( "Select Output Directory" ), boardFilePath );
592
593 if( dirDialog.ShowModal() == wxID_CANCEL )
594 return 0;
595
596 fn = board->GetFileName();
597 fn.SetPath( dirDialog.GetPath() );
598 fn.SetExt( wxT( "rpt" ) );
599
600 FILE* rptfile = wxFopen( fn.GetFullPath(), wxT( "wt" ) );
601
602 if( rptfile == nullptr )
603 {
604 wxMessageBox( wxString::Format( _( "Footprint report file created:\n'%s'." ), fn.GetFullPath() ),
605 _( "Footprint Report" ), wxICON_INFORMATION );
606
607 return 0;
608 }
609
610 std::string data;
611 PLACE_FILE_EXPORTER exporter( board, m_frame->GetUserUnits() == EDA_UNITS::MM,
612 false, // aOnlySMD
613 false, // aNoTHItems
614 false, // aExcludeDNP
615 false, // aExcludeBOM
616 true, true, // aTopSide, aBottomSide
617 false, // aFormatCSV
618 true, // aUseAuxOrigin
619 false ); // aNegateBottomX
620
621 // Set the current variant for variant-aware filtering
622 exporter.SetVariant( board->GetCurrentVariant() );
623
624 data = exporter.GenReportData();
625
626 fputs( data.c_str(), rptfile );
627 fclose( rptfile );
628
629 wxMessageBox( wxString::Format( _( "Footprint report file created:\n'%s'." ), fn.GetFullPath() ),
630 _( "Footprint Report" ), wxICON_INFORMATION );
631
632 return 0;
633}
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap, int aMinHeight)
Definition bitmap.cpp:106
int GenFootprintsReport(const TOOL_EVENT &aEvent)
int GeneratePosFile(const TOOL_EVENT &aEvent)
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:372
const wxString & GetFileName() const
Definition board.h:409
DIALOG_GEN_FOOTPRINT_POSITION_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Generate Placement Files"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
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
void SetupStandardButtons(std::map< int, wxString > aLabels={})
std::string m_hash_key
int ShowModal() override
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
BOARD * GetBoard() const
The main frame for Pcbnew.
int DoGenFootprintsPositionFile(const wxString &aFullFileName, bool aUnitsMM, bool aOnlySMD, bool aNoTHItems, bool aExcludeDNP, bool aExcludeBOM, bool aTopSide, bool aBottomSide, bool aFormatCSV, bool aUseAuxOrigin, bool aNegateBottomX)
Create an ASCII footprint position file.
BOARD * board() const
Used to create Gerber drill files.
const wxString GetPlaceFileName(const wxString &aFullBaseFilename, PCB_LAYER_ID aLayer) const
void SetVariant(const wxString &aVariant)
Set the variant name for variant-aware filtering.
int CreatePlaceFile(const wxString &aFullFilename, PCB_LAYER_ID aLayer, bool aIncludeBrdEdges, bool aExcludeDNP, bool aExcludeBOM)
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
void SetVariant(const wxString &aVariant)
Set the variant name for variant-aware export.
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.
Definition project.cpp:407
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:71
T * getEditFrame() const
Return the application window object, casted to requested user type.
Definition tool_base.h:182
Generic, UI-independent tool event.
Definition tool_event.h:167
const wxString ExpandEnvVarSubstitutions(const wxString &aString, const PROJECT *aProject)
Replace any environment variable & text variable references with their values.
Definition common.cpp:704
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:725
bool IsOK(wxWindow *aParent, const wxString &aMessage)
Display a yes/no dialog with aMessage and returns the user response.
Definition confirm.cpp:274
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition confirm.cpp:217
void DisplayError(wxWindow *aParent, const wxString &aText)
Display an error or warning message box with aMessage.
Definition confirm.cpp:192
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:61
@ F_Cu
Definition layer_ids.h:60
@ 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.
std::string path
IbisParser parser & reporter
Definition of file extensions used in Kicad.