Kicad project manager: add .cmp, .drl .pos and .rpt files management.

Code cleaning and other minor fixes.
This commit is contained in:
jean-pierre charras 2012-02-16 21:03:33 +01:00
parent 35ddad2193
commit ba689c10e3
33 changed files with 396 additions and 96 deletions

View File

@ -71,6 +71,7 @@ set(COMMON_SRCS
selcolor.cpp selcolor.cpp
string.cpp string.cpp
trigo.cpp trigo.cpp
wildcards_and_files_ext.cpp
worksheet.cpp worksheet.cpp
wxwineda.cpp wxwineda.cpp
xnode.cpp xnode.cpp

View File

@ -336,7 +336,7 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event )
wxString tmp = wxGetApp().GetHelpFileName(); wxString tmp = wxGetApp().GetHelpFileName();
// Search for "getting_started_in_kicad.pdf" or "Getting_Started_in_KiCad.pdf" // Search for "getting_started_in_kicad.pdf" or "Getting_Started_in_KiCad.pdf"
wxGetApp().GetHelpFileName() = wxT( "getting_started_in_kicad.pdf" ); wxGetApp().SetHelpFileName( wxT( "getting_started_in_kicad.pdf" ) );
wxString helpFile = wxGetApp().GetHelpFile(); wxString helpFile = wxGetApp().GetHelpFile();
if( !helpFile ) if( !helpFile )

View File

@ -46,25 +46,6 @@
* application class. * application class.
*/ */
const wxString ProjectFileExtension( wxT( "pro" ) );
const wxString SchematicFileExtension( wxT( "sch" ) );
const wxString NetlistFileExtension( wxT( "net" ) );
const wxString GerberFileExtension( wxT( "pho" ) );
const wxString PcbFileExtension( wxT( "brd" ) );
const wxString PdfFileExtension( wxT( "pdf" ) );
const wxString MacrosFileExtension( wxT( "mcr" ) );
const wxString ProjectFileWildcard( _( "KiCad project files (*.pro)|*.pro" ) );
const wxString SchematicFileWildcard( _( "KiCad schematic files (*.sch)|*.sch" ) );
const wxString NetlistFileWildcard( _( "KiCad netlist files (*.net)|*.net" ) );
const wxString GerberFileWildcard( _( "Gerber files (*.pho)|*.pho" ) );
const wxString PcbFileWildcard( _( "KiCad printed circuit board files (*.brd)|*.brd" ) );
const wxString PdfFileWildcard( _( "Portable document format files (*.pdf)|*.pdf" ) );
const wxString MacrosFileWildcard( _( "KiCad recorded macros (*.mcr)|*.mcr" ) );
const wxString AllFilesWildcard( _( "All files (*)|*" ) );
wxString g_ProductName = wxT( "KiCad E.D.A. " ); wxString g_ProductName = wxT( "KiCad E.D.A. " );
bool g_ShowPageLimits = true; bool g_ShowPageLimits = true;
wxString g_UserLibDirBuffer; wxString g_UserLibDirBuffer;

View File

@ -14,6 +14,8 @@
#include <wx/apptrait.h> #include <wx/apptrait.h>
#include <wx/stdpaths.h> #include <wx/stdpaths.h>
#include <wildcards_and_files_ext.h>
#include <boost/foreach.hpp> #include <boost/foreach.hpp>

View File

@ -0,0 +1,61 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 20012 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2008-2012 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* @file wildcards_and_files_ext.cpp
*/
#include <wildcards_and_files_ext.h>
/**
* file extensions and wildcards used in kicad.
*/
const wxString ProjectFileExtension( wxT( "pro" ) );
const wxString SchematicFileExtension( wxT( "sch" ) );
const wxString NetlistFileExtension( wxT( "net" ) );
const wxString ComponentFileExtension( wxT( "cmp" ) );
const wxString GerberFileExtension( wxT( "pho" ) );
const wxString PcbFileExtension( wxT( "brd" ) );
const wxString PdfFileExtension( wxT( "pdf" ) );
const wxString MacrosFileExtension( wxT( "mcr" ) );
const wxString DrillFileExtension( wxT( "drl" ) );
const wxString ReportFileExtension( wxT( "rpt" ) );
const wxString FootprintPlaceFileExtension( wxT( "pos" ) );
const wxString ProjectFileWildcard( _( "KiCad project files (*.pro)|*.pro" ) );
const wxString SchematicFileWildcard( _( "KiCad schematic files (*.sch)|*.sch" ) );
const wxString NetlistFileWildcard( _( "KiCad netlist files (*.net)|*.net" ) );
const wxString GerberFileWildcard( _( "Gerber files (*.pho)|*.pho" ) );
const wxString PcbFileWildcard( _( "KiCad printed circuit board files (*.brd)|*.brd" ) );
const wxString PdfFileWildcard( _( "Portable document format files (*.pdf)|*.pdf" ) );
const wxString MacrosFileWildcard( _( "KiCad recorded macros (*.mcr)|*.mcr" ) );
const wxString AllFilesWildcard( _( "All files (*)|*" ) );
// Wildcard for cvpcb component to footprint link file
const wxString ComponentFileWildcard( _( "KiCad cmp/footprint link files (*.cmp)|*.cmp" ) );
const wxString DrillFileWildcard( _( "Drill files (*.drl)|*.drl;*.DRL" ) );
const wxString ReportFileWildcard = _( "Report files (*.rpt)|*.rpt" );
const wxString FootprintPlaceFileWildcard = _( "Footprint place files (*.pos)|*.pos" );

View File

@ -10,6 +10,7 @@
#include <param_config.h> #include <param_config.h>
#include <cvpcb.h> #include <cvpcb.h>
#include <cvpcb_mainframe.h> #include <cvpcb_mainframe.h>
#include <wildcards_and_files_ext.h>
#define GROUP wxT("/cvpcb") #define GROUP wxT("/cvpcb")

View File

@ -41,7 +41,7 @@
#include <class_DisplayFootprintsFrame.h> #include <class_DisplayFootprintsFrame.h>
#include <cvpcb_id.h> #include <cvpcb_id.h>
#include <html_messagebox.h> #include <html_messagebox.h>
#include <wildcards_and_files_ext.h>
#include <build_version.h> #include <build_version.h>

View File

@ -23,7 +23,6 @@
COLORS_DESIGN_SETTINGS g_ColorsSettings; COLORS_DESIGN_SETTINGS g_ColorsSettings;
/* Constant string definitions for CvPcb */ /* Constant string definitions for CvPcb */
const wxString ComponentFileExtension( wxT( "cmp" ) );
const wxString RetroFileExtension( wxT( "stf" ) ); const wxString RetroFileExtension( wxT( "stf" ) );
const wxString FootprintAliasFileExtension( wxT( "equ" ) ); const wxString FootprintAliasFileExtension( wxT( "equ" ) );
@ -31,9 +30,6 @@ const wxString FootprintAliasFileExtension( wxT( "equ" ) );
const wxString RetroFileWildcard( _( "KiCad retroannotation files (*.stf)|*.stf" ) ); const wxString RetroFileWildcard( _( "KiCad retroannotation files (*.stf)|*.stf" ) );
const wxString FootprintAliasFileWildcard( _( "KiCad footprint alias files (*.equ)|*.equ" ) ); const wxString FootprintAliasFileWildcard( _( "KiCad footprint alias files (*.equ)|*.equ" ) );
// Wildcard for cvpcb component to footprint link file ( normal output file )
const wxString ComponentFileWildcard( _( "KiCad cmp/footprint link files (*.cmp)|*.cmp" ) );
const wxString titleLibLoadError( _( "Library Load Error" ) ); const wxString titleLibLoadError( _( "Library Load Error" ) );

View File

@ -25,11 +25,9 @@ typedef boost::ptr_vector< COMPONENT_INFO > COMPONENT_LIST;
extern const wxString FootprintAliasFileExtension; extern const wxString FootprintAliasFileExtension;
extern const wxString RetroFileExtension; extern const wxString RetroFileExtension;
extern const wxString ComponentFileExtension;
extern const wxString RetroFileWildcard; extern const wxString RetroFileWildcard;
extern const wxString FootprintAliasFileWildcard; extern const wxString FootprintAliasFileWildcard;
extern const wxString ComponentFileWildcard;
extern const wxString titleLibLoadError; extern const wxString titleLibLoadError;

View File

@ -1,8 +1,31 @@
///////////////////////////////////////////////////////////////////////////// /**
// Name: dialog_cvpcb_config.cpp * @file dialog_cvpcb_config.cpp
// Author: jean-pierre Charras */
// Licence: gpl
///////////////////////////////////////////////////////////////////////////// /*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <fctsys.h> #include <fctsys.h>
#include <wx/tokenzr.h> #include <wx/tokenzr.h>
@ -16,9 +39,8 @@
#include <cvpcb.h> #include <cvpcb.h>
#include <cvpcb_mainframe.h> #include <cvpcb_mainframe.h>
#include <protos.h>
#include <dialog_cvpcb_config.h> #include <dialog_cvpcb_config.h>
#include <wildcards_and_files_ext.h>
DIALOG_CVPCB_CONFIG::DIALOG_CVPCB_CONFIG( CVPCB_MAINFRAME* parent ) : DIALOG_CVPCB_CONFIG::DIALOG_CVPCB_CONFIG( CVPCB_MAINFRAME* parent ) :

View File

@ -35,6 +35,7 @@
#include <cvpcb.h> #include <cvpcb.h>
#include <cvpcb_mainframe.h> #include <cvpcb_mainframe.h>
#include <cvstruct.h> #include <cvstruct.h>
#include <wildcards_and_files_ext.h>
#define titleComponentLibErr _( "Component Library Error" ) #define titleComponentLibErr _( "Component Library Error" )

View File

@ -41,6 +41,7 @@
#include <hotkeys.h> #include <hotkeys.h>
#include <dialogs/dialog_color_config.h> #include <dialogs/dialog_color_config.h>
#include <transform.h> #include <transform.h>
#include <wildcards_and_files_ext.h>
#include <wx/snglinst.h> #include <wx/snglinst.h>

View File

@ -2,6 +2,29 @@
* @file eeschema_config.cpp * @file eeschema_config.cpp
*/ */
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 KiCad Developers, see CHANGELOG.TXT for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <fctsys.h> #include <fctsys.h>
#include <appl_wxstruct.h> #include <appl_wxstruct.h>
#include <class_drawpanel.h> #include <class_drawpanel.h>
@ -26,6 +49,7 @@
#include <dialogs/dialog_eeschema_options.h> #include <dialogs/dialog_eeschema_options.h>
#include <dialogs/dialog_schematic_find.h> #include <dialogs/dialog_schematic_find.h>
#include <wildcards_and_files_ext.h>
#define HOTKEY_FILENAME wxT( "eeschema" ) #define HOTKEY_FILENAME wxT( "eeschema" )

View File

@ -39,6 +39,7 @@
#include <class_library.h> #include <class_library.h>
#include <libeditframe.h> #include <libeditframe.h>
#include <sch_sheet.h> #include <sch_sheet.h>
#include <wildcards_and_files_ext.h>
bool SCH_EDIT_FRAME::SaveEEFile( SCH_SCREEN* aScreen, int aSaveType, bool aCreateBackupFile ) bool SCH_EDIT_FRAME::SaveEEFile( SCH_SCREEN* aScreen, int aSaveType, bool aCreateBackupFile )

View File

@ -51,7 +51,8 @@
#include <dialog_helpers.h> #include <dialog_helpers.h>
#include <netlist_control.h> #include <netlist_control.h>
#include <dialogs/annotate_dialog.h> #include <dialogs/annotate_dialog.h>
#include <wildcards_and_files_ext.h>
#include <wildcards_and_files_ext.h>
//Imported function: //Imported function:

View File

@ -63,6 +63,7 @@
#include <wx/display.h> #include <wx/display.h>
#include <build_version.h> #include <build_version.h>
#include <wildcards_and_files_ext.h>

View File

@ -37,6 +37,7 @@
#include <sch_sheet.h> #include <sch_sheet.h>
#include <dialogs/dialog_sch_sheet_props.h> #include <dialogs/dialog_sch_sheet_props.h>
#include <wildcards_and_files_ext.h>
bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC ) bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC )

View File

@ -2,6 +2,30 @@
* @file gerbview/files.cpp * @file gerbview/files.cpp
*/ */
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <fctsys.h> #include <fctsys.h>
#include <common.h> #include <common.h>
#include <class_drawpanel.h> #include <class_drawpanel.h>
@ -11,6 +35,7 @@
#include <gerbview.h> #include <gerbview.h>
#include <gerbview_id.h> #include <gerbview_id.h>
#include <class_gerbview_layer_widget.h> #include <class_gerbview_layer_widget.h>
#include <wildcards_and_files_ext.h>
void GERBVIEW_FRAME::OnGbrFileHistory( wxCommandEvent& event ) void GERBVIEW_FRAME::OnGbrFileHistory( wxCommandEvent& event )
@ -192,12 +217,10 @@ bool GERBVIEW_FRAME::LoadExcellonFiles( const wxString& aFullFileName )
if( !filename.IsOk() ) if( !filename.IsOk() )
{ {
filetypes = _( "Drill files (.drl)" ); filetypes = wxGetTranslation( DrillFileWildcard );
filetypes << wxT("|");
filetypes += wxT(";*.drl;*.DRL" );
filetypes << wxT("|"); filetypes << wxT("|");
/* All filetypes */ /* All filetypes */
filetypes += AllFilesWildcard; filetypes += wxGetTranslation( AllFilesWildcard );
/* Use the current working directory if the file name path does not exist. */ /* Use the current working directory if the file name path does not exist. */
if( filename.DirExists() ) if( filename.DirExists() )

View File

@ -275,32 +275,6 @@ extern wxString g_UserLibDirBuffer;
extern bool g_ShowPageLimits; ///< true to display the page limits extern bool g_ShowPageLimits; ///< true to display the page limits
/**
* File extension definitions. Please do not changes these. If a different
* file extension is needed, create a new definition in the application.
* Please note, just because they are defined as const doesn't guarantee
* that they cannot be changed.
*/
extern const wxString ProjectFileExtension;
extern const wxString SchematicFileExtension;
extern const wxString NetlistFileExtension;
extern const wxString GerberFileExtension;
extern const wxString PcbFileExtension;
extern const wxString PdfFileExtension;
extern const wxString MacrosFileExtension;
/// Proper wxFileDialog wild card definitions.
extern const wxString ProjectFileWildcard;
extern const wxString SchematicFileWildcard;
extern const wxString BoardFileWildcard;
extern const wxString NetlistFileWildcard;
extern const wxString GerberFileWildcard;
extern const wxString PcbFileWildcard;
extern const wxString PdfFileWildcard;
extern const wxString MacrosFileWildcard;
extern const wxString AllFilesWildcard;
/// Name of default configuration file. (kicad.pro) /// Name of default configuration file. (kicad.pro)
extern wxString g_Prj_Default_Config_FullFilename; extern wxString g_Prj_Default_Config_FullFilename;

View File

@ -0,0 +1,71 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 20012 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2007-2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2008-2012 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/**
* The common library
* @file wildcards_and_files_ext.h
*/
#ifndef INCLUDE_WILDCARDS_AND_FILES_EXT_H_
#define INCLUDE_WILDCARDS_AND_FILES_EXT_H_
#include <wx/wx.h>
/**
* File extension definitions. Please do not changes these. If a different
* file extension is needed, create a new definition in the application.
* Please note, just because they are defined as const doesn't guarantee
* that they cannot be changed.
* Mainly wild cards are most of time translated when displayed
*/
extern const wxString ProjectFileExtension;
extern const wxString SchematicFileExtension;
extern const wxString NetlistFileExtension;
extern const wxString GerberFileExtension;
extern const wxString PcbFileExtension;
extern const wxString PdfFileExtension;
extern const wxString MacrosFileExtension;
extern const wxString ComponentFileExtension;
extern const wxString DrillFileExtension;
extern const wxString ReportFileExtension;
extern const wxString FootprintPlaceFileExtension;
/// Proper wxFileDialog wild card definitions.
extern const wxString ProjectFileWildcard;
extern const wxString SchematicFileWildcard;
extern const wxString BoardFileWildcard;
extern const wxString NetlistFileWildcard;
extern const wxString GerberFileWildcard;
extern const wxString PcbFileWildcard;
extern const wxString PdfFileWildcard;
extern const wxString MacrosFileWildcard;
extern const wxString AllFilesWildcard;
extern const wxString ComponentFileWildcard;
extern const wxString DrillFileWildcard;
extern const wxString ReportFileWildcard;
extern const wxString FootprintPlaceFileWildcard;
#endif // INCLUDE_WILDCARDS_AND_FILES_EXT_H_

View File

@ -41,9 +41,13 @@ TREEPROJECTFILES::TREEPROJECTFILES( TREE_PROJECT_FRAME* parent ) :
m_ImageList->Add( KiBitmap( icon_gerbview_small_xpm ) ); // TREE_GERBER m_ImageList->Add( KiBitmap( icon_gerbview_small_xpm ) ); // TREE_GERBER
m_ImageList->Add( KiBitmap( datasheet_xpm ) ); // TREE_PDF m_ImageList->Add( KiBitmap( datasheet_xpm ) ); // TREE_PDF
m_ImageList->Add( KiBitmap( icon_txt_xpm ) ); // TREE_TXT m_ImageList->Add( KiBitmap( icon_txt_xpm ) ); // TREE_TXT
m_ImageList->Add( KiBitmap( icon_cvpcb_small_xpm ) ); // TREE_NET m_ImageList->Add( KiBitmap( netlist_xpm ) ); // TREE_NET
m_ImageList->Add( KiBitmap( unknown_xpm ) ); // TREE_UNKNOWN m_ImageList->Add( KiBitmap( unknown_xpm ) ); // TREE_UNKNOWN
m_ImageList->Add( KiBitmap( directory_xpm ) ); // TREE_DIRECTORY m_ImageList->Add( KiBitmap( directory_xpm ) ); // TREE_DIRECTORY
m_ImageList->Add( KiBitmap( icon_cvpcb_small_xpm ) ); // TREE_CMP_LINK
m_ImageList->Add( KiBitmap( tools_xpm ) ); // TREE_REPORT
m_ImageList->Add( KiBitmap( post_compo_xpm ) ); // TREE_POS
m_ImageList->Add( KiBitmap( post_drill_xpm ) ); // TREE_DRILL
SetImageList( m_ImageList ); SetImageList( m_ImageList );
} }

View File

@ -1,8 +1,33 @@
/** /**
* @file kicad.cpp * @file kicad.cpp
* @brief Main KiCad library manager file * @brief Main KiCad Project manager file
*/ */
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004-2012 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <fctsys.h> #include <fctsys.h>
#include <appl_wxstruct.h> #include <appl_wxstruct.h>
@ -14,6 +39,7 @@
#include <kicad.h> #include <kicad.h>
#include <tree_project_frame.h> #include <tree_project_frame.h>
#include <wildcards_and_files_ext.h>
#include <build_version.h> #include <build_version.h>

View File

@ -156,14 +156,18 @@ public: KICAD_MANAGER_FRAME( wxWindow* parent, const wxString& title,
// please update both // please update both
enum TreeFileType { enum TreeFileType {
TREE_PROJECT = 1, TREE_PROJECT = 1,
TREE_SCHEMA, TREE_SCHEMA, // Schematic file (.sch)
TREE_PCB, TREE_PCB, // board file (.brd)
TREE_GERBER, TREE_GERBER, // Gerber file (.pho, .g*)
TREE_PDF, TREE_PDF, // PDF file (.pdf)
TREE_TXT, TREE_TXT, // ascii text file (.txt)
TREE_NET, TREE_NET, // netlist file (.net)
TREE_UNKNOWN, TREE_UNKNOWN,
TREE_DIRECTORY, TREE_DIRECTORY,
TREE_CMP_LINK, // cmp/footprint link file (.cmp)
TREE_REPORT, // report file (.rpt)
TREE_FP_PLACE, // fooprints position (place) file (.pos)
TREE_DRILL, // Excellon drill file (.drl)
TREE_MAX TREE_MAX
}; };

View File

@ -3,9 +3,29 @@
* @brief KICAD_MANAGER_FRAME is the KiCad main frame. * @brief KICAD_MANAGER_FRAME is the KiCad main frame.
*/ */
#ifdef __GNUG__ /*
#pragma implementation * This program source code file is part of KiCad, a free EDA CAD application.
#endif *
* Copyright (C) 2012 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <fctsys.h> #include <fctsys.h>
#include <appl_wxstruct.h> #include <appl_wxstruct.h>
@ -15,6 +35,7 @@
#include <kicad.h> #include <kicad.h>
#include <tree_project_frame.h> #include <tree_project_frame.h>
#include <wildcards_and_files_ext.h>
static const wxString TreeFrameWidthEntry( wxT( "LeftWinWidth" ) ); static const wxString TreeFrameWidthEntry( wxT( "LeftWinWidth" ) );

View File

@ -3,6 +3,30 @@
* Load and save project configuration files (*.pro) * Load and save project configuration files (*.pro)
*/ */
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004-2012 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <fctsys.h> #include <fctsys.h>
#include <appl_wxstruct.h> #include <appl_wxstruct.h>
#include <confirm.h> #include <confirm.h>
@ -10,6 +34,7 @@
#include <prjconfig.h> #include <prjconfig.h>
#include <kicad.h> #include <kicad.h>
#include <tree_project_frame.h> #include <tree_project_frame.h>
#include <wildcards_and_files_ext.h>
#include <build_version.h> #include <build_version.h>

View File

@ -13,6 +13,7 @@
#include <tree_project_frame.h> #include <tree_project_frame.h>
#include <class_treeprojectfiles.h> #include <class_treeprojectfiles.h>
#include <class_treeproject_item.h> #include <class_treeproject_item.h>
#include <wildcards_and_files_ext.h>
#include <wx/regex.h> #include <wx/regex.h>
#include <wx/dir.h> #include <wx/dir.h>
@ -37,10 +38,10 @@ const wxChar* s_AllowedExtensionsToList[] =
{ {
wxT( "^.*\\.pro$" ), wxT( "^.*\\.pro$" ),
wxT( "^.*\\.pdf$" ), wxT( "^.*\\.pdf$" ),
wxT( "^[^$].*\\.brd$" ), wxT( "^[^$].*\\.brd$" ), // Pcbnew files
wxT( "^.*\\.net$" ), wxT( "^.*\\.net$" ),
wxT( "^.*\\.txt$" ), wxT( "^.*\\.txt$" ),
wxT( "^.*\\.pho$" ), // Gerber file wxT( "^.*\\.pho$" ), // Gerber file (Kicad extension)
wxT( "^.*\\.gbr$" ), // Gerber file wxT( "^.*\\.gbr$" ), // Gerber file
wxT( "^.*\\.gb[alops]$" ), // Gerber back (or bottom) layer file wxT( "^.*\\.gb[alops]$" ), // Gerber back (or bottom) layer file
wxT( "^.*\\.gt[alops]$" ), // Gerber front (or top) layer file wxT( "^.*\\.gt[alops]$" ), // Gerber front (or top) layer file
@ -49,8 +50,10 @@ const wxChar* s_AllowedExtensionsToList[] =
wxT( "^.*\\.sxw$" ), wxT( "^.*\\.sxw$" ),
wxT( "^.*\\.htm$" ), wxT( "^.*\\.htm$" ),
wxT( "^.*\\.html$" ), wxT( "^.*\\.html$" ),
wxT( "^.*\\.rpt$" ), wxT( "^.*\\.rpt$" ), // Report files
wxT( "^.*\\.csv$" ), wxT( "^.*\\.csv$" ), // Report files in comma separateed format
wxT( "^.*\\.pos$" ), // Footprint position files
wxT( "^.*\\.cmp$" ), // Cvpcb cmp/footprint link files
wxT( "^.*\\.drl$" ), // Excellon drill files wxT( "^.*\\.drl$" ), // Excellon drill files
NULL // end of list NULL // end of list
}; };
@ -440,6 +443,23 @@ wxString TREE_PROJECT_FRAME::GetFileExt( TreeFileType type )
case TREE_NET: case TREE_NET:
ext = NetlistFileExtension; ext = NetlistFileExtension;
break; break;
case TREE_CMP_LINK:
ext = ComponentFileExtension;
break;
case TREE_REPORT:
ext = ReportFileExtension;
break;
case TREE_FP_PLACE:
ext = FootprintPlaceFileExtension;
break;
case TREE_DRILL:
ext = DrillFileExtension;
break;
default: /* Eliminates unnecessary GCC warning. */ default: /* Eliminates unnecessary GCC warning. */
break; break;
} }
@ -483,6 +503,23 @@ wxString TREE_PROJECT_FRAME::GetFileWildcard( TreeFileType type )
case TREE_NET: case TREE_NET:
ext = NetlistFileWildcard; ext = NetlistFileWildcard;
break; break;
case TREE_CMP_LINK:
ext = ComponentFileWildcard;
break;
case TREE_REPORT:
ext = ReportFileWildcard;
break;
case TREE_FP_PLACE:
ext = FootprintPlaceFileWildcard;
break;
case TREE_DRILL:
ext = DrillFileWildcard;
break;
default: /* Eliminates unnecessary GCC warning. */ default: /* Eliminates unnecessary GCC warning. */
break; break;
} }

View File

@ -14,6 +14,7 @@
#include <pcbnew_config.h> #include <pcbnew_config.h>
#include <class_board_design_settings.h> #include <class_board_design_settings.h>
#include <wildcards_and_files_ext.h>
#include <dialog_netlist.h> #include <dialog_netlist.h>

View File

@ -1,9 +1,32 @@
///////////////////////////////////////////////////////////////////////////// /**
// Name: dialog_pcbnew_config_libs_and_paths.cpp * @file ^pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.cpp
// Author: jean-pierre Charras */
// Created: 2009 apr 18
// Licence: GPL /*
///////////////////////////////////////////////////////////////////////////// * This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004-2012 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2004-2012 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* Handle the Pcbnew library config (library list, and default lib path) /* Handle the Pcbnew library config (library list, and default lib path)
*/ */
@ -17,6 +40,7 @@
#include <macros.h> #include <macros.h>
#include <wxPcbStruct.h> #include <wxPcbStruct.h>
#include <pcbcommon.h> #include <pcbcommon.h>
#include <wildcards_and_files_ext.h>
#include <dialog_pcbnew_config_libs_and_paths.h> #include <dialog_pcbnew_config_libs_and_paths.h>

View File

@ -45,6 +45,7 @@
#include <protos.h> #include <protos.h>
#include <pcbnew_id.h> #include <pcbnew_id.h>
#include <io_mgr.h> #include <io_mgr.h>
#include <wildcards_and_files_ext.h>
#include <class_board.h> #include <class_board.h>
#include <build_version.h> // BOARD_FILE_VERSION #include <build_version.h> // BOARD_FILE_VERSION

View File

@ -45,6 +45,7 @@
#include <pcbnew.h> #include <pcbnew.h>
#include <pcb_plot_params.h> #include <pcb_plot_params.h>
#include <wildcards_and_files_ext.h>
#include <dialog_gen_module_position_file_base.h> #include <dialog_gen_module_position_file_base.h>
@ -207,7 +208,7 @@ bool DIALOG_GEN_MODULE_POSITION::CreateFiles()
else else
fn.SetName( fn.GetName() + wxT( "_" ) + frontLayerName ); fn.SetName( fn.GetName() + wxT( "_" ) + frontLayerName );
fn.SetExt( wxT( "pos") ); fn.SetExt( FootprintPlaceFileExtension );
int fpcount = m_parent->DoGenFootprintsPositionFile( fn.GetFullPath(), UnitsMM(), int fpcount = m_parent->DoGenFootprintsPositionFile( fn.GetFullPath(), UnitsMM(),
ForceAllSmd(), side ); ForceAllSmd(), side );

View File

@ -52,15 +52,11 @@
#include <pcbplot.h> #include <pcbplot.h>
#include <pcbnew.h> #include <pcbnew.h>
#include <gendrill.h> #include <gendrill.h>
#include <wildcards_and_files_ext.h>
#include <dialog_gendrill.h> // Dialog box for drill file generation #include <dialog_gendrill.h> // Dialog box for drill file generation
const wxString DrillFileExtension( wxT( "drl" ) );
const wxString DrillFileWildcard( _( "Drill files (*.drl)|*.drl" ) );
const wxString RptFileExtension( wxT( "rpt" ) );
const wxString RptFileWildcard = _( "Drill report files (*.rpt)|*.rpt" );
/* /*
* Creates the drill files in EXCELLON format * Creates the drill files in EXCELLON format
* Number format: * Number format:
@ -653,10 +649,10 @@ void DIALOG_GENDRILL::GenDrillReport( const wxString aFileName )
fn = aFileName; fn = aFileName;
fn.SetName( fn.GetName() + wxT( "-drl" ) ); fn.SetName( fn.GetName() + wxT( "-drl" ) );
fn.SetExt( RptFileExtension ); fn.SetExt( ReportFileExtension );
wxFileDialog dlg( this, _( "Save Drill Report File" ), fn.GetPath(), wxFileDialog dlg( this, _( "Save Drill Report File" ), fn.GetPath(),
fn.GetFullName(), wxGetTranslation( RptFileWildcard ), fn.GetFullName(), wxGetTranslation( ReportFileWildcard ),
wxFD_SAVE ); wxFD_SAVE );
if( dlg.ShowModal() == wxID_CANCEL ) if( dlg.ShowModal() == wxID_CANCEL )

View File

@ -44,6 +44,7 @@
#include <pcbnew.h> #include <pcbnew.h>
#include <protos.h> #include <protos.h>
#include <hotkeys.h> #include <hotkeys.h>
#include <wildcards_and_files_ext.h>
// Colors for layers and items // Colors for layers and items

View File

@ -52,10 +52,9 @@
#include <dialog_mask_clearance.h> #include <dialog_mask_clearance.h>
#include <dialog_general_options.h> #include <dialog_general_options.h>
#include <wildcards_and_files_ext.h>
#define HOTKEY_FILENAME wxT( "pcbnew" )
void PCB_EDIT_FRAME::Process_Config( wxCommandEvent& event ) void PCB_EDIT_FRAME::Process_Config( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();