beginnings of the 2 specctra imports

This commit is contained in:
dickelbeck 2008-02-06 22:32:15 +00:00
parent 822017c72d
commit cf460637b2
9 changed files with 106 additions and 13 deletions

View File

@ -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 <dick@softplc.com>
================================================================================
+pcbnew
started specctra imports of *.ses and *.dsn, by adding menus to File | Import.
2008-Feb-4 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew

View File

@ -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,

View File

@ -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 );

View File

@ -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

View File

@ -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);
//-----<Add import menu>-----------------------------------------------
// 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 import menu>----------------------------------------------
// Add archive footprints menu
m_FilesMenu->AppendSeparator();
wxMenu * submenuarchive = new wxMenu();

View File

@ -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 )

View File

@ -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.
*/

View File

@ -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 );

View File

@ -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 <dick@softplc.com>
* 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 )
{
}