Commit 8d79a82b authored by dickelbeck's avatar dickelbeck
Browse files

specctra export support

parent 06158c7c
Loading
Loading
Loading
Loading
+36 −20
Original line number Original line Diff line number Diff line
@@ -4,6 +4,23 @@ 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-Jan-21 UPDATE   Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew:
    Added specctra_export.cpp, specctra.cpp, specctra.h, dsn.cpp, and dsn.h to
    pcbnew's link requirements. Updated CMakeLists.txt to reflect this. This
    increased pcbnew's size by 175kb so far. Started the actual export (i.e.
    BOARD to DSN::PCB copying logic) which is going into specctra_export.cpp's
    void WinEDA_PcbFrame::ExportToSPECCTRA( wxCommandEvent& event ) so that the
    huge header file, specctra.h need only be included in one or two *.cpp
    files. The specctra export menu support was added to id.h, wxPcbStruct.h,
    menubarpcb.cpp, and pcbframe.cpp. After dsn export, I intend to add an
    import, and a session file feedback merge. See the revised
    how-to-build-kicad.txt for the new boost c++ libraries requirement.
    
    
2008-Jan-21 UPDATE  Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
2008-Jan-21 UPDATE  Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
================================================================================
+eeschema:
+eeschema:
@@ -39,7 +56,6 @@ email address.
    drill file for layer3 to layer 4
    drill file for layer3 to layer 4





2008-Jan-18 UPDATE   Dick Hollenbeck <dick@softplc.com>
2008-Jan-18 UPDATE   Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
    how-to-build-kicad.txt: added the Boost C++ Libraries installation info
    how-to-build-kicad.txt: added the Boost C++ Libraries installation info
+8 −0
Original line number Original line Diff line number Diff line
@@ -388,6 +388,14 @@ public:


    void                ExportToGenCAD( wxCommandEvent& event );
    void                ExportToGenCAD( wxCommandEvent& event );
    
    
    /**
     * Function ExporttoSPECCTRA
     * will export the current BOARD to a specctra dsn file.  See
     * See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the
     * specification.
     */
    void                ExportToSPECCTRA( wxCommandEvent& event );

    /* Fonctions specifiques */
    /* Fonctions specifiques */
    MODULE*             ListAndSelectModuleName();
    MODULE*             ListAndSelectModuleName();
    void                Liste_Equipot( wxCommandEvent& event );
    void                Liste_Equipot( wxCommandEvent& event );
+3 −2
Original line number Original line Diff line number Diff line
@@ -61,7 +61,7 @@ SET(PCBNEW_SRCS
#   docedit.cpp <-- not used
#   docedit.cpp <-- not used
    dragsegm.cpp
    dragsegm.cpp
    drc.cpp
    drc.cpp
#   dsn.cpp
    dsn.cpp
    edgemod.cpp
    edgemod.cpp
    edit.cpp
    edit.cpp
    editedge.cpp
    editedge.cpp
@@ -121,7 +121,8 @@ SET(PCBNEW_SRCS
    set_color.cpp
    set_color.cpp
    set_grid.cpp
    set_grid.cpp
    solve.cpp
    solve.cpp
#   specctra.cpp
    specctra.cpp
    specctra_export.cpp
    surbrill.cpp
    surbrill.cpp
    swap_layers.cpp
    swap_layers.cpp
    tool_modedit.cpp
    tool_modedit.cpp
+9 −2
Original line number Original line Diff line number Diff line
@@ -98,10 +98,17 @@ wxMenuBar * menuBar = GetMenuBar();
		// Add Export menu
		// Add Export menu
		m_FilesMenu->AppendSeparator();
		m_FilesMenu->AppendSeparator();
		wxMenu * submenuexport = new wxMenu();
		wxMenu * submenuexport = new wxMenu();

		item = new wxMenuItem(submenuexport, ID_GEN_EXPORT_SPECCTRA,
			_("&Specctra DSN"), _("Export board to a \"Specctra DSN\" file") );
	    item->SetBitmap(export_xpm);
		submenuexport->Append(item);
        
		item = new wxMenuItem(submenuexport, ID_GEN_EXPORT_FILE_GENCADFORMAT,
		item = new wxMenuItem(submenuexport, ID_GEN_EXPORT_FILE_GENCADFORMAT,
			_("&GenCAD"), _("Export GenCAD Format") );
			_("&GenCAD"), _("Export GenCAD Format") );
	    item->SetBitmap(export_xpm);
	    item->SetBitmap(export_xpm);
		submenuexport->Append(item);
		submenuexport->Append(item);
        
		item = new wxMenuItem(submenuexport, ID_GEN_EXPORT_FILE_MODULE_REPORT,
		item = new wxMenuItem(submenuexport, ID_GEN_EXPORT_FILE_MODULE_REPORT,
			_("&Module report"), _("Create a pcb report (footprint report)") );
			_("&Module report"), _("Create a pcb report (footprint report)") );
	    item->SetBitmap(tools_xpm);
	    item->SetBitmap(tools_xpm);
+24 −8
Original line number Original line Diff line number Diff line
@@ -55,9 +55,15 @@
#include <wx/ffile.h>
#include <wx/ffile.h>




#define STANDALONE      0   // set to 1 for "stand alone, i.e. unit testing"
                            // set to 0 for component of pcbnew 


#if STANDALONE
 #define EDA_BASE           // build_version.h behavior
 #define EDA_BASE           // build_version.h behavior
 #undef  COMMON_GLOBL
 #undef  COMMON_GLOBL
 #define COMMON_GLOBL       // build_version.h behavior
 #define COMMON_GLOBL       // build_version.h behavior
#endif
#include "build_version.h"
#include "build_version.h"




@@ -3320,7 +3326,7 @@ const char* SPECCTRA_DB::GetQuoteChar( const char* wrapee )
}
}




void SPECCTRA_DB::ExportPCB( wxString filename, BOARD* aBoard )
void SPECCTRA_DB::ExportPCB( wxString filename ) throw( IOError )
{
{
    fp = wxFopen( filename, wxT("w") );
    fp = wxFopen( filename, wxT("w") );
    
    
@@ -3329,8 +3335,6 @@ void SPECCTRA_DB::ExportPCB( wxString filename, BOARD* aBoard )
        ThrowIOError( _("Unable to open file \"%s\""), filename.GetData() );  
        ThrowIOError( _("Unable to open file \"%s\""), filename.GetData() );  
    }
    }
    
    
    // copy the BOARD to an empty PCB here.

    if( pcb )
    if( pcb )
        pcb->Format( this, 0 );
        pcb->Format( this, 0 );


@@ -3361,6 +3365,18 @@ PCB* SPECCTRA_DB::MakePCB()
    PCB*    pcb = new PCB();
    PCB*    pcb = new PCB();
    
    
    pcb->parser = new PARSER( pcb );
    pcb->parser = new PARSER( pcb );
    pcb->resolution = new UNIT_RES( pcb, T_resolution );
    pcb->unit = new UNIT_RES( pcb, T_unit );
    
    pcb->structure = new STRUCTURE( pcb );
    
    pcb->placement = new PLACEMENT( pcb );
    
    pcb->library = new LIBRARY( pcb );
    
    pcb->network = new NETWORK( pcb );
    
    pcb->wiring = new WIRING( pcb );


    return pcb;
    return pcb;
}
}
@@ -3556,7 +3572,7 @@ void PLACE::Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IOError )


// unit test this source file
// unit test this source file


#if 1
#if STANDALONE


using namespace DSN;
using namespace DSN;


@@ -3589,7 +3605,7 @@ int main( int argc, char** argv )


    // export what we read in, making this test program basically a beautifier
    // export what we read in, making this test program basically a beautifier
    db.ExportSESSION( wxT("/tmp/export.ses") );
    db.ExportSESSION( wxT("/tmp/export.ses") );
//    db.ExportPCB( wxT("/tmp/export.dsn"), 0 ); 
//    db.ExportPCB( wxT("/tmp/export.dsn") ); 
    
    
}
}


Loading