Commit cf460637 authored by dickelbeck's avatar dickelbeck

beginnings of the 2 specctra imports

parent 822017c7
...@@ -5,6 +5,12 @@ Started 2007-June-11 ...@@ -5,6 +5,12 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. 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> 2008-Feb-4 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
+pcbnew +pcbnew
......
...@@ -95,9 +95,10 @@ enum main_id { ...@@ -95,9 +95,10 @@ enum main_id {
ID_GEN_EXPORT_SPECCTRA, ID_GEN_EXPORT_SPECCTRA,
ID_GEN_EXPORT_FILE_GENCADFORMAT, ID_GEN_EXPORT_FILE_GENCADFORMAT,
ID_GEN_EXPORT_FILE_MODULE_REPORT, ID_GEN_EXPORT_FILE_MODULE_REPORT,
ID_GEN_EXPORT_FILE_FORMAT_2, // Not used
ID_GEN_EXPORT_FILE_FORMAT_3, // Not used ID_GEN_IMPORT_FILE,
ID_GEN_EXPORT_FILE_FORMAT_4, // Not used ID_GEN_IMPORT_SPECCTRA_SESSION,
ID_GEN_IMPORT_SPECCTRA_DESIGN,
ID_EXIT, ID_EXIT,
ID_OPTIONS_SETUP, ID_OPTIONS_SETUP,
......
...@@ -385,8 +385,26 @@ public: ...@@ -385,8 +385,26 @@ public:
* See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the * See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the
* specification. * 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 */ /* Fonctions specifiques */
MODULE* ListAndSelectModuleName(); MODULE* ListAndSelectModuleName();
void Liste_Equipot( wxCommandEvent& event ); void Liste_Equipot( wxCommandEvent& event );
......
...@@ -121,6 +121,7 @@ SET(PCBNEW_SRCS ...@@ -121,6 +121,7 @@ SET(PCBNEW_SRCS
solve.cpp solve.cpp
specctra.cpp specctra.cpp
specctra_export.cpp specctra_export.cpp
specctra_import.cpp
surbrill.cpp surbrill.cpp
swap_layers.cpp swap_layers.cpp
tool_modedit.cpp tool_modedit.cpp
......
...@@ -116,6 +116,25 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -116,6 +116,25 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
ADD_MENUITEM_WITH_HELP_AND_SUBMENU(m_FilesMenu, submenuexport, ADD_MENUITEM_WITH_HELP_AND_SUBMENU(m_FilesMenu, submenuexport,
ID_GEN_EXPORT_FILE, _("E&xport"), _("Export board"), export_xpm); 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 // Add archive footprints menu
m_FilesMenu->AppendSeparator(); m_FilesMenu->AppendSeparator();
wxMenu * submenuarchive = new wxMenu(); wxMenu * submenuarchive = new wxMenu();
......
...@@ -56,10 +56,13 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame ) ...@@ -56,10 +56,13 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
EVT_MENU_RANGE( ID_LOAD_FILE_1, ID_LOAD_FILE_10, EVT_MENU_RANGE( ID_LOAD_FILE_1, ID_LOAD_FILE_10,
WinEDA_PcbFrame::Files_io ) 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_GENCADFORMAT, WinEDA_PcbFrame::ExportToGenCAD )
EVT_MENU( ID_GEN_EXPORT_FILE_MODULE_REPORT, WinEDA_PcbFrame::GenModuleReport ) 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_NEW_MODULES, WinEDA_PcbFrame::Process_Special_Functions )
EVT_MENU( ID_MENU_ARCHIVE_ALL_MODULES, WinEDA_PcbFrame::Process_Special_Functions ) EVT_MENU( ID_MENU_ARCHIVE_ALL_MODULES, WinEDA_PcbFrame::Process_Special_Functions )
......
...@@ -3806,13 +3806,8 @@ public: ...@@ -3806,13 +3806,8 @@ public:
* the BOARD given to this function must have all the MODULEs on the component * the BOARD given to this function must have all the MODULEs on the component
* side of the BOARD. * 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. * 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. * @param aBoard The BOARD to convert to a PCB.
*/ */
......
...@@ -43,7 +43,7 @@ using namespace DSN; ...@@ -43,7 +43,7 @@ using namespace DSN;
// see wxPcbStruct.h // see wxPcbStruct.h
void WinEDA_PcbFrame::ExportToSPECCTRA( wxCommandEvent& event ) void WinEDA_PcbFrame::ExportToSpecctra( wxCommandEvent& event )
{ {
wxString fullFileName = GetScreen()->m_FileName; wxString fullFileName = GetScreen()->m_FileName;
wxString std_ext = wxT( ".dsn" ); wxString std_ext = wxT( ".dsn" );
...@@ -103,7 +103,7 @@ void WinEDA_PcbFrame::ExportToSPECCTRA( wxCommandEvent& event ) ...@@ -103,7 +103,7 @@ void WinEDA_PcbFrame::ExportToSPECCTRA( wxCommandEvent& event )
if( ok ) if( ok )
{ {
// @todo display a message saying the export is complete. Affiche_Message( wxString( _("BOARD exported OK.")) );
} }
else else
DisplayError( this, errorText ); DisplayError( this, errorText );
......
/*
* 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 )
{
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment