From ba689c10e3a400633321d4c69d55f9e053a3f687 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 16 Feb 2012 21:03:33 +0100 Subject: [PATCH] Kicad project manager: add .cmp, .drl .pos and .rpt files management. Code cleaning and other minor fixes. --- common/CMakeLists.txt | 1 + common/basicframe.cpp | 2 +- common/common.cpp | 19 ----- common/projet_config.cpp | 2 + common/wildcards_and_files_ext.cpp | 61 ++++++++++++++++ cvpcb/cfg.cpp | 1 + cvpcb/cvframe.cpp | 2 +- cvpcb/cvpcb.cpp | 4 -- cvpcb/cvpcb.h | 2 - cvpcb/dialogs/dialog_cvpcb_config.cpp | 36 ++++++++-- cvpcb/readwrite_dlgs.cpp | 1 + eeschema/eeschema.cpp | 1 + eeschema/eeschema_config.cpp | 24 +++++++ eeschema/files-io.cpp | 1 + eeschema/netlist_control.cpp | 3 +- eeschema/schframe.cpp | 1 + eeschema/sheet.cpp | 1 + gerbview/files.cpp | 31 ++++++-- include/common.h | 26 ------- include/wildcards_and_files_ext.h | 71 +++++++++++++++++++ kicad/class_treeprojectfiles.cpp | 6 +- kicad/kicad.cpp | 28 +++++++- kicad/kicad.h | 16 +++-- kicad/mainframe.cpp | 27 ++++++- kicad/prjconfig.cpp | 25 +++++++ kicad/tree_project_frame.cpp | 45 ++++++++++-- pcbnew/dialogs/dialog_netlist.cpp | 1 + .../dialog_pcbnew_config_libs_and_paths.cpp | 36 ++++++++-- pcbnew/files.cpp | 1 + pcbnew/gen_modules_placefile.cpp | 3 +- pcbnew/gendrill.cpp | 10 +-- pcbnew/pcbnew.cpp | 1 + pcbnew/pcbnew_config.cpp | 3 +- 33 files changed, 396 insertions(+), 96 deletions(-) create mode 100644 common/wildcards_and_files_ext.cpp create mode 100644 include/wildcards_and_files_ext.h diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 2585fd3ed6..3749bc051d 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -71,6 +71,7 @@ set(COMMON_SRCS selcolor.cpp string.cpp trigo.cpp + wildcards_and_files_ext.cpp worksheet.cpp wxwineda.cpp xnode.cpp diff --git a/common/basicframe.cpp b/common/basicframe.cpp index ec627a10d7..a9bbc099fc 100644 --- a/common/basicframe.cpp +++ b/common/basicframe.cpp @@ -336,7 +336,7 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event ) wxString tmp = wxGetApp().GetHelpFileName(); // 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(); if( !helpFile ) diff --git a/common/common.cpp b/common/common.cpp index e1141ce4d2..1aaff80ff8 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -46,25 +46,6 @@ * 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. " ); bool g_ShowPageLimits = true; wxString g_UserLibDirBuffer; diff --git a/common/projet_config.cpp b/common/projet_config.cpp index 9fc9866c83..94ef5cded8 100644 --- a/common/projet_config.cpp +++ b/common/projet_config.cpp @@ -14,6 +14,8 @@ #include #include +#include + #include diff --git a/common/wildcards_and_files_ext.cpp b/common/wildcards_and_files_ext.cpp new file mode 100644 index 0000000000..ba15f597cf --- /dev/null +++ b/common/wildcards_and_files_ext.cpp @@ -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 + * 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 + +/** + * 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" ); diff --git a/cvpcb/cfg.cpp b/cvpcb/cfg.cpp index 79d5360035..dfc107a733 100644 --- a/cvpcb/cfg.cpp +++ b/cvpcb/cfg.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #define GROUP wxT("/cvpcb") diff --git a/cvpcb/cvframe.cpp b/cvpcb/cvframe.cpp index 521e2bfad7..0903bb9bf9 100644 --- a/cvpcb/cvframe.cpp +++ b/cvpcb/cvframe.cpp @@ -41,7 +41,7 @@ #include #include #include - +#include #include diff --git a/cvpcb/cvpcb.cpp b/cvpcb/cvpcb.cpp index fae9eb762b..06b2367234 100644 --- a/cvpcb/cvpcb.cpp +++ b/cvpcb/cvpcb.cpp @@ -23,7 +23,6 @@ COLORS_DESIGN_SETTINGS g_ColorsSettings; /* Constant string definitions for CvPcb */ -const wxString ComponentFileExtension( wxT( "cmp" ) ); const wxString RetroFileExtension( wxT( "stf" ) ); const wxString FootprintAliasFileExtension( wxT( "equ" ) ); @@ -31,9 +30,6 @@ const wxString FootprintAliasFileExtension( wxT( "equ" ) ); const wxString RetroFileWildcard( _( "KiCad retroannotation files (*.stf)|*.stf" ) ); 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" ) ); diff --git a/cvpcb/cvpcb.h b/cvpcb/cvpcb.h index 201a61c598..23f072242a 100644 --- a/cvpcb/cvpcb.h +++ b/cvpcb/cvpcb.h @@ -25,11 +25,9 @@ typedef boost::ptr_vector< COMPONENT_INFO > COMPONENT_LIST; extern const wxString FootprintAliasFileExtension; extern const wxString RetroFileExtension; -extern const wxString ComponentFileExtension; extern const wxString RetroFileWildcard; extern const wxString FootprintAliasFileWildcard; -extern const wxString ComponentFileWildcard; extern const wxString titleLibLoadError; diff --git a/cvpcb/dialogs/dialog_cvpcb_config.cpp b/cvpcb/dialogs/dialog_cvpcb_config.cpp index 70ec8465fd..5fc56bfe83 100644 --- a/cvpcb/dialogs/dialog_cvpcb_config.cpp +++ b/cvpcb/dialogs/dialog_cvpcb_config.cpp @@ -1,8 +1,31 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dialog_cvpcb_config.cpp -// Author: jean-pierre Charras -// Licence: gpl -///////////////////////////////////////////////////////////////////////////// +/** + * @file dialog_cvpcb_config.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) 2012 Wayne Stambaugh + * 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 #include @@ -16,9 +39,8 @@ #include #include -#include - #include +#include DIALOG_CVPCB_CONFIG::DIALOG_CVPCB_CONFIG( CVPCB_MAINFRAME* parent ) : diff --git a/cvpcb/readwrite_dlgs.cpp b/cvpcb/readwrite_dlgs.cpp index bdac44ad5f..30f1c46a34 100644 --- a/cvpcb/readwrite_dlgs.cpp +++ b/cvpcb/readwrite_dlgs.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #define titleComponentLibErr _( "Component Library Error" ) diff --git a/eeschema/eeschema.cpp b/eeschema/eeschema.cpp index 16b96b998a..4da3ec25d0 100644 --- a/eeschema/eeschema.cpp +++ b/eeschema/eeschema.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index b492effc8e..1b2e59e53c 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -2,6 +2,29 @@ * @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 #include #include @@ -26,6 +49,7 @@ #include #include +#include #define HOTKEY_FILENAME wxT( "eeschema" ) diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index 2de303fb50..554b93c421 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -39,6 +39,7 @@ #include #include #include +#include bool SCH_EDIT_FRAME::SaveEEFile( SCH_SCREEN* aScreen, int aSaveType, bool aCreateBackupFile ) diff --git a/eeschema/netlist_control.cpp b/eeschema/netlist_control.cpp index 0f38f7f9d8..a0d5c98ab8 100644 --- a/eeschema/netlist_control.cpp +++ b/eeschema/netlist_control.cpp @@ -51,7 +51,8 @@ #include #include #include - +#include +#include //Imported function: diff --git a/eeschema/schframe.cpp b/eeschema/schframe.cpp index 803c51800a..6df0205af3 100644 --- a/eeschema/schframe.cpp +++ b/eeschema/schframe.cpp @@ -63,6 +63,7 @@ #include #include +#include diff --git a/eeschema/sheet.cpp b/eeschema/sheet.cpp index 4f3c4cb565..78a06d69cd 100644 --- a/eeschema/sheet.cpp +++ b/eeschema/sheet.cpp @@ -37,6 +37,7 @@ #include #include +#include bool SCH_EDIT_FRAME::EditSheet( SCH_SHEET* aSheet, wxDC* aDC ) diff --git a/gerbview/files.cpp b/gerbview/files.cpp index ea171f512a..5679bc189f 100644 --- a/gerbview/files.cpp +++ b/gerbview/files.cpp @@ -2,6 +2,30 @@ * @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 #include #include @@ -11,6 +35,7 @@ #include #include #include +#include void GERBVIEW_FRAME::OnGbrFileHistory( wxCommandEvent& event ) @@ -192,12 +217,10 @@ bool GERBVIEW_FRAME::LoadExcellonFiles( const wxString& aFullFileName ) if( !filename.IsOk() ) { - filetypes = _( "Drill files (.drl)" ); - filetypes << wxT("|"); - filetypes += wxT(";*.drl;*.DRL" ); + filetypes = wxGetTranslation( DrillFileWildcard ); filetypes << wxT("|"); /* All filetypes */ - filetypes += AllFilesWildcard; + filetypes += wxGetTranslation( AllFilesWildcard ); /* Use the current working directory if the file name path does not exist. */ if( filename.DirExists() ) diff --git a/include/common.h b/include/common.h index bc2e283df2..d50c5dbc43 100644 --- a/include/common.h +++ b/include/common.h @@ -275,32 +275,6 @@ extern wxString g_UserLibDirBuffer; 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) extern wxString g_Prj_Default_Config_FullFilename; diff --git a/include/wildcards_and_files_ext.h b/include/wildcards_and_files_ext.h new file mode 100644 index 0000000000..b1ae8c55e9 --- /dev/null +++ b/include/wildcards_and_files_ext.h @@ -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 + * Copyright (C) 2008-2012 Wayne Stambaugh + * 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 + +/** + * 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_ diff --git a/kicad/class_treeprojectfiles.cpp b/kicad/class_treeprojectfiles.cpp index df9b057eeb..8f58775a49 100644 --- a/kicad/class_treeprojectfiles.cpp +++ b/kicad/class_treeprojectfiles.cpp @@ -41,9 +41,13 @@ TREEPROJECTFILES::TREEPROJECTFILES( TREE_PROJECT_FRAME* parent ) : m_ImageList->Add( KiBitmap( icon_gerbview_small_xpm ) ); // TREE_GERBER m_ImageList->Add( KiBitmap( datasheet_xpm ) ); // TREE_PDF 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( 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 ); } diff --git a/kicad/kicad.cpp b/kicad/kicad.cpp index aa5f077625..bd6ecdee6b 100644 --- a/kicad/kicad.cpp +++ b/kicad/kicad.cpp @@ -1,8 +1,33 @@ /** * @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 #include @@ -14,6 +39,7 @@ #include #include +#include #include diff --git a/kicad/kicad.h b/kicad/kicad.h index 5712a26fa0..d98c33406e 100644 --- a/kicad/kicad.h +++ b/kicad/kicad.h @@ -156,14 +156,18 @@ public: KICAD_MANAGER_FRAME( wxWindow* parent, const wxString& title, // please update both enum TreeFileType { TREE_PROJECT = 1, - TREE_SCHEMA, - TREE_PCB, - TREE_GERBER, - TREE_PDF, - TREE_TXT, - TREE_NET, + TREE_SCHEMA, // Schematic file (.sch) + TREE_PCB, // board file (.brd) + TREE_GERBER, // Gerber file (.pho, .g*) + TREE_PDF, // PDF file (.pdf) + TREE_TXT, // ascii text file (.txt) + TREE_NET, // netlist file (.net) TREE_UNKNOWN, 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 }; diff --git a/kicad/mainframe.cpp b/kicad/mainframe.cpp index 566f1aa7ab..c7d6ae9bc5 100644 --- a/kicad/mainframe.cpp +++ b/kicad/mainframe.cpp @@ -3,9 +3,29 @@ * @brief KICAD_MANAGER_FRAME is the KiCad main frame. */ -#ifdef __GNUG__ -#pragma implementation -#endif +/* + * 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 #include @@ -15,6 +35,7 @@ #include #include +#include static const wxString TreeFrameWidthEntry( wxT( "LeftWinWidth" ) ); diff --git a/kicad/prjconfig.cpp b/kicad/prjconfig.cpp index ddbc16fe13..ab2c33c116 100644 --- a/kicad/prjconfig.cpp +++ b/kicad/prjconfig.cpp @@ -3,6 +3,30 @@ * 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 #include #include @@ -10,6 +34,7 @@ #include #include #include +#include #include diff --git a/kicad/tree_project_frame.cpp b/kicad/tree_project_frame.cpp index 71450715ac..2271b1ae2f 100644 --- a/kicad/tree_project_frame.cpp +++ b/kicad/tree_project_frame.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -37,10 +38,10 @@ const wxChar* s_AllowedExtensionsToList[] = { wxT( "^.*\\.pro$" ), wxT( "^.*\\.pdf$" ), - wxT( "^[^$].*\\.brd$" ), + wxT( "^[^$].*\\.brd$" ), // Pcbnew files wxT( "^.*\\.net$" ), wxT( "^.*\\.txt$" ), - wxT( "^.*\\.pho$" ), // Gerber file + wxT( "^.*\\.pho$" ), // Gerber file (Kicad extension) wxT( "^.*\\.gbr$" ), // Gerber file wxT( "^.*\\.gb[alops]$" ), // Gerber back (or bottom) layer file wxT( "^.*\\.gt[alops]$" ), // Gerber front (or top) layer file @@ -49,8 +50,10 @@ const wxChar* s_AllowedExtensionsToList[] = wxT( "^.*\\.sxw$" ), wxT( "^.*\\.htm$" ), wxT( "^.*\\.html$" ), - wxT( "^.*\\.rpt$" ), - wxT( "^.*\\.csv$" ), + wxT( "^.*\\.rpt$" ), // Report files + 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 NULL // end of list }; @@ -440,6 +443,23 @@ wxString TREE_PROJECT_FRAME::GetFileExt( TreeFileType type ) case TREE_NET: ext = NetlistFileExtension; 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. */ break; } @@ -483,6 +503,23 @@ wxString TREE_PROJECT_FRAME::GetFileWildcard( TreeFileType type ) case TREE_NET: ext = NetlistFileWildcard; 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. */ break; } diff --git a/pcbnew/dialogs/dialog_netlist.cpp b/pcbnew/dialogs/dialog_netlist.cpp index c3914f3723..25d690e8b6 100644 --- a/pcbnew/dialogs/dialog_netlist.cpp +++ b/pcbnew/dialogs/dialog_netlist.cpp @@ -14,6 +14,7 @@ #include #include +#include #include diff --git a/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.cpp b/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.cpp index 965026e885..db74fe5499 100644 --- a/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.cpp +++ b/pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.cpp @@ -1,9 +1,32 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: dialog_pcbnew_config_libs_and_paths.cpp -// Author: jean-pierre Charras -// Created: 2009 apr 18 -// Licence: GPL -///////////////////////////////////////////////////////////////////////////// +/** + * @file ^pcbnew/dialogs/dialog_pcbnew_config_libs_and_paths.cpp + */ + +/* + * 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) */ @@ -17,6 +40,7 @@ #include #include #include +#include #include diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index fe097ad246..442759f057 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include // BOARD_FILE_VERSION diff --git a/pcbnew/gen_modules_placefile.cpp b/pcbnew/gen_modules_placefile.cpp index 7740f9929d..eb888ca116 100644 --- a/pcbnew/gen_modules_placefile.cpp +++ b/pcbnew/gen_modules_placefile.cpp @@ -45,6 +45,7 @@ #include #include +#include #include @@ -207,7 +208,7 @@ bool DIALOG_GEN_MODULE_POSITION::CreateFiles() else fn.SetName( fn.GetName() + wxT( "_" ) + frontLayerName ); - fn.SetExt( wxT( "pos") ); + fn.SetExt( FootprintPlaceFileExtension ); int fpcount = m_parent->DoGenFootprintsPositionFile( fn.GetFullPath(), UnitsMM(), ForceAllSmd(), side ); diff --git a/pcbnew/gendrill.cpp b/pcbnew/gendrill.cpp index ff20d2df31..a360d523eb 100644 --- a/pcbnew/gendrill.cpp +++ b/pcbnew/gendrill.cpp @@ -52,15 +52,11 @@ #include #include #include +#include #include // 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 * Number format: @@ -653,10 +649,10 @@ void DIALOG_GENDRILL::GenDrillReport( const wxString aFileName ) fn = aFileName; fn.SetName( fn.GetName() + wxT( "-drl" ) ); - fn.SetExt( RptFileExtension ); + fn.SetExt( ReportFileExtension ); wxFileDialog dlg( this, _( "Save Drill Report File" ), fn.GetPath(), - fn.GetFullName(), wxGetTranslation( RptFileWildcard ), + fn.GetFullName(), wxGetTranslation( ReportFileWildcard ), wxFD_SAVE ); if( dlg.ShowModal() == wxID_CANCEL ) diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index 667076ca75..84a18f2d03 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -44,6 +44,7 @@ #include #include #include +#include // Colors for layers and items diff --git a/pcbnew/pcbnew_config.cpp b/pcbnew/pcbnew_config.cpp index 5c43235c82..9a3a8464cb 100644 --- a/pcbnew/pcbnew_config.cpp +++ b/pcbnew/pcbnew_config.cpp @@ -52,10 +52,9 @@ #include #include +#include -#define HOTKEY_FILENAME wxT( "pcbnew" ) - void PCB_EDIT_FRAME::Process_Config( wxCommandEvent& event ) { int id = event.GetId();