KiCad PCB EDA Suite
gerbview/files.cpp
Go to the documentation of this file.
1 
5 /*
6  * This program source code file is part of KiCad, a free EDA CAD application.
7  *
8  * Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
9  * Copyright (C) 2004-2017 KiCad Developers, see AUTHORS.txt for contributors.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, you may find one here:
23  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
24  * or you may search the http://www.gnu.org website for the version 2 license,
25  * or you may write to the Free Software Foundation, Inc.,
26  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
27  */
28 
29 #include <fctsys.h>
30 #include <wx/fs_zip.h>
31 #include <wx/wfstream.h>
32 #include <wx/zipstrm.h>
33 
34 #include <common.h>
35 #include <class_drawpanel.h>
36 #include <reporter.h>
37 #include <html_messagebox.h>
38 
39 #include <gerbview_frame.h>
40 #include <gerbview_id.h>
41 #include <gerber_file_image.h>
42 #include <gerber_file_image_list.h>
43 #include <gerbview_layer_widget.h>
46 
47 // HTML Messages used more than one time:
48 #define MSG_NO_MORE_LAYER\
49  _( "<b>No more available free graphic layer</b> in Gerbview to load files" )
50 #define MSG_NOT_LOADED _( "\n<b>Not loaded:</b> <i>%s</i>" )
51 
52 void GERBVIEW_FRAME::OnGbrFileHistory( wxCommandEvent& event )
53 {
54  wxString fn;
55 
56  fn = GetFileFromHistory( event.GetId(), _( "Gerber files" ) );
57 
58  if( !fn.IsEmpty() )
59  {
60  Erase_Current_DrawLayer( false );
61  LoadGerberFiles( fn );
62  }
63 }
64 
65 
66 void GERBVIEW_FRAME::OnDrlFileHistory( wxCommandEvent& event )
67 {
68  wxString fn;
69 
70  fn = GetFileFromHistory( event.GetId(), _( "Drill files" ), &m_drillFileHistory );
71 
72  if( !fn.IsEmpty() )
73  {
74  Erase_Current_DrawLayer( false );
75  LoadExcellonFiles( fn );
76  }
77 }
78 
79 
80 void GERBVIEW_FRAME::OnZipFileHistory( wxCommandEvent& event )
81 {
82  wxString filename;
83  filename = GetFileFromHistory( event.GetId(), _( "Zip files" ), &m_zipFileHistory );
84 
85  if( !filename.IsEmpty() )
86  {
87  Erase_Current_DrawLayer( false );
88  LoadZipArchiveFile( filename );
89  }
90 }
91 
92 
93 void GERBVIEW_FRAME::OnJobFileHistory( wxCommandEvent& event )
94 {
95  wxString filename;
96  filename = GetFileFromHistory( event.GetId(), _( "Job files" ), &m_jobFileHistory );
97 
98  if( !filename.IsEmpty() )
99  {
100  LoadGerberJobFile( filename );
101  }
102 }
103 
104 
105 /* File commands. */
106 void GERBVIEW_FRAME::Files_io( wxCommandEvent& event )
107 {
108  int id = event.GetId();
109 
110  switch( id )
111  {
112  case wxID_FILE:
113  LoadGerberFiles( wxEmptyString );
114  break;
115 
117  Clear_DrawLayers( false );
118  Zoom_Automatique( false );
119  m_canvas->Refresh();
120  ClearMsgPanel();
121  break;
122 
124  LoadExcellonFiles( wxEmptyString );
125  m_canvas->Refresh();
126  break;
127 
129  LoadZipArchiveFile( wxEmptyString );
130  m_canvas->Refresh();
131  break;
132 
134  LoadGerberJobFile( wxEmptyString );
135  m_canvas->Refresh();
136  break;
137 
138  default:
139  wxFAIL_MSG( wxT( "File_io: unexpected command id" ) );
140  break;
141  }
142 }
143 
144 
145 bool GERBVIEW_FRAME::LoadGerberFiles( const wxString& aFullFileName )
146 {
147  wxString filetypes;
148  wxArrayString filenamesList;
149  wxFileName filename = aFullFileName;
150  wxString currentPath;
151 
152  if( !filename.IsOk() )
153  {
154  /* Standard gerber filetypes
155  * (See http://en.wikipedia.org/wiki/Gerber_File)
156  * the .gbr (.pho in legacy files) extension is the default used in Pcbnew
157  * However there are a lot of other extensions used for gerber files
158  * Because the first letter is usually g, we accept g* as extension
159  * (Mainly internal copper layers do not have specific extension,
160  * and filenames are like *.g1, *.g2 *.gb1 ...).
161  * Now (2014) Ucamco (the company which manages the Gerber format) encourages
162  * use of .gbr only and the Gerber X2 file format.
163  */
164  filetypes = _( "Gerber files (.g* .lgr .pho)" );
165  filetypes << wxT("|");
166  filetypes += wxT("*.g*;*.G*;*.pho;*.PHO" );
167  filetypes << wxT("|");
168 
169  /* Special gerber filetypes */
170  filetypes += _( "Top layer (*.GTL)|*.GTL;*.gtl|" );
171  filetypes += _( "Bottom layer (*.GBL)|*.GBL;*.gbl|" );
172  filetypes += _( "Bottom solder resist (*.GBS)|*.GBS;*.gbs|" );
173  filetypes += _( "Top solder resist (*.GTS)|*.GTS;*.gts|" );
174  filetypes += _( "Bottom overlay (*.GBO)|*.GBO;*.gbo|" );
175  filetypes += _( "Top overlay (*.GTO)|*.GTO;*.gto|" );
176  filetypes += _( "Bottom paste (*.GBP)|*.GBP;*.gbp|" );
177  filetypes += _( "Top paste (*.GTP)|*.GTP;*.gtp|" );
178  filetypes += _( "Keep-out layer (*.GKO)|*.GKO;*.gko|" );
179  filetypes += _( "Mechanical layers (*.GMx)|*.GM1;*.gm1;*.GM2;*.gm2;*.GM3;*.gm3|" );
180  filetypes += _( "Top Pad Master (*.GPT)|*.GPT;*.gpt|" );
181  filetypes += _( "Bottom Pad Master (*.GPB)|*.GPB;*.gpb|" );
182 
183  // All filetypes
184  filetypes += AllFilesWildcard;
185 
186  // Use the current working directory if the file name path does not exist.
187  if( filename.DirExists() )
188  currentPath = filename.GetPath();
189  else
190  {
191  currentPath = m_mruPath;
192 
193  // On wxWidgets 3.1 (bug?) the path in wxFileDialog is ignored when
194  // finishing by the dir separator. Remove it if any:
195  if( currentPath.EndsWith( '\\' ) || currentPath.EndsWith( '/' ) )
196  currentPath.RemoveLast();
197  }
198 
199  wxFileDialog dlg( this, _( "Open Gerber File(s)" ),
200  currentPath,
201  filename.GetFullName(),
202  filetypes,
203  wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE | wxFD_CHANGE_DIR );
204 
205  if( dlg.ShowModal() == wxID_CANCEL )
206  return false;
207 
208  dlg.GetPaths( filenamesList );
209  m_mruPath = currentPath = dlg.GetDirectory();
210  }
211  else
212  {
213  filenamesList.Add( aFullFileName );
214  m_mruPath = currentPath = filename.GetPath();
215  }
216 
217  Erase_Current_DrawLayer( false );
218 
219  // Set the busy cursor
220  wxBusyCursor wait;
221 
222  return loadListOfGerberFiles( currentPath, filenamesList );
223 }
224 
225 
226 bool GERBVIEW_FRAME::loadListOfGerberFiles( const wxString& aPath,
227  const wxArrayString& aFilenameList )
228 {
229  wxFileName filename;
230 
231  // Read gerber files: each file is loaded on a new GerbView layer
232  bool success = true;
233  int layer = GetActiveLayer();
234  int visibility = GetVisibleLayers();
235 
236  // Manage errors when loading files
237  wxString msg;
238  WX_STRING_REPORTER reporter( &msg );
239 
240  // Show progress dialog after 1 second of loading
241  static const long long progressShowDelay = 1000;
242 
243  auto startTime = wxGetUTCTimeMillis();
244  std::unique_ptr<WX_PROGRESS_REPORTER> progress = nullptr;
245 
246  for( unsigned ii = 0; ii < aFilenameList.GetCount(); ii++ )
247  {
248  if( !progress && wxGetUTCTimeMillis() - startTime > progressShowDelay )
249  {
250  progress = std::make_unique<WX_PROGRESS_REPORTER>( this,
251  _( "Loading Gerber files..." ), 1, false );
252  progress->SetMaxProgress( aFilenameList.GetCount() - 1 );
253  progress->Report( _("Loading Gerber files..." ) );
254  }
255  else if( progress )
256  {
257  progress->KeepRefreshing();
258  }
259 
260  filename = aFilenameList[ii];
261 
262  if( !filename.IsAbsolute() )
263  filename.SetPath( aPath );
264 
265  m_lastFileName = filename.GetFullPath();
266 
267  SetActiveLayer( layer, false );
268 
269  visibility |= ( 1 << layer );
270 
271  if( Read_GERBER_File( filename.GetFullPath() ) )
272  {
274 
275  layer = getNextAvailableLayer( layer );
276 
277  if( layer == NO_AVAILABLE_LAYERS && ii < aFilenameList.GetCount()-1 )
278  {
279  success = false;
281 
282  // Report the name of not loaded files:
283  ii += 1;
284  while( ii < aFilenameList.GetCount() )
285  {
286  filename = aFilenameList[ii++];
287  wxString txt;
288  txt.Printf( MSG_NOT_LOADED,
289  GetChars( filename.GetFullName() ) );
290  reporter.Report( txt, REPORTER::RPT_ERROR );
291  }
292  break;
293  }
294 
295  SetActiveLayer( layer, false );
296  }
297 
298  if( progress )
299  progress->AdvanceProgress();
300  }
301 
302  if( !success )
303  {
304  wxSafeYield(); // Allows slice of time to redraw the screen
305  // to refresh widgets, before displaying messages
306  HTML_MESSAGE_BOX mbox( this, _( "Errors" ) );
307  mbox.ListSet( msg );
308  mbox.ShowModal();
309  }
310 
311  SetVisibleLayers( visibility );
312 
313  Zoom_Automatique( false );
314 
315  // Synchronize layers tools with actual active layer:
317 
318  // TODO: it would be nice if we could set the active layer to one of the
319  // ones that was just loaded, but to maintain the previous user experience
320  // we need to set it to a blank layer in case they load another file.
321  // We can't start with the next available layer when loading files because
322  // some users expect the behavior of overwriting the active layer on load.
323  SetActiveLayer( getNextAvailableLayer( layer ), true );
324 
326  syncLayerBox( true );
327 
328  GetGalCanvas()->Refresh();
329 
330  return success;
331 }
332 
333 
334 bool GERBVIEW_FRAME::LoadExcellonFiles( const wxString& aFullFileName )
335 {
336  wxString filetypes;
337  wxArrayString filenamesList;
338  wxFileName filename = aFullFileName;
339  wxString currentPath;
340 
341  if( !filename.IsOk() )
342  {
343  filetypes = DrillFileWildcard();
344  filetypes << wxT( "|" );
345 
346  /* All filetypes */
347  filetypes += wxGetTranslation( AllFilesWildcard );
348 
349  /* Use the current working directory if the file name path does not exist. */
350  if( filename.DirExists() )
351  currentPath = filename.GetPath();
352  else
353  currentPath = m_mruPath;
354 
355  wxFileDialog dlg( this, _( "Open Excellon Drill File(s)" ),
356  currentPath, filename.GetFullName(), filetypes,
357  wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE | wxFD_CHANGE_DIR );
358 
359  if( dlg.ShowModal() == wxID_CANCEL )
360  return false;
361 
362  dlg.GetPaths( filenamesList );
363  currentPath = wxGetCwd();
364  m_mruPath = currentPath;
365  }
366  else
367  {
368  filenamesList.Add( aFullFileName );
369  currentPath = filename.GetPath();
370  m_mruPath = currentPath;
371  }
372 
373  // Read Excellon drill files: each file is loaded on a new GerbView layer
374  bool success = true;
375  int layer = GetActiveLayer();
376 
377  // Manage errors when loading files
378  wxString msg;
379  WX_STRING_REPORTER reporter( &msg );
380 
381  for( unsigned ii = 0; ii < filenamesList.GetCount(); ii++ )
382  {
383  filename = filenamesList[ii];
384 
385  if( !filename.IsAbsolute() )
386  filename.SetPath( currentPath );
387 
388  m_lastFileName = filename.GetFullPath();
389 
390  SetActiveLayer( layer, false );
391 
392  if( Read_EXCELLON_File( filename.GetFullPath() ) )
393  {
394  // Update the list of recent drill files.
395  UpdateFileHistory( filename.GetFullPath(), &m_drillFileHistory );
396 
397  layer = getNextAvailableLayer( layer );
398 
399  if( layer == NO_AVAILABLE_LAYERS && ii < filenamesList.GetCount()-1 )
400  {
401  success = false;
403 
404  // Report the name of not loaded files:
405  ii += 1;
406  while( ii < filenamesList.GetCount() )
407  {
408  filename = filenamesList[ii++];
409  wxString txt;
410  txt.Printf( MSG_NOT_LOADED,
411  GetChars( filename.GetFullName() ) );
412  reporter.Report( txt, REPORTER::RPT_ERROR );
413  }
414  break;
415  }
416 
417  SetActiveLayer( layer, false );
418  }
419  }
420 
421  if( !success )
422  {
423  HTML_MESSAGE_BOX mbox( this, _( "Errors" ) );
424  mbox.ListSet( msg );
425  mbox.ShowModal();
426  }
427 
428  Zoom_Automatique( false );
429 
430  // Synchronize layers tools with actual active layer:
434  syncLayerBox();
435 
436  return success;
437 }
438 
439 
440 bool GERBVIEW_FRAME::unarchiveFiles( const wxString& aFullFileName, REPORTER* aReporter )
441 {
442  wxString msg;
443 
444  // Extract the path of aFullFileName. We use it to store temporary files
445  wxFileName fn( aFullFileName );
446  wxString unzipDir = fn.GetPath();
447 
448  wxFFileInputStream zipFile( aFullFileName );
449 
450  if( !zipFile.IsOk() )
451  {
452  if( aReporter )
453  {
454  msg.Printf( _( "Zip file \"%s\" cannot be opened" ), GetChars( aFullFileName ) );
455  aReporter->Report( msg, REPORTER::RPT_ERROR );
456  }
457 
458  return false;
459  }
460 
461  // Update the list of recent zip files.
462  UpdateFileHistory( aFullFileName, &m_zipFileHistory );
463 
464  // The unzipped file in only a temporary file. Give it a filename
465  // which cannot conflict with an usual filename.
466  // TODO: make Read_GERBER_File() and Read_EXCELLON_File() able to
467  // accept a stream, and avoid using a temp file.
468  wxFileName temp_fn( "$tempfile.tmp" );
469  temp_fn.MakeAbsolute( unzipDir );
470  wxString unzipped_tempfile = temp_fn.GetFullPath();
471 
472 
473  bool success = true;
474  wxZipInputStream zipArchive( zipFile );
475  wxZipEntry* entry;
476  bool reported_no_more_layer = false;
477 
478  while( ( entry = zipArchive.GetNextEntry() ) )
479  {
480  wxString fname = entry->GetName();
481  wxFileName uzfn = fname;
482  wxString curr_ext = uzfn.GetExt().Lower();
483 
484  // The archive contains Gerber and/or Excellon drill files. Use the right loader.
485  // However it can contain a few other files (reports, pdf files...),
486  // which will be skipped.
487  // Gerber files ext is usually "gbr", but can be also another value, starting by "g"
488  // old gerber files ext from kicad is .pho
489  // drill files do not have a well defined ext
490  // It is .drl in kicad, but .txt in Altium for instance
491  // Allows only .drl for drill files.
492  if( curr_ext[0] != 'g' && curr_ext != "pho" && curr_ext != "drl" )
493  {
494  if( aReporter )
495  {
496  msg.Printf( _( "Info: skip file <i>\"%s\"</i> (unknown type)\n" ),
497  GetChars( entry->GetName() ) );
498  aReporter->Report( msg, REPORTER::RPT_WARNING );
499  }
500 
501  continue;
502  }
503 
504  int layer = GetActiveLayer();
505 
506  if( layer == NO_AVAILABLE_LAYERS )
507  {
508  success = false;
509 
510  if( aReporter )
511  {
512  if( !reported_no_more_layer )
514 
515  reported_no_more_layer = true;
516 
517  // Report the name of not loaded files:
518  msg.Printf( MSG_NOT_LOADED, GetChars( entry->GetName() ) );
519  aReporter->Report( msg, REPORTER::RPT_ERROR );
520  }
521 
522  delete entry;
523  continue;
524  }
525 
526  // Create the unzipped temporary file:
527  {
528  wxFFileOutputStream temporary_ofile( unzipped_tempfile );
529 
530  if( temporary_ofile.Ok() )
531  temporary_ofile.Write( zipArchive );
532  else
533  {
534  success = false;
535 
536  if( aReporter )
537  {
538  msg.Printf( _( "<b>Unable to create temporary file \"%s\"</b>\n"),
539  GetChars( unzipped_tempfile ) );
540  aReporter->Report( msg, REPORTER::RPT_ERROR );
541  }
542  }
543  }
544 
545  bool read_ok = true;
546 
547  if( curr_ext[0] == 'g' || curr_ext == "pho" )
548  {
549  // Read gerber files: each file is loaded on a new GerbView layer
550  read_ok = Read_GERBER_File( unzipped_tempfile );
551  }
552  else // if( curr_ext == "drl" )
553  {
554  read_ok = Read_EXCELLON_File( unzipped_tempfile );
555  }
556 
557  delete entry;
558 
559  // The unzipped file is only a temporary file, delete it.
560  wxRemoveFile( unzipped_tempfile );
561 
562  if( !read_ok )
563  {
564  success = false;
565 
566  if( aReporter )
567  {
568  msg.Printf( _("<b>unzipped file %s read error</b>\n"),
569  GetChars( unzipped_tempfile ) );
570  aReporter->Report( msg, REPORTER::RPT_ERROR );
571  }
572  }
573  else
574  {
575  GERBER_FILE_IMAGE* gerber_image = GetGbrImage( layer );
576 
577  if( gerber_image )
578  gerber_image->m_FileName = fname;
579 
580  layer = getNextAvailableLayer( layer );
581  SetActiveLayer( layer, false );
582  }
583  }
584 
585  return success;
586 }
587 
588 
589 bool GERBVIEW_FRAME::LoadZipArchiveFile( const wxString& aFullFileName )
590 {
591 #define ZipFileExtension "zip"
592 
593  wxFileName filename = aFullFileName;
594  wxString currentPath;
595 
596  if( !filename.IsOk() )
597  {
598  // Use the current working directory if the file name path does not exist.
599  if( filename.DirExists() )
600  currentPath = filename.GetPath();
601  else
602  currentPath = m_mruPath;
603 
604  wxFileDialog dlg( this,
605  _( "Open Zip File" ),
606  currentPath,
607  filename.GetFullName(),
608  ZipFileWildcard(),
609  wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR );
610 
611  if( dlg.ShowModal() == wxID_CANCEL )
612  return false;
613 
614  filename = dlg.GetPath();
615  currentPath = wxGetCwd();
616  m_mruPath = currentPath;
617  }
618  else
619  {
620  currentPath = filename.GetPath();
621  m_mruPath = currentPath;
622  }
623 
624  wxString msg;
625  WX_STRING_REPORTER reporter( &msg );
626 
627  if( filename.IsOk() )
628  unarchiveFiles( filename.GetFullPath(), &reporter );
629 
630  Zoom_Automatique( false );
631 
632  // Synchronize layers tools with actual active layer:
636  syncLayerBox();
637 
638  if( !msg.IsEmpty() )
639  {
640  wxSafeYield(); // Allows slice of time to redraw the screen
641  // to refresh widgets, before displaying messages
642  HTML_MESSAGE_BOX mbox( this, _( "Messages" ) );
643  mbox.ListSet( msg );
644  mbox.ShowModal();
645  }
646 
647  return true;
648 }
wxString m_lastFileName
The last filename chosen to be proposed to the user.
bool Clear_DrawLayers(bool query)
wxString m_mruPath
Most recently used path.
void Files_io(wxCommandEvent &event)
virtual void Refresh(bool eraseBackground=true, const wxRect *rect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
Definition: draw_panel.cpp:338
void syncLayerBox(bool aRebuildLayerBox=false)
Function syncLayerBox updates the currently "selected" layer within m_SelLayerBox The currently activ...
GERBER_LAYER_WIDGET * m_LayersManager
bool Read_GERBER_File(const wxString &GERBER_FullFileName)
Definition: readgerb.cpp:40
Class GERBER_FILE_IMAGE holds the Image data and parameters for one gerber file and layer parameters ...
void SetActiveLayer(int aLayer, bool doLayerWidgetUpdate=true)
Function SetActiveLayer will change the currently active layer to aLayer and also update the GERBER_L...
void OnGbrFileHistory(wxCommandEvent &event)
Function OnGbrFileHistory deletes the current data and loads a Gerber file selected from history list...
wxString ZipFileWildcard()
wxFileHistory m_drillFileHistory
Class REPORTER is a pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:61
void Erase_Current_DrawLayer(bool query)
int GetActiveLayer()
Function SetActiveLayer returns the active layer.
void SetVisibleLayers(long aLayerMask)
Function SetVisibleLayers is a proxy function that calls the correspondent function in m_BoardSetting...
void UpdateFileHistory(const wxString &FullFileName, wxFileHistory *aFileHistory=NULL)
Function UpdateFileHistory Updates the list of recently opened files.
int getNextAvailableLayer(int aLayer=0) const
Function getNextAvailableLayer finds the next empty layer starting at aLayer and returns it to the ca...
long GetVisibleLayers() const
Function GetVisibleLayers is a proxy function that calls the correspondent function in m_BoardSetting...
bool LoadGerberJobFile(const wxString &aFileName)
Load a Gerber job file, and load gerber files found in job files.
#define MSG_NOT_LOADED
void Zoom_Automatique(bool aWarpPointer)
Function Zoom_Automatique redraws the screen with best zoom level and the best centering that shows a...
Definition: zoom.cpp:106
REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_UNDEFINED) override
Function Report is a pure virtual function to override in the derived object.
Definition: reporter.cpp:53
bool unarchiveFiles(const wxString &aFullFileName, REPORTER *aReporter=nullptr)
Extracts gerber and drill files from the zip archive, and load them.
#define NO_AVAILABLE_LAYERS
bool LoadGerberFiles(const wxString &aFileName)
function LoadGerberFiles Load a photoplot (Gerber) file or many files.
void ListSet(const wxString &aList)
Function ListSet Add a list of items.
bool LoadZipArchiveFile(const wxString &aFileName)
function LoadZipArchiveFileLoadZipArchiveFile Load a zipped archive file.
Subclass of DIALOG_DISPLAY_HTML_TEXT_BASE, which is generated by wxFormBuilder.
void UpdateLayerIcons()
Function UpdateLayerIcons Update all layer manager icons (layers only) Useful when loading a file or ...
The common library.
wxFileHistory m_jobFileHistory
Class HTML_MESSAGE_BOX.
#define MSG_NO_MORE_LAYER
wxString DrillFileWildcard()
void Refresh(bool aEraseBackground=true, const wxRect *aRect=NULL) override
Update the board display after modifying it by a python script (note: it is automatically called by a...
Class WX_STRING_REPORTER is a wrapper for reporting to a wxString object.
Definition: reporter.h:163
wxFileHistory m_zipFileHistory
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:106
void OnJobFileHistory(wxCommandEvent &event)
deletes the current data and load a gerber job file selected from the history list.
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:92
wxString GetFileFromHistory(int cmdId, const wxString &type, wxFileHistory *aFileHistory=NULL)
Function GetFileFromHistory fetches the file name from the file history list.
The common library.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_UNDEFINED)=0
Function Report is a pure virtual function to override in the derived object.
void OnDrlFileHistory(wxCommandEvent &event)
Function OnDrlFileHistory deletes the current data and load a drill file in Excellon format selected ...
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Function GetGalCanvas returns a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:903
bool LoadExcellonFiles(const wxString &aFileName)
function LoadExcellonFiles Load a drill (EXCELLON) file or many files.
void OnZipFileHistory(wxCommandEvent &event)
Function OnZipFileHistory deletes the current data and load a zip archive file selected from the hist...
GERBER_FILE_IMAGE * GetGbrImage(int aIdx) const
const wxString AllFilesWildcard
bool loadListOfGerberFiles(const wxString &aPath, const wxArrayString &aFilenameList)
Loads a list of Gerber files and updates the view based on them.
void ClearMsgPanel(void)
Clear all messages from the message panel.
Definition: draw_frame.cpp:822
void ReFillLayerWidget()
Function ReFillLayerWidget changes out all the layers in m_Layers and may be called upon loading new ...
bool Read_EXCELLON_File(const wxString &aFullFileName)