KiCad PCB EDA Suite
append_board_to_current.cpp File Reference

append a board to the currently edited board. More...

#include <fctsys.h>
#include <confirm.h>
#include <properties.h>
#include <wxPcbStruct.h>
#include <pcbnew.h>
#include <io_mgr.h>
#include <class_module.h>
#include <class_zone.h>
#include <class_board.h>
#include <pcb_draw_panel_gal.h>

Go to the source code of this file.

Functions

IO_MGR::PCB_FILE_T plugin_type (const wxString &aFileName, int aCtl)
 

Detailed Description

append a board to the currently edited board.

Definition in file append_board_to_current.cpp.

Function Documentation

IO_MGR::PCB_FILE_T plugin_type ( const wxString &  aFileName,
int  aCtl 
)

Definition at line 372 of file pcbnew/files.cpp.

Referenced by PCB_EDIT_FRAME::AppendBoardFile().

373 {
374  IO_MGR::PCB_FILE_T pluginType;
375 
376  wxFileName fn = aFileName;
377 
378  // Note: file extensions are expected to be in ower case.
379  // This is not always true, especially when importing files, so the string
380  // comparisons are case insensitive to try to find the suitable plugin.
381 
382  if( fn.GetExt().CmpNoCase( IO_MGR::GetFileExtension( IO_MGR::LEGACY ) ) == 0 )
383  {
384  // both legacy and eagle share a common file extension.
385  pluginType = ( aCtl & KICTL_EAGLE_BRD ) ? IO_MGR::EAGLE : IO_MGR::LEGACY;
386  }
387  else if( fn.GetExt().CmpNoCase( IO_MGR::GetFileExtension( IO_MGR::LEGACY ) + backupSuffix ) == 0 )
388  {
389  pluginType = IO_MGR::LEGACY;
390  }
391  else if( fn.GetExt().CmpNoCase( IO_MGR::GetFileExtension( IO_MGR::PCAD ) ) == 0 )
392  {
393  pluginType = IO_MGR::PCAD;
394  }
395  else
396  {
397  pluginType = IO_MGR::KICAD;
398  }
399 
400  return pluginType;
401 }
#define KICTL_EAGLE_BRD
chosen *.brd file is Eagle according to user.
Definition: kiway_player.h:130
S-expression Pcbnew file format.
Definition: io_mgr.h:54
static const wxChar backupSuffix[]
Legacy Pcbnew file formats prior to s-expression.
Definition: io_mgr.h:53
PCB_FILE_T
Enum PCB_FILE_T is a set of file types that the IO_MGR knows about, and for which there has been a pl...
Definition: io_mgr.h:51
static const wxString GetFileExtension(PCB_FILE_T aFileType)
Function GetFileExtension returns the file extension for aFileType.
Definition: io_mgr.cpp:167