diff --git a/change_log.txt b/change_log.txt index a80ed22e04..ccdbd6bdd8 100644 --- a/change_log.txt +++ b/change_log.txt @@ -5,6 +5,12 @@ Started 2007-June-11 Please add newer entries at the top, list the date and your name with email address. +2008-Feb-6 UPDATE Dick Hollenbeck +================================================================================ ++pcbnew + started specctra imports of *.ses and *.dsn, by adding menus to File | Import. + + 2008-Feb-4 UPDATE Dick Hollenbeck ================================================================================ +pcbnew diff --git a/include/id.h b/include/id.h index 090c59af26..42b382ad67 100644 --- a/include/id.h +++ b/include/id.h @@ -95,9 +95,10 @@ enum main_id { ID_GEN_EXPORT_SPECCTRA, ID_GEN_EXPORT_FILE_GENCADFORMAT, ID_GEN_EXPORT_FILE_MODULE_REPORT, - ID_GEN_EXPORT_FILE_FORMAT_2, // Not used - ID_GEN_EXPORT_FILE_FORMAT_3, // Not used - ID_GEN_EXPORT_FILE_FORMAT_4, // Not used + + ID_GEN_IMPORT_FILE, + ID_GEN_IMPORT_SPECCTRA_SESSION, + ID_GEN_IMPORT_SPECCTRA_DESIGN, ID_EXIT, ID_OPTIONS_SETUP, diff --git a/include/wxPcbStruct.h b/include/wxPcbStruct.h index 84a0a536ae..5c2bcb1728 100644 --- a/include/wxPcbStruct.h +++ b/include/wxPcbStruct.h @@ -385,8 +385,26 @@ public: * See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the * specification. */ - void ExportToSPECCTRA( wxCommandEvent& event ); + void ExportToSpecctra( wxCommandEvent& event ); + /** + * Function ImportSpecctraSession + * will import a specctra *.ses file and use it to relocate MODULEs and + * to replace all vias and tracks in an existing and loaded BOARD. + * See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the + * specification. + */ + void ImportSpecctraSession( wxCommandEvent& event ); + + /** + * Function ImportSpecctraDesign + * will import a specctra *.dsn file and use it to replace an entire BOARD. + * The new board will not have any graphics, only components, tracks and vias. + * See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the + * specification. + */ + void ImportSpecctraDesign( wxCommandEvent& event ); + /* Fonctions specifiques */ MODULE* ListAndSelectModuleName(); void Liste_Equipot( wxCommandEvent& event ); diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 171bb67642..646287b5e8 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -121,6 +121,7 @@ SET(PCBNEW_SRCS solve.cpp specctra.cpp specctra_export.cpp + specctra_import.cpp surbrill.cpp swap_layers.cpp tool_modedit.cpp diff --git a/pcbnew/menubarpcb.cpp b/pcbnew/menubarpcb.cpp index 0175e9ad30..5e8526d841 100644 --- a/pcbnew/menubarpcb.cpp +++ b/pcbnew/menubarpcb.cpp @@ -116,6 +116,25 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ADD_MENUITEM_WITH_HELP_AND_SUBMENU(m_FilesMenu, submenuexport, ID_GEN_EXPORT_FILE, _("E&xport"), _("Export board"), export_xpm); + + //---------------------------------------------------- + // no separator, keep it next to Import + wxMenu * submenuImport = new wxMenu(); + + item = new wxMenuItem(submenuImport, ID_GEN_IMPORT_SPECCTRA_SESSION, + _("&Specctra Session"), _("Import a routed \"Specctra Session\" (*.ses) file") ); + item->SetBitmap(export_xpm); // @todo need better bitmap + submenuImport->Append(item); + + item = new wxMenuItem(submenuImport, ID_GEN_IMPORT_SPECCTRA_DESIGN, + _("&Specctra Design"), _("Import a \"Specctra Design\" (*.dsn) file") ); + item->SetBitmap(export_xpm); // @todo need better bitmap + submenuImport->Append(item); + + ADD_MENUITEM_WITH_HELP_AND_SUBMENU(m_FilesMenu, submenuImport, + ID_GEN_IMPORT_FILE, _("Import"), _("Import files"), export_xpm); + //--------------------------------------------------- + // Add archive footprints menu m_FilesMenu->AppendSeparator(); wxMenu * submenuarchive = new wxMenu(); diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index efc7a525fe..27449f3467 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -56,10 +56,13 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame ) EVT_MENU_RANGE( ID_LOAD_FILE_1, ID_LOAD_FILE_10, WinEDA_PcbFrame::Files_io ) - EVT_MENU( ID_GEN_EXPORT_SPECCTRA, WinEDA_PcbFrame::ExportToSPECCTRA ) + EVT_MENU( ID_GEN_EXPORT_SPECCTRA, WinEDA_PcbFrame::ExportToSpecctra ) EVT_MENU( ID_GEN_EXPORT_FILE_GENCADFORMAT, WinEDA_PcbFrame::ExportToGenCAD ) EVT_MENU( ID_GEN_EXPORT_FILE_MODULE_REPORT, WinEDA_PcbFrame::GenModuleReport ) + EVT_MENU( ID_GEN_IMPORT_SPECCTRA_SESSION, WinEDA_PcbFrame::ImportSpecctraSession ) + EVT_MENU( ID_GEN_IMPORT_SPECCTRA_DESIGN, WinEDA_PcbFrame::ImportSpecctraDesign ) + EVT_MENU( ID_MENU_ARCHIVE_NEW_MODULES, WinEDA_PcbFrame::Process_Special_Functions ) EVT_MENU( ID_MENU_ARCHIVE_ALL_MODULES, WinEDA_PcbFrame::Process_Special_Functions ) diff --git a/pcbnew/specctra.h b/pcbnew/specctra.h index addb0528de..2ddcaa8b6d 100644 --- a/pcbnew/specctra.h +++ b/pcbnew/specctra.h @@ -3806,13 +3806,8 @@ public: * the BOARD given to this function must have all the MODULEs on the component * side of the BOARD. * - * See void WinEDA_PcbFrame::ExportToSPECCTRA( wxCommandEvent& event ) + * See void WinEDA_PcbFrame::ExportToSpecctra( wxCommandEvent& event ) * for how this can be done before calling this function. - * @todo - * I would have liked to put the flipping logic into the ExportToSPECCTRA() - * function directly, but for some strange reason, - * void Change_Side_Module( MODULE* Module, wxDC* DC ) is a member of - * of class WinEDA_BasePcbFrame rather than class BOARD. * * @param aBoard The BOARD to convert to a PCB. */ diff --git a/pcbnew/specctra_export.cpp b/pcbnew/specctra_export.cpp index 7dca45fee3..2b5b6426c9 100644 --- a/pcbnew/specctra_export.cpp +++ b/pcbnew/specctra_export.cpp @@ -43,7 +43,7 @@ using namespace DSN; // see wxPcbStruct.h -void WinEDA_PcbFrame::ExportToSPECCTRA( wxCommandEvent& event ) +void WinEDA_PcbFrame::ExportToSpecctra( wxCommandEvent& event ) { wxString fullFileName = GetScreen()->m_FileName; wxString std_ext = wxT( ".dsn" ); @@ -103,7 +103,7 @@ void WinEDA_PcbFrame::ExportToSPECCTRA( wxCommandEvent& event ) if( ok ) { - // @todo display a message saying the export is complete. + Affiche_Message( wxString( _("BOARD exported OK.")) ); } else DisplayError( this, errorText ); diff --git a/pcbnew/specctra_import.cpp b/pcbnew/specctra_import.cpp new file mode 100644 index 0000000000..0942f27d04 --- /dev/null +++ b/pcbnew/specctra_import.cpp @@ -0,0 +1,50 @@ +/* + * This program source code file is part of KICAD, a free EDA CAD application. + * + * Copyright (C) 2007-2008 SoftPLC Corporation, Dick Hollenbeck + * Copyright (C) 2007 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 + */ + + +/* This source is a complement to specctra.cpp and implements the import of + a specctra session file (*.ses), and import of a specctra design file + (*.dsn) file. The specification for the grammar of the specctra dsn file + used to develop this code is given here: + http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf + + Also see the comments at the top of the specctra.cpp file itself. +*/ + + +#include "specctra.h" + + +using namespace DSN; + +void WinEDA_PcbFrame::ImportSpecctraDesign( wxCommandEvent& event ) +{ +} + + +void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event ) +{ +} + +